@@ -10,8 +10,12 @@ import type {
10
10
import type { DataTuple } from "../model-extension-file" ;
11
11
import type { Mode } from "../shared/mode" ;
12
12
import 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" ;
14
17
import type { BaseLogger } from "../../common/logging" ;
18
+ import type { AccessPathSuggestionRow } from "../suggestions" ;
15
19
16
20
type GenerateMethodDefinition < T > = ( method : T ) => DataTuple [ ] ;
17
21
type ReadModeledMethod = ( row : DataTuple [ ] ) => ModeledMethod ;
@@ -39,6 +43,18 @@ type ModelsAsDataLanguageModelGeneration = {
39
43
) => ModeledMethod [ ] ;
40
44
} ;
41
45
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
+
42
58
export type ModelsAsDataLanguagePredicates = {
43
59
source ?: ModelsAsDataLanguagePredicate < SourceModeledMethod > ;
44
60
sink ?: ModelsAsDataLanguagePredicate < SinkModeledMethod > ;
@@ -61,6 +77,7 @@ export type ModelsAsDataLanguage = {
61
77
createMethodSignature : ( method : MethodDefinition ) => string ;
62
78
predicates : ModelsAsDataLanguagePredicates ;
63
79
modelGeneration ?: ModelsAsDataLanguageModelGeneration ;
80
+ accessPathSuggestions ?: ModelsAsDataLanguageAccessPathSuggestions ;
64
81
/**
65
82
* Returns the list of valid arguments that can be selected for the given method.
66
83
* @param method The method to get the valid arguments for.
0 commit comments