export declare function match(instance: T, ...matchers: Matcher[]): R; export interface Matcher { matches(instance: T): R | undefined; } export declare function case_(pattern: Pattern, handler: (instance: Matched) => R): Matcher; export declare function default_(handler: () => R): Matcher; export declare class CaseMatcher implements Matcher { private pattern; private handler; constructor(pattern: Pattern, handler: (instance: Matched) => R); matches(instance: T): R | undefined; } export declare type Pattern = { [P in keyof T]?: T[P] | Matcher; }; export declare type Matched = { [P in keyof T]?: T[P] | any[] | { [key: string]: any; }; }; export declare function regex(value: RegExp): RegexMatcher; export declare class RegexMatcher implements Matcher { private value; constructor(value: RegExp); matches(instance: any): string[] | undefined; } export declare function isPartial(instance: T, partial: Partial): boolean; export declare function apply(instance: T, pattern: Pattern): Matched | undefined;