import { DataStoreInterface, HttpClientInterface } from './interfaces'; import { Query } from 'rollun-ts-rql'; import { AxiosResponse } from 'axios'; export interface HttpDataStoreOptions { client?: HttpClientInterface; idField?: string; timeout?: number; headers?: { [key: string]: string; }; } export default class HttpDatastore implements DataStoreInterface { readonly identifier: any; protected readonly timeout: number; private url; constructor(url: string, { idField, timeout, headers }?: HttpDataStoreOptions); read(id: string): Promise; has(id: string): Promise; query(query?: Query): Promise>; create(item: Partial): Promise; update(item: Partial): Promise; delete(id: string): Promise; count(): Promise; rewrite(item: Partial): Promise; protected getItemCount(response: AxiosResponse): number; }