UNPKG

draft-dsl-match

Version:
20 lines (19 loc) 1.06 kB
import { NodePath } from "@babel/core"; import { TemplateLiteral, Expression, CallExpression } from "@babel/types"; export { __, match as MatchDSL, when, not, select as use } from "ts-pattern"; export declare const String: import("ts-pattern/lib/types/Pattern").PatternType.String; export declare const Number: import("ts-pattern/lib/types/Pattern").PatternType.Number; export declare const Boolean: import("ts-pattern/lib/types/Pattern").PatternType.Boolean; export interface IPatternMatchConfig { factory?: string; } export interface IPatternMatch { InplaceTranscribe(this: PatternMatch & IPatternMatch, literal: NodePath<TemplateLiteral>, output_type: string): string; CallChainRoot(to_match: Expression, output_type: string): CallExpression; } export declare class PatternMatch { m_Factory: string; constructor(config?: IPatternMatchConfig); InplaceTranscribe(literal: NodePath<TemplateLiteral>, output_type: string): CallExpression; CallChainRoot(to_match: Expression, output_type: string): CallExpression; }