@dataswift/hat-js
Version:
HAT JavaScript SDK for web and Node.js
13 lines (12 loc) • 918 B
TypeScript
import { HttpService } from '../services/HttpService';
import { HatRecord, HatRecordDelete } from '../interfaces/hat-record.interface';
import { ClientState } from '../index';
import { HatHttpParameters, IHttpResponse } from '../interfaces/http.interface';
export interface HatData {
getAllDefault: <T>(namespace: string, endpoint: string) => Promise<IHttpResponse<Array<HatRecord<T>>>>;
getAll: <T>(namespace: string, endpoint: string, options: HatHttpParameters) => Promise<IHttpResponse<Array<HatRecord<T>>>>;
create: <T>(namespace: string, endpoint: string, body: T) => Promise<IHttpResponse<HatRecord<T>>>;
update: <T>(records: Array<HatRecord<T>>) => Promise<IHttpResponse<Array<HatRecord<T>>>>;
delete: (recordsIds: string[]) => Promise<IHttpResponse<HatRecordDelete>>;
}
export declare const hatData: (config: ClientState, headers: Record<string, string>, httpSvc: HttpService) => HatData;