@@ -10,8 +10,12 @@ import type {
1010import type { DataTuple } from "../model-extension-file" ;
1111import type { Mode } from "../shared/mode" ;
1212import type { QueryConstraints } from "../../local-queries/query-constraints" ;
13- import type { DecodedBqrs } from "../../common/bqrs-cli-types" ;
13+ import type {
14+ DecodedBqrs ,
15+ DecodedBqrsChunk ,
16+ } from "../../common/bqrs-cli-types" ;
1417import type { BaseLogger } from "../../common/logging" ;
18+ import type { AccessPathSuggestionRow } from "../suggestions" ;
1519
1620type GenerateMethodDefinition < T > = ( method : T ) => DataTuple [ ] ;
1721type ReadModeledMethod = ( row : DataTuple [ ] ) => ModeledMethod ;
@@ -39,6 +43,18 @@ type ModelsAsDataLanguageModelGeneration = {
3943 ) => ModeledMethod [ ] ;
4044} ;
4145
46+ type ModelsAsDataLanguageAccessPathSuggestions = {
47+ parseResults : (
48+ // The results of a single predicate of the query.
49+ bqrs : DecodedBqrsChunk ,
50+ // The language-specific predicate that was used to generate the results. This is passed to allow
51+ // sharing of code between different languages.
52+ modelsAsDataLanguage : ModelsAsDataLanguage ,
53+ // The logger to use for logging.
54+ logger : BaseLogger ,
55+ ) => AccessPathSuggestionRow [ ] ;
56+ } ;
57+
4258export type ModelsAsDataLanguagePredicates = {
4359 source ?: ModelsAsDataLanguagePredicate < SourceModeledMethod > ;
4460 sink ?: ModelsAsDataLanguagePredicate < SinkModeledMethod > ;
@@ -61,6 +77,7 @@ export type ModelsAsDataLanguage = {
6177 createMethodSignature : ( method : MethodDefinition ) => string ;
6278 predicates : ModelsAsDataLanguagePredicates ;
6379 modelGeneration ?: ModelsAsDataLanguageModelGeneration ;
80+ accessPathSuggestions ?: ModelsAsDataLanguageAccessPathSuggestions ;
6481 /**
6582 * Returns the list of valid arguments that can be selected for the given method.
6683 * @param method The method to get the valid arguments for.
0 commit comments