Skip to content

Yurba.js / yurba.js / CommandArgsSchema

Type Alias: CommandArgsSchema

CommandArgsSchema = Record<string, CommandArgsSchemaEntry | string | [string, any?, "rest"?]>

Defines the schema for command arguments. Can be an object with CommandArgsSchemaEntry, a string, or a tuple.

Examples

ts
// Using CommandArgsSchemaEntry objects
{
  name: { type: 'string', required: true },
  age: { type: 'int', default: 18 }
}
ts
// Using string shorthand
{
  name: 'string',
  age: 'int'
}
ts
// Using tuple notation
{
  name: ['string', 'defaultName'],
  args: ['string', undefined, 'rest']
}