@hapic/harbor
Version:
A harbor http api client.
21 lines (20 loc) • 537 B
TypeScript
import type { Client, RequestBaseOptions } from 'hapic';
export type BaseAPIContext = {
client?: Client | RequestBaseOptions;
};
export type ResourceCollectionResponse<R> = {
data: R[];
meta: {
total?: number;
};
};
type SortString<T> = T extends string ? `${T}` | `-${T}` : never;
export type ResourceCollectionQuery<T extends Record<string, any> = Record<string, any>> = {
q?: {
[K in keyof T]?: any;
};
page?: number;
page_size?: number;
sort?: SortString<keyof T>[];
};
export {};