import { OperationObject, Operation } from '../operations' import { GeneratorFunction } from '../generator' export type HandleFunction = GeneratorFunction<[OperationObject, Context], any, Operation> export interface HandlerDescriptor { filter?: (operation: OperationObject, ctx: Context) => boolean handle: HandleFunction } export type Handler = HandleFunction | HandlerDescriptor | HandlerDescriptor[] export interface Plugin { handlers: Record> namespace?: string validators?: Record } export type Validator = (operation: OperationObject) => void