import { Query } from '../query/Query'; import { Graph } from '../graph'; import { ErrorDetails } from '@andyfischer/streams'; import { Handler } from '../handler'; export interface AttrExactMatch { t: 'exact'; } export interface AttrPositionalMatch { t: 'positional'; handlerAttr: string; queryTagIndex: number; } export interface AttrPartiallyFilled { t: 'attr_partially_filled'; } export interface AttrOverprovided { t: 'attr_overprovided'; } export interface UnusedOptional { t: 'unused_optional'; } export interface FailedMatch { t: 'fail'; reason: FailReason; } export type FailReason = 'handler_doesnt_have_attr' | 'handler_requires_value'; export type AttrMatch = AttrExactMatch | AttrPositionalMatch | AttrPartiallyFilled | AttrOverprovided | UnusedOptional; export type AttrMatchResult = AttrMatch | FailedMatch; export interface HandlerToQueryMatch { handler: Handler; attrs: Map; unusedOptionalsCount: number; } export declare class MatchContext { } export declare function checkOneMatch(ctx: MatchContext, query: Query, handler: Handler): HandlerToQueryMatch; export declare function getClosestWrongQueryMountMatch(ctx: MatchContext, query: Query, handler: Handler): { attrs: Map; unusedOptionalsCount: number; matchProblems: any[]; }; export declare function findClosestWrongMatches(ctx: MatchContext, graph: Graph, query: Query): { bestMatches: any; }; export declare function errorForNoTableFound(ctx: MatchContext, graph: Graph, query: Query): ErrorDetails;