@ichicraft/widgets-widget-base 1.9.2 → 1.9.4

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