@basd/nested
Version:
Allows you to create deeply nested object structures, while also enabling you to traverse them efficiently.
17 lines (15 loc) • 452 B
TypeScript
declare module '@basd/nested' {
export interface NestedOptions {
parent?: Nested;
path?: any[];
[key: string]: any;
}
export class Nested {
constructor(opts?: NestedOptions, ...args: any[]);
static mixin(childClass: any): any;
parent: Nested | null;
path: any[];
root: Nested;
sub(path: string | string[], opts?: NestedOptions | ((node: Nested, part: string) => NestedOptions), ...args: any[]): Nested;
}
}