Documentation
    Preparing search index...

    Type Alias Default<Value>

    Default: tags.TagBase<
        {
            exclusive: true;
            kind: "default";
            schema: Value extends bigint
                ? { default: Numeric<Value> }
                : { default: Value };
            target: Value extends boolean
                ? "boolean"
                : Value extends bigint
                    ? "bigint"
                    : Value extends number ? "number" : "string";
            value: Value;
        },
    >

    Default value metadata for JSON Schema generation.

    Default<Value> is a type tag that specifies a default value for a property in the generated JSON Schema. This is metadata-only - typia does not automatically apply default values at runtime.

    The default value appears in the default field of the JSON Schema output, which API documentation tools and code generators can use to show default values or generate code that applies them.

    Only primitive literal types are supported: boolean, bigint, number, and string. For complex defaults, consider using optional properties with runtime default assignment.

    Type Parameters

    • Value extends boolean | bigint | number | string

      The default value literal (must be a primitive)

    Jeongho Nam - https://github.com/samchon

    interface Config {
    // Default to 10 items per page
    pageSize: (number & Default<10>) | undefined;
    // Default to enabled
    enabled: (boolean & Default<true>) | undefined;
    // Default sort order
    sortOrder: (string & Default<"asc">) | undefined;
    }