@slck/utils
Version:
utils library - Utility functions for common development.
19 lines (18 loc) • 666 B
TypeScript
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];
};