cloudrx
Version:
TypeScript library for streaming cloud provider events using RxJS with automatic persistence and replay capabilities
31 lines • 897 B
TypeScript
import { Observable } from 'rxjs';
import { CloudProvider, Streamed, CloudOptions } from '../base';
type MemoryDelays = {
init?: number;
emission?: number;
storage?: number;
};
export type MemoryOptions = CloudOptions & {
delays?: MemoryDelays;
};
type Data = {
payload: string;
};
type Record = {
id: string;
data: Data;
};
export declare class Memory extends CloudProvider<Record, Record['id']> {
private options?;
private _all;
private _latest;
private _initialized;
private delays;
constructor(id: string, options?: MemoryOptions | undefined);
protected _init(): Observable<this>;
protected _stream(all: boolean): Observable<Record[]>;
protected _store<T>(item: T): Observable<(event: Record) => boolean>;
protected _unmarshall<T>(event: Record): Streamed<T, Record['id']>;
}
export {};
//# sourceMappingURL=provider.d.ts.map