gunshi / default
default
The main entry point for Gunshi.
Example
js
import { cli } from 'gunshi'
Variables
Variable | Description |
---|---|
DEFAULT_LOCALE | The default locale string, which format is BCP 47 language tag. |
Functions
Function | Description |
---|---|
cli | Run the command. |
parseArgs | Parse command line arguments. |
resolveArgs | Resolve command line arguments. |
Classes
Class | Description |
---|---|
DefaultTranslation | Translation adapter. This adapter is used to custom message formatter like Intlify message format, `Intl.MessageFormat` (MF2), and etc. This adapter will support localization with your preferred message format. |
Interfaces
Interface | Description |
---|---|
ArgOptions | An object that contains options schema. |
ArgOptionSchema | An option schema for an argument. This schema is similar to the schema of the node:utils . difference is that: - multiple property is not supported - required property and description property are added - default property type, not support multiple types |
Command | Command interface. |
CommandContext | Command context. Command context is the context of the command execution. |
CommandEnvironment | Command environment. |
CommandOptions | Command options. |
TranslationAdapter | Translation adapter. This adapter is used to custom message formatter like Intlify message format, `Intl.MessageFormat` (MF2), and etc. This adapter will support localization with your preferred message format. |
TranslationAdapterFactoryOptions | Translation adapter factory options. |
References
define
Re-exports define
Type Aliases
Type Alias | Description |
---|---|
ArgValues | An object that contains the values of the arguments. |
Commandable | Define a command type. |
CommandBuiltinKeys | Command i18n built-in keys. The command i18n built-in keys are used to translate function. |
CommandBuiltinOptionsKeys | Command i18n built-in options keys. |
CommandBuiltinResourceKeys | Command i18n built-in resource keys. |
CommandOptionKeys | Command i18n option keys. The command i18n option keys are used to translate function. |
CommandResource | Command resource. |
CommandResourceFetcher | Command resource fetcher. |
CommandRunner | Command runner. |
GenerateNamespacedKey | Generate a namespaced key. |
LazyCommand | Lazy command interface. Lazy command that's not loaded until it is executed. |
RemovedIndex | Remove index signature from object or record type. |
TranslationAdapterFactory | Translation adapter factory. |