forked from SAP/ui5-language-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.d.ts
44 lines (38 loc) · 1.33 KB
/
api.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import {
BaseUI5Node,
UI5SemanticModel,
} from "@ui5-language-assistant/semantic-model-types";
export type TypeNameFix = Record<string, string | undefined>;
export type Json = unknown;
export declare const GENERATED_LIBRARY: string;
/**
* Create a UI5 semantic model based on the sent libraries loaded from api.json files.
* @param opts.libraries - Map of library name to library content loaded from api.json file
* @param opts.typeNameFix - Map from type name that should be fixed due to a typo in the api.json to the fixed name (or undefined if it should be removed).
* @param opts.strict - If true, throw an error when encountering an unexpected structure or value in a library. Default is true.
*/
export function generate(opts: {
version: string;
libraries: Record<string, Json>;
typeNameFix: TypeNameFix;
strict: boolean;
printValidationErrors?: boolean;
}): UI5SemanticModel;
/**
* Run the iteratee on each root symbol in the model
* @param model
* @param iteratee
*/
export function forEachSymbol(
model: UI5SemanticModel,
iteratee: (symbol: BaseUI5Node, fqn: string) => boolean | void
): void;
/**
* Return a root symbol according to its fully qualified name, or undefined if not found
* @param model
* @param fqn
*/
export function findSymbol(
model: UI5SemanticModel,
fqn: string
): BaseUI5Node | undefined;