import type { GeneratorRule, ParserRule } from '@traqula/core'; import type * as T11 from '@traqula/rules-sparql-1-1'; import type { AstFactory } from './AstFactory.js'; export type SparqlRule< /** * Name of grammar rule, should be a strict subtype of string like 'myGrammarRule'. */ NameType extends string = string, /** * Type that will be returned after a correct parse of this rule. * This type will be the return type of calling SUBRULE with this grammar rule. */ ReturnType = unknown, GenInputType = ReturnType, /** * Function arguments that can be given to convey the state of the current parse operation. */ ParamType extends any[] = []> = SparqlGrammarRule & SparqlGeneratorRule; export type SparqlGeneratorRule< /** * Name of grammar rule, should be a strict subtype of string like 'myGrammarRule'. */ NameType extends string = string, /** * Type that will be returned after a correct parse of this rule. * This type will be the return type of calling SUBRULE with this grammar rule. */ ReturnType = unknown, /** * Function arguments that can be given to convey the state of the current parse operation. */ ParamType extends any[] = []> = GeneratorRule; export type SparqlGrammarRule< /** * Name of grammar rule, should be a strict subtype of string like 'myGrammarRule'. */ NameType extends string = string, /** * Type that will be returned after a correct parse of this rule. * This type will be the return type of calling SUBRULE with this grammar rule. */ ReturnType = unknown, /** * Function arguments that can be given to convey the state of the current parse operation. */ ParamType extends any[] = []> = ParserRule; export type SparqlContext = T11.SparqlContext & { astFactory: AstFactory; /** * Function that decodes UCHAR codepoint escapes (\\uXXXX / \\UXXXXXXXX) within a string. * In SPARQL 1.2 this is applied per-rule rather than as a query pre-processor. * @deprecated no longer used since it did not properly implement the decuding of sting literals. */ codepointEscape: (input: string) => string; }; export type SparqlGeneratorContext = T11.SparqlGeneratorContext & { astFactory: AstFactory; };