import { IOEndpoint, IOOptions } from 'type-r'; import { MemoryEndpoint } from '../../memory'; export declare function create(url: string, fetchOptions?: Partial): RestfulEndpoint; export { create as restfulIO }; export declare type HttpMethod = 'GET' | 'POST' | 'UPDATE' | 'DELETE' | 'PUT'; export interface RestfulIOOptions extends IOOptions { params?: object; options?: RequestInit; } export declare type RestfulFetchOptions = { cache?: RequestCache; credentials?: RequestCredentials; mode?: RequestMode; redirect?: RequestRedirect; referrerPolicy?: ReferrerPolicy; mockData?: any; simulateDelay?: number; }; export declare class RestfulEndpoint implements IOEndpoint { url: string; constructor(url: string, { mockData, simulateDelay, ...fetchOptions }?: RestfulFetchOptions); fetchOptions: RestfulFetchOptions; memoryIO: MemoryEndpoint; static defaultFetchOptions: RestfulFetchOptions; create(json: any, options: RestfulIOOptions, record: any): Promise; update(id: any, json: any, options: RestfulIOOptions, record: any): Promise; read(id: any, options: IOOptions, record: any): Promise; destroy(id: any, options: RestfulIOOptions, record: any): Promise; list(options: RestfulIOOptions, collection: any): Promise; subscribe(events: any): any; unsubscribe(events: any): any; simulateIO(method: string, httpMethod: string, url: string, args: any): Promise; protected isRelativeUrl(url: any): boolean; protected removeTrailingSlash(url: string): string; protected getRootUrl(recordOrCollection: any): string; protected getUrl(record: any): string; protected objectUrl(record: any, id: any, options: any): any; protected collectionUrl(collection: any, options: any): any; protected buildRequestOptions(method: string, options?: RequestInit, body?: any): RequestInit; protected request(method: HttpMethod, url: string, { options }: RestfulIOOptions, body?: any): Promise; }