ts-type-forge
    Preparing search index...

    Type Alias StrictOmit<T, K>

    StrictOmit: Pick<T, Exclude<keyof T, K>>

    Creates a type with all properties of T except for those in union K. This is a stricter version that requires K to extend keyof T.

    Type Parameters

    • T

      The object type to omit from.

    • K extends keyof T

      The union of keys to omit, must extend keyof T.

    An object type without the specified properties.

    type Person = { name: string; age: number; email: string };
    type PublicInfo = StrictOmit<Person, 'email'>; // { name: string; age: number }
    // type Invalid = StrictOmit<Person, 'email' | 'invalid'>; // Error: 'invalid' is not a key of Person