devtypes
    Preparing search index...

    Type Alias Exact<T, Shape>

    Exact: T extends Shape
        ? Exclude<keyof T, keyof Shape> extends never ? T : never
        : never

    Exact - ensure T has exactly the properties of Shape (no more) Usage: Exact< { a:number }, { a:number } > -> passes; Exact< { a:number; b: number }, { a:number } > -> fails

    Type Parameters

    • T
    • Shape
    type A = Exact<{ a: number }, { a: number }>; // { a: number }
    type B = Exact<{ a: number; b: number }, { a: number }>; // never