UNPKG

reshuffle-aws-connectors

Version:
41 lines (40 loc) 1.81 kB
/// <reference types="node" /> import { BaseConnector, EventConfiguration, PersistentStore, Reshuffle, Updater } from 'reshuffle-base-connector'; export { Reshuffle }; export { EventConfiguration }; export declare type Options = Record<string, any>; export declare type CoreEventFilter = (ec: EventConfiguration) => boolean; export declare type CoreEventHandler = (event: Record<string, any>) => void; export declare type CoreEventMapper = (ec: EventConfiguration) => any; export declare class CoreEventManager { private connector; eventConfigurationSet: Record<string, EventConfiguration>; constructor(connector: BaseConnector); addEvent(eventOptions: Options, handler: CoreEventHandler, eventId: string | Record<string, any>): EventConfiguration; removeEvent(ec: EventConfiguration): void; mapEvents(mapper: CoreEventMapper): any[]; fire(filter: CoreEventFilter, events: any | any[]): Promise<void>; } export declare class CorePersistentStore implements PersistentStore { private connector; private prefix; constructor(connector: BaseConnector, descriptor?: Record<string, any>); private getStore; del(key: string): Promise<void>; get(key: string): Promise<any>; list(): Promise<string[]>; set(key: string, value: any): Promise<any>; update(key: string, updater: Updater): Promise<any[]>; validateKey(key: string): void; validateValue(value: any): void; } export declare class CoreConnector extends BaseConnector { protected options: Options; protected eventManager: CoreEventManager; protected store: CorePersistentStore; protected interval?: NodeJS.Timer; constructor(app: Reshuffle, options: Options, id?: string); onStart(): void; onStop(): void; onRemoveEvent(event: EventConfiguration): void; }