exthos
Version:
stream processing in nodejs using the power of golang
71 lines • 2.8 kB
TypeScript
import { Engine } from "../engine/engine.js";
import { TInput, TInputBroker } from "../types/inputs.js";
import { TOutput } from "../types/outputs.js";
import { TProcessor } from "../types/processors.js";
declare type Batching = Omit<Required<TInputBroker["broker"]>["batching"], "processors">;
declare type RouteProxymisedMethods<A extends any[], T extends keyof Route> = (...a: A) => Pick<Route, T> & {
then: (value: (rt: Pick<Route, T>) => void) => {
catch: (value: (e: Error) => void) => {
finally: (value: () => void) => void;
};
} & {
finally: (value: () => void) => void;
};
catch: (value: (e: Error) => void) => {
finally: (value: () => void) => void;
};
};
declare let from: (params_0: Engine, params_1: TInput, ...params_2: TInput[]) => Pick<Route, "batchInput" | "to" | "_via"> & {
then: (value: (rt: Pick<Route, "batchInput" | "to" | "_via">) => void) => {
catch: (value: (e: Error) => void) => {
finally: (value: () => void) => void;
};
} & {
finally: (value: () => void) => void;
};
catch: (value: (e: Error) => void) => {
finally: (value: () => void) => void;
};
};
declare class Route {
#private;
constructor(engine: Engine, ...inputs: [TInput, ...TInput[]]);
batchInput: (batching: Batching) => Pick<Route, "batchOutput" | "to" | "_via"> & {
then: (value: (rt: Pick<Route, "batchOutput" | "to" | "_via">) => void) => {
catch: (value: (e: Error) => void) => {
finally: (value: () => void) => void;
};
} & {
finally: (value: () => void) => void;
};
catch: (value: (e: Error) => void) => {
finally: (value: () => void) => void;
};
};
batchOutput: (batching: Batching) => Pick<Route, "to"> & {
then: (value: (rt: Pick<Route, "to">) => void) => {
catch: (value: (e: Error) => void) => {
finally: (value: () => void) => void;
};
} & {
finally: (value: () => void) => void;
};
catch: (value: (e: Error) => void) => {
finally: (value: () => void) => void;
};
};
to: RouteProxymisedMethods<[
TOutput,
...TOutput[]
], "start" | "startAfter" | "stop" | "stopAfter">;
_via: RouteProxymisedMethods<[
TProcessor,
...TProcessor[]
], "to" | "batchOutput" | "_via">;
start: RouteProxymisedMethods<[], "stop" | "stopAfter">;
startAfter: RouteProxymisedMethods<[number], "stop" | "stopAfter">;
stop: RouteProxymisedMethods<[], "start" | "startAfter">;
stopAfter: RouteProxymisedMethods<[number], "start" | "startAfter">;
}
export { from, Route };
//# sourceMappingURL=route.d.ts.map