18 lines
458 B
TypeScript
18 lines
458 B
TypeScript
|
|
import { CommandContext } from "./CommandContext";
|
||
|
|
import { FileTreeCommands } from "./file-tree-commands/FileTreeCommands";
|
||
|
|
|
||
|
|
export class CommandManager
|
||
|
|
{
|
||
|
|
static fileTreeCommands = new FileTreeCommands();
|
||
|
|
|
||
|
|
|
||
|
|
static createContext(): CommandContext
|
||
|
|
{
|
||
|
|
return { depth: 0, path: [] };
|
||
|
|
}
|
||
|
|
|
||
|
|
static childContext( parent: CommandContext, label: string): CommandContext
|
||
|
|
{
|
||
|
|
return { depth: parent.depth + 1, path: [...parent.path, label] };
|
||
|
|
}
|
||
|
|
}
|