import { Constructable } from '../../types'; import { Graph } from '../Graph'; import { ResolveChain } from './ResolveChain'; export abstract class Middleware> { private next!: Middleware>; public setNext(next: Middleware>) { this.next = next; } public get resolveChain(): ResolveChain { return { proceed: (Graph: Constructable, props?: Props): T => { return this.next.resolve(this.next.resolveChain, Graph, props); }, }; } abstract resolve(resolveChain: RC, Graph: Constructable, props?: Props): T; }