createSchema
Generated reference page for the createSchema function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/schema/flag.ts - Source link:
packages/dreamcli/src/core/schema/flag.ts:253
Signatures
ts
function createSchema(kind: "string" | "number" | "boolean" | "enum" | "array" | "custom", overrides?: FlagSchemaOverrides): FlagSchema;| Parameter | Type | Description |
|---|---|---|
kind | "string" | "number" | "boolean" | "enum" | "array" | "custom" | Discriminator for the value type this flag accepts. |
overrides | FlagSchemaOverrides | undefined | Partial FlagSchema fields merged onto defaults. |
Members
Members
createSchema
Create a raw FlagSchema object with sensible defaults.
Most consumers should prefer the higher-level flag factory, which returns an immutable FlagBuilder with type inference and safe modifier chaining. createSchema() is the low-level escape hatch for advanced schema composition, tests, or custom factories that need to work directly with the runtime descriptor.
overrides are shallow-merged on top of the default shape, so callers are responsible for keeping the resulting schema internally consistent.
ts
(kind: "string" | "number" | "boolean" | "enum" | "array" | "custom", overrides?: FlagSchemaOverrides): FlagSchema;Examples
ts
const schema = createSchema('enum', {
enumValues: ['us', 'eu', 'ap'],
description: 'Deployment region',
});