UNPKG

tardis-dev

Version:

Convenient access to tick-level historical and real-time cryptocurrency market data via Node.js

42 lines 2.16 kB
import { MapperFactory } from './mappers/index.ts'; import { Disconnect, Exchange, FilterForExchange } from './types.ts'; type MapperOutput<T> = T extends MapperFactory<any, infer U> ? U : never; type ReplayNormalizedMessage<U extends readonly MapperFactory<any, any>[], Z extends boolean> = Z extends true ? MapperOutput<U[number]> | Disconnect : MapperOutput<U[number]>; export declare function replay<T extends Exchange, U extends boolean = false, Z extends boolean = false>({ exchange, from, to, filters, skipDecoding, withDisconnects, apiKey, withMicroseconds, autoCleanup, waitWhenDataNotYetAvailable }: ReplayOptions<T, U, Z>): AsyncIterableIterator<Z extends true ? U extends true ? { localTimestamp: Buffer; message: Buffer; } | undefined : { localTimestamp: Date; message: any; } | undefined : U extends true ? { localTimestamp: Buffer; message: Buffer; } : { localTimestamp: Date; message: any; }>; export declare function replayNormalized<T extends Exchange, U extends MapperFactory<T, any>[], Z extends boolean = false>({ exchange, symbols, from, to, withDisconnectMessages, apiKey, autoCleanup, waitWhenDataNotYetAvailable }: ReplayNormalizedOptions<T, Z>, ...normalizers: U): AsyncIterableIterator<ReplayNormalizedMessage<U, Z>>; export type ReplayOptions<T extends Exchange, U extends boolean = false, Z extends boolean = false> = { readonly exchange: T; readonly from: string; readonly to: string; readonly filters: FilterForExchange[T][]; readonly skipDecoding?: U; readonly withDisconnects?: Z; readonly apiKey?: string; readonly withMicroseconds?: boolean; readonly autoCleanup?: boolean; readonly waitWhenDataNotYetAvailable?: boolean | number; }; export type ReplayNormalizedOptions<T extends Exchange, U extends boolean = false> = { readonly exchange: T; readonly symbols?: string[]; readonly from: string; readonly to: string; readonly withDisconnectMessages?: U; readonly apiKey?: string; readonly autoCleanup?: boolean; readonly waitWhenDataNotYetAvailable?: boolean | number; }; export {}; //# sourceMappingURL=replay.d.ts.map