From eb23ca64d6cdeaf3763cd412b74c08252dfffbf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n=20Blanco?= Date: Fri, 22 Apr 2022 16:16:02 +0200 Subject: [PATCH] Add missing types in hub.ts (#3538) --- static/hub.ts | 62 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/static/hub.ts b/static/hub.ts index 91630b43f..36d30edd2 100644 --- a/static/hub.ts +++ b/static/hub.ts @@ -187,12 +187,15 @@ export class Hub { public nextTreeId(): number { return this.treeIds.next(); } + public nextEditorId(): number { return this.editorIds.next(); } + public nextCompilerId(): number { return this.compilerIds.next(); } + public nextExecutorId(): number { return this.executorIds.next(); } @@ -358,7 +361,7 @@ export class Hub { this.editors.push(editor); } - private treeFactory(container: GoldenLayout.Container, state: any): Tree { + private treeFactory(container: GoldenLayout.Container, state: ConstructorParameters[1]): Tree { const tree = new Tree(this, state, container); this.trees.push(tree); return tree; @@ -368,11 +371,11 @@ export class Hub { return new Compiler(this, container, state); } - public executorFactory(container: GoldenLayout.Container, state: any): any /* typeof Executor */ { + public executorFactory(container: GoldenLayout.Container, state: any): any /*typeof Executor */ { return new Executor(this, container, state); } - public outputFactory(container: GoldenLayout.Container, state: any): any /* typeof Output */ { + public outputFactory(container: GoldenLayout.Container, state: ConstructorParameters[2]): Output { return new Output(this, container, state); } @@ -384,51 +387,78 @@ export class Hub { return new Diff(this, container, state); } - public toolInputViewFactory(container: GoldenLayout.Container, state: any): any /* typeof ToolInputView */ { + public toolInputViewFactory( + container: GoldenLayout.Container, + state: ConstructorParameters[2] + ): ToolInputView { return new ToolInputView(this, container, state); } - public optViewFactory(container: GoldenLayout.Container, state: any): OptView { + public optViewFactory(container: GoldenLayout.Container, state: ConstructorParameters[2]): OptView { return new OptView(this, container, state); } - public flagsViewFactory(container: GoldenLayout.Container, state: any): any /* typeof FlagsView */ { + public flagsViewFactory( + container: GoldenLayout.Container, + state: ConstructorParameters[2] + ): FlagsView { return new FlagsView(this, container, state); } - public ppViewFactory(container: GoldenLayout.Container, state: any): PreProcessorView { + public ppViewFactory( + container: GoldenLayout.Container, + state: ConstructorParameters[2] + ): PreProcessorView { return new PreProcessorView(this, container, state); } - public astViewFactory(container: GoldenLayout.Container, state: any): AstView { + public astViewFactory(container: GoldenLayout.Container, state: ConstructorParameters[2]): AstView { return new AstView(this, container, state); } - public irViewFactory(container: GoldenLayout.Container, state: any): IrView { + public irViewFactory(container: GoldenLayout.Container, state: ConstructorParameters[2]): IrView { return new IrView(this, container, state); } - public deviceViewFactory(container: GoldenLayout.Container, state: any): any /* typeof DeviceView */ { + public deviceViewFactory( + container: GoldenLayout.Container, + state: ConstructorParameters[2] + ): DeviceView { return new DeviceView(this, container, state); } - public gnatDebugTreeViewFactory(container: GoldenLayout.Container, state: any): GnatDebugTreeView { + public gnatDebugTreeViewFactory( + container: GoldenLayout.Container, + state: ConstructorParameters[2] + ): GnatDebugTreeView { return new GnatDebugTreeView(this, container, state); } - public gnatDebugViewFactory(container: GoldenLayout.Container, state: any): GnatDebugView { + public gnatDebugViewFactory( + container: GoldenLayout.Container, + state: ConstructorParameters[2] + ): GnatDebugView { return new GnatDebugView(this, container, state); } - public rustMirViewFactory(container: GoldenLayout.Container, state: any): RustMirView { + public rustMirViewFactory( + container: GoldenLayout.Container, + state: ConstructorParameters[2] + ): RustMirView { return new RustMirView(this, container, state); } - public rustMacroExpViewFactory(container: GoldenLayout.Container, state: any): RustMacroExpView { + public rustMacroExpViewFactory( + container: GoldenLayout.Container, + state: ConstructorParameters[2] + ): RustMacroExpView { return new RustMacroExpView(this, container, state); } - public rustHirViewFactory(container: GoldenLayout.Container, state: any): RustHirView { + public rustHirViewFactory( + container: GoldenLayout.Container, + state: ConstructorParameters[2] + ): RustHirView { return new RustHirView(this, container, state); } @@ -436,7 +466,7 @@ export class Hub { return new GCCDumpView(this, container, state); } - public cfgViewFactory(container: GoldenLayout.Container, state: any): any /* typeof CfgView */ { + public cfgViewFactory(container: GoldenLayout.Container, state: ConstructorParameters[2]): CfgView { return new CfgView(this, container, state); }