0.0.2 • Published 6 months ago

@types/jayrbolton__suffix-tree v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/jayrbolton__suffix-tree

Summary

This package contains type definitions for @jayrbolton/suffix-tree (https://www.npmjs.com/package/@jayrbolton/suffix-tree).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jayrbolton__suffix-tree.

index.d.ts

// Type definitions for @jayrbolton/suffix-tree 0.0
// Project: https://www.npmjs.com/package/@jayrbolton/suffix-tree
// Definitions by: Unlocked <https://github.com/TheUnlocked>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export interface STree {
    activeNode: SNode;
    root: SNode;
    left: number;
    right: number;
    idx: number;
    lastID: number;
    strings: { [id: number]: string };
    skip: number;
    text: string[];
}
export interface SNode {
    start: number;
    children: { [char: string]: SNode };
    id: number;
    parent: SNode;
}

export function create(str?: string): STree;

export function add(str: string, tree: STree): STree;
export function addSingle(char: number | string, tree: STree): STree;

export function getStringByIndex(idx: number, tree: STree): string;
export function findSuffix(suffix: string, tree: STree): number[];
export function allSuffixes(tree: STree): string[];

export function format(tree: STree): string;

Additional Details

  • Last updated: Fri, 08 Oct 2021 18:01:23 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Unlocked.

0.0.1

7 months ago

0.0.2

6 months ago

0.0.0

3 years ago