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(methods: Methods): Multimethod>; extend(methods: Methods, 'super'>): Multimethod>>; decorate(decorators: Decorators): Multimethod; } export interface AsyncMultimethod

{ (...args: P): Promise; extend(methods: Methods, 'super'>): AsyncMultimethod; decorate(decorators: Decorators, 'super'>): AsyncMultimethod; } export declare type Methods

= Record | Array | Super>>; export declare type Method

= (bindings: PatternBindings, ...args: P) => R; export declare type Decorators

= Record | Array | Super>>; export declare type Decorator

= (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 = (T extends Promise ? 1 : never) extends never ? T : (T extends Promise ? never : 1) extends never ? Promise ? U : T> : (T extends Promise ? U : T) | Promise ? U : T>; declare type Awaitable = T | Promise; export {};