import { Logger } from './lib/logger'; import Task from './runtime/task'; import { Manager } from './lib/manager'; import { IRunner, Callback, Pool, ISteveo, IRegistry, IProducer, IEvent, KafkaConfiguration, RedisConfiguration, SQSConfiguration, DummyConfiguration, Middleware, MessageRoutingOptions, Configuration, PayloadT } from './common'; import { Storage } from './types/storage'; import { TaskOptions } from './types/task-options'; import { Workflow } from './runtime/workflow'; import { WorkflowOptions } from './types/workflow'; export { Logger } from './lib/logger'; export { Storage, Repositories } from './types/storage'; export { WorkflowStateRepository } from './types/workflow-repo'; export { WorkflowState } from './types/workflow-state'; export { WorkflowPayload } from './types/workflow'; export { consoleLogger } from './lib/logger'; export { KafkaConfiguration, RedisConfiguration, SQSConfiguration, DummyConfiguration, } from './common'; export { Middleware }; export declare class Steveo implements ISteveo { config: KafkaConfiguration | RedisConfiguration | SQSConfiguration; logger: Logger; registry: IRegistry; _producer?: IProducer; _runner?: IRunner; /** * General purpose storage engine originally introduced to * maintain workflow execution state. */ _storage?: Storage; events: IEvent; pool: Pool; restarts: number; exiting: boolean; paused: boolean; manager: Manager; middleware: Middleware[]; constructor(configuration: KafkaConfiguration | RedisConfiguration | SQSConfiguration | DummyConfiguration, logger?: Logger, storage?: Storage | undefined); /** * Start the [fluent](https://en.wikipedia.org/wiki/Fluent_interface) declaration * and registration of a new workflow. * @param topic * @returns */ flow(name: string, options?: WorkflowOptions): Workflow; /** * Declare a task consumer. * Given the steveo instance configuration, this will monitor the topic (queue) for the * message `name` and call back the given function. * @param name * @param callback * @param options * @returns */ task, R = any, C = any>(name: string, callback: Callback, options?: TaskOptions): Task; /** * Publish the given payload to the given topic * @param key */ publish>(name: string, payload: T, options?: MessageRoutingOptions[E]): Promise; /** * Formats a topic name to the queue naming convention */ getTopicName(name: string): string; /** * Registers a new topic (queue) with the configured message queue provider. * @param name * @param topic (Optional) Topic/queue name; if not provided the name will be used */ registerTopic(name: string, topic?: string): Promise; get storage(): Storage; get producer(): IProducer; pause(): Promise; resume(): Promise; stop(): Promise; /** * This pattern allows us to load all tasks in a directory * and as part of that they self register with the registry allowing */ loadTasks(): Promise; start(customTopics?: string[]): Promise; runner(): IRunner; } declare const _default: (config: T, logger: Logger, storage?: Storage) => Steveo; export default _default;