UNPKG

hat-javascript-sdk

Version:

HAT JavaScript SDK

12 lines (11 loc) 793 B
import { HatHttpParameters, IHttpResponse } from '../services/HttpService'; import { HatRecord } from '../interfaces/hat-record'; import { ClientState } from '../index'; export interface HatData { getDefault: <T>(namespace: string, endpoint: string) => Promise<IHttpResponse<Array<HatRecord<T>>>>; get: <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<number>>; } export declare const hatData: (config: ClientState, headers: string[][]) => HatData;