fix type hints
This commit is contained in:
parent
e49317a73c
commit
d77a70b25a
|
@ -1,5 +1,25 @@
|
||||||
|
import { SlashCommandAbortController } from './SlashCommandAbortController.js';
|
||||||
import { SlashCommandArgument, SlashCommandNamedArgument } from './SlashCommandArgument.js';
|
import { SlashCommandArgument, SlashCommandNamedArgument } from './SlashCommandArgument.js';
|
||||||
import { SlashCommandClosure } from './SlashCommandClosure.js';
|
import { SlashCommandClosure } from './SlashCommandClosure.js';
|
||||||
|
import { PARSER_FLAG } from './SlashCommandParser.js';
|
||||||
|
import { SlashCommandScope } from './SlashCommandScope.js';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {{
|
||||||
|
* _pipe:string|SlashCommandClosure,
|
||||||
|
* _scope:SlashCommandScope,
|
||||||
|
* _parserFlags:{[id:PARSER_FLAG]:boolean},
|
||||||
|
* _abortController:SlashCommandAbortController,
|
||||||
|
* [id:string]:string,
|
||||||
|
* }} NamedArguments
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {string|SlashCommandClosure|(string|SlashCommandClosure)[]} UnnamedArguments
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +28,7 @@ export class SlashCommand {
|
||||||
* Creates a SlashCommand from a properties object.
|
* Creates a SlashCommand from a properties object.
|
||||||
* @param {Object} props
|
* @param {Object} props
|
||||||
* @param {string} [props.name]
|
* @param {string} [props.name]
|
||||||
* @param {(namedArguments:Object.<string,string|SlashCommandClosure>, unnamedArguments:string|SlashCommandClosure|(string|SlashCommandClosure)[])=>string|SlashCommandClosure|void|Promise<string|SlashCommandClosure|void>} [props.callback]
|
* @param {(namedArguments:NamedArguments, unnamedArguments:string|SlashCommandClosure|(string|SlashCommandClosure)[])=>string|SlashCommandClosure|void|Promise<string|SlashCommandClosure|void>} [props.callback]
|
||||||
* @param {string} [props.helpString]
|
* @param {string} [props.helpString]
|
||||||
* @param {boolean} [props.splitUnnamedArgument]
|
* @param {boolean} [props.splitUnnamedArgument]
|
||||||
* @param {string[]} [props.aliases]
|
* @param {string[]} [props.aliases]
|
||||||
|
@ -25,7 +45,7 @@ export class SlashCommand {
|
||||||
|
|
||||||
|
|
||||||
/**@type {string}*/ name;
|
/**@type {string}*/ name;
|
||||||
/**@type {(namedArguments:Object<string, string|SlashCommandClosure>, unnamedArguments:string|SlashCommandClosure|(string|SlashCommandClosure)[])=>string|SlashCommandClosure|Promise<string|SlashCommandClosure>}*/ callback;
|
/**@type {(namedArguments:{_pipe:string|SlashCommandClosure, _scope:SlashCommandScope, _abortController:SlashCommandAbortController, [id:string]:string|SlashCommandClosure}, unnamedArguments:string|SlashCommandClosure|(string|SlashCommandClosure)[])=>string|SlashCommandClosure|Promise<string|SlashCommandClosure>}*/ callback;
|
||||||
/**@type {string}*/ helpString;
|
/**@type {string}*/ helpString;
|
||||||
/**@type {boolean}*/ splitUnnamedArgument = false;
|
/**@type {boolean}*/ splitUnnamedArgument = false;
|
||||||
/**@type {string[]}*/ aliases = [];
|
/**@type {string[]}*/ aliases = [];
|
||||||
|
|
|
@ -20,7 +20,7 @@ export class SlashCommandExecutor {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
/**@type {SlashCommandNamedArgumentAssignment[]}*/ namedArgumentList = [];
|
/**@type {SlashCommandNamedArgumentAssignment[]}*/ namedArgumentList = [];
|
||||||
/**@type {SlashCommandUnnamedArgumentAssignment[]}*/ unnamedArgumentList = [];
|
/**@type {SlashCommandUnnamedArgumentAssignment[]}*/ unnamedArgumentList = [];
|
||||||
/**@type {Object<PARSER_FLAG,boolean>} */ parserFlags;
|
/**@type {{[id:PARSER_FLAG]:boolean}} */ parserFlags;
|
||||||
|
|
||||||
get commandCount() {
|
get commandCount() {
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Reference in New Issue