@sassoftware/vi-api 0.0.29

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 (140) hide show
  1. package/alert-reps/index.d.ts +677 -0
  2. package/alert-reps/package.json +5 -0
  3. package/component/bindings.d.ts +85 -0
  4. package/component/bindings.js +1 -0
  5. package/component/index.d.ts +49 -0
  6. package/component/index.js +16 -0
  7. package/component/package.json +9 -0
  8. package/component/public-api.d.ts +1 -0
  9. package/component/public-api.js +1 -0
  10. package/config/config-api.d.ts +92 -0
  11. package/config/config-api.js +6 -0
  12. package/config/package.json +9 -0
  13. package/config/public-api.d.ts +1 -0
  14. package/config/public-api.js +1 -0
  15. package/control/control-api.d.ts +450 -0
  16. package/control/control-api.js +1 -0
  17. package/control/data-types.d.ts +9 -0
  18. package/control/data-types.js +1 -0
  19. package/control/events.d.ts +75 -0
  20. package/control/events.js +5 -0
  21. package/control/file.d.ts +14 -0
  22. package/control/file.js +1 -0
  23. package/control/image.d.ts +14 -0
  24. package/control/image.js +1 -0
  25. package/control/package.json +9 -0
  26. package/control/page.d.ts +55 -0
  27. package/control/page.js +1 -0
  28. package/control/public-api.d.ts +8 -0
  29. package/control/public-api.js +8 -0
  30. package/control/restrictions.d.ts +33 -0
  31. package/control/restrictions.js +1 -0
  32. package/control/toolbar-property-api.d.ts +16 -0
  33. package/control/toolbar-property-api.js +1 -0
  34. package/current-user/currentUser-api.d.ts +65 -0
  35. package/current-user/currentUser-api.js +11 -0
  36. package/current-user/package.json +9 -0
  37. package/current-user/public-api.d.ts +1 -0
  38. package/current-user/public-api.js +1 -0
  39. package/event/event-api.d.ts +57 -0
  40. package/event/event-api.js +26 -0
  41. package/event/package.json +9 -0
  42. package/event/public-api.d.ts +1 -0
  43. package/event/public-api.js +1 -0
  44. package/file/file-api.d.ts +44 -0
  45. package/file/file-api.js +1 -0
  46. package/file/package.json +9 -0
  47. package/file/public-api.d.ts +1 -0
  48. package/file/public-api.js +1 -0
  49. package/http/index.d.ts +364 -0
  50. package/http/index.js +45 -0
  51. package/http/package.json +9 -0
  52. package/http/public-api.d.ts +1 -0
  53. package/http/public-api.js +1 -0
  54. package/index.d.ts +65 -0
  55. package/index.js +1 -0
  56. package/localization/localization-api.d.ts +26 -0
  57. package/localization/localization-api.js +1 -0
  58. package/localization/package.json +9 -0
  59. package/localization/public-api.d.ts +1 -0
  60. package/localization/public-api.js +1 -0
  61. package/metadata/admin/admin-metadata-api.d.ts +18 -0
  62. package/metadata/admin/admin-metadata-api.js +1 -0
  63. package/metadata/metadata-api.d.ts +237 -0
  64. package/metadata/metadata-api.js +1 -0
  65. package/metadata/package.json +9 -0
  66. package/metadata/public-api.d.ts +2 -0
  67. package/metadata/public-api.js +2 -0
  68. package/object/object-api.d.ts +507 -0
  69. package/object/object-api.js +13 -0
  70. package/object/package.json +9 -0
  71. package/object/public-api.d.ts +1 -0
  72. package/object/public-api.js +1 -0
  73. package/package.json +14 -0
  74. package/page-admin/package.json +9 -0
  75. package/page-admin/page-admin-api.d.ts +29 -0
  76. package/page-admin/page-admin-api.js +11 -0
  77. package/page-admin/public-api.d.ts +1 -0
  78. package/page-admin/public-api.js +1 -0
  79. package/page-model/package.json +9 -0
  80. package/page-model/page-model-api.d.ts +126 -0
  81. package/page-model/page-model-api.js +11 -0
  82. package/page-model/public-api.d.ts +1 -0
  83. package/page-model/public-api.js +1 -0
  84. package/page-state/package.json +9 -0
  85. package/page-state/page-state-api.d.ts +59 -0
  86. package/page-state/page-state-api.js +1 -0
  87. package/page-state/public-api.d.ts +1 -0
  88. package/page-state/public-api.js +1 -0
  89. package/property/package.json +9 -0
  90. package/property/property-api.d.ts +46 -0
  91. package/property/property-api.js +17 -0
  92. package/property/public-api.d.ts +1 -0
  93. package/property/public-api.js +1 -0
  94. package/public-api.d.ts +1 -0
  95. package/public-api.js +1 -0
  96. package/reference-data/package.json +9 -0
  97. package/reference-data/public-api.d.ts +1 -0
  98. package/reference-data/public-api.js +1 -0
  99. package/reference-data/refData.d.ts +72 -0
  100. package/reference-data/refData.js +1 -0
  101. package/resource/package.json +9 -0
  102. package/resource/public-api.d.ts +1 -0
  103. package/resource/public-api.js +1 -0
  104. package/resource/resource-api.d.ts +17 -0
  105. package/resource/resource-api.js +1 -0
  106. package/score-reps/index.d.ts +133 -0
  107. package/score-reps/package.json +5 -0
  108. package/search/client/client-search-api.d.ts +159 -0
  109. package/search/client/client-search-api.js +14 -0
  110. package/search/package.json +9 -0
  111. package/search/public-api.d.ts +2 -0
  112. package/search/public-api.js +2 -0
  113. package/search/search-api.d.ts +72 -0
  114. package/search/search-api.js +1 -0
  115. package/sheet/package.json +9 -0
  116. package/sheet/public-api.d.ts +1 -0
  117. package/sheet/public-api.js +1 -0
  118. package/sheet/sheet-api.d.ts +184 -0
  119. package/sheet/sheet-api.js +1 -0
  120. package/svi-datahub/index.d.ts +4514 -0
  121. package/svi-datahub/package.json +5 -0
  122. package/svi-sand/index.d.ts +1057 -0
  123. package/svi-sand/package.json +5 -0
  124. package/tab/package.json +9 -0
  125. package/tab/public-api.d.ts +1 -0
  126. package/tab/public-api.js +1 -0
  127. package/tab/tab-api.d.ts +33 -0
  128. package/tab/tab-api.js +1 -0
  129. package/theme/package.json +9 -0
  130. package/theme/public-api.d.ts +1 -0
  131. package/theme/public-api.js +1 -0
  132. package/theme/theme-api.d.ts +35 -0
  133. package/theme/theme-api.js +17 -0
  134. package/time-slider/index.d.ts +35 -0
  135. package/time-slider/index.js +17 -0
  136. package/traversal/package.json +9 -0
  137. package/traversal/public-api.d.ts +1 -0
  138. package/traversal/public-api.js +1 -0
  139. package/traversal/traversal-api.d.ts +34 -0
  140. package/traversal/traversal-api.js +1 -0
@@ -0,0 +1,450 @@
1
+ import { FileChange, SASObjectAttachedFile, SASUploadedFile } from "../file/file-api";
2
+ import { PageMode, PageModel } from "../page-model/page-model-api";
3
+ import { FieldType, FieldTypeToValue } from "./data-types";
4
+ import { PageDataChange, PageModeChange, StateChange } from "./events";
5
+ import { Control, RefreshablePageControlOptions, SlidingPanelProperties, TypeAttributes } from "./page";
6
+ import { FieldTypeToRestrictions, FileRestrictions } from "./restrictions";
7
+ import { AttachmentFormData } from "./file";
8
+ /**
9
+ * The minimum API that should be supported on control members across solutions.
10
+ */
11
+ export interface ControlMemberApiBase<ControlTypeAttributes extends TypeAttributes = TypeAttributes, ControlFieldType extends FieldType = never> {
12
+ /**
13
+ * Methods related to this control.
14
+ */
15
+ readonly control: ControlApiBase<ControlTypeAttributes, ControlFieldType>;
16
+ /**
17
+ * Methods related to the entire page.
18
+ */
19
+ readonly page: ControlPageApiBase;
20
+ }
21
+ /**
22
+ * {@link ControlMemberApiBase} extension that provides more functionality.
23
+ * @extends ControlMemberApiBase
24
+ */
25
+ export interface ControlMemberApi<ControlTypeAttributes extends TypeAttributes = TypeAttributes, ControlFieldType extends FieldType = any> extends ControlMemberApiBase<ControlTypeAttributes, ControlFieldType> {
26
+ /**
27
+ * Methods related to this control
28
+ */
29
+ readonly control: ControlApi<ControlTypeAttributes, ControlFieldType>;
30
+ /**
31
+ * Methods related to the entire page the control is on.
32
+ */
33
+ readonly page: ControlPageApi;
34
+ /**
35
+ * Methods available when administering this control.
36
+ */
37
+ readonly admin: ControlAdminApi;
38
+ }
39
+ /**
40
+ * This Control API pertains functionality that checks the state, registers event handlers and so on.
41
+ */
42
+ export interface ControlApiBase<ControlTypeAttributes extends TypeAttributes = TypeAttributes, ControlFieldType extends FieldType = never> {
43
+ /**
44
+ * Methods related to the state of the control.
45
+ */
46
+ readonly state: ControlStateApi;
47
+ /** Control type. */
48
+ readonly type: string;
49
+ /**
50
+ * Sets the value of the control's field.
51
+ * Field must be configured as dataSource in the control's typeAttributes.
52
+ * @method
53
+ * @param value {FieldTypeToValue<ControlFieldType>} New field value.
54
+ */
55
+ setFieldValue(value: FieldTypeToValue<ControlFieldType>): void;
56
+ /**
57
+ * Gives the value of the control's field.
58
+ * Field must be configured as dataSource in the control's typeAttributes.
59
+ * @method
60
+ * @returns The value of the control's field.
61
+ */
62
+ getFieldValue(): FieldTypeToValue<ControlFieldType>;
63
+ /**
64
+ * Returns the field restrictions that are associated with the calling control.
65
+ * Field must be configured as dataSource in the control's typeAttributes.
66
+ * @method
67
+ * @returns The field restrictions that should be applied.
68
+ */
69
+ getFieldRestrictions(): FieldTypeToRestrictions<ControlFieldType>;
70
+ /**
71
+ * Returns the restrictions of the control's file category.
72
+ * File category must be configured as fileCategory in the control's typeAttributes.
73
+ * @method
74
+ * @returns The file restrictions that should be applied.
75
+ */
76
+ getFileRestrictions(): FileRestrictions;
77
+ /**
78
+ * Returns the calling control object.
79
+ * @method
80
+ * @returns Object representing the calling control.
81
+ */
82
+ getControl(): Control<ControlTypeAttributes>;
83
+ }
84
+ /**
85
+ * This API pertains to administration functionality for controls, for example registering resources.
86
+ */
87
+ export interface ControlAdminApi {
88
+ /**
89
+ * Registers a function to be invoked when retrieving this control's internationalization resources.
90
+ * @method
91
+ * @param fn {function} a function that returns each internationalization resource's key and value.
92
+ * No parameters. Return type: Record<string, string>
93
+ */
94
+ registerGetI18nResourcesFn(fn: () => Record<string, string>): void;
95
+ }
96
+ /**
97
+ * Extension of {@link ControlApiBase} supplied by SAS Visual Investigator to provide more functionality.
98
+ * @extends ControlApiBase
99
+ */
100
+ export interface ControlApi<ControlTypeAttributes extends TypeAttributes = TypeAttributes, ControlFieldType extends FieldType = never> extends ControlApiBase<ControlTypeAttributes, ControlFieldType> {
101
+ /**
102
+ * Methods related to the state of the control.
103
+ */
104
+ readonly state: ControlStateApi;
105
+ /**
106
+ * Space for component specific API functions.
107
+ */
108
+ readonly component?: any;
109
+ /**
110
+ * Returns the calling control's parent object.
111
+ * @method
112
+ * @returns Object representing the calling control's parent.
113
+ */
114
+ getParentControl(): Control | undefined;
115
+ /**
116
+ * Returns the parent ancestor with the given type for this control.
117
+ * @method
118
+ * @param ofType {string} Type of ancestor to be returned.
119
+ * @returns Object representing the calling control's ancestor, or undefined if no match.
120
+ */
121
+ getAncestorControl(ofType: string): Control | undefined;
122
+ /**
123
+ * Returns a string that can be used as an aria label for the field, which includes its required state.
124
+ * Uses the typeAttributes.title.text field for the label.
125
+ * @method
126
+ * @returns The aria label that should be applied.
127
+ */
128
+ getAriaLabel: () => string;
129
+ }
130
+ /**
131
+ * Methods and properties related to the state of the control.
132
+ */
133
+ export interface ControlStateApi {
134
+ /**
135
+ * Returns the read-only state of the calling control.
136
+ * True if the control is read-only, otherwise false.
137
+ */
138
+ readonly readOnly: boolean;
139
+ /**
140
+ * Returns the required state of the calling control.
141
+ * True if control is required, otherwise false.
142
+ */
143
+ readonly required: boolean;
144
+ /**
145
+ * Checks if the current controls should allow input.
146
+ * Returns True if the control allows input, otherwise false.
147
+ */
148
+ readonly allowInput: boolean;
149
+ /**
150
+ * Returns if this control could be read-only based on a condition.
151
+ * True if the control could be read-only, otherwise false.
152
+ */
153
+ readonly couldBeReadOnly: boolean;
154
+ /**
155
+ * Returns if this control could be required based on a condition.
156
+ * True if the control could be required, otherwise false.
157
+ */
158
+ readonly couldBeRequired: boolean;
159
+ /**
160
+ * Returns the hidden state of the calling control.
161
+ * True if the control is hidden, otherwise false.
162
+ */
163
+ readonly hidden: boolean;
164
+ /**
165
+ * Registers a function to be invoked whenever a state change event occurs.
166
+ * This function receives an object that contains information about the change event.
167
+ *
168
+ * @method
169
+ * @param handler {function} Function to be invoked when a state is changed.
170
+ * Parameter (change: StateChange). Returns void.
171
+ */
172
+ onChange(handler: (change: StateChange) => void): void;
173
+ /**
174
+ * Re-evaluates the status of all control states.
175
+ * @method
176
+ */
177
+ update(): void;
178
+ }
179
+ /**
180
+ * API methods related to object fields associated with a page.
181
+ */
182
+ export interface ControlPageFieldApi {
183
+ /**
184
+ * Sets the value of the supplied field.
185
+ * This works only with fields for the current object for which the control is associated.
186
+ * For example, if the control is on a parent object, you cannot set a child's field.
187
+ * @method
188
+ * @param value {FieldTypeToValue<Type>} New field value.
189
+ * @param field {string} Field name.
190
+ */
191
+ setFieldValue<Type extends FieldType>(value: FieldTypeToValue<Type>, field: string): void;
192
+ /**
193
+ * Returns the value of the supplied field.
194
+ * This works only with fields for the current object for which the control is associated with.
195
+ * For example, if the control is on a parent object, you cannot get a child's field.
196
+ * @method
197
+ * @template {FieldType} File type.
198
+ * @param field {string} Field name.
199
+ */
200
+ getFieldValue<Type extends FieldType>(field: string): FieldTypeToValue<Type>;
201
+ /**
202
+ * Returns the field restrictions that are associated with the calling control.
203
+ * @method
204
+ * @template {FieldType} Field type.
205
+ * @param field {string} Field name to get restrictions for.
206
+ * @returns Applied field restrictions.
207
+ */
208
+ getFieldRestrictions<Type extends FieldType>(field: string): FieldTypeToRestrictions<Type>;
209
+ }
210
+ /**
211
+ * Methods related to the page to which a control belongs.
212
+ * @class
213
+ */
214
+ export interface ControlPageApiBase {
215
+ /**
216
+ * Methods related to files associated with the page.
217
+ */
218
+ readonly file: ControlFileApiBase;
219
+ /**
220
+ * The object ID, if applicable. Otherwise "".
221
+ */
222
+ readonly objectId: string;
223
+ /**
224
+ * The object name, if applicable. Otherwise "".
225
+ */
226
+ readonly objectName: string;
227
+ /**
228
+ * Checks if the object is external.
229
+ */
230
+ readonly isExternalObject: boolean;
231
+ /**
232
+ * Checks if the page is a home page.
233
+ */
234
+ readonly isHomepage: boolean;
235
+ /**
236
+ * Returns the mode of the page on which the calling control resides.
237
+ * @method
238
+ * @returns The current PageMode.
239
+ */
240
+ getMode(): PageMode;
241
+ /**
242
+ * Methods that relate to object fields associated with the page.
243
+ */
244
+ readonly field: ControlPageFieldApi;
245
+ /**
246
+ * Registers a function to be invoked whenever a relevant change happens.
247
+ * The handler receives an object that gives information about the change event.
248
+ * There are two types of changes -
249
+ * PageDataChange when the data in the page model changes,
250
+ * and PageModeChange when the page mode changes.
251
+ * @method
252
+ * @param handler {function} Function to be invoked when there is a change.
253
+ * Parameter (change) is of type PageDataChange or PageModeChange.
254
+ * Returns void.
255
+ */
256
+ onChange(handler: (change: PageDataChange | PageModeChange) => void): void;
257
+ }
258
+ /**
259
+ * {@link ControlPageApiBase} extension that provides more functionality.
260
+ * @extends ControlPageApiBase
261
+ */
262
+ export interface ControlPageApi extends ControlPageApiBase {
263
+ /**
264
+ * Methods related to the files associated with the page.
265
+ */
266
+ file: ControlFileApi;
267
+ /**
268
+ * Returns the model of the page in which the calling control resides.
269
+ * @method
270
+ * @returns The current page model object.
271
+ */
272
+ getPageModel(): PageModel;
273
+ /**
274
+ * Registers a function to be invoked whenever one of the calling control's properties change.
275
+ * @method
276
+ * @param handler {function} Function to be invoked on property change.
277
+ * Parameters are (category: string, property: string, currentValue: any, previousValue: any).
278
+ * Returns void.
279
+ */
280
+ onPropertyChange(handler: (category: string, property: string, currentValue: any, previousValue: any) => void): void;
281
+ /**
282
+ * Returns the disabled status of the page toolbar.
283
+ * @method
284
+ * @returns True, if the toolbar is disabled. Otherwise false.
285
+ */
286
+ isToolbarDisabled(): boolean;
287
+ /**
288
+ * Triggers a certain type of notification for users.
289
+ * For example, a type EDIT_FAIL notification if a sheet has failed to be added to a workspace.
290
+ * @method
291
+ * @param notification {string} Message to be displayed on the notification.
292
+ * @param type {string} Type of notification. For example LOCK, EDIT_FAIL, VERSION_MISMATCH.
293
+ * @param [autoDismissDuration] {number} Length of time before the notification should be dismissed.
294
+ */
295
+ raiseNotification(notification: string, type: string, autoDismissDuration?: number): void;
296
+ /**
297
+ * Adds a refreshable control to the page.
298
+ * @method
299
+ * @param control {Control} Control to add.
300
+ * @param refreshFn {function} Function to be called when the control is refreshed. There are no parameters. Returns void.
301
+ * @param [options] {RefreshablePageControlOptions} Options to be added to the refreshable control.
302
+ */
303
+ addRefreshableControl(control: Control, refreshFn: () => void, options?: RefreshablePageControlOptions): void;
304
+ /**
305
+ * Removes a refreshable control from the page.
306
+ * @method
307
+ * @param controlToRemove {Control} Control to be removed.
308
+ */
309
+ removeRefreshableControl(controlToRemove: Control): void;
310
+ /**
311
+ * Refreshes a control when updated data is displayed.
312
+ * By default, attempts to refresh all controls.
313
+ * Specify categoryToRefresh or controlToRefresh to restrict what is refreshed.
314
+ * @method
315
+ * @param categoryToRefresh {(string|undefined)} Name of the category to be refreshed.
316
+ * @param [controlToRefresh] {Control} Individual control to be refreshed.
317
+ */
318
+ reloadRefreshableControls(categoryToRefresh: string | undefined, controlToRefresh: Control): void;
319
+ /**
320
+ * Sets a page to be dirty, that is, when it has been edited and not saved.
321
+ * @method
322
+ */
323
+ setPageDirty(): void;
324
+ /**
325
+ * Toggle the page-level sliding panel. This panel should be used to contain information that is
326
+ * supplementary to the document, for example attachments or workflow tasks.
327
+ * @method
328
+ * @param sectionLabel {string} Describes the section, this should be internationalised.
329
+ * @param contentUrl {string} Contains the template URL of the contents to be ng-included.
330
+ * @param [panelProperties] {SlidingPanelProperties} Properties that are exposed to the template from the caller.
331
+ * @param [onClose] {function} A callback function invoked when the panel is dismissed. There are no parameters. Returns void.
332
+ */
333
+ toggleSlidingPanel(sectionLabel: string, contentUrl: string, panelProperties?: SlidingPanelProperties, onClose?: () => void): void;
334
+ /**
335
+ * Checks if a page is in edit mode.
336
+ * @method
337
+ * @returns A boolean value that checks whether or not a page is in edit mode. Undefined if there is no page model.
338
+ */
339
+ isInEditMode(): boolean | undefined;
340
+ /**
341
+ * Takes a page out of edit mode. Promise resolves with a boolean value to determine if the user has saved or not.
342
+ * If the user has not saved, the user is prompted to do so.
343
+ * @method
344
+ * @param closeTab {boolean} Checks if the tab should close after edit mode is cancelled.
345
+ * @returns A promise that resolves once the edit has been cancelled.
346
+ */
347
+ cancelEdit(closeTab: boolean): Promise<{
348
+ userSaved: boolean;
349
+ }>;
350
+ /**
351
+ * Sets the page to be in edit mode. Used when clicking the Edit button.
352
+ * @method
353
+ * @returns A promise that resolves when the page is put in edit mode.
354
+ */
355
+ edit(): Promise<any>;
356
+ /**
357
+ * Refreshes the attachments grid to display new attachments when new attachment is uploaded.
358
+ * @method
359
+ */
360
+ refreshAttachments(): void;
361
+ /**
362
+ * Reloads an instance of a page.
363
+ * @method
364
+ * @returns A promise that resolves when the page is reloaded.
365
+ */
366
+ reloadPage(): Promise<void>;
367
+ /**
368
+ * Saves a page after editing.
369
+ * @method
370
+ * @param stopEditing {boolean} Checks if the page should leave edit mode after it is saved.
371
+ * @param closeObject {boolean} Checks if the page should be closed after it is saved.
372
+ * @returns A promise which resolves when the page has been saved.
373
+ */
374
+ save(stopEditing: boolean, closeObject: boolean): Promise<void>;
375
+ }
376
+ /**
377
+ * Methods related to files
378
+ */
379
+ export interface ControlFileApiBase {
380
+ /**
381
+ * Returns the restrictions of the control's file category.
382
+ * @method
383
+ * @param [category] {string} Get restrictions for the file category name.
384
+ * @returns The file restrictions that should be applied.
385
+ */
386
+ getFileRestrictions(category: string): FileRestrictions;
387
+ }
388
+ /**
389
+ * {@link ControlFileApiBase} extension that provides more functionality.
390
+ * @extends ControlFileApiBase
391
+ */
392
+ export interface ControlFileApi extends ControlFileApiBase {
393
+ /**
394
+ * Opens the file upload dialog.
395
+ *
396
+ * @method
397
+ * @param {IAttachmentFormData} options Additional options to pass to the file upload dialog.
398
+ * @returns {Promise<SASObjectAttachedFile[]>} Promise which resolves to an array of uploaded files.
399
+ */
400
+ openFileUploadDialog(options: AttachmentFormData): Promise<SASObjectAttachedFile[]>;
401
+ /**
402
+ * Opens the image upload dialog.
403
+ *
404
+ * @method
405
+ * @param {boolean} allowMultiple Determines if multiple files can be uploaded at once.
406
+ * @param {number} [maxSize=] Maximum size of the image to be uploaded, in bytes.
407
+ * @returns {Promise<SASObjectAttachedFile[]>} A Promise which resolves to an array of uploaded files.
408
+ */
409
+ openImageUploadDialog(allowMultiple: boolean, maxSize?: number): Promise<SASObjectAttachedFile[]>;
410
+ /**
411
+ * Returns all saved and unsaved files associated with the current object.
412
+ *
413
+ * @method
414
+ * @param {string} [category=] An optional file category to filter by.
415
+ * @returns {Promise<SASObjectAttachedFile[]>} A Promise which resolves to an array of files.
416
+ */
417
+ getFiles(category?: string): Promise<SASObjectAttachedFile[]>;
418
+ /**
419
+ * Creates a file operation to upload a new file.
420
+ *
421
+ * @method
422
+ * @param {SASUploadedFile} file The new file to upload.
423
+ * @returns {Promise<void>} A Promise that resolves when the file operation has been created.
424
+ */
425
+ addFile(file: SASUploadedFile): Promise<void>;
426
+ /**
427
+ * Creates a file operation to update a given file.
428
+ *
429
+ * @method
430
+ * @param {SASUploadedFile} updatedFile The updated file.
431
+ * @returns {Promise<void>} A Promise that resolves when the file operation has been created.
432
+ */
433
+ updateFile(updatedFile: SASUploadedFile): Promise<void>;
434
+ /**
435
+ * Create a file operation to remove a file with a given ID.
436
+ *
437
+ * @method
438
+ * @param {string} id The ID of the file to remove.
439
+ * @returns {Promise<void>} A Promise that resolves when the file operation has been created.
440
+ */
441
+ removeFile(id: string): Promise<void>;
442
+ /**
443
+ * Registers a function to be invoked whenever a file change event occurs.
444
+ * This function receives an object that contains information about the change event.
445
+ *
446
+ * @method
447
+ * @param {Function} handler A function to be invoked when a file change event occurs.
448
+ */
449
+ onChange(handler: (change: FileChange) => void): void;
450
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export declare type FieldType = "STRING" | "BOOLEAN" | "REFERENCEDATA" | "USER_GROUP" | "JSON" | DateDataType | NumberDataType;
2
+ export declare type NumberDataType = "SMALLINT" | "INTEGER" | "LONG" | "FLOAT" | "DOUBLE" | "NUMERIC";
3
+ export declare type DateDataType = "DATE" | "TIMESTAMP" | "TIMESTAMP_WITH_TIME_ZONE";
4
+ export interface UserGroup {
5
+ id: string;
6
+ type: "user" | "group";
7
+ }
8
+ export declare type FieldTypeToValue<Type extends FieldType> = Type extends "BOOLEAN" ? boolean : Type extends "STRING" | DateDataType | "REFERENCEDATA" ? string : Type extends NumberDataType ? number : Type extends "JSON" ? object : Type extends "USER_GROUP" ? UserGroup[] : never;
9
+ export declare type FieldValue = undefined | string | number | boolean | object | UserGroup;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,75 @@
1
+ import { PageMode } from "../page-model/page-model-api";
2
+ import { FieldValue } from "./data-types";
3
+ import { TypeAttributes } from "./page";
4
+ export interface ModeChange {
5
+ type: "mode";
6
+ value: {
7
+ new: PageMode;
8
+ old: PageMode;
9
+ };
10
+ }
11
+ export interface FieldChange<Value extends FieldValue> {
12
+ type: "field";
13
+ value: {
14
+ new: Value | undefined;
15
+ old: Value | undefined;
16
+ };
17
+ field: string;
18
+ /**
19
+ * The object name, if applicable. Otherwise, "".
20
+ */
21
+ objectName: string;
22
+ /**
23
+ * The object position, for child objects only.
24
+ */
25
+ objectPosition?: number;
26
+ }
27
+ export interface ControlConfigChange<ControlTypeAttributes extends TypeAttributes> {
28
+ type: "controlConfig";
29
+ config: TypeAttributesChange<ControlTypeAttributes> | ConfigStateChange;
30
+ }
31
+ export declare type TypeAttributesChange<ControlTypeAttributes extends TypeAttributes, Property extends keyof ControlTypeAttributes = keyof ControlTypeAttributes> = Property extends any ? {
32
+ type: "typeAttributes";
33
+ value: {
34
+ new: ControlTypeAttributes[Property];
35
+ old: ControlTypeAttributes[Property];
36
+ };
37
+ property: Property;
38
+ } : never;
39
+ export interface ConfigStateChange {
40
+ type: "configState";
41
+ value: {
42
+ new: boolean;
43
+ old: boolean;
44
+ };
45
+ property: "readOnly" | "hidden" | "required";
46
+ }
47
+ export interface PageModelData {
48
+ [property: string]: any;
49
+ }
50
+ export declare enum ChangeType {
51
+ PAGE_MODE = "mode",
52
+ PAGE_DATA = "pageData"
53
+ }
54
+ export interface PageDataChange {
55
+ readonly type: ChangeType.PAGE_DATA;
56
+ value: {
57
+ new: PageModelData;
58
+ old?: PageModelData;
59
+ };
60
+ }
61
+ export interface PageModeChange {
62
+ readonly type: ChangeType.PAGE_MODE;
63
+ value: {
64
+ new: PageMode;
65
+ old?: PageMode;
66
+ };
67
+ }
68
+ export interface StateChange {
69
+ readOnly?: boolean;
70
+ hidden?: boolean;
71
+ required?: boolean;
72
+ allowInput?: boolean;
73
+ couldBeReadOnly?: boolean;
74
+ couldBeRequired?: boolean;
75
+ }
@@ -0,0 +1,5 @@
1
+ export var ChangeType;
2
+ (function (ChangeType) {
3
+ ChangeType["PAGE_MODE"] = "mode";
4
+ ChangeType["PAGE_DATA"] = "pageData";
5
+ })(ChangeType || (ChangeType = {}));
@@ -0,0 +1,14 @@
1
+ export interface AttachmentFormData {
2
+ title: string;
3
+ label: string;
4
+ options: AttachmentDialogOptions;
5
+ pageModel?: {
6
+ id?: string;
7
+ type: string;
8
+ };
9
+ }
10
+ export interface AttachmentDialogOptions {
11
+ maxSize?: number;
12
+ allowMultiple?: boolean;
13
+ fileExtensions?: string;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ export interface SASMenuItem {
2
+ label?: string;
3
+ showLabel?: boolean;
4
+ iconClass?: string;
5
+ items?: SASMenuItem[];
6
+ separator?: boolean;
7
+ disabled?: (() => boolean) | boolean;
8
+ onClick?(): void;
9
+ }
10
+ export interface ImageDialogOptions {
11
+ maxSize?: number;
12
+ allowMultiple?: boolean;
13
+ fileExtensions?: string;
14
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "@sassoftware/vi-api/control",
3
+ "files": [
4
+ "**/*.d.ts",
5
+ "**/*.js"
6
+ ],
7
+ "main": "public-api.js",
8
+ "types": "public-api.d.ts"
9
+ }
@@ -0,0 +1,55 @@
1
+ export declare const enum PageModeEvent {
2
+ CREATE = "create",
3
+ EDIT = "edit",
4
+ OPEN = "open",
5
+ INSPECT = "inspect",
6
+ SUMMARY = "summary"
7
+ }
8
+ export interface Control<ControlTypeAttributes extends TypeAttributes = TypeAttributes> {
9
+ id?: string;
10
+ attributes?: ControlAttributes;
11
+ typeAttributes: ControlTypeAttributes;
12
+ attrs: ControlAttrs;
13
+ childNodes?: Control[];
14
+ }
15
+ export interface ControlAttrs {
16
+ attributes?: {
17
+ disabled: boolean;
18
+ showActionHistory: boolean;
19
+ showVersionHistory: boolean;
20
+ };
21
+ id: string;
22
+ category: string;
23
+ type: string;
24
+ states?: ControlStates;
25
+ }
26
+ export interface TypeAttributes {
27
+ [property: string]: any;
28
+ }
29
+ export interface ControlAttributes extends TypeAttributes {
30
+ global?: {
31
+ state?: GlobalControlStates;
32
+ groupRestrictions?: Array<{
33
+ id: string;
34
+ name: string;
35
+ }>;
36
+ };
37
+ }
38
+ export interface ControlStates {
39
+ readOnly?: boolean;
40
+ required?: boolean;
41
+ hidden?: boolean;
42
+ }
43
+ export interface GlobalControlStates {
44
+ conditions?: any[];
45
+ readOnly?: boolean;
46
+ required?: boolean;
47
+ hidden?: boolean;
48
+ }
49
+ export interface SlidingPanelProperties {
50
+ [property: string]: any;
51
+ }
52
+ export interface RefreshablePageControlOptions {
53
+ refreshCategory?: string;
54
+ requiresIndex?: boolean;
55
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export * from "./control-api";
2
+ export * from "./data-types";
3
+ export * from "./events";
4
+ export * from "./file";
5
+ export * from "./image";
6
+ export * from "./page";
7
+ export * from "./restrictions";
8
+ export * from "./toolbar-property-api";
@@ -0,0 +1,8 @@
1
+ export * from "./control-api";
2
+ export * from "./data-types";
3
+ export * from "./events";
4
+ export * from "./file";
5
+ export * from "./image";
6
+ export * from "./page";
7
+ export * from "./restrictions";
8
+ export * from "./toolbar-property-api";