UNPKG

@slck/utils

Version:

utils library - Utility functions for common development.

28 lines (27 loc) 900 B
export type GenericObjectType<T extends string, U> = { [key in T]: U; }; export type ErrorType = string | object | null | number | boolean; export interface PathQueryParams { [key: string]: string | number | Date | boolean; } export type SlckHttpVerb = 'POST' | 'GET' | 'DELETE' | 'PUT' | 'PATCH'; export interface EndpointConfig { uri: string; verb: SlckHttpVerb; pathParams?: PathQueryParams[]; queryParams?: PathQueryParams[]; body?: Record<string, any> | string | null; } export type UnCapitalizeObjectKeys<T> = { [key in keyof T as Uncapitalize<key & string>]: T[key] extends Object ? UnCapitalizeObjectKeys<T[key]> : T[key]; }; export type Scale = { value: number; name: string; plural?: string; }; export declare const SCALES: Scale[]; export declare const UNITS: string[]; export declare const TEENS: string[]; export declare const TENS: string[];