UNPKG

@cosmicmind/patternjs

Version:

A library of Design Patterns in TypeScript.

17 lines 720 B
import { Optional } from '@cosmicmind/foundationjs'; export type Chainable<T> = { get next(): Optional<Chainable<T>>; execute(...args: T[]): boolean; isProcessable(...args: T[]): boolean; }; export declare abstract class RequestChain<T> implements Chainable<T> { protected _next: Optional<Chainable<T>>; get next(): Optional<Chainable<T>>; append(chainable: Chainable<T>): void; clear(): void; execute(...args: T[]): boolean; abstract isProcessable(...args: T[]): boolean; protected abstract processor(...args: T[]): boolean; } export declare function generateRequestChain<T>(...chainables: RequestChain<T>[]): Optional<RequestChain<T>>; //# sourceMappingURL=RequestChain.d.ts.map