KeysMatch (Type)
Type Aliases
Section titled “Type Aliases”KeysMatch
Section titled “KeysMatch”type KeysMatch<T, Keys> = [keyof T] extends [Keys[number]] ? [Keys[number]] extends [keyof T] ? true : object : object;Defined in: types/KeysMatch.ts:16
Helper type to ensure that an array of keys matches an interface.
For example:
interface Foo { arg1: string; arg2: string;}
const FOO_KEYS = ["arg1", "arg2"] as const;type _ = Expect<KeysMatch<Foo, typeof FOO_KEYS>>;Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Keys extends readonly PropertyKey[] |
