import { Awaitable, PluginWithExtension } from "@gunshi/plugin"; //#region src/extension.d.ts /** * @author kazuya kawaguchi (a.k.a. kazupon) * @license MIT */ /** * Extended command context which provides utilities via global options plugin. * These utilities are available via `CommandContext.extensions['g:global']`. */ interface GlobalExtension { /** * Show the version of the application. if `--version` option is specified, it will print the version to the console. * * @returns The version of the application, or `unknown` if the version is not specified. */ showVersion: () => string; /** * Show the header of the application. * * @returns The header of the application, or `undefined` if the `renderHeader` is not specified. */ showHeader: () => Awaitable; /** * Show the usage of the application. if `--help` option is specified, it will print the usage to the console. * * @returns The usage of the application, or `undefined` if the `renderUsage` is not specified. */ showUsage: () => Awaitable; /** * Show validation errors. This is called when argument validation fails. * * @param error - The aggregate error containing validation failures * @returns The rendered error message, or `undefined` if `renderValidationErrors` is null */ showValidationErrors: (error: AggregateError) => Awaitable; } //#endregion //#region ../shared/src/constants.d.ts /** * @author kazuya kawaguchi (a.k.a. kazupon) * @license MIT */ declare const BUILT_IN_PREFIX = "_"; declare const PLUGIN_PREFIX = "g"; declare const BUILT_IN_KEY_SEPARATOR = ":"; //#endregion //#region ../plugin-i18n/src/types.d.ts //#endregion //#region ../plugin-i18n/src/helpers.d.ts //#endregion //#region ../plugin-i18n/src/translation.d.ts //#endregion //#region ../gunshi/src/index.d.ts //#endregion //#region ../shared/src/types.d.ts /** * Generate a namespaced key. */ type GenerateNamespacedKey = `${Prefixed}${typeof BUILT_IN_KEY_SEPARATOR}${Key}`; //#endregion //#region ../shared/src/localization.d.ts //#endregion //#region ../shared/src/utils.d.ts //#endregion //#region ../shared/src/index.d.ts //#endregion //#region src/types.d.ts /** * The unique identifier for the global options plugin. */ declare const pluginId: GenerateNamespacedKey<'global', typeof PLUGIN_PREFIX>; /** * Type representing the unique identifier for the global options plugin. */ type PluginId = typeof pluginId; //#endregion //#region src/index.d.ts /** * global options plugin * * @returns A defined plugin as global options */ declare function global(): PluginWithExtension; //#endregion export { type GlobalExtension, PluginId, global as default, pluginId };