ts-type-forge
    Preparing search index...

    Type Alias PartiallyOptional<T, K>

    PartiallyOptional: PartiallyPartial<T, K>

    Alias for PartiallyPartial. Creates a type where specified keys K of T are made optional.

    Type Parameters

    • T

      The original type.

    • K extends keyof T

      The keys to make optional.

    A new type with keys K made optional.

    type Data = { a: number; b: string; c: boolean };
    type PartiallyOptionalData = PartiallyOptional<Data, 'a' | 'b'>;
    // Result: { a?: number; b?: string; c: boolean }