@ichicraft/widgets-widget-base 1.9.2 → 1.9.3

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.
@@ -1,715 +1,716 @@
1
- /**
2
- * Widget context providing widget metadata and functionality offered by the widget board
3
- */
4
- export interface WidgetContext {
5
- /**
6
- * Metadata and functions in the context of a widget instance. A widget instance
7
- * is a single and specific widget that a user has on his/her board. It has its own
8
- * unique ID and possibly configuration data if the widget is configurable by the user
9
- */
10
- instance: WidgetInstanceContext;
11
- /**
12
- * Metadata and functions in the context of a widget's variant (fka definition). A widget variant is
13
- * a widget that's been installed by an administrator from within the board administration.
14
- */
15
- definition: WidgetVariantContext;
16
- /**
17
- * Metadata and functions in the context of a widget's manifest. A widget manifest contains
18
- * all information of the originally installed widget. Multiple `variants` of the same widget `manifest`
19
- * can exist in a widget board configuration.
20
- */
21
- manifest: WidgetManifestContext;
22
- /**
23
- * Tells whether the widget board is running in a Teams context
24
- */
25
- inTeamsContext: boolean;
26
- /**
27
- * Tells whether the widget board is running in a Teams browser hosted context
28
- */
29
- isTeamsBrowserHosted: boolean;
30
- /**
31
- * Tells whether the widget board is running in a Teams webview hosted context
32
- */
33
- isTeamsWebViewHosted: boolean;
34
- /**
35
- * Tells whether the widget board is running in a SharePoint iOS app context
36
- */
37
- isSharePointiOSApp: boolean;
38
- /**
39
- * Tells whether the widget board is running in a webview hosted context
40
- */
41
- isWebViewHosted: boolean;
42
- /**
43
- * Tells whether the widget board is running in an embedded context
44
- */
45
- isEmbedded: boolean;
46
- /**
47
- * Tells whether the widget board is running in a mobile browser context
48
- */
49
- isMobileBrowser: boolean;
50
- /**
51
- * Tells whether the widget board is running in a mobile webview context
52
- */
53
- isMobileWebView: boolean;
54
- /**
55
- * Tenant ID of current SharePoint tenant
56
- */
57
- tenantId: string;
58
- /**
59
- * Site url of the site where the widget board is running
60
- */
61
- siteUrl: string;
62
- /**
63
- * User name of the currently signed in user.
64
- */
65
- userName: string;
66
- /**
67
- * The email address for the current user.
68
- *
69
- * @remarks
70
- * Example: `"example@contoso.com"`
71
- */
72
- userEmail: string;
73
- /**
74
- * SharePoint ID of the user in the current site
75
- */
76
- spUserId: number;
77
- /**
78
- * Login name of current user in claim style: i:0#.f|myprovider|myuser
79
- */
80
- claimBasedLoginName: string;
81
- /**
82
- * Azure AD Security groups that user is member of
83
- */
84
- userSecurityGroups: string[];
85
- /**
86
- * SharePoint groups in this site collection that user is member of
87
- */
88
- userSharePointGroups: number[];
89
- /**
90
- * Provides the date that the user's account was created
91
- */
92
- userAccountCreated: Date;
93
- /**
94
- * Roles of the current user. This may very depending on the active board
95
- */
96
- userRoles: UserRole[];
97
- /**
98
- * Language code of currently used UI rendering language in SharePoint
99
- */
100
- language: string;
101
- /**
102
- * List of supported languages as configured in Widget Board configuration
103
- */
104
- contentLanguages: {
105
- /**
106
- * Numeric Locale ID, like 1033 for English - United States
107
- */
108
- LCID: number;
109
- /**
110
- * Language code, like 'en-US' for English - United States
111
- */
112
- BCP47LanguageTag: string;
113
- /**
114
- * 2 or 3 character uppercase language code, like 'EN' for English - United States
115
- */
116
- abbreviatedCode: string;
117
- /**
118
- * Friendly name of the language, translated in the currently used UI language
119
- */
120
- friendlyName: string;
121
- /**
122
- * Whether this is the default UI language of the Widget Board
123
- */
124
- isDefault?: boolean;
125
- /**
126
- * Whether this is the current UI language of the Widget Board
127
- */
128
- isCurrent?: boolean;
129
- }[];
130
- /**
131
- * Preferred border radius of UI elements as configured in Widget Board configuration
132
- */
133
- elementBorderRadius: number;
134
- /**
135
- * MS Graph Client Factory class as provided by the WebPartContext object.
136
- */
137
- msGraphClientFactory: any;
138
- /**
139
- * AAD Http Client Factory class as provided by the WebPartContext object.
140
- */
141
- aadHttpClientFactory: any;
142
- /**
143
- * AAD Token Provider Factory class as provided by the WebPartContext object.
144
- */
145
- aadTokenProviderFactory: any;
146
- /**
147
- * Currently in use theme (by SharePoint/Teams)
148
- */
149
- theme: any;
150
- /**
151
- * Returns whether or not the currently signed in user is part of an AAD security group.
152
- * Provide the guid of the group.
153
- */
154
- isCurrentUserMemberOfSecGroup?: (groupId: string) => Promise<boolean>;
155
- /**
156
- * Returns whether or not the currently signed in user is part of a SharePoint group in the current site.
157
- * Provide the id of the SP Group.
158
- */
159
- isCurrentUserMemberOfSPGroup?: (groupId: number) => Promise<boolean>;
160
- /**
161
- * Generates a hash of all combined SP Groups of the current user. This can be used as
162
- * cache invalidator to detect changes.
163
- * Store this hash as part of your local cache to detect when to refresh SP Group related data.
164
- */
165
- generateHashForAllCurrentUserSPGroups?: () => Promise<string>;
166
- /**
167
- * Generates a hash of all combined AAD Security Groups of the current user. This can be used as
168
- * cache invalidator to detect changes.
169
- * Store this hash as part of your local cache to detect when to refresh Sec Group related data.
170
- */
171
- generateHashForAllCurrentUserSecGroups?: () => Promise<string>;
172
- /**
173
- * Call this function from within one of the applicable render methods in case of an unresolvable error.
174
- * The widgetboard will render a 'disrupted' message and in case of an error in widget rendering it
175
- * offers the user the option to delete the widget from the board.
176
- */
177
- handleFatalError?: () => void;
178
- /**
179
- * Functionality offered by the widget board to load a script using SPComponentLoader.
180
- */
181
- loadScript?: <TModule>(url: string, options?: any) => Promise<TModule>;
182
- /**
183
- * Functionality offered by the widget board to open a File Picker panel to select files.
184
- * @param onFilePicked Function that's called when a file was picked. Returns the url of the picked file.
185
- * @param options Options to change the behavior of the file picker
186
- */
187
- openFilePicker?: (onFilePicked: (fileUrl: string, fileProps: FilePickerFileProps) => void, options?: FilePickerOptions) => void;
188
- /**
189
- * Functionality offered by the widget board to open a url in an iframe dialog.
190
- * @param url The url to open in a dialog.
191
- * @param options Options to configure the dialog (e.g. size, margin, callbacks, ...)
192
- */
193
- openIFrameDialog?: (url: string, options?: IFrameDialogOptions) => void;
194
- /**
195
- * Provides access to the Teams SDK and Teams context. Only provided when the web part is loaded in Teams.
196
- */
197
- teamsSdk?: {
198
- /**
199
- * Microsoft Teams SDK.
200
- */
201
- teamsJs: any;
202
- /**
203
- * {@inheritDoc @microsoft/teams-js#Context}
204
- */
205
- context: any;
206
- };
207
- }
208
- /**
209
- * Widget instance context providing metadata and functionality offered by the widget board. A widget instance
210
- * is a single and specific widget that a user has on his/her board. It has its own
211
- * unique ID and possibly configuration data if the widget is configurable by the user
212
- */
213
- export interface WidgetInstanceContext {
214
- /**
215
- * Unique id for a specific widget on a user's board
216
- */
217
- id: string;
218
- /**
219
- * Optional configuration data that contains user settings of a specific widget instance
220
- */
221
- data?: string;
222
- /**
223
- * The type of board this widget instance is added to.
224
- */
225
- boardType?: BoardType;
226
- /**
227
- * Call this function from within a widget instance to publish a notification to the
228
- * notitication box on top of the widget board. It should provide information for this specific
229
- * widget instance. Notitifcation content is limited to one single line and a widget instance
230
- * can only have one active notification at a time
231
- */
232
- publishNotification?: (content: string, expirationDateTime: Date) => void;
233
- /**
234
- * Call this function to open the widget configuration panel for a user. This is an additional
235
- * way to open the panel because a user can also open the configuration panel by using the contextual
236
- * menu of the widget.
237
- */
238
- openConfiguration?: () => void;
239
- /**
240
- * Call this function to open the widget delete confirmation dialog for a user. This offers widget developers
241
- * the ability to trigger the "widget deletion process". This allows different methods to delete the widget.
242
- */
243
- initiateWidgetDeletion?: () => void;
244
- /**
245
- * Functionality offered by the widget board to change the title of the widget.
246
- */
247
- setWidgetTitle?: (title: string) => void;
248
- /**
249
- * Functionality offered by the widget board to append the title of the widget with additional text.
250
- */
251
- setWidgetTitleSuffix?: (suffix: string) => void;
252
- /**
253
- * Functionality offered by the widget board to change the subtitle of the widget.
254
- */
255
- setWidgetSubtitle?: (subtitle: string) => void;
256
- /**
257
- * Show or hide the header of the widget, allowing widgets to take control of full widget real estate.
258
- */
259
- setWidgetHeaderVisibility?: (visible: boolean) => void;
260
- /**
261
- * Show or hide the settings button of the widget.
262
- */
263
- setUserConfigButtonVisibility?: (visible: boolean) => void;
264
- /**
265
- * Optional callback to handle the click event of the widget title.
266
- */
267
- onWidgetTitleClicked?: () => void;
268
- /**
269
- * Allows registration of multiple custom command bar items which can either result in an icon or
270
- * an icon button, depending on the presence of the onClick property. To remove the items,
271
- * use the [unregisterCommandBarItems] function.
272
- */
273
- registerCustomCommandBarItems?: (props: CustomCommandBarItemProps[]) => void;
274
- /**
275
- * Allows registration of a custom command bar item which can either result in an icon or
276
- * an icon button, depending on the presence of the onClick property. To remove the item,
277
- * use the [unregisterCommandBarItem] function.
278
- */
279
- registerCustomCommandBarItem?: (props: CustomCommandBarItemProps) => void;
280
- /**
281
- * Removes all registered custom command bar items.
282
- */
283
- unregisterCustomCommandBarItems?: () => void;
284
- /**
285
- * Removes a single custom command bar item, corresponding to the provided id.
286
- * If no id was specified, it removes all items.
287
- */
288
- unregisterCustomCommandBarItem?: (id?: string) => void;
289
- /**
290
- * Raises an event to be handled by the Time-based Events feature of Ichicraft Boards.
291
- * @param object The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
292
- * @param action The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase.
293
- * @param data Optionally provide extra metadata to be included with the raised event.
294
- * widgetAlias property (from manifest) and variantTitle property will automatically be added by the widget board.
295
- */
296
- raiseEvent?: (object: string, action: string, data?: {
297
- [key: string]: string;
298
- }) => void;
299
- }
300
- /**
301
- * Widget variant context providing metadata and functionality offered by the widget board. A widget variant is
302
- * a widget that's been installed by an administrator from within the board administration.
303
- */
304
- export interface WidgetVariantContext {
305
- /**
306
- * Unique id of an installed and configured widget in the widget board.
307
- * If this is a 'single instance widget', which means that no more than one instance of this
308
- * widget can be installed in the widget board, the id of the definition is the same as the id of the manifest.
309
- */
310
- id: string;
311
- /**
312
- * Optional configuration data that contains board-wide settings of a specific widget instance
313
- */
314
- data?: string;
315
- /**
316
- * A list of board types applicable for this widget variant.
317
- */
318
- allowedBoardTypes?: BoardType[];
319
- /**
320
- * The icon defined for this widget variant.
321
- */
322
- iconName?: string;
323
- }
324
- /**
325
- * Widget manifest context providing metadata and functions offered by the widget board. A widget manifest contains
326
- * all information of the originally installed widget. Multiple `variants` of the same widget `manifest`
327
- * can exist in a widget board configuration.
328
- */
329
- export interface WidgetManifestContext {
330
- /**
331
- * Unique id of a widget 'type', also used in the widget manifest config file in the original script source manifest file.
332
- * If this is a 'single instance widget', which means that no more than one instance of this
333
- * widget can be installed in the widget board, the id of the definition is the same as the id of the manifest.
334
- */
335
- id: string;
336
- }
337
- export interface ValidationResult {
338
- isValid: boolean;
339
- errors: string[];
340
- }
341
- export interface WidgetImages {
342
- preview: string;
343
- additional: string[];
344
- }
345
- export interface WidgetResource {
346
- lang: number;
347
- title: string;
348
- subtitle?: string;
349
- shortDescription: string;
350
- instructions: string;
351
- images: WidgetImages;
352
- }
353
- export interface WebApiPermissionRequest {
354
- /**
355
- * Specifies the name of the resource service principle to wich access has been granted. Use the same principle names as in a SPPKG packages webApiPermissionRequests.
356
- */
357
- resource: string;
358
- /**
359
- * Specifies the name of the scope claim that the resource application should expect in the OAuth 2.0 access token. Use the same scope names as in a SPPKG packages webApiPermissionRequests.
360
- */
361
- scope: string;
362
- }
363
- /**
364
- * The widget manifest contains meta information about the widget
365
- */
366
- export interface WidgetManifestConfig {
367
- /**
368
- * Version of the widget manifest schema. The value of this field
369
- * is controlled by Ichicraft. The purpose of this field is to help
370
- * manage upgrades of the widget manifest schema.
371
- * The current version is version 2, introducing externals + manifestVersion
372
- * properties
373
- */
374
- manifestVersion: number;
375
- /**
376
- * Unique id to identify the widget
377
- */
378
- id: string;
379
- /**
380
- * Internal name for the widget, used internally by Ichicraft
381
- */
382
- name: string;
383
- /**
384
- * Version should contain the semver of this widget. For future use.
385
- */
386
- version: string;
387
- /**
388
- * The minimum number of rows this widget can inhabit in the widget board.
389
- * By default, a widget always takes up 2 rows (and 1 column),
390
- * If you want the widget to be able to shrink to 1 row, specify 1, otherwise, leave this
391
- * property empty.
392
- * _REMARK_: A value higher than 2 is considered invalid and will be ignored.
393
- */
394
- minRows: number;
395
- /**
396
- * The maximum number of rows this widget can inhabit in the widget board.
397
- * By default, a widget always takes up 2 rows (and 1 column).
398
- * Leave this empty and the maxRows will be defaulted to 2.
399
- * Specify Inifinity to allow spanning any number of rows.
400
- * _REMARK_: A value lower than 2 is considered invalid and will be ignored.
401
- */
402
- maxRows: number;
403
- /**
404
- * The maximum number of columns this widget can inhabit in the widget board.
405
- * By default, a widget always takes up 1 column (and 2 rows).
406
- * Leave this empty and the maxCols will be defaulted to 1.
407
- * Specify Inifinity to allow spanning any number of columns.
408
- * _REMARK_ A value lower than 1 is considered invalid and will be ignored.
409
- */
410
- maxCols: number;
411
- /**
412
- * Whether this widget is configurable by the user. Implementation of user config functions is necessary if true.
413
- */
414
- isConfigurableByUser: boolean;
415
- /**
416
- * Whether this widget is configurable by the board admin. Implementation of admin config functions is necessary if true.
417
- */
418
- isConfigurableByAdmin: boolean;
419
- /**
420
- * Internally used by Ichicraft
421
- */
422
- widgetBoardCompatibilityVersion?: number;
423
- /**
424
- * Icon used to represent this widget, used as default when installing a widget in the board. Icon should be the type id of a UI Fabric icon.
425
- */
426
- iconName: string;
427
- /**
428
- * Image used to represent this widget, used as default when installing a widget in the board.
429
- */
430
- thumbnailUrl: string;
431
- /**
432
- * Language specific resources for this widget, used as default when installing a widget in the board
433
- */
434
- resources: WidgetResource[];
435
- /**
436
- * Web API permission requests. Like SPPKG packages, the widget specifies required API permissions.
437
- */
438
- webApiPermissionRequests?: WebApiPermissionRequest[];
439
- /**
440
- * This is the url of the widget script. It should be a well formatted url that points
441
- * to the script file's unique location. Script files should be hosted on a secure website (https).
442
- */
443
- scriptUrl: string;
444
- /**
445
- * File path used when debugging a widget, this is set automatically when you debug a widget
446
- */
447
- bundleFilePath?: string;
448
- /**
449
- * Added in manifestVersion 2
450
- * Lists modules (package dependencies) that should be loaded separately from bundle.
451
- * Libraries mentioned here will not be bundled when packed as a production release,
452
- * instead, they will be loaded from the provided path (path points to a CDN or other file location)
453
- */
454
- externals?: {
455
- [name: string]: {
456
- /**
457
- * Path to the script file. If this is a module (e.g. AMD or UMD), make sure you also
458
- * specify the modules this module depends on as separate modules using the correct aliases.
459
- */
460
- path: string;
461
- /**
462
- * Used for non-AMD scripts to specify dependencies. Should point to other non-AMD modules
463
- */
464
- globalDependencies?: string[];
465
- /**
466
- * In case this isn't an AMD module, define the variable name used by the script to
467
- * make the module available (i.e. global/root/window variable name like jQuery or $)
468
- */
469
- globalName?: string;
470
- /**
471
- * If this module has dependencies, map them here to other externals you also specified
472
- * For instance: external @fluentui/react umd module has dependencies React and ReactDOM.
473
- * To point these to the right externals, map them like this:
474
- * React: react
475
- * ReactDOM: 'react-dom'
476
- * And make sure you specified 'react' and 'react-dom' as externals as well.
477
- */
478
- dependencyMappings?: {
479
- [name: string]: string;
480
- };
481
- };
482
- };
483
- /**
484
- * Everything related to analytics of this widget in Ichicraft Boards
485
- */
486
- analytics?: {
487
- /**
488
- * A list of time-based events this widget can raise. All the possible events MUST be
489
- * described in this list for the widget board to be able to pick them up.
490
- * @ref Use WidgetContext.instance.raiseEvent(object: string, action: string, data?: { [key: string]: string }) to raise these events
491
- */
492
- timeBasedEvents: {
493
- /**
494
- * The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
495
- */
496
- object: string;
497
- /**
498
- * The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase.
499
- */
500
- action: string;
501
- /**
502
- * A descriptive text used in the Administration panel to describe this event
503
- */
504
- description: string;
505
- }[];
506
- };
507
- }
508
- export declare enum DebugComponentType {
509
- /**
510
- * This is the default component type and just opens the default widget board.
511
- */
512
- Default = "Default",
513
- /**
514
- * This automatically opens the widget board administration panel and opens the widget admin config
515
- * dialog of the widget you're working on
516
- */
517
- AdminConfig = "AdminConfig"
518
- }
519
- /**
520
- * The widget debug serve config contains settings for debugging a widget in development
521
- */
522
- export interface WidgetDebugServeConfig {
523
- /**
524
- * Provide a url of a SharePoint site that hosts a widget board. This page will be opened
525
- * as soon as you start debugging using [npm run start]
526
- */
527
- widgetsDebugPageUrl: string;
528
- /**
529
- * Provide a component type to open the debugging widget board with that specific component.
530
- * This speeds up your development cycle: [npm run start] > save changes > builds automatically >
531
- * refresh browser > automatically open updated component.
532
- */
533
- debugComponentType?: DebugComponentType;
534
- }
535
- export declare enum ICPersonaType {
536
- User = 0,
537
- SPGroup = 1,
538
- Other = 2,
539
- Custom = 3
540
- }
541
- export interface ICPersona {
542
- displayName: string;
543
- id: string;
544
- type?: ICPersonaType;
545
- }
546
- /**
547
- * Tells the severity of the command bar item, resulting in
548
- * distinguishable presentation of the item
549
- */
550
- export declare enum CustomCommandBarItemSeverity {
551
- /** Normal severity, displays just like all the other command bar items */
552
- Normal = 0,
553
- /** Warning severity, displays the item with a more noticable warning color */
554
- Warning = 1
555
- }
556
- /**
557
- * Tells how to render the command bar item, e.g. as an icon button or as a link.
558
- */
559
- export declare enum CommandBarItemType {
560
- /** Normal severity, displays just like all the other command bar items */
561
- Icon = "icon",
562
- /** Warning severity, displays the item with a more noticable warning color */
563
- Link = "link"
564
- }
565
- /**
566
- * Properties to pass to the registerCommandBarItems function, resulting in the
567
- * rendering of a command bar item.
568
- */
569
- export declare type CustomCommandBarItemProps = CommandBarIcon | CommandBarLink;
570
- /**
571
- * Base properties of a custom CommandBarItem.
572
- */
573
- export interface CommandBarItemBase {
574
- /**
575
- * Optional identifier for the icon.
576
- */
577
- id?: string;
578
- /**
579
- * Type of item, (e.g. 'icon' or 'link')
580
- */
581
- itemType: CommandBarItemType;
582
- /**
583
- * Optional content to show as a tooltip above the item.
584
- */
585
- tooltipContent?: string;
586
- /**
587
- * Optionally tells the tooltip to be shown automatically.
588
- */
589
- showTooltipAutomatically?: boolean;
590
- /**
591
- * Optionally tells the Widget Header that this item should always be visible, even when not hovering.
592
- */
593
- pinned?: boolean;
594
- }
595
- /**
596
- * Properties to render a custom CommandBarItem either as a single Icon or an Icon Button.
597
- */
598
- export interface CommandBarIcon extends CommandBarItemBase {
599
- itemType: CommandBarItemType.Icon;
600
- /**
601
- * Name of the icon, as specified and available in Fluent UI Iconography:
602
- * https://developer.microsoft.com/en-us/fluentui#/styles/web/icons
603
- */
604
- iconName: string;
605
- /**
606
- * Optionally display a red notification icon badge in the top-right corner of the button.
607
- */
608
- showNotificationBadge?: boolean;
609
- /**
610
- * Optional severity to specify how the item should render
611
- */
612
- severity?: CustomCommandBarItemSeverity;
613
- /**
614
- * Optionally provide an order in which this button should appear, when registering multiple custom buttons.
615
- */
616
- order?: number;
617
- /**
618
- * Optional onClick event, which is triggered on user click and makes the command
619
- * bar item render as a button instead of a non-clickable icon.
620
- */
621
- onClick?: () => void;
622
- }
623
- /**
624
- * Properties to render a custom CommandBarItem as a Link Button.
625
- */
626
- export interface CommandBarLink extends CommandBarItemBase {
627
- itemType: CommandBarItemType.Link;
628
- /**
629
- * Required label to display the clickable link.
630
- */
631
- label: string;
632
- /**
633
- * Required onClick event, which is triggered on user click.
634
- */
635
- onClick: () => void;
636
- }
637
- /**
638
- * Options to pass to the openIFrameDialog function. Use this to configure how the dialog is rendered, and to handle events (e.g. onDismissed)
639
- */
640
- export interface IFrameDialogOptions {
641
- /**
642
- * Maximum width of the dialog. If it exceeds the window width, that width is used instead.
643
- */
644
- maxWidth?: number;
645
- /**
646
- * Maximum height of the dialog. If it exceeds the window height, that height is used instead.
647
- */
648
- maxHeight?: number;
649
- /**
650
- * Minimum margin on the left- and right side of the dialog.
651
- */
652
- marginHorizontal?: number;
653
- /**
654
- * Minimum margin on the top- and bottom side of the dialog.
655
- */
656
- marginVertical?: number;
657
- /**
658
- * This event is triggered when the iFrame dialog is dismissed by the user.
659
- */
660
- onDismissed?: () => void;
661
- }
662
- /**
663
- * Options to pass to openFilePicker function
664
- */
665
- export interface FilePickerOptions {
666
- /**
667
- * Array of file extensions that will be used to filter the files in the picker.
668
- * @default ['.gif', '.jpg', '.jpeg', '.png']
669
- */
670
- extensions?: string[];
671
- /**
672
- * Maximum number of files to show in a folder
673
- * @default 100
674
- */
675
- itemsCountQueryLimit?: number;
676
- /**
677
- * Whether or not to hide the organisational site files tab
678
- * @default false
679
- */
680
- hideOrganisationalAssetTab?: boolean;
681
- /**
682
- * Whether or not to hide the site files tab
683
- * @default false
684
- */
685
- hideSiteFilesTab?: boolean;
686
- /**
687
- * Whether or not to hide the upload tab
688
- * @default false
689
- */
690
- hideLocalUploadTab?: boolean;
691
- /**
692
- * Function that's called when user closes file picker without picking a file
693
- * @default undefined
694
- */
695
- onCancel?: () => void;
696
- }
697
- export interface FilePickerFileProps {
698
- /**
699
- * Unique identifier of the file item in SharePoint, in the shape of a Guid.
700
- */
701
- uniqueId: string;
702
- /**
703
- * Unique identifier of the list in SharePoint, in the shape of a Guid.
704
- */
705
- listId: string;
706
- /**
707
- * Unique identifier of the site in SharePoint, in the shape of a Guid.
708
- */
709
- siteId: string;
710
- }
711
- export declare type BoardType = 'shared' | 'personal';
712
- export declare type UserRole = 'administrator' | 'board-owner';
713
- export interface ExportData {
714
- data: object[];
715
- }
1
+ import { AadTokenProviderFactory } from '../.';
2
+ /**
3
+ * Widget context providing widget metadata and functionality offered by the widget board
4
+ */
5
+ export interface WidgetContext {
6
+ /**
7
+ * Metadata and functions in the context of a widget instance. A widget instance
8
+ * is a single and specific widget that a user has on his/her board. It has its own
9
+ * unique ID and possibly configuration data if the widget is configurable by the user
10
+ */
11
+ instance: WidgetInstanceContext;
12
+ /**
13
+ * Metadata and functions in the context of a widget's variant (fka definition). A widget variant is
14
+ * a widget that's been installed by an administrator from within the board administration.
15
+ */
16
+ definition: WidgetVariantContext;
17
+ /**
18
+ * Metadata and functions in the context of a widget's manifest. A widget manifest contains
19
+ * all information of the originally installed widget. Multiple `variants` of the same widget `manifest`
20
+ * can exist in a widget board configuration.
21
+ */
22
+ manifest: WidgetManifestContext;
23
+ /**
24
+ * Tells whether the widget board is running in a Teams context
25
+ */
26
+ inTeamsContext: boolean;
27
+ /**
28
+ * Tells whether the widget board is running in a Teams browser hosted context
29
+ */
30
+ isTeamsBrowserHosted: boolean;
31
+ /**
32
+ * Tells whether the widget board is running in a Teams webview hosted context
33
+ */
34
+ isTeamsWebViewHosted: boolean;
35
+ /**
36
+ * Tells whether the widget board is running in a SharePoint iOS app context
37
+ */
38
+ isSharePointiOSApp: boolean;
39
+ /**
40
+ * Tells whether the widget board is running in a webview hosted context
41
+ */
42
+ isWebViewHosted: boolean;
43
+ /**
44
+ * Tells whether the widget board is running in an embedded context
45
+ */
46
+ isEmbedded: boolean;
47
+ /**
48
+ * Tells whether the widget board is running in a mobile browser context
49
+ */
50
+ isMobileBrowser: boolean;
51
+ /**
52
+ * Tells whether the widget board is running in a mobile webview context
53
+ */
54
+ isMobileWebView: boolean;
55
+ /**
56
+ * Tenant ID of current SharePoint tenant
57
+ */
58
+ tenantId: string;
59
+ /**
60
+ * Site url of the site where the widget board is running
61
+ */
62
+ siteUrl: string;
63
+ /**
64
+ * User name of the currently signed in user.
65
+ */
66
+ userName: string;
67
+ /**
68
+ * The email address for the current user.
69
+ *
70
+ * @remarks
71
+ * Example: `"example@contoso.com"`
72
+ */
73
+ userEmail: string;
74
+ /**
75
+ * SharePoint ID of the user in the current site
76
+ */
77
+ spUserId: number;
78
+ /**
79
+ * Login name of current user in claim style: i:0#.f|myprovider|myuser
80
+ */
81
+ claimBasedLoginName: string;
82
+ /**
83
+ * Azure AD Security groups that user is member of
84
+ */
85
+ userSecurityGroups: string[];
86
+ /**
87
+ * SharePoint groups in this site collection that user is member of
88
+ */
89
+ userSharePointGroups: number[];
90
+ /**
91
+ * Provides the date that the user's account was created
92
+ */
93
+ userAccountCreated: Date;
94
+ /**
95
+ * Roles of the current user. This may very depending on the active board
96
+ */
97
+ userRoles: UserRole[];
98
+ /**
99
+ * Language code of currently used UI rendering language in SharePoint
100
+ */
101
+ language: string;
102
+ /**
103
+ * List of supported languages as configured in Widget Board configuration
104
+ */
105
+ contentLanguages: {
106
+ /**
107
+ * Numeric Locale ID, like 1033 for English - United States
108
+ */
109
+ LCID: number;
110
+ /**
111
+ * Language code, like 'en-US' for English - United States
112
+ */
113
+ BCP47LanguageTag: string;
114
+ /**
115
+ * 2 or 3 character uppercase language code, like 'EN' for English - United States
116
+ */
117
+ abbreviatedCode: string;
118
+ /**
119
+ * Friendly name of the language, translated in the currently used UI language
120
+ */
121
+ friendlyName: string;
122
+ /**
123
+ * Whether this is the default UI language of the Widget Board
124
+ */
125
+ isDefault?: boolean;
126
+ /**
127
+ * Whether this is the current UI language of the Widget Board
128
+ */
129
+ isCurrent?: boolean;
130
+ }[];
131
+ /**
132
+ * Preferred border radius of UI elements as configured in Widget Board configuration
133
+ */
134
+ elementBorderRadius: number;
135
+ /**
136
+ * MS Graph Client Factory class as provided by the WebPartContext object.
137
+ */
138
+ msGraphClientFactory: any;
139
+ /**
140
+ * AAD Http Client Factory class as provided by the WebPartContext object.
141
+ */
142
+ aadHttpClientFactory: any;
143
+ /**
144
+ * AAD Token Provider Factory class as provided by the WebPartContext object.
145
+ */
146
+ aadTokenProviderFactory: AadTokenProviderFactory;
147
+ /**
148
+ * Currently in use theme (by SharePoint/Teams)
149
+ */
150
+ theme: any;
151
+ /**
152
+ * Returns whether or not the currently signed in user is part of an AAD security group.
153
+ * Provide the guid of the group.
154
+ */
155
+ isCurrentUserMemberOfSecGroup?: (groupId: string) => Promise<boolean>;
156
+ /**
157
+ * Returns whether or not the currently signed in user is part of a SharePoint group in the current site.
158
+ * Provide the id of the SP Group.
159
+ */
160
+ isCurrentUserMemberOfSPGroup?: (groupId: number) => Promise<boolean>;
161
+ /**
162
+ * Generates a hash of all combined SP Groups of the current user. This can be used as
163
+ * cache invalidator to detect changes.
164
+ * Store this hash as part of your local cache to detect when to refresh SP Group related data.
165
+ */
166
+ generateHashForAllCurrentUserSPGroups?: () => Promise<string>;
167
+ /**
168
+ * Generates a hash of all combined AAD Security Groups of the current user. This can be used as
169
+ * cache invalidator to detect changes.
170
+ * Store this hash as part of your local cache to detect when to refresh Sec Group related data.
171
+ */
172
+ generateHashForAllCurrentUserSecGroups?: () => Promise<string>;
173
+ /**
174
+ * Call this function from within one of the applicable render methods in case of an unresolvable error.
175
+ * The widgetboard will render a 'disrupted' message and in case of an error in widget rendering it
176
+ * offers the user the option to delete the widget from the board.
177
+ */
178
+ handleFatalError?: () => void;
179
+ /**
180
+ * Functionality offered by the widget board to load a script using SPComponentLoader.
181
+ */
182
+ loadScript?: <TModule>(url: string, options?: any) => Promise<TModule>;
183
+ /**
184
+ * Functionality offered by the widget board to open a File Picker panel to select files.
185
+ * @param onFilePicked Function that's called when a file was picked. Returns the url of the picked file.
186
+ * @param options Options to change the behavior of the file picker
187
+ */
188
+ openFilePicker?: (onFilePicked: (fileUrl: string, fileProps: FilePickerFileProps) => void, options?: FilePickerOptions) => void;
189
+ /**
190
+ * Functionality offered by the widget board to open a url in an iframe dialog.
191
+ * @param url The url to open in a dialog.
192
+ * @param options Options to configure the dialog (e.g. size, margin, callbacks, ...)
193
+ */
194
+ openIFrameDialog?: (url: string, options?: IFrameDialogOptions) => void;
195
+ /**
196
+ * Provides access to the Teams SDK and Teams context. Only provided when the web part is loaded in Teams.
197
+ */
198
+ teamsSdk?: {
199
+ /**
200
+ * Microsoft Teams SDK.
201
+ */
202
+ teamsJs: any;
203
+ /**
204
+ * {@inheritDoc @microsoft/teams-js#Context}
205
+ */
206
+ context: any;
207
+ };
208
+ }
209
+ /**
210
+ * Widget instance context providing metadata and functionality offered by the widget board. A widget instance
211
+ * is a single and specific widget that a user has on his/her board. It has its own
212
+ * unique ID and possibly configuration data if the widget is configurable by the user
213
+ */
214
+ export interface WidgetInstanceContext {
215
+ /**
216
+ * Unique id for a specific widget on a user's board
217
+ */
218
+ id: string;
219
+ /**
220
+ * Optional configuration data that contains user settings of a specific widget instance
221
+ */
222
+ data?: string;
223
+ /**
224
+ * The type of board this widget instance is added to.
225
+ */
226
+ boardType?: BoardType;
227
+ /**
228
+ * Call this function from within a widget instance to publish a notification to the
229
+ * notitication box on top of the widget board. It should provide information for this specific
230
+ * widget instance. Notitifcation content is limited to one single line and a widget instance
231
+ * can only have one active notification at a time
232
+ */
233
+ publishNotification?: (content: string, expirationDateTime: Date) => void;
234
+ /**
235
+ * Call this function to open the widget configuration panel for a user. This is an additional
236
+ * way to open the panel because a user can also open the configuration panel by using the contextual
237
+ * menu of the widget.
238
+ */
239
+ openConfiguration?: () => void;
240
+ /**
241
+ * Call this function to open the widget delete confirmation dialog for a user. This offers widget developers
242
+ * the ability to trigger the "widget deletion process". This allows different methods to delete the widget.
243
+ */
244
+ initiateWidgetDeletion?: () => void;
245
+ /**
246
+ * Functionality offered by the widget board to change the title of the widget.
247
+ */
248
+ setWidgetTitle?: (title: string) => void;
249
+ /**
250
+ * Functionality offered by the widget board to append the title of the widget with additional text.
251
+ */
252
+ setWidgetTitleSuffix?: (suffix: string) => void;
253
+ /**
254
+ * Functionality offered by the widget board to change the subtitle of the widget.
255
+ */
256
+ setWidgetSubtitle?: (subtitle: string) => void;
257
+ /**
258
+ * Show or hide the header of the widget, allowing widgets to take control of full widget real estate.
259
+ */
260
+ setWidgetHeaderVisibility?: (visible: boolean) => void;
261
+ /**
262
+ * Show or hide the settings button of the widget.
263
+ */
264
+ setUserConfigButtonVisibility?: (visible: boolean) => void;
265
+ /**
266
+ * Optional callback to handle the click event of the widget title.
267
+ */
268
+ onWidgetTitleClicked?: () => void;
269
+ /**
270
+ * Allows registration of multiple custom command bar items which can either result in an icon or
271
+ * an icon button, depending on the presence of the onClick property. To remove the items,
272
+ * use the [unregisterCommandBarItems] function.
273
+ */
274
+ registerCustomCommandBarItems?: (props: CustomCommandBarItemProps[]) => void;
275
+ /**
276
+ * Allows registration of a custom command bar item which can either result in an icon or
277
+ * an icon button, depending on the presence of the onClick property. To remove the item,
278
+ * use the [unregisterCommandBarItem] function.
279
+ */
280
+ registerCustomCommandBarItem?: (props: CustomCommandBarItemProps) => void;
281
+ /**
282
+ * Removes all registered custom command bar items.
283
+ */
284
+ unregisterCustomCommandBarItems?: () => void;
285
+ /**
286
+ * Removes a single custom command bar item, corresponding to the provided id.
287
+ * If no id was specified, it removes all items.
288
+ */
289
+ unregisterCustomCommandBarItem?: (id?: string) => void;
290
+ /**
291
+ * Raises an event to be handled by the Time-based Events feature of Ichicraft Boards.
292
+ * @param object The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
293
+ * @param action The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase.
294
+ * @param data Optionally provide extra metadata to be included with the raised event.
295
+ * widgetAlias property (from manifest) and variantTitle property will automatically be added by the widget board.
296
+ */
297
+ raiseEvent?: (object: string, action: string, data?: {
298
+ [key: string]: string;
299
+ }) => void;
300
+ }
301
+ /**
302
+ * Widget variant context providing metadata and functionality offered by the widget board. A widget variant is
303
+ * a widget that's been installed by an administrator from within the board administration.
304
+ */
305
+ export interface WidgetVariantContext {
306
+ /**
307
+ * Unique id of an installed and configured widget in the widget board.
308
+ * If this is a 'single instance widget', which means that no more than one instance of this
309
+ * widget can be installed in the widget board, the id of the definition is the same as the id of the manifest.
310
+ */
311
+ id: string;
312
+ /**
313
+ * Optional configuration data that contains board-wide settings of a specific widget instance
314
+ */
315
+ data?: string;
316
+ /**
317
+ * A list of board types applicable for this widget variant.
318
+ */
319
+ allowedBoardTypes?: BoardType[];
320
+ /**
321
+ * The icon defined for this widget variant.
322
+ */
323
+ iconName?: string;
324
+ }
325
+ /**
326
+ * Widget manifest context providing metadata and functions offered by the widget board. A widget manifest contains
327
+ * all information of the originally installed widget. Multiple `variants` of the same widget `manifest`
328
+ * can exist in a widget board configuration.
329
+ */
330
+ export interface WidgetManifestContext {
331
+ /**
332
+ * Unique id of a widget 'type', also used in the widget manifest config file in the original script source manifest file.
333
+ * If this is a 'single instance widget', which means that no more than one instance of this
334
+ * widget can be installed in the widget board, the id of the definition is the same as the id of the manifest.
335
+ */
336
+ id: string;
337
+ }
338
+ export interface ValidationResult {
339
+ isValid: boolean;
340
+ errors: string[];
341
+ }
342
+ export interface WidgetImages {
343
+ preview: string;
344
+ additional: string[];
345
+ }
346
+ export interface WidgetResource {
347
+ lang: number;
348
+ title: string;
349
+ subtitle?: string;
350
+ shortDescription: string;
351
+ instructions: string;
352
+ images: WidgetImages;
353
+ }
354
+ export interface WebApiPermissionRequest {
355
+ /**
356
+ * Specifies the name of the resource service principle to wich access has been granted. Use the same principle names as in a SPPKG packages webApiPermissionRequests.
357
+ */
358
+ resource: string;
359
+ /**
360
+ * Specifies the name of the scope claim that the resource application should expect in the OAuth 2.0 access token. Use the same scope names as in a SPPKG packages webApiPermissionRequests.
361
+ */
362
+ scope: string;
363
+ }
364
+ /**
365
+ * The widget manifest contains meta information about the widget
366
+ */
367
+ export interface WidgetManifestConfig {
368
+ /**
369
+ * Version of the widget manifest schema. The value of this field
370
+ * is controlled by Ichicraft. The purpose of this field is to help
371
+ * manage upgrades of the widget manifest schema.
372
+ * The current version is version 2, introducing externals + manifestVersion
373
+ * properties
374
+ */
375
+ manifestVersion: number;
376
+ /**
377
+ * Unique id to identify the widget
378
+ */
379
+ id: string;
380
+ /**
381
+ * Internal name for the widget, used internally by Ichicraft
382
+ */
383
+ name: string;
384
+ /**
385
+ * Version should contain the semver of this widget. For future use.
386
+ */
387
+ version: string;
388
+ /**
389
+ * The minimum number of rows this widget can inhabit in the widget board.
390
+ * By default, a widget always takes up 2 rows (and 1 column),
391
+ * If you want the widget to be able to shrink to 1 row, specify 1, otherwise, leave this
392
+ * property empty.
393
+ * _REMARK_: A value higher than 2 is considered invalid and will be ignored.
394
+ */
395
+ minRows: number;
396
+ /**
397
+ * The maximum number of rows this widget can inhabit in the widget board.
398
+ * By default, a widget always takes up 2 rows (and 1 column).
399
+ * Leave this empty and the maxRows will be defaulted to 2.
400
+ * Specify Inifinity to allow spanning any number of rows.
401
+ * _REMARK_: A value lower than 2 is considered invalid and will be ignored.
402
+ */
403
+ maxRows: number;
404
+ /**
405
+ * The maximum number of columns this widget can inhabit in the widget board.
406
+ * By default, a widget always takes up 1 column (and 2 rows).
407
+ * Leave this empty and the maxCols will be defaulted to 1.
408
+ * Specify Inifinity to allow spanning any number of columns.
409
+ * _REMARK_ A value lower than 1 is considered invalid and will be ignored.
410
+ */
411
+ maxCols: number;
412
+ /**
413
+ * Whether this widget is configurable by the user. Implementation of user config functions is necessary if true.
414
+ */
415
+ isConfigurableByUser: boolean;
416
+ /**
417
+ * Whether this widget is configurable by the board admin. Implementation of admin config functions is necessary if true.
418
+ */
419
+ isConfigurableByAdmin: boolean;
420
+ /**
421
+ * Internally used by Ichicraft
422
+ */
423
+ widgetBoardCompatibilityVersion?: number;
424
+ /**
425
+ * Icon used to represent this widget, used as default when installing a widget in the board. Icon should be the type id of a UI Fabric icon.
426
+ */
427
+ iconName: string;
428
+ /**
429
+ * Image used to represent this widget, used as default when installing a widget in the board.
430
+ */
431
+ thumbnailUrl: string;
432
+ /**
433
+ * Language specific resources for this widget, used as default when installing a widget in the board
434
+ */
435
+ resources: WidgetResource[];
436
+ /**
437
+ * Web API permission requests. Like SPPKG packages, the widget specifies required API permissions.
438
+ */
439
+ webApiPermissionRequests?: WebApiPermissionRequest[];
440
+ /**
441
+ * This is the url of the widget script. It should be a well formatted url that points
442
+ * to the script file's unique location. Script files should be hosted on a secure website (https).
443
+ */
444
+ scriptUrl: string;
445
+ /**
446
+ * File path used when debugging a widget, this is set automatically when you debug a widget
447
+ */
448
+ bundleFilePath?: string;
449
+ /**
450
+ * Added in manifestVersion 2
451
+ * Lists modules (package dependencies) that should be loaded separately from bundle.
452
+ * Libraries mentioned here will not be bundled when packed as a production release,
453
+ * instead, they will be loaded from the provided path (path points to a CDN or other file location)
454
+ */
455
+ externals?: {
456
+ [name: string]: {
457
+ /**
458
+ * Path to the script file. If this is a module (e.g. AMD or UMD), make sure you also
459
+ * specify the modules this module depends on as separate modules using the correct aliases.
460
+ */
461
+ path: string;
462
+ /**
463
+ * Used for non-AMD scripts to specify dependencies. Should point to other non-AMD modules
464
+ */
465
+ globalDependencies?: string[];
466
+ /**
467
+ * In case this isn't an AMD module, define the variable name used by the script to
468
+ * make the module available (i.e. global/root/window variable name like jQuery or $)
469
+ */
470
+ globalName?: string;
471
+ /**
472
+ * If this module has dependencies, map them here to other externals you also specified
473
+ * For instance: external @fluentui/react umd module has dependencies React and ReactDOM.
474
+ * To point these to the right externals, map them like this:
475
+ * React: react
476
+ * ReactDOM: 'react-dom'
477
+ * And make sure you specified 'react' and 'react-dom' as externals as well.
478
+ */
479
+ dependencyMappings?: {
480
+ [name: string]: string;
481
+ };
482
+ };
483
+ };
484
+ /**
485
+ * Everything related to analytics of this widget in Ichicraft Boards
486
+ */
487
+ analytics?: {
488
+ /**
489
+ * A list of time-based events this widget can raise. All the possible events MUST be
490
+ * described in this list for the widget board to be able to pick them up.
491
+ * @ref Use WidgetContext.instance.raiseEvent(object: string, action: string, data?: { [key: string]: string }) to raise these events
492
+ */
493
+ timeBasedEvents: {
494
+ /**
495
+ * The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase.
496
+ */
497
+ object: string;
498
+ /**
499
+ * The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase.
500
+ */
501
+ action: string;
502
+ /**
503
+ * A descriptive text used in the Administration panel to describe this event
504
+ */
505
+ description: string;
506
+ }[];
507
+ };
508
+ }
509
+ export declare enum DebugComponentType {
510
+ /**
511
+ * This is the default component type and just opens the default widget board.
512
+ */
513
+ Default = "Default",
514
+ /**
515
+ * This automatically opens the widget board administration panel and opens the widget admin config
516
+ * dialog of the widget you're working on
517
+ */
518
+ AdminConfig = "AdminConfig"
519
+ }
520
+ /**
521
+ * The widget debug serve config contains settings for debugging a widget in development
522
+ */
523
+ export interface WidgetDebugServeConfig {
524
+ /**
525
+ * Provide a url of a SharePoint site that hosts a widget board. This page will be opened
526
+ * as soon as you start debugging using [npm run start]
527
+ */
528
+ widgetsDebugPageUrl: string;
529
+ /**
530
+ * Provide a component type to open the debugging widget board with that specific component.
531
+ * This speeds up your development cycle: [npm run start] > save changes > builds automatically >
532
+ * refresh browser > automatically open updated component.
533
+ */
534
+ debugComponentType?: DebugComponentType;
535
+ }
536
+ export declare enum ICPersonaType {
537
+ User = 0,
538
+ SPGroup = 1,
539
+ Other = 2,
540
+ Custom = 3
541
+ }
542
+ export interface ICPersona {
543
+ displayName: string;
544
+ id: string;
545
+ type?: ICPersonaType;
546
+ }
547
+ /**
548
+ * Tells the severity of the command bar item, resulting in
549
+ * distinguishable presentation of the item
550
+ */
551
+ export declare enum CustomCommandBarItemSeverity {
552
+ /** Normal severity, displays just like all the other command bar items */
553
+ Normal = 0,
554
+ /** Warning severity, displays the item with a more noticable warning color */
555
+ Warning = 1
556
+ }
557
+ /**
558
+ * Tells how to render the command bar item, e.g. as an icon button or as a link.
559
+ */
560
+ export declare enum CommandBarItemType {
561
+ /** Normal severity, displays just like all the other command bar items */
562
+ Icon = "icon",
563
+ /** Warning severity, displays the item with a more noticable warning color */
564
+ Link = "link"
565
+ }
566
+ /**
567
+ * Properties to pass to the registerCommandBarItems function, resulting in the
568
+ * rendering of a command bar item.
569
+ */
570
+ export type CustomCommandBarItemProps = CommandBarIcon | CommandBarLink;
571
+ /**
572
+ * Base properties of a custom CommandBarItem.
573
+ */
574
+ export interface CommandBarItemBase {
575
+ /**
576
+ * Optional identifier for the icon.
577
+ */
578
+ id?: string;
579
+ /**
580
+ * Type of item, (e.g. 'icon' or 'link')
581
+ */
582
+ itemType: CommandBarItemType;
583
+ /**
584
+ * Optional content to show as a tooltip above the item.
585
+ */
586
+ tooltipContent?: string;
587
+ /**
588
+ * Optionally tells the tooltip to be shown automatically.
589
+ */
590
+ showTooltipAutomatically?: boolean;
591
+ /**
592
+ * Optionally tells the Widget Header that this item should always be visible, even when not hovering.
593
+ */
594
+ pinned?: boolean;
595
+ }
596
+ /**
597
+ * Properties to render a custom CommandBarItem either as a single Icon or an Icon Button.
598
+ */
599
+ export interface CommandBarIcon extends CommandBarItemBase {
600
+ itemType: CommandBarItemType.Icon;
601
+ /**
602
+ * Name of the icon, as specified and available in Fluent UI Iconography:
603
+ * https://developer.microsoft.com/en-us/fluentui#/styles/web/icons
604
+ */
605
+ iconName: string;
606
+ /**
607
+ * Optionally display a red notification icon badge in the top-right corner of the button.
608
+ */
609
+ showNotificationBadge?: boolean;
610
+ /**
611
+ * Optional severity to specify how the item should render
612
+ */
613
+ severity?: CustomCommandBarItemSeverity;
614
+ /**
615
+ * Optionally provide an order in which this button should appear, when registering multiple custom buttons.
616
+ */
617
+ order?: number;
618
+ /**
619
+ * Optional onClick event, which is triggered on user click and makes the command
620
+ * bar item render as a button instead of a non-clickable icon.
621
+ */
622
+ onClick?: () => void;
623
+ }
624
+ /**
625
+ * Properties to render a custom CommandBarItem as a Link Button.
626
+ */
627
+ export interface CommandBarLink extends CommandBarItemBase {
628
+ itemType: CommandBarItemType.Link;
629
+ /**
630
+ * Required label to display the clickable link.
631
+ */
632
+ label: string;
633
+ /**
634
+ * Required onClick event, which is triggered on user click.
635
+ */
636
+ onClick: () => void;
637
+ }
638
+ /**
639
+ * Options to pass to the openIFrameDialog function. Use this to configure how the dialog is rendered, and to handle events (e.g. onDismissed)
640
+ */
641
+ export interface IFrameDialogOptions {
642
+ /**
643
+ * Maximum width of the dialog. If it exceeds the window width, that width is used instead.
644
+ */
645
+ maxWidth?: number;
646
+ /**
647
+ * Maximum height of the dialog. If it exceeds the window height, that height is used instead.
648
+ */
649
+ maxHeight?: number;
650
+ /**
651
+ * Minimum margin on the left- and right side of the dialog.
652
+ */
653
+ marginHorizontal?: number;
654
+ /**
655
+ * Minimum margin on the top- and bottom side of the dialog.
656
+ */
657
+ marginVertical?: number;
658
+ /**
659
+ * This event is triggered when the iFrame dialog is dismissed by the user.
660
+ */
661
+ onDismissed?: () => void;
662
+ }
663
+ /**
664
+ * Options to pass to openFilePicker function
665
+ */
666
+ export interface FilePickerOptions {
667
+ /**
668
+ * Array of file extensions that will be used to filter the files in the picker.
669
+ * @default ['.gif', '.jpg', '.jpeg', '.png']
670
+ */
671
+ extensions?: string[];
672
+ /**
673
+ * Maximum number of files to show in a folder
674
+ * @default 100
675
+ */
676
+ itemsCountQueryLimit?: number;
677
+ /**
678
+ * Whether or not to hide the organisational site files tab
679
+ * @default false
680
+ */
681
+ hideOrganisationalAssetTab?: boolean;
682
+ /**
683
+ * Whether or not to hide the site files tab
684
+ * @default false
685
+ */
686
+ hideSiteFilesTab?: boolean;
687
+ /**
688
+ * Whether or not to hide the upload tab
689
+ * @default false
690
+ */
691
+ hideLocalUploadTab?: boolean;
692
+ /**
693
+ * Function that's called when user closes file picker without picking a file
694
+ * @default undefined
695
+ */
696
+ onCancel?: () => void;
697
+ }
698
+ export interface FilePickerFileProps {
699
+ /**
700
+ * Unique identifier of the file item in SharePoint, in the shape of a Guid.
701
+ */
702
+ uniqueId: string;
703
+ /**
704
+ * Unique identifier of the list in SharePoint, in the shape of a Guid.
705
+ */
706
+ listId: string;
707
+ /**
708
+ * Unique identifier of the site in SharePoint, in the shape of a Guid.
709
+ */
710
+ siteId: string;
711
+ }
712
+ export type BoardType = 'shared' | 'personal';
713
+ export type UserRole = 'administrator' | 'board-owner';
714
+ export interface ExportData {
715
+ data: object[];
716
+ }