rojects/source/commands/CommandManager.ts

18 lines
458 B
TypeScript
Raw Normal View History

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] };
}
}