Skip to main content
Module

x/discord_api_types/utils/internals.ts

Up to date Discord API Typings, versioned by the API version
Go to Latest
File
export type Nullable<T> = { [P in keyof T]: T[P] | null;};
/** * Allows support for TS 4.5's `exactOptionalPropertyTypes` option by ensuring a property present and undefined is valid * (since JSON.stringify ignores undefined properties) */export type AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base> = { [K in keyof Base]: Base[K] extends Exclude<Base[K], undefined> ? Base[K] : Base[K] | undefined;};
export type StrictPartial<Base> = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Partial<Base>>;
export type StrictRequired<Base> = Required<{ [K in keyof Base]: Exclude<Base[K], undefined> }>;
export type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never;