/** * Makes a type easier to read. */ type Prettify = NonNullable<{ [K in keyof T]: T[K]; }>; /** * Generates the types required on a method, based on those provided in the config. */ export type CompositeParameters, ConfigParameters extends Record> = Prettify & Partial>; /** * If an object has a `parameters` property, and the `parameters` object has required properties, * then the `parameters` property on the root object is marked as required. */ export type RequireParametersUnlessAllAreOptional; }> = Record extends NonNullable ? T : Prettify>>; /** * Template parameters used in the base URI of all API endpoints. `version` will default to `"v1"` * if not specified. */ export interface BaseUriParameters { shortCode: string; version?: string; } /** * Generic interface for path parameters. */ export interface PathParameters { [key: string]: string | number | boolean; } /** * Generic interface for query parameters. */ export interface QueryParameters { [key: string]: string | number | boolean | string[] | number[]; } /** * Generic interface for all parameter types. */ export type UrlParameters = PathParameters | QueryParameters; /** * Custom query parameter type with any string prefixed with `c_` as the key and the allowed * types for query parameters for the value. */ export type CustomQueryParameters = { [key in `c_${string}`]: string | number | boolean | string[] | number[]; }; /** * Custom body request type with any string prefixed with `c_` as the key and the allowed * types for the value. */ export type CustomRequestBody = { [key in `c_${string}`]: string | number | boolean | string[] | number[] | { [key: string]: unknown; }; }; export {};