export type WithID = T & { id: string }; export type CommonKeys = keyof T1 & keyof T2; export type Mutable = { -readonly [P in keyof T]: T[P]; }; type IntersectingProps = { [x in CommonKeys]: T1[x] | T2[x] }; /** * Merges two types, creating a union at every shared property. */ export type Merge = Omit> & IntersectingProps & Omit>; /** * Will return an error type if the two types are not equal. Will return the first type if they are equal. * Will update return type if {@link https://github.com/microsoft/TypeScript/issues/23689 | this issue} * ever gets resolved. */ export type Equal = (A extends B ? B : Error) extends A ? A : Error; export type DeepRequire = Required<{ [P in keyof T]: T[P] extends object | undefined ? DeepRequire> : T[P]; }>; export interface IAuthClient { getSessionToken: () => Promise; }