/** * @file Helpable * @module kronk/lib/Helpable */ import type { Command, HelpableInfo } from '@flex-development/kronk'; /** * A help text candidate. * * @class * @abstract */ declare abstract class Helpable { /** * Candidate metadata. * * @see {@linkcode HelpableInfo} * * @protected * @instance * @member {HelpableInfo} info */ protected info: HelpableInfo; /** * The parent command. * * @public * @instance * @member {Command | null | undefined} parent */ parent: Command | null | undefined; /** * Create a new help text candidate. * * @param {HelpableInfo | null | undefined} [info] * Help text candidate info */ constructor(info?: HelpableInfo | null | undefined); /** * Whether the candidate should **not** be displayed in help text. * * @public * @instance * * @return {boolean} * `true` if candidate should removed from help text, `false` otherwise */ get hidden(): boolean; /** * Get a list of ancestor commands. * * The first command is the parent of `this` candidate, and the last is the * greatest grandparent of `this` candidate. * * @public * @instance * * @return {Command[]} * The list of ancestor commands */ ancestors(): Command[]; /** * Set the candidate description. * * The description can be long or short form text, or a URL pointing to more * information about the candidate. * * @public * @instance * * @param {URL | string | null | undefined} description * Candidate description text or a URL pointing to more info * @return {this} * `this` candidate */ description(description: URL | string | null | undefined): this; /** * Get the candidate description. * * @public * @instance * * @return {string} * Candidate description text or a URL pointing to more info */ description(): string; /** * Remove the candidate from the help text. * * @public * @instance * * @param {boolean | null | undefined} [hidden=true] * Whether the candidate should be hidden in help text * @return {this} * `this` candidate */ hide(hidden?: boolean | null | undefined): this; } export default Helpable;