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