We code better now

This commit is contained in:
2022-06-12 14:22:15 +02:00
parent 929519225a
commit 0a0020b5c0
12 changed files with 230 additions and 166 deletions

View File

@@ -1,19 +1,18 @@
import type { ProjectList } from "../projects/types";
import type { ContentList } from "../content/types";
import { printSyntax, commandList } from "./definitions";
interface CommandInterfaceCallbacks {
setModalVisible: CallableFunction;
setModalProject: CallableFunction;
setModalProjectType: CallableFunction;
setModalVisible?: CallableFunction;
setModalContent?: CallableFunction;
}
export class CommandInterface {
callbacks: CommandInterfaceCallbacks;
projects: ProjectList;
callbacks?: CommandInterfaceCallbacks;
content: ContentList = [];
constructor(callbacks: CommandInterfaceCallbacks, projects: ProjectList) {
constructor(callbacks?: CommandInterfaceCallbacks, content?: ContentList) {
this.callbacks = callbacks;
this.projects = projects;
this.content = content || [];
}
static commandCompletion(input: string): string[] {