export type Response = { data: T } export type RequestConfig = { sinceMins?: number; now?: boolean; requestVia?: ("http"|"socket")[] quiet?: boolean; stream?: boolean; } & { data?: D; params?: any; headers?: Record; }; export type ApiPost = , D = any>( url: string, data?: D, config?: AsyncEmitOptions & RequestConfig ) => Promise; export type ApiPut = , D = any>( url: string, data?: D, config?: AsyncEmitOptions & RequestConfig ) => Promise; export type ApiDelete = , D = any>(url: string, config?: AsyncEmitOptions & RequestConfig) => Promise; export type ApiGet = , D = any>(url: string, config?: AsyncEmitOptions & RequestConfig) => Promise; export type AsyncEmit = (event: string, body?: any, options?: AsyncEmitOptions) => Promise; export type OnEvent = ( event: string, cb: (body: any, cb?: (body?: any) => Promise) => any | Promise ) => Promise<() => void>; export type AsyncEmitOptions = { timeout?: number; sinceMins?: number; now?: boolean; quiet?: boolean; notScoped?: boolean; };