Bluestep JS Documentation
    Preparing search index...

    Type Alias FromSchema<S>

    FromSchema: S extends { const: infer C }
        ? C
        : S extends { enum: readonly (infer E)[] }
            ? E
            : S extends { type: "object" }
                ? _ObjectFromSchema<S>
                : S extends { items: infer I; type: "array" }
                    ? FromSchema<I>[]
                    : S extends { type: "string" }
                        ? string
                        : S extends { type: "number"
                        | "integer" }
                            ? number
                            : S extends { type: "boolean" }
                                ? boolean
                                : S extends { type: "null" } ? null : unknown

    Derives a TS type from a JSONSchema literal. Used by B.ai.tool.custom() to type the executor's args from the schema. Supports object/array/string/number/integer/boolean/null, plus enum and const.

    Type Parameters

    • S