createArgSchema
Generated reference page for the createArgSchema function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/schema/arg.ts - Source link:
packages/dreamcli/src/core/schema/arg.ts:167
Signatures
ts
function createArgSchema(kind: "string" | "number" | "enum" | "custom", overrides?: Partial<ArgSchema>): ArgSchema;| Parameter | Type | Description |
|---|---|---|
kind | "string" | "number" | "enum" | "custom" | Discriminator for the value type this arg accepts. |
overrides | Partial<ArgSchema> | undefined | Partial schema fields shallow-merged onto defaults. |
Members
Members
createArgSchema
Create a raw ArgSchema object with sensible defaults.
Most consumers should prefer the higher-level arg factory, which returns an immutable ArgBuilder with type inference and fluent modifiers. createArgSchema() exists for advanced schema composition, targeted tests, or custom builders that need the plain runtime descriptor.
overrides are shallow-merged on top of the default shape, so callers are responsible for preserving invariants such as variadic ordering and compatible parseFn / kind combinations.
ts
(kind: "string" | "number" | "enum" | "custom", overrides?: Partial<ArgSchema>): ArgSchema;Examples
ts
const schema = createArgSchema('custom', {
description: 'Hex color',
parseFn: (raw) => `#${raw}`,
});