Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

ReadonlyKeys

ReadonlyKeys

@example
type Props = { readonly foo: string; bar: number };

  // Expect: "foo"
  type Keys = ReadonlyKeys<Props>;
type ReadonlyKeys<T extends object> = [P in keyof T]-?: IfEquals<[Q in P]: T[P], -readonly [Q in P]: T[P], never, P>[keyof T];

§Type Parameters

§
T extends object
[src]

§Type

§
[P in keyof T]-?: IfEquals<[Q in P]: T[P], -readonly [Q in P]: T[P], never, P>[keyof T]
[src]