From 8fdf38a63f0ca467b2d3c3201a90e8eda29c2712 Mon Sep 17 00:00:00 2001 From: LenAnderson Date: Sat, 20 Apr 2024 07:37:30 -0400 Subject: [PATCH] fix type annotations --- public/scripts/slash-commands/SlashCommandScope.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/public/scripts/slash-commands/SlashCommandScope.js b/public/scripts/slash-commands/SlashCommandScope.js index c9378be29..f6a7100b9 100644 --- a/public/scripts/slash-commands/SlashCommandScope.js +++ b/public/scripts/slash-commands/SlashCommandScope.js @@ -1,18 +1,21 @@ +import { SlashCommandClosure } from './SlashCommandClosure.js'; + export class SlashCommandScope { - /**@type {String[]}*/ variableNames = []; + /**@type {string[]}*/ variableNames = []; get allVariableNames() { const names = [...this.variableNames, ...(this.parent?.allVariableNames ?? [])]; return names.filter((it,idx)=>idx == names.indexOf(it)); } // @ts-ignore - /**@type {Object.}*/ variables = {}; + /**@type {object.}*/ variables = {}; // @ts-ignore - /**@type {Object.}*/ macros = {}; + /**@type {object.}*/ macros = {}; + /**@type {{key:string, value:string|SlashCommandClosure}[]} */ get macroList() { return [...Object.keys(this.macros).map(key=>({ key, value:this.macros[key] })), ...(this.parent?.macroList ?? [])]; } /**@type {SlashCommandScope}*/ parent; - /**@type {String}*/ #pipe; + /**@type {string}*/ #pipe; get pipe() { return this.#pipe ?? this.parent?.pipe; }