import { Ast, Type } from 'thingtalk'; import type { SlotBag } from './slot_bag'; import type ThingpediaLoader from './load-thingpedia'; /** * A placeholder of the form "something", "some person", etc. */ export interface Placeholder { type: Type; } /** * A phrase that includes a coreference, such as "post this on twitter", * "post the caption on twitter", "book it on yelp", "book the restaurant on yelp" */ export interface ExpressionWithCoreference { expression: Ast.Expression; type: Type; slot: ParamSlot | null; pname: string | null; } export interface ErrorMessage { code: string; bag: SlotBag; } export interface ParamSlot { schema: Ast.FunctionDef; name: string; type: Type; filterable: boolean; symmetric: boolean; ast: Ast.VarRefValue; } export interface FilterValueSlot { schema: Ast.FunctionDef; name: string; ast: Ast.FilterValue; } export interface FilterSlot { schema: Ast.FunctionDef; ptype: Type; ast: Ast.BooleanExpression; } export interface DomainIndependentFilterSlot { schema: null; ptype: Type | null; ast: Ast.BooleanExpression; } export interface InputParamSlot { schema: Ast.FunctionDef; ptype: Type; ast: Ast.InputParam; } declare function typeToStringSafe(type: Type): string; export declare function makeInputParamSlot(slot: ParamSlot, value: Ast.Value, tpLoader: ThingpediaLoader): InputParamSlot | null; export declare function makeDomainIndependentFilter(pname: string, op: string, value: Ast.Value): DomainIndependentFilterSlot; declare function makeFilter(tpLoader: ThingpediaLoader, slot: ParamSlot, op: string, value: Ast.Value, negate?: boolean): FilterSlot | null; declare function makeAndFilter(tpLoader: ThingpediaLoader, slot: ParamSlot, op: string, values: [Ast.Value, Ast.Value], negate?: boolean): FilterSlot | null; declare function makeDateRangeFilter(tpLoader: ThingpediaLoader, slot: ParamSlot, values: Ast.Value[]): FilterSlot | null; declare function resolveJoin(lhs: Ast.FunctionDef, rhs: Ast.FunctionDef): Ast.FunctionDef; declare function makeSelfJoinCondition(tpLoader: ThingpediaLoader, slot: ParamSlot): FilterSlot | null; declare function isHumanEntity(type: Type | string): boolean; declare function isLocationEntity(type: Type): boolean; declare function isTimeEntity(type: Type): boolean; declare function interrogativePronoun(type: Type): 'who' | 'where' | 'when' | 'what'; declare function isSameFunction(fndef1: Ast.FunctionDef, fndef2: Ast.FunctionDef): boolean; export { isSameFunction, typeToStringSafe, makeFilter, makeAndFilter, makeDateRangeFilter, isHumanEntity, isLocationEntity, isTimeEntity, interrogativePronoun, resolveJoin, makeSelfJoinCondition };