import { Options } from './options'; export interface MultimethodConstructor {
(options: Options
>): Multimethod
;
(options: Options
>): AsyncMultimethod
; new
(options: Options
>): Multimethod
; new
(options: Options
>): AsyncMultimethod
; } export interface Multimethod
{
(...args: P): R;
extend ): Multimethod >;
extend , 'super'>): Multimethod >>;
decorate(decorators: Decorators ): Multimethod ;
}
export interface AsyncMultimethod {
(...args: P): Promise , 'super'>): AsyncMultimethod ;
decorate(decorators: Decorators , 'super'>): AsyncMultimethod ;
}
export declare type Methods = Record = (bindings: PatternBindings, ...args: P) => R;
export declare type Decorators = Record = (bindings: PatternBindings, method: (...args: P) => R, args: P) => R;
export declare type PatternBindings = {
[name in string]?: string;
};
/**
* Type operator that computes the return type of a multimethod, given the
* union T = T1 | T2 | ... of the return types of the multimethod's methods.
*/
declare type Result