@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
20 lines (19 loc) • 738 B
TypeScript
import { Tree as RadixTree } from '../radix';
import { LockType } from './support';
export interface Tree<T> {
get(s: string): T;
longestPrefix(s: string): [string, T];
insert(s: string, v: T): T;
walkPrefix(lockType: LockType, s: string, f: (s: string, v: T) => [boolean, Error | null]): Promise<Error | null>;
}
export declare function newSimpleTree<T>(): SimpleTree<T>;
export declare class SimpleTree<T> implements Tree<T> {
private mu;
tree: RadixTree;
private zero;
constructor();
get(s: string): T;
longestPrefix(s: string): [string, T];
insert(s: string, v: T): T;
walkPrefix(lockType: LockType, s: string, f: (s: string, v: T) => [boolean, Error | null]): Promise<Error | null>;
}