@bedrock-oss/bedrock-boost
    Preparing search index...

    Variable TypeBuilderConst

    TypeBuilder: {
        array: <T_1>(elem: Schema<T_1>) => ArraySchema<T_1>;
        boolean: () => BooleanSchema;
        enum: <T extends string | number>(values: readonly T[]) => EnumSchema<T>;
        literal: <V extends string | number | boolean | null>(
            v: V,
        ) => LiteralSchema<V>;
        number: () => NumberSchema;
        object: <P extends PropsRecord = Record<string, never>>(
            name?: string,
        ) => ObjectBuilder<P>;
        oneOf: <T_3 extends any[]>(
            ...options: { [K_1 in keyof T_3]: Schema<T_3[K_1]> },
        ) => UnionSchema<any>;
        string: () => StringSchema;
        tuple: <T_2 extends any[]>(
            ...elements: { [K in keyof T_2]: Schema<T_2[K]> },
        ) => TupleSchema<T_2>;
        union: <A, B>(a: Schema<A>, b: Schema<B>) => Schema<A | B>;
    }

    Factory helpers for constructing common Schema variants.

    Type declaration

    • array: <T_1>(elem: Schema<T_1>) => ArraySchema<T_1>

      Creates a schema that validates arrays of another schema.

    • boolean: () => BooleanSchema

      Creates a schema that validates boolean values.

    • enum: <T extends string | number>(values: readonly T[]) => EnumSchema<T>

      Creates a schema that validates members of an enum-like collection.

    • literal: <V extends string | number | boolean | null>(v: V) => LiteralSchema<V>

      Creates a schema that accepts a single literal value.

    • number: () => NumberSchema

      Creates a schema that validates numeric values.

    • object: <P extends PropsRecord = Record<string, never>>(
          name?: string,
      ) => ObjectBuilder<P>

      Starts building an object schema through ObjectBuilder.

    • oneOf: <T_3 extends any[]>(
          ...options: { [K_1 in keyof T_3]: Schema<T_3[K_1]> },
      ) => UnionSchema<any>

      Creates a schema that accepts any of the provided options.

    • string: () => StringSchema

      Creates a schema that validates string values.

    • tuple: <T_2 extends any[]>(
          ...elements: { [K in keyof T_2]: Schema<T_2[K]> },
      ) => TupleSchema<T_2>

      Creates a schema that validates tuples with positional schemas.

    • union: <A, B>(a: Schema<A>, b: Schema<B>) => Schema<A | B>

      Creates a schema that accepts one of two possible shapes.