export interface IONode { } export interface IOPromise extends Promise { abort?: () => void; } export interface IOEndpoint { list(options: IOOptions, collection?: any): IOPromise; create(json: any, options: IOOptions, record?: any): IOPromise; update(id: string | number, json: any, options: IOOptions, record?: any): IOPromise; read(id: string | number, options: IOOptions, record?: any): IOPromise; destroy(id: string | number, options: IOOptions, record?: any): IOPromise; subscribe(events: IOEvents, collection?: any): IOPromise; unsubscribe(events: IOEvents, collection?: any): void; } export interface IOOptions { ioMethod?: 'save' | 'fetch'; } export interface IOEvents { updated?: (json: any) => void; removed?: (json: any) => void; } export declare function getOwnerEndpoint(self: any): IOEndpoint; export declare function createIOPromise(initialize: InitIOPromise): IOPromise; export declare type InitIOPromise = (resolve: (x?: any) => void, reject: (x?: any) => void, abort?: (fn: Function) => void) => void; export declare function startIO(self: IONode, promise: IOPromise, options: IOOptions, thenDo: (json: any) => any): IOPromise; export declare function abortIO(self: IONode): void; export declare function triggerAndBubble(eventSource: any, ...args: any[]): void;