@jiminp/tooltool
    Preparing search index...

    Type Alias RecursivePartial<T>

    RecursivePartial: T extends RecursiveAtomic
        ? T
        : T extends (infer U)[]
            ? RecursivePartial<U>[]
            : T extends object ? { [P in keyof T]?: RecursivePartial<T[P]> } : T

    Recursively makes all properties of type T optional.

    Distributes over unions, retaining primitive and nullish members while making nested object properties optional. Useful for patches and configuration overrides.

    Type Parameters

    • T

      The type to be made recursively partial.

    Mutable arrays recurse into their elements; mutable tuples widen to arrays. Array unions keep separate branches. Readonly arrays and tuples use optional mapped-type semantics.

    Dates, regular expressions, mutable and readonly maps and sets, and callable types remain unchanged. Other objects are treated structurally: custom-class data properties become optional, and methods remain callable when present. TypeScript cannot distinguish class instances from matching plain records.

    const patch: RecursivePartial<{ settings?: { theme: string; size: number } | null }> = {
    settings: { theme: "dark" },
    };