@sassoftware/vi-api 1.40.3 → 1.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/README.md +36 -5
  2. package/component/index.d.ts +5 -1
  3. package/component/package.json +2 -2
  4. package/config/config-api.d.ts +5 -1
  5. package/config/package.json +2 -2
  6. package/control/control-api.d.ts +12 -1
  7. package/control/package.json +2 -2
  8. package/control/page.d.ts +9 -0
  9. package/current-user/currentUser-api.d.ts +5 -1
  10. package/current-user/package.json +2 -2
  11. package/elements/index.d.ts +30 -0
  12. package/elements/index.js +31 -0
  13. package/elements/package.json +9 -0
  14. package/elements/properties.d.ts +89 -0
  15. package/event/event-api.d.ts +9 -4
  16. package/event/event-api.js +1 -0
  17. package/event/package.json +2 -2
  18. package/file/file-api.d.ts +5 -1
  19. package/file/package.json +2 -2
  20. package/http/index.d.ts +5 -1
  21. package/http/package.json +2 -2
  22. package/index.d.ts +3 -1
  23. package/init/index.d.ts +12 -7
  24. package/init/index.js +3 -2
  25. package/init/package.json +2 -2
  26. package/localization/localization-api.d.ts +24 -9
  27. package/localization/package.json +2 -2
  28. package/metadata/admin/admin-metadata-api.d.ts +5 -1
  29. package/metadata/admin/index.d.ts +1 -0
  30. package/metadata/admin/index.js +1 -0
  31. package/metadata/metadata-api.d.ts +9 -5
  32. package/metadata/package.json +2 -2
  33. package/object/object-api.d.ts +9 -5
  34. package/object/package.json +2 -2
  35. package/package.json +3 -3
  36. package/page-admin/package.json +2 -2
  37. package/page-admin/page-admin-api.d.ts +5 -1
  38. package/page-model/package.json +2 -2
  39. package/page-model/page-model-api.d.ts +6 -5
  40. package/page-state/package.json +2 -2
  41. package/page-state/page-state-api.d.ts +4 -1
  42. package/page-template/package.json +2 -2
  43. package/page-template/page-template-api.d.ts +5 -1
  44. package/property/package.json +2 -2
  45. package/property/property-api.d.ts +6 -2
  46. package/reference-data/package.json +2 -2
  47. package/reference-data/refData.d.ts +4 -1
  48. package/resource/package.json +2 -2
  49. package/resource/resource-api.d.ts +5 -1
  50. package/search/client/client-search-api.d.ts +7 -3
  51. package/search/client/index.d.ts +1 -0
  52. package/search/client/index.js +1 -0
  53. package/search/package.json +2 -2
  54. package/search/search-api.d.ts +5 -1
  55. package/sheet/package.json +2 -2
  56. package/sheet/sheet-api.d.ts +5 -1
  57. package/shell-tabs/package.json +2 -2
  58. package/shell-tabs/shell-tabs-api.d.ts +11 -7
  59. package/svi-datahub/index.d.ts +75 -75
  60. package/svi-datahub/package.json +1 -1
  61. package/tab/package.json +2 -2
  62. package/tab/tab-api.d.ts +5 -1
  63. package/theme/package.json +2 -2
  64. package/theme/theme-api.d.ts +6 -2
  65. package/traversal/package.json +2 -2
  66. package/traversal/traversal-api.d.ts +5 -1
  67. package/component/public-api.d.ts +0 -1
  68. package/component/public-api.js +0 -1
  69. package/http/public-api.d.ts +0 -1
  70. package/http/public-api.js +0 -1
  71. package/init/public-api.d.ts +0 -1
  72. package/init/public-api.js +0 -1
  73. package/public-api.d.ts +0 -1
  74. /package/config/{public-api.d.ts → index.d.ts} +0 -0
  75. /package/config/{public-api.js → index.js} +0 -0
  76. /package/control/{public-api.d.ts → index.d.ts} +0 -0
  77. /package/control/{public-api.js → index.js} +0 -0
  78. /package/current-user/{public-api.d.ts → index.d.ts} +0 -0
  79. /package/current-user/{public-api.js → index.js} +0 -0
  80. /package/{public-api.js → elements/properties.js} +0 -0
  81. /package/event/{public-api.d.ts → index.d.ts} +0 -0
  82. /package/event/{public-api.js → index.js} +0 -0
  83. /package/file/{public-api.d.ts → index.d.ts} +0 -0
  84. /package/file/{public-api.js → index.js} +0 -0
  85. /package/localization/{public-api.d.ts → index.d.ts} +0 -0
  86. /package/localization/{public-api.js → index.js} +0 -0
  87. /package/metadata/{public-api.d.ts → index.d.ts} +0 -0
  88. /package/metadata/{public-api.js → index.js} +0 -0
  89. /package/object/{public-api.d.ts → index.d.ts} +0 -0
  90. /package/object/{public-api.js → index.js} +0 -0
  91. /package/page-admin/{public-api.d.ts → index.d.ts} +0 -0
  92. /package/page-admin/{public-api.js → index.js} +0 -0
  93. /package/page-model/{public-api.d.ts → index.d.ts} +0 -0
  94. /package/page-model/{public-api.js → index.js} +0 -0
  95. /package/page-state/{public-api.d.ts → index.d.ts} +0 -0
  96. /package/page-state/{public-api.js → index.js} +0 -0
  97. /package/page-template/{public-api.d.ts → index.d.ts} +0 -0
  98. /package/page-template/{public-api.js → index.js} +0 -0
  99. /package/property/{public-api.d.ts → index.d.ts} +0 -0
  100. /package/property/{public-api.js → index.js} +0 -0
  101. /package/reference-data/{public-api.d.ts → index.d.ts} +0 -0
  102. /package/reference-data/{public-api.js → index.js} +0 -0
  103. /package/resource/{public-api.d.ts → index.d.ts} +0 -0
  104. /package/resource/{public-api.js → index.js} +0 -0
  105. /package/search/{public-api.d.ts → index.d.ts} +0 -0
  106. /package/search/{public-api.js → index.js} +0 -0
  107. /package/sheet/{public-api.d.ts → index.d.ts} +0 -0
  108. /package/sheet/{public-api.js → index.js} +0 -0
  109. /package/shell-tabs/{public-api.d.ts → index.d.ts} +0 -0
  110. /package/shell-tabs/{public-api.js → index.js} +0 -0
  111. /package/tab/{public-api.d.ts → index.d.ts} +0 -0
  112. /package/tab/{public-api.js → index.js} +0 -0
  113. /package/theme/{public-api.d.ts → index.d.ts} +0 -0
  114. /package/theme/{public-api.js → index.js} +0 -0
  115. /package/traversal/{public-api.d.ts → index.d.ts} +0 -0
  116. /package/traversal/{public-api.js → index.js} +0 -0
package/README.md CHANGED
@@ -1,9 +1,40 @@
1
- # SAS Visual Investigator API
1
+ # Visual Investigator API
2
2
 
3
- ## Overview
4
-
5
- A package containing TypeScript type definitions to be used with the Visual Investigator Client API.
3
+ The [SAS Visual Investigator](https://www.sas.com/en_us/software/intelligence-analytics-visual-investigator.html) API provides a set of components and service methods that enable developers to create customized solutions within the application.
6
4
 
7
5
  ## Getting Started
8
6
 
9
- For documentation and examples please see our [Solution Extension GitHub](https://github.com/sassoftware/vi-solution-extensions)
7
+ For documentation and examples please see our [Solution Extension GitHub](https://github.com/sassoftware/vi-solution-extensions).
8
+
9
+ ### Installation
10
+ To use the API, install the NPM package [@sassoftware/vi-api](https://www.npmjs.com/package/@sassoftware/vi-api):
11
+ ```bash
12
+ npm install @sassoftware/vi-api
13
+ ```
14
+
15
+ ### API
16
+
17
+ The SVI API is available through the JavaScript window object:
18
+ ```javascript
19
+ window.sas.vi.metadata.getEntity("person");
20
+ ```
21
+ ### Typings
22
+
23
+ To complement the API, solution developers can download the API typings package.
24
+ Run the following command in your project:
25
+ ```
26
+ npm install @sassoftware/vi-api
27
+ ```
28
+ The types can be used to help with autocompletion of API spaces, methods, and expected return types.
29
+ ```typescript
30
+ import { SviWindow } from "@sassoftware/vi-api";
31
+ import { StoredObjectDTO } from "@sassoftware/vi-api/svi-datahub";
32
+
33
+ const sviWindow = window as SviWindow;
34
+ sviWindow.sas.vi.metadata.getEntity("person").then((entity: StoredObjectDTO | undefined) => {
35
+ if (entity) {
36
+ console.log("Retrieved entity:", entity.label);
37
+ }
38
+ });
39
+ ```
40
+
@@ -16,7 +16,11 @@ export interface ComponentCreationResult<T> {
16
16
  }
17
17
  /**
18
18
  * Functionality related to dynamically creating SAS Visual Investigator user interface components.
19
- * Accessed from the window at window.sas.vi.component.
19
+ *
20
+ * Accessed from the window at `window.sas.vi.component`.
21
+ *
22
+ * @example window.sas.vi.component.create(SviComponent.Page, targetElement, bindings);
23
+ * @category API
20
24
  */
21
25
  export interface ComponentApi {
22
26
  create(component: SviComponent.ControlCollection, target: HTMLElement, bindings?: ControlCollectionBindings): Promise<ComponentCreationResult<ControlCollectionBindings>>;
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
@@ -109,7 +109,11 @@ export interface VersionSummary {
109
109
  }
110
110
  /**
111
111
  * Configuration-related functionality.
112
- * Accessed from the window at window.sas.vi.config.
112
+ *
113
+ * Accessed from the window at `window.sas.vi.config`.
114
+ *
115
+ * @example window.sas.vi.config.getSolutions();
116
+ * @category API
113
117
  */
114
118
  export interface ConfigApi {
115
119
  /**
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
@@ -21,6 +21,7 @@ export interface ControlMemberApiBase<ControlTypeAttributes extends TypeAttribut
21
21
  /**
22
22
  * {@link ControlMemberApiBase} extension that provides more functionality.
23
23
  * @extends ControlMemberApiBase
24
+ * @category API
24
25
  */
25
26
  export interface ControlMemberApi<ControlTypeAttributes extends TypeAttributes = TypeAttributes, ControlFieldType extends FieldType = any> extends ControlMemberApiBase<ControlTypeAttributes, ControlFieldType> {
26
27
  /**
@@ -87,6 +88,8 @@ export interface ControlApiBase<ControlTypeAttributes extends TypeAttributes = T
87
88
  }
88
89
  /**
89
90
  * This API pertains to administration functionality for controls, for example registering resources.
91
+ *
92
+ * @category API
90
93
  */
91
94
  export interface ControlAdminApi {
92
95
  /**
@@ -100,6 +103,7 @@ export interface ControlAdminApi {
100
103
  /**
101
104
  * Extension of {@link ControlApiBase} supplied by SAS Visual Investigator to provide more functionality.
102
105
  * @extends ControlApiBase
106
+ * @category API
103
107
  */
104
108
  export interface ControlApi<ControlTypeAttributes extends TypeAttributes = TypeAttributes, ControlFieldType extends FieldType = never> extends ControlApiBase<ControlTypeAttributes, ControlFieldType> {
105
109
  /**
@@ -138,6 +142,8 @@ export interface ControlApi<ControlTypeAttributes extends TypeAttributes = TypeA
138
142
  }
139
143
  /**
140
144
  * Methods and properties related to the state of the control.
145
+ *
146
+ * @category API
141
147
  */
142
148
  export interface ControlStateApi {
143
149
  /**
@@ -197,6 +203,8 @@ export interface ControlStateApi {
197
203
  }
198
204
  /**
199
205
  * API methods related to object fields associated with a page.
206
+ *
207
+ * @category API
200
208
  */
201
209
  export interface ControlPageFieldApi {
202
210
  /**
@@ -277,6 +285,7 @@ export interface ControlPageApiBase {
277
285
  /**
278
286
  * {@link ControlPageApiBase} extension that provides more functionality.
279
287
  * @extends ControlPageApiBase
288
+ * @category API
280
289
  */
281
290
  export interface ControlPageApi extends ControlPageApiBase {
282
291
  /**
@@ -309,7 +318,8 @@ export interface ControlPageApi extends ControlPageApiBase {
309
318
  isToolbarDisabled(): boolean;
310
319
  /**
311
320
  * Sets the toolbar control to be disabled.
312
- * @param control {Control} The control to be disabled.
321
+ * @param {string} actionName the toolbar action name.
322
+ * @param {boolean} setDisabled disable the toolbar item.
313
323
  * @method
314
324
  */
315
325
  setToolbarItemDisabled(actionName: string, setDisabled: boolean): void;
@@ -429,6 +439,7 @@ export interface ControlFileApiBase {
429
439
  /**
430
440
  * {@link ControlFileApiBase} extension that provides more functionality.
431
441
  * @extends ControlFileApiBase
442
+ * @category API
432
443
  */
433
444
  export interface ControlFileApi extends ControlFileApiBase {
434
445
  /**
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
package/control/page.d.ts CHANGED
@@ -14,6 +14,15 @@ export interface Control<ControlTypeAttributes extends TypeAttributes = TypeAttr
14
14
  attrs: ControlAttrs;
15
15
  childNodes?: Control[];
16
16
  }
17
+ export type ToolbarControl<T extends Record<any, any> = {}> = Control<{}> & {
18
+ attrs: {
19
+ attributes: {
20
+ disabled: boolean;
21
+ state?: ActionState;
22
+ } & T;
23
+ };
24
+ typeAttributes: never;
25
+ };
17
26
  export interface ControlAttrs {
18
27
  attributes?: {
19
28
  disabled: boolean;
@@ -28,7 +28,11 @@ export interface SessionDetails {
28
28
  }
29
29
  /**
30
30
  * This API is used to get the details and functionality associated with the current user.
31
- * Accessed from the window at window.sas.vi.currentUser.
31
+ *
32
+ * Accessed from the window at `window.sas.vi.currentUser`.
33
+ *
34
+ * @example window.sas.vi.currentUser.getSessionDetails();
35
+ * @category API
32
36
  */
33
37
  export interface CurrentUserApi {
34
38
  /**
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * SAS Visual Investigator exposes a number of controls within the DOM as Custom Elements.
3
+ *
4
+ * See {@link SVICustomElement} for the list of available SVI Custom Elements.
5
+ *
6
+ * @module
7
+ */
8
+ /**
9
+ * This enumeration list contains the tag names of all SVI custom elements.
10
+ *
11
+ * @category CustomElement
12
+ */
13
+ export declare enum SVICustomElement {
14
+ /**
15
+ * Wrap a given control in an SVI control label.
16
+ *
17
+ * By default, the label will include a {@link MaskToggleButton | mask-toggle-button}
18
+ * for toggling the masked state of the control's dataSource, if configured for masking.
19
+ *
20
+ * See {@link LabelledControlProperties} for supported input bindings.
21
+ */
22
+ LabelledControl = "svi-labelled-control",
23
+ /**
24
+ * Toggle a given dataSource between it's masked and unmasked state, if configured for masking.
25
+ *
26
+ * See {@link MaskToggleButtonProperties} for supported input bindings.
27
+ */
28
+ MaskToggleButton = "svi-mask-toggle-button"
29
+ }
30
+ export * from "./properties";
@@ -0,0 +1,31 @@
1
+ /**
2
+ * SAS Visual Investigator exposes a number of controls within the DOM as Custom Elements.
3
+ *
4
+ * See {@link SVICustomElement} for the list of available SVI Custom Elements.
5
+ *
6
+ * @module
7
+ */
8
+ /**
9
+ * This enumeration list contains the tag names of all SVI custom elements.
10
+ *
11
+ * @category CustomElement
12
+ */
13
+ export var SVICustomElement;
14
+ (function (SVICustomElement) {
15
+ /**
16
+ * Wrap a given control in an SVI control label.
17
+ *
18
+ * By default, the label will include a {@link MaskToggleButton | mask-toggle-button}
19
+ * for toggling the masked state of the control's dataSource, if configured for masking.
20
+ *
21
+ * See {@link LabelledControlProperties} for supported input bindings.
22
+ */
23
+ SVICustomElement["LabelledControl"] = "svi-labelled-control";
24
+ /**
25
+ * Toggle a given dataSource between it's masked and unmasked state, if configured for masking.
26
+ *
27
+ * See {@link MaskToggleButtonProperties} for supported input bindings.
28
+ */
29
+ SVICustomElement["MaskToggleButton"] = "svi-mask-toggle-button";
30
+ })(SVICustomElement || (SVICustomElement = {}));
31
+ export * from "./properties";
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@sassoftware/vi-api/elements",
3
+ "files": [
4
+ "**/*.d.ts",
5
+ "**/*.js"
6
+ ],
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
+ }
@@ -0,0 +1,89 @@
1
+ import { PageModel } from "../page-model";
2
+ import { Control } from "../control";
3
+ /** Page Controls require a valid {@link Control | childNode} and {@link PageModel | pageModel}.</strong> */
4
+ export interface PageControlBindings {
5
+ childNode: Control;
6
+ pageModel: PageModel;
7
+ }
8
+ /**
9
+ * Properties for {@link SVICustomElement.LabelledControl}.
10
+ *
11
+ * @category CustomElement
12
+ *
13
+ * @example HTML Example:
14
+ * ```html
15
+ * <svi-labelled-control
16
+ * [childNode]="childNode"
17
+ * [pageModel]="pageModel"
18
+ * >
19
+ * <!-- my control -->
20
+ * </svi-labelled-control>
21
+ * ```
22
+ *
23
+ * @example Create the element via document.createElement:
24
+ * ```ts
25
+ * const labelledControl = document.createElement(SVICustomElement.LabelledControl);
26
+ * labelledControl.pageModel = this.pageModel;
27
+ * labelledControl.childNode = this.childNode;
28
+ * labelledControl.appendChild(myControlElement)
29
+ * ```
30
+ */
31
+ export interface LabelledControlProperties extends PageControlBindings {
32
+ /** Set the label as required. */
33
+ isRequired?: boolean;
34
+ /** Set the label as disabled. */
35
+ isDisabled?: boolean;
36
+ /** Override the text displayed in the label. */
37
+ overrideLabel?: string;
38
+ /** Add css classes to the label element. */
39
+ labelClass?: string;
40
+ /**
41
+ * Specify which dataSource the label's mask-toggle-button will toggle.
42
+ *
43
+ * If no {@link MaskToggleButtonProperties.dataSource | dataSource} is specified,
44
+ * the mask-toggle-button will toggle the dataSource(s) defined in the childNode's {@link Control.typeAttributes | typeAttributes}.
45
+ */
46
+ dataSource?: string;
47
+ /** Disable the label's mask toggle button. */
48
+ disableMaskToggle?: boolean;
49
+ /** Hide the label's mask toggle button. */
50
+ hideMaskToggle?: boolean;
51
+ /** Set the label's `for` attribute. */
52
+ for?: string;
53
+ }
54
+ /**
55
+ * Properties for {@link SVICustomElement.MaskToggleButton}.
56
+ *
57
+ * @category CustomElement
58
+ *
59
+ * @example HTML Example
60
+ * ```html
61
+ * <svi-mask-toggle-button
62
+ * [childNode]="childNode"
63
+ * [pageModel]="pageModel"
64
+ * >
65
+ * </svi-mask-toggle-button>
66
+ * ```
67
+ *
68
+ * @example Create element via document.createElement:
69
+ * ```ts
70
+ * const maskToggleBtn = document.createElement(SVICustomElement.MaskToggleButton);
71
+ * maskToggleBtn.pageModel = this.pageModel;
72
+ * maskToggleBtn.childNode = this.childNode;
73
+ * ```
74
+ */
75
+ export interface MaskToggleButtonProperties extends PageControlBindings {
76
+ /**
77
+ * Specify which dataSource will be toggled.
78
+ *
79
+ * If no {@link MaskToggleButtonProperties.dataSource | dataSource} is specified,
80
+ * the mask-toggle-button will toggle the dataSource(s) defined in the childNode's {@link Control.typeAttributes | typeAttributes}.
81
+ */
82
+ dataSource?: string;
83
+ /** Disable the mask toggle button. */
84
+ disabled?: boolean;
85
+ /** Hide the mask toggle button. */
86
+ hidden?: boolean;
87
+ /** Override the control name displayed in the authorization dialog. */
88
+ controlName?: string;
89
+ }
@@ -18,7 +18,8 @@ export declare enum PageEvents {
18
18
  TabSelectedEvent = "spb::tabSelected",
19
19
  VisitAllTabs = "spb::mark-all-tabs-visited",
20
20
  MaskToggleEvent = "spb::mask-toggle",
21
- MaskAllEvent = "spb::mask-all"
21
+ MaskAllEvent = "spb::mask-all",
22
+ ClearDateFieldEvent = "spb::clear-date-field"
22
23
  }
23
24
  export declare enum DocumentGeneratorEvents {
24
25
  AfterDocumentGenerated = "docgen::after-document-generated"
@@ -28,7 +29,11 @@ export interface Subscription {
28
29
  }
29
30
  /**
30
31
  * This API provides the details and functionality associated with publishing and subscribing to events.
31
- * Accessed from the window at window.sas.vi.event.
32
+ *
33
+ * Accessed from the window at `window.sas.vi.event`.
34
+ *
35
+ * @example window.sas.vi.event.publish("eventName", payload);
36
+ * @category API
32
37
  */
33
38
  export interface EventApi {
34
39
  /**
@@ -42,8 +47,8 @@ export interface EventApi {
42
47
  * @method
43
48
  * @description Subscribes to an event and registers a function to be called on any future published events.
44
49
  * If the eventName does not exist, it is created.
45
- * @param eventName {string} Name of the event to subscribe to.
46
- * @param {EventApi~subscriptionCallback} Function Invoked when the subscription is triggered by an event.
50
+ * @param {string} eventName Name of the event to subscribe to.
51
+ * @param {EventApi~subscriptionCallback} observer Invoked when the subscription is triggered by an event.
47
52
  * Has access to the event's payload.
48
53
  * @returns The subscription being made to the event.
49
54
  */
@@ -20,6 +20,7 @@ export var PageEvents;
20
20
  PageEvents["VisitAllTabs"] = "spb::mark-all-tabs-visited";
21
21
  PageEvents["MaskToggleEvent"] = "spb::mask-toggle";
22
22
  PageEvents["MaskAllEvent"] = "spb::mask-all";
23
+ PageEvents["ClearDateFieldEvent"] = "spb::clear-date-field";
23
24
  })(PageEvents || (PageEvents = {}));
24
25
  export var DocumentGeneratorEvents;
25
26
  (function (DocumentGeneratorEvents) {
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
@@ -30,7 +30,11 @@ export interface FileOperation {
30
30
  }
31
31
  /**
32
32
  * This API provides functionality related to uploading files.
33
- * Accessed from the window at window.sas.vi.file.
33
+ *
34
+ * Accessed from the window at `window.sas.vi.file`.
35
+ *
36
+ * @example window.sas.vi.file.uploadToVIFolder(file, "fileName")
37
+ * @category API
34
38
  */
35
39
  export interface FileApi {
36
40
  /**
package/file/package.json CHANGED
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
package/http/index.d.ts CHANGED
@@ -7,7 +7,11 @@ export interface HttpResponse<R> {
7
7
  }
8
8
  /**
9
9
  * This API provides functionality for making REST requests.
10
- * Accessed from the window at window.sas.vi.http.
10
+ *
11
+ * Accessed from the window at `window.sas.vi.http`
12
+ *
13
+ * @example window.sas.vi.http.get("example_url", {...})
14
+ * @category API
11
15
  */
12
16
  export interface HttpApi {
13
17
  /**
package/http/package.json CHANGED
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
package/index.d.ts CHANGED
@@ -24,7 +24,9 @@ import { ShellTabsApi } from "./shell-tabs/shell-tabs-api";
24
24
  import { PageTemplateApi } from "./page-template/page-template-api";
25
25
  import { InitApi } from "./init";
26
26
  /**
27
- * Common API Functions.
27
+ * The SVI API contains common API functions and can be accessed directly from the window via `window.sas.vi`
28
+ *
29
+ * @module
28
30
  */
29
31
  export interface SviCommonApi {
30
32
  component: ComponentApi;
package/init/index.d.ts CHANGED
@@ -3,21 +3,25 @@ export declare const ERR_EXISTING_APP_DECLARED: (appName: string) => string;
3
3
  export declare const ERR_EXISTING_RESOURCE_BUNDLE_DECLARED: (appName: string) => string;
4
4
  export declare const ERR_INIT_TIMEOUT: (name: string, timeout?: number) => string;
5
5
  /**
6
- * An API to manage the asynchronous initialisation of solution applications
7
- * before the Visual Investigator application is fully initialised.
6
+ * An API to manage the asynchronous initialization of solution applications before the
7
+ * Visual Investigator application is fully initialized.
8
+ *
9
+ * Accessed from the window at `window.sas.viInit`
10
+ * @example window.sas.viInit.registerResourceBundle(bundleName, resources);
11
+ * @category API
8
12
  */
9
13
  export interface InitApi {
10
14
  /**
11
15
  * Declare an application.
12
- * Visual Investigator will await whenReady for each before continuing its own app initialisation.
13
- * notifyAppReady should be called to indicate when the app initialisation is complete.
16
+ * Visual Investigator will await whenReady for each before continuing its own app initialization.
17
+ * notifyAppReady should be called to indicate when the app initialization is complete.
14
18
  * if provided, registerResourceBundle should be called to indicate when the I18n resource bundle is ready.
15
19
  * @param appName appName of the app configuration.
16
20
  * @param i18nResourceBundleName I18n resource bundle name of the app configuration.
17
21
  */
18
22
  declareApp(appName: string, i18nResourceBundleName?: string): void;
19
23
  /**
20
- * Notify listeners that the app has been initialised.
24
+ * Notify listeners that the app has been initialized.
21
25
  * @param appName appName of the app configuration.
22
26
  */
23
27
  notifyAppReady(appName: string): void;
@@ -38,8 +42,9 @@ export interface InitApi {
38
42
  registerResourceBundle(bundleName: string, resources: I18nResources): void;
39
43
  }
40
44
  /**
41
- * Initialisation events for the Visual Investigator application.
42
- * These can be awaited using window.sas.viInit.whenReady
45
+ * Initialization events for the Visual Investigator application.
46
+ *
47
+ * These can be awaited using `window.sas.viInit.whenReady`
43
48
  */
44
49
  export declare enum SviInitEvent {
45
50
  /** all apps which were declared through window.sas.viInit */
package/init/index.js CHANGED
@@ -3,8 +3,9 @@ export const ERR_EXISTING_APP_DECLARED = (appName) => `App: '${appName}' has alr
3
3
  export const ERR_EXISTING_RESOURCE_BUNDLE_DECLARED = (appName) => `I18n resource bundle: '${appName}' has already been declared.`;
4
4
  export const ERR_INIT_TIMEOUT = (name, timeout) => `Ready check for '${name}' timed out after ${timeout ?? APP_INIT_TIMEOUT_MS}ms.`;
5
5
  /**
6
- * Initialisation events for the Visual Investigator application.
7
- * These can be awaited using window.sas.viInit.whenReady
6
+ * Initialization events for the Visual Investigator application.
7
+ *
8
+ * These can be awaited using `window.sas.viInit.whenReady`
8
9
  */
9
10
  export var SviInitEvent;
10
11
  (function (SviInitEvent) {
package/init/package.json CHANGED
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }
@@ -1,6 +1,10 @@
1
1
  /**
2
2
  * This API is used for the localization methods.
3
- * Accessed from the window at window.sas.vi.localization.
3
+ *
4
+ * Accessed from the window at `window.sas.vi.localization`.
5
+ *
6
+ * @example window.sas.vi.localization.getLocale();
7
+ * @category API
4
8
  */
5
9
  export interface LocalizationApi {
6
10
  /**
@@ -16,6 +20,13 @@ export interface LocalizationApi {
16
20
  * @returns The current application locale.
17
21
  */
18
22
  getLocale(): string;
23
+ /**
24
+ * @method
25
+ * @description Gets user's preferred locale format in BCP 47 format. This should be used
26
+ * to format dates\numbers in VI extensions but not to drive the language.
27
+ * @returns The user's preferred locale format.
28
+ */
29
+ getFormatLocale(): string;
19
30
  /**
20
31
  * @method
21
32
  * @description Gets the application display direction.
@@ -30,7 +41,11 @@ export interface LocalizationApi {
30
41
  }
31
42
  /**
32
43
  * This API is used for solution content localization.
33
- * Accessed from the window at window.sas.vi.localization.solution.
44
+ *
45
+ * Accessed from the window at `window.sas.vi.localization.solution`.
46
+ *
47
+ * @example window.sas.vi.metadata.getLocalizationBundle();
48
+ * @category API
34
49
  */
35
50
  export interface SolutionLocalizationApi {
36
51
  /**
@@ -52,7 +67,7 @@ export interface SolutionLocalizationApi {
52
67
  * @returns The localized value for the given resource key, else undefined.
53
68
  * @param resourceKey {string} A resource key used to lookup the localized value.
54
69
  * @example
55
- * getLocalizedResource("colours.red.txt") === "rouge"
70
+ * getLocalizedResource("colors.red.txt") === "rouge"
56
71
  */
57
72
  getLocalizedResource(resourceKey: string): string | undefined;
58
73
  /**
@@ -64,7 +79,7 @@ export interface SolutionLocalizationApi {
64
79
  * @param resourceKey {string} A resource key used to lookup the localized value.
65
80
  * @returns The localized string.
66
81
  * @example
67
- * localize("red", "colours.red.txt") === "rouge"
82
+ * localize("red", "colors.red.txt") === "rouge"
68
83
  */
69
84
  localize(str: string, resourceKey?: string): string;
70
85
  /**
@@ -76,7 +91,7 @@ export interface SolutionLocalizationApi {
76
91
  * @param props {Record<string, string | undefined>} The properties to localize and their resource keys.
77
92
  * @returns The localized object.
78
93
  * @example
79
- * localizeObject({ label: "red" }, { "label": "colours.red.txt" }) === { label: "rouge" }
94
+ * localizeObject({ label: "red" }, { "label": "colors.red.txt" }) === { label: "rouge" }
80
95
  */
81
96
  localizeObject<T extends object>(obj: T, props: Record<string, string | undefined>): T;
82
97
  /**
@@ -89,7 +104,7 @@ export interface SolutionLocalizationApi {
89
104
  * @example
90
105
  * localizeList(
91
106
  * [{ id: "red", label: "Red" }, { id: "blue", label: "Blue"} ],
92
- * (item) => ({ "label": `colours.${item.id}.title` })
107
+ * (item) => ({ "label": `colors.${item.id}.title` })
93
108
  * ) === [{ id: "red", label: "Rouge" }, { id: "blue", label: "Bleu"} ]
94
109
  */
95
110
  localizeList<T extends object>(list: T[], getProps: (obj: T) => Record<string, string | undefined>): T[];
@@ -98,9 +113,9 @@ export interface SolutionLocalizationApi {
98
113
  * Stores localized strings by key and value.
99
114
  * @example
100
115
  * {
101
- * bykey: {
102
- * "colours.red.label": "rouge",
103
- * "colours.blue.label": "bleu"
116
+ * byKey: {
117
+ * "colors.red.label": "rouge",
118
+ * "colors.blue.label": "bleu"
104
119
  * },
105
120
  * byValue: {
106
121
  * "red": "rouge",
@@ -4,6 +4,6 @@
4
4
  "**/*.d.ts",
5
5
  "**/*.js"
6
6
  ],
7
- "main": "public-api.js",
8
- "types": "public-api.d.ts"
7
+ "main": "index.js",
8
+ "types": "index.d.ts"
9
9
  }