import type { CacheManager } from '@ichicraft/caching'; import type { Client } from '@microsoft/microsoft-graph-client'; import type { AadHttpClientFactory, AadTokenProviderFactory, SPHttpClient, SPHttpClientConfiguration } from '@microsoft/sp-http'; import type { SPFI } from '@pnp/sp/presets/all'; export type { AadTokenProviderFactory, AadTokenProvider, AadHttpClientFactory, AadHttpClient, AadHttpClientConfiguration, AadHttpClientResponse, SPHttpClient, SPHttpClientConfiguration, } from '@microsoft/sp-http'; /** * Widget context providing widget metadata and functionality offered by the widget board */ export interface WidgetContext { /** * Metadata and functions in the context of a widget instance. A widget instance * is a single and specific widget that a user has on their board. It has its own * unique ID and possibly configuration data if the widget is configurable by the user. */ instance: WidgetInstanceContext; /** * Metadata and functions in the context of a widget buddy. A widget buddy * is a single and specific widget instance that a user has in their buddy bar. */ buddy?: WidgetBuddyContext; /** * Metadata and functions in the context of a widget's variant (fka 'definition'). A widget variant is * a widget that's been installed and possibly configured by an administrator from within the admin center. * @deprecated Use `variant` instead */ definition?: WidgetVariantContext; /** * Metadata and functions in the context of a widget's variant (fka 'definition'). A widget variant is * a widget that's been installed and possibly configured by an administrator from within the admin center. */ variant: WidgetVariantContext; /** * Metadata and functions in the context of a widget's manifest. A widget manifest contains * all information of the originally installed widget. Multiple `variants` of the same widget `manifest` * can exist in a widget board configuration. */ manifest: WidgetManifestContext; /** * Metadata in the context of the user's current theme, e.g. color settings and the preferred border radius for UI elements. */ design: WidgetDesignContext; /** * Tells whether the widget board is running in a Teams context */ inTeamsContext: boolean; /** * Tells whether the widget board is running in a Teams browser hosted context */ isTeamsBrowserHosted: boolean; /** * Tells whether the widget board is running in a Teams webview hosted context */ isTeamsWebViewHosted: boolean; /** * Tells whether the widget board is running in a SharePoint iOS app context */ isSharePointiOSApp: boolean; /** * Tells whether the widget board is running in a webview hosted context */ isWebViewHosted: boolean; /** * Tells whether the widget board is running in an embedded context */ isEmbedded: boolean; /** * Tells whether the widget board is running in a mobile browser context */ isMobileBrowser: boolean; /** * Tells whether the widget board is running in a mobile webview context */ isMobileWebView: boolean; /** * Tenant ID of current SharePoint tenant. */ tenantId: string; /** * ID of current Bloom Intranet installation. Could either be a Site Collection ID (SP Shell) * or a fixed ID (Teams Shell) */ boardsInstanceId: string; /** * Site ID of the SharePoint site where the widget board is running */ siteId: string; /** * Site url of the SharePoint site where the widget board is running */ siteUrl: string; /** * Display name of the currently signed in user * * @remarks * Example: `"Alex Wilber"` */ userDisplayName: string; /** * User principal name of the currently signed in user */ userName: string; /** * The email address for the current user * * @remarks * Example: `"example@contoso.com"` */ userEmail: string; /** * SharePoint ID of the user in the current site */ spUserId: number; /** * Login name of current user in claim style: i:0#.f|myprovider|myuser */ claimBasedLoginName: string; /** * Azure AD Security groups that user is member of */ userSecurityGroups: string[]; /** * SharePoint groups in this site collection that user is member of */ userSharePointGroups: number[]; /** * Provides the date that the user's account was created */ userAccountCreated: Date; /** * Roles of the current user. This may very depending on the active board */ userRoles: UserRole[]; /** * Language code of currently used UI rendering language in SharePoint */ language: string; /** * Base URL of the folder the widget bundle was loaded from. Widgets can use this to * fetch assets published alongside their bundle, such as per-language i18n files. */ assetsBaseUrl?: string; /** * List of supported languages as configured in Widget Board configuration */ contentLanguages: { /** * Numeric Locale ID, like 1033 for English - United States */ LCID: number; /** * Language code, like 'en-US' for English - United States */ BCP47LanguageTag: string; /** * 2 or 3 character uppercase language code, like 'EN' for English - United States */ abbreviatedCode: string; /** * Friendly name of the language, translated in the currently used UI language */ friendlyName: string; /** * Whether this is the default UI language of the Widget Board */ isDefault?: boolean; /** * Whether this is the current UI language of the Widget Board */ isCurrent?: boolean; }[]; /** * Preferred border radius of UI elements as configured in Widget Board configuration. * @deprecated This property has been moved under `design`. */ elementBorderRadius: number; /** * A multi purpose SharePoint interface that can be used to interact with SharePoint. * It's based on the PnPjs library. */ sp: SPFI; /** * Used to perform REST calls against SharePoint. */ spHttpClient: SPHttpClient; /** * Provides a set of switches for enabling/disabling various features of the SPHttpClient. */ spHttpClientConfiguration: SPHttpClientConfiguration; /** * SharePoint Service Scope, taken from SPFx WebPart Context. Type is removed to avoid dependency on SPFx. */ spServiceScope?: unknown; /** * MS Graph Client Factory class as provided by the WebPartContext object. * @deprecated The type is removed to avoid dependency on SPFx. Use `msGraphClient` instead. */ msGraphClientFactory: any; /** * MS Graph Client instance, ready to use. */ msGraphClient: Client; /** * AAD Http Client Factory class as provided by the WebPartContext object. */ aadHttpClientFactory: AadHttpClientFactory; /** * AAD Token Provider Factory class as provided by the WebPartContext object. */ aadTokenProviderFactory: AadTokenProviderFactory; /** * Currently in use theme (by SharePoint/Teams) */ theme: any; /** * Returns whether or not the currently signed in user is part of an AAD security group. * Provide the guid of the group. */ isCurrentUserMemberOfSecGroup?: (groupId: string) => Promise; /** * Returns whether or not the currently signed in user is part of a SharePoint group in the current site. * Provide the id of the SP Group. */ isCurrentUserMemberOfSPGroup?: (groupId: number) => Promise; /** * Returns whether or not the currently signed in user is part of a Bloom Group. * Provide the id (GUID) of the Bloom Group. */ isCurrentUserMemberOfBloomGroup?: (groupId: string) => Promise; /** * Provides the tenant's Bloom Group definitions, e.g. so pickers can offer them. * Untyped to avoid a cross-package dependency (like `theme`); items carry the * Bloom Group shape as defined by the host. */ bloomGroups?: { fetchGroups(): Promise; }; /** * Generates a hash of all combined SP Groups of the current user. This can be used as * cache invalidator to detect changes. * Store this hash as part of your local cache to detect when to refresh SP Group related data. */ generateHashForAllCurrentUserSPGroups?: () => Promise; /** * Generates a hash of all combined AAD Security Groups of the current user. This can be used as * cache invalidator to detect changes. * Store this hash as part of your local cache to detect when to refresh Sec Group related data. */ generateHashForAllCurrentUserSecGroups?: () => Promise; /** * Call this function from within one of the applicable render methods in case of an unresolvable error. * The widgetboard will render a 'disrupted' message and in case of an error in widget rendering it * offers the user the option to delete the widget from the board. */ handleFatalError?: () => void; /** * Functionality offered by the widget board to load a script using SPComponentLoader. */ loadScript?: (url: string, options?: any) => Promise; /** * Functionality offered by the widget board to load a publicly available SharePoint component using SPComponentLoader. */ loadComponentById?: (id: string, version?: string) => Promise; /** * Functionality offered by the widget board to open a File Picker panel to select files. * @param onFilePicked Function that's called when a file was picked. Returns the url of the picked file. * @param options Options to change the behavior of the file picker */ openFilePicker?: (onFilePicked: (fileUrl: string, fileProps: FilePickerFileProps) => void, options?: FilePickerOptions) => void; /** * Functionality offered by the widget board to open a url in an iframe dialog. * @param url The url to open in a dialog. * @param options Options to configure the dialog (e.g. size, margin, callbacks, ...) */ openIFrameDialog?: (url: string, options?: IFrameDialogOptions) => void; /** * Provides access to the Teams SDK and Teams context. Only provided when the web part is loaded in Teams. */ teamsSdk?: { /** * Microsoft Teams SDK. */ teamsJs: any; /** * {@inheritDoc @microsoft/teams-js#Context} */ context: any; }; } /** * Widget instance context providing metadata and functionality offered by the widget board. A widget instance * is a single and specific widget that a user has on his/her board. It has its own * unique ID and possibly configuration data if the widget is configurable by the user */ export interface WidgetInstanceContext { /** * Unique id of a specific widget instance. */ id: string; /** * Unique id of the parent of a specific widget instance (e.g. of a personal/shared board, buddy bar, ...). */ parentId: string; /** * Optional configuration data that contains user settings of a specific widget instance. */ data?: string; /** * The type of board this widget instance is added to. */ boardType?: BoardType; /** * Creates a deep link URL based on the current board and this widget instance, combined with * the provided data. * @returns The deep link URL. */ createDeepLink?: (data?: string) => string; /** * Sets deep link data related to this widget instance in the URL of the current page. */ setDeepLinkData?: (data?: string) => void; /** * Gets all deep link data related to this widget instance from the URL of the current page. */ getDeepLinkData?: () => string; /** * @deprecated This feature is no longer available. It will be removed in a future release. */ publishNotification?: (content: string, expirationDateTime: Date) => void; /** * Call this function to open the widget configuration panel for a user. This is an additional * way to open the panel because a user can also open the configuration panel by using the contextual * menu of the widget. */ openConfiguration?: () => void; /** * Call this function to open the widget delete confirmation dialog for a user. This offers widget developers * the ability to trigger the "widget deletion process". This allows different methods to delete the widget. */ initiateWidgetDeletion?: () => void; /** * Functionality offered by the widget board to change the title of the widget. */ setWidgetTitle?: (title: string) => void; /** * Functionality offered by the widget board to append the title of the widget with additional text. */ setWidgetTitleSuffix?: (suffix: string) => void; /** * Functionality offered by the widget board to change the subtitle of the widget. */ setWidgetSubtitle?: (subtitle: string) => void; /** * Show or hide the header of the widget, allowing widgets to take control of full widget real estate. */ setWidgetHeaderVisibility?: (visible: boolean) => void; /** * Show or hide the settings button of the widget. */ setUserConfigButtonVisibility?: (visible: boolean) => void; /** * Optional callback to handle the click event of the widget title. */ onWidgetTitleClicked?: () => void; /** * Allows registration of multiple custom command bar items which can either result in an icon or * an icon button, depending on the presence of the onClick property. To remove the items, * use the [unregisterCommandBarItems] function. */ registerCustomCommandBarItems?: (props: CommandBarItemProps[]) => void; /** * Allows registration of a custom command bar item which can either result in an icon or * an icon button, depending on the presence of the onClick property. To remove the item, * use the [unregisterCommandBarItem] function. */ registerCustomCommandBarItem?: (props: CommandBarItemProps) => void; /** * Updates the instance configuration of the widget. This is used to update the * configuration data of the widget instance, which is stored in the widget board. */ updateInstanceConfiguration?: (serializedInstanceConfiguration: string) => void; /** * Removes all registered custom command bar items. */ unregisterCustomCommandBarItems?: () => void; /** * Removes a single custom command bar item, corresponding to the provided id. * If no id was specified, it removes all items. */ unregisterCustomCommandBarItem?: (id?: string) => void; /** * Allows registration of tabs (pivots) in the widget header. To unregister the tabs, provide 'undefined' options. */ registerTabs?: (options: CommandBarTabOptions) => void; /** * Allows setting the current selected tab in the widget header. */ setSelectedTab?: (tabId: string) => void; /** * Raises an event to be handled by the Time-based Events feature. * @param object The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase. * @param action The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase. * @param data Optionally provide extra metadata to be included with the raised event. * widgetAlias property (from manifest) and variantTitle property will automatically be added by the widget board. */ raiseEvent?: (object: string, action: string, data?: { [key: string]: string; }) => void; /** * Cache manager scoped to this widget instance. * Data stored here is specific to this instance only. */ cache: CacheManager; } export interface WidgetBuddyContext { /** * The default color of the buddy icon, as configured in the user's theme. * @deprecated Use `design.header.iconColor` (or `design.header.activeIconColor` for the hover/active state) instead. */ defaultColor: string; /** * Allows updating the badge properties of the buddy, e.g. its visibility, count or color. * This will only override the provided properties. */ updateBadgeProperties: (props: Partial) => void; /** * Overrides the onClick function that triggers when clicking on a buddy in the Buddy Bar. */ registerOnBuddyClick: (onClick: () => void) => void; } /** * Options passed by the host to `BaseWidget.renderBuddy` describing the slot * the widget is about to render into. Lets the widget decide synchronously * how rich its buddy rendering can afford to be. */ export interface BuddyRenderOptions { /** * Whether the buddy slot has enough room for a richer rendering than the * standard buddy icon button. When `false`, the widget should either fall * back on the host's default buddy button (by returning `false` from * `renderBuddy`) or render a minimal icon that fits the standard slot. */ allowRichRendering: boolean; } /** * Widget variant context providing metadata and functionality offered by the widget board. A widget variant is * a widget that's been installed by an administrator from within the board administration. */ export interface WidgetVariantContext { /** * Unique id of an installed and configured widget in the widget board. * If this is a 'single instance widget', which means that no more than one instance of this * widget can be installed in the widget board, the id of the definition is the same as the id of the manifest. */ id: string; /** * Optional configuration data that contains board-wide settings of a specific widget instance */ data?: string; /** * A list of board types applicable for this widget variant. */ allowedBoardTypes?: BoardType[]; /** * A list of administrators able to edit the admin configuration of this widget variant. */ administrators?: any[]; /** * The icon defined for this widget variant. */ iconName?: string; /** * Cache manager scoped to this widget variant. * Data stored here is shared across all instances of this variant, but isolated from other variants. */ cache: CacheManager; } /** * Widget manifest context providing metadata and functions offered by the widget board. A widget manifest contains * all information of the originally installed widget. Multiple `variants` of the same widget `manifest` * can exist in a widget board configuration. */ export interface WidgetManifestContext { /** * Unique id of a widget 'type', also used in the widget manifest config file in the original script source manifest file. * If this is a 'single instance widget', which means that no more than one instance of this * widget can be installed in the widget board, the id of the definition is the same as the id of the manifest. */ id: string; /** * Cache manager scoped to this widget type (manifest level). * Data stored here is shared across all variants and instances of this widget type. */ cache: CacheManager; } export interface WidgetDesignContext { /** Available options in the ColorPicker.*/ colorOptions: ColorOption[]; /** Preferred border radius of UI elements.*/ borderRadius: number; /** The height of a single row in the board grid. Use this to determine how many columns high a widget is. */ rowHeight: number; /** Design settings related to icon badges. */ badge: { /** Background color of an icon badge. */ color: string; /** Inner text color of an icon badge. */ textColor: string; }; /** Design settings related to the board header (welcome message, buddy bar and icons). */ header: { /** Text color used in the header. */ textColor: string; /** Icon color used in the header. */ iconColor: string; /** Text color used in the header for secondary/supporting text (e.g. a subtitle or subline). */ subTextColor: string; /** Icon color used in the header when an element is in the active or hover state. */ activeIconColor: string; }; } export interface ValidationResult { isValid: boolean; errors: string[]; } export interface WidgetImages { preview: string; additional: string[]; } export interface WidgetResource { lang: number; title: string; subtitle?: string; shortDescription: string; instructions: string; images: WidgetImages; } export interface WebApiPermissionRequest { /** * Specifies the name of the API to which access has to be granted. * This can be something like "Microsoft Graph" or "Power BI Service" and is the same * as what one would use in the package-solution file in an SPPKG package. */ resource: string; /** * Specifies the name of one scope claim that the resource application * should expect in the OAuth 2.0 access token. * This can be something like "User.Read.All" (for Graph) or "Report.Read.All" (for Power BI) and is the same * as what one would use in the package-solution file in an SPPKG package. */ scope: string; /** * This marks an optional API permission. If true, Boards will not throw an error upon * rendering when the permission isn't granted. */ isOptional?: boolean; /** * Optional justification for the API permission request. This is used to explain why the permission is needed. * It can be used by administrators to understand the purpose of the permission. */ justification?: string; } /** * The widget manifest contains meta information about the widget */ export interface WidgetManifestConfig { /** * Version of the widget manifest schema. The value of this field * is controlled by Ichicraft. The purpose of this field is to help * manage upgrades of the widget manifest schema. * The current version is version `2`, introducing externals + manifestVersion * properties */ manifestVersion: number; /** Unique id to identify the widget */ id: string; /** Internal name for the widget, used internally by Ichicraft */ name: string; /** Version should contain the semver of this widget. For future use. */ version: string; /** * The current stage of the software release lifecycle this widget is in. * @remark For Bloom Intranet administrators, anything other than the default will be displayed in the widget library. * @default "release" */ releaseType?: ReleaseType; /** (Optional) External url that admins can navigate to for more information about the widget. Displayed e.g. in the admin widget library, and the licenses panel (for Bloom widgets). * For now, only admins are able to access this url through the Bloom UI. */ aboutUrl?: string; /** (Optional) External url that users can navigate to for more information about what's recently been added to the widget. Accessed e.g. through the widget's header menu. * Only available if the 'What's New' feature is enabled.*/ whatsNewUrl?: string; /** * The minimum number of rows this widget must inhabit on a board. * @remark The value should be either `1` or `2`. Any other value is considered invalid and will be ignored. * @default 2 */ minRows: number; /** * The maximum number of rows this widget can inhabit on a board. * @remark The value should be `2` or higher. Specify `Infinity` to allow spanning any number of rows. Any other value is considered invalid and will be ignored. * @default 2 */ maxRows: number; /** * The maximum number of columns this widget can inhabit on a board. * @remark The value should be `1` or higher. Specify `Infinity` to allow spanning any number of columns. Any other value is considered invalid and will be ignored. * @default 1 */ maxCols: number; /** * Whether this widget is configurable by the user. Implementation of user config functions is necessary if true. */ isConfigurableByUser: boolean; /** * Whether this widget is configurable by the board admin. Implementation of admin config functions is necessary if true. */ isConfigurableByAdmin: boolean; /** * Internally used by Ichicraft. */ widgetBoardCompatibilityVersion?: number; /** * 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. */ iconName: string; /** * Image used to represent this widget, used as default when installing a widget in the board. */ thumbnailUrl: string; /** * Language specific resources for this widget, used as default when installing a widget in the board */ resources: WidgetResource[]; /** * Web API permission requests. Like SPPKG packages, the widget specifies required API permissions. */ webApiPermissionRequests?: WebApiPermissionRequest[]; /** * This is the url of the widget script. It should be a well formatted url that points * to the script file's unique location. Script files should be hosted on a secure website (https). */ scriptUrl: string; /** * File path used when debugging a widget, this is set automatically when you debug a widget */ bundleFilePath?: string; /** * Added in manifestVersion 2 * Lists modules (package dependencies) that should be loaded separately from bundle. * Libraries mentioned here will not be bundled when packed as a production release, * instead, they will be loaded from the provided path (path points to a CDN or other file location) */ externals?: { [name: string]: { /** * Path to the script file. If this is a module (e.g. AMD or UMD), make sure you also * specify the modules this module depends on as separate modules using the correct aliases. */ path: string; /** * Used for non-AMD scripts to specify dependencies. Should point to other non-AMD modules */ globalDependencies?: string[]; /** * In case this isn't an AMD module, define the variable name used by the script to * make the module available (i.e. global/root/window variable name like jQuery or $) */ globalName?: string; /** * If this module has dependencies, map them here to other externals you also specified * For instance: external @fluentui/react umd module has dependencies React and ReactDOM. * To point these to the right externals, map them like this: * React: react * ReactDOM: 'react-dom' * And make sure you specified 'react' and 'react-dom' as externals as well. */ dependencyMappings?: { [name: string]: string; }; }; }; /** * Everything related to analytics of this widget in Bloom Intranet. */ analytics?: { /** * A list of time-based events this widget can raise. All the possible events MUST be * described in this list for the widget board to be able to pick them up. * @ref Use WidgetContext.instance.raiseEvent(object: string, action: string, data?: { [key: string]: string }) to raise these events */ timeBasedEvents: { /** * The object this event concerns (e.g. app, report, newsArticle, ...). Use camelCase. */ object: string; /** * The action that was performed to/on the object (e.g. viewed, clicked, deleted, ...). Use camelCase. */ action: string; /** * A descriptive text used in the Administration panel to describe this event */ description: string; }[]; }; } export declare enum DebugComponentType { /** * This is the default component type and just opens the default widget board. */ Default = "Default", /** * This automatically opens the widget board administration panel and opens the widget admin config * dialog of the widget you're working on */ AdminConfig = "AdminConfig" } /** * The widget debug serve config contains settings for debugging a widget in development */ export interface WidgetDebugServeConfig { /** * Provide a url of a SharePoint site that hosts a widget board. This page will be opened * as soon as you start debugging using [npm run start] */ widgetsDebugPageUrl: string; /** * Provide a component type to open the debugging widget board with that specific component. * This speeds up your development cycle: [npm run start] > save changes > builds automatically > * refresh browser > automatically open updated component. */ debugComponentType?: DebugComponentType; } /** * Tells the severity of the command bar item, resulting in * distinguishable presentation of the item */ export declare enum CustomCommandBarItemSeverity { /** Normal severity, displays just like all the other command bar items */ Normal = 0, /** Warning severity, displays the item with a more noticable warning color */ Warning = 1 } /** * Tells how to render the command bar item, e.g. as an icon button or as a link. */ export declare enum CommandBarItemType { /** Renders the item as an Icon */ Icon = "icon", /** Renders the item as a clickable link */ Link = "link", /** Renders the item as a search bar */ SearchBar = "search-bar", /** Renders the item in the overflow menu */ Overflow = "overflow" } /** * Base properties of a CommandBarItem, rendered in the widget header. */ export interface CommandBarItemProps { /** * Optional identifier for the icon. */ id?: string; /** * Optional type of item, (e.g. 'icon' or 'link'). When not specified, the item is rendered as an icon. */ itemType?: CommandBarItemType; /** * Optional content to show as a tooltip above the item. */ tooltipContent?: string; /** * Optionally tells the tooltip to be shown automatically. */ showTooltipAutomatically?: boolean; /** * Optionally tells the Widget Header that this item should always be visible, even when not hovering. */ pinned?: boolean; /** * Optionally tells the Widget Header that this item should always be rendered as if it is being hovered. */ highlighted?: boolean; /** * Optionally override the cursor when hovering over the item. */ cursor?: string; /** * Optionally tells the Widget Header that this item should be rendered in a disabled state. */ disabled?: boolean; /** * Name of the icon displayed when rendered as an Icon, or in the overflow menu. * See the available icon names in Fluent UI Iconography: * https://developer.microsoft.com/en-us/fluentui#/styles/web/icons */ iconName?: string; /** * Displayed label when rendered as a link, or in the overflow menu. */ label?: string; /** * Optionally display a badge in the top-right corner of the button. * Optionally use in conjunction with notificationBadgeCount to display a number inside the badge. */ showNotificationBadge?: boolean; /** * Optional count to display in the notification badge. * Only applies when showNotificationBadge is true, and will be truncated to "99+" when the count exceeds 99. */ notificationBadgeCount?: number; /** * Optional severity to specify how the item should render */ severity?: CustomCommandBarItemSeverity; /** * Optionally provide an order in which this button should appear, when registering multiple custom buttons. */ order?: number; /** * Optional onClick event, which is triggered on user click and makes the command * bar item render as a button instead of a non-clickable icon. */ onClick?: () => void; } /** * Base properties of a CommandBarItem, rendered in the widget header. */ export interface CommandBarSearchItem extends CommandBarItemProps { searchTerms: string; onChange?: (value: string) => void; onSearch?: (value: string) => void; } export interface CommandBarTabOptions { /** * The tabs to display in the widget command bar. */ tabs: CommandBarTab[]; /** * Override the icon that is displayed in the overflow menu button. */ overflowButtonIconName?: string; /** * Optional tooltip to display when hovering over the overflow menu button. */ overflowButtonTooltip?: string; /** * Callback function that triggers when a new tab is selected. */ onTabSelect: (tabId: string) => void; } export interface CommandBarTab { /** * Unique id for this tab. */ id: string; /** * The text displayed in the tab. Leave this empty if you don't want to display any text. */ label: string; /** * Optional item count displayed after the label between parantheses. Example: Test label (5) */ itemCount?: string | number; /** * Optional icon to display before the label. */ iconName?: string; /** * Optional image to display before the label. */ imageUrl?: string; /** * Optional tooltip to display when hovering over the tab. */ tooltip?: string; } /** * Options to pass to the openIFrameDialog function. Use this to configure how the dialog is rendered, and to handle events (e.g. onDismissed) */ export interface IFrameDialogOptions { /** * Option to hide the Hub navigation on SharePoint sites. */ hideSpHubNav?: boolean; /** * Option to hide the site header on SharePoint sites. */ hideSpSiteHeader?: boolean; /** * Maximum width of the dialog. If it exceeds the window width, that width is used instead. */ maxWidth?: number; /** * Maximum height of the dialog. If it exceeds the window height, that height is used instead. */ maxHeight?: number; /** * Minimum margin on the left- and right side of the dialog. */ marginHorizontal?: number; /** * Minimum margin on the top- and bottom side of the dialog. */ marginVertical?: number; /** * Show 'back' and 'forward' buttons in the dialog header, to allow navigating through the browser history. */ showHistoryButtons?: boolean; /** * Show an 'open in new window' button in the dialog header. */ showOpenInNewWindow?: boolean; /** * Title displayed in the dialog header. */ title?: string; /** * URL opened when clicking on the header title. */ titleUrl?: string; /** * This event is triggered when the iFrame dialog is dismissed by the user. */ onDismissed?: () => void; /** * This event is triggered when the iFrame dialog has been loaded. */ onLoad?: (iframe: HTMLIFrameElement) => void; /** * Renders an icon on the left side of the dialog header. */ onRenderHeaderIcon?: (domElement: HTMLDivElement) => void; } /** * Options to pass to openFilePicker function */ export interface FilePickerOptions { /** * Array of file extensions that will be used to filter the files in the picker. * @default ['.gif', '.jpg', '.jpeg', '.png'] */ extensions?: string[]; /** * Maximum number of files to show in a folder * @default 100 */ itemsCountQueryLimit?: number; /** * Whether or not to hide the organisational site files tab * @default false */ hideOrganisationalAssetTab?: boolean; /** * Whether or not to hide the site files tab * @default false */ hideSiteFilesTab?: boolean; /** * Whether or not to hide the upload tab * @default false */ hideLocalUploadTab?: boolean; /** * Function that's called when user closes file picker without picking a file * @default undefined */ onCancel?: () => void; } export interface FilePickerFileProps { /** * Name of the selected file (including extension). */ fileName: string; /** * Unique identifier of the file item in SharePoint, in the form of a Guid. */ uniqueId: string; /** * Unique identifier of the list in SharePoint, in the form of a Guid. */ listId: string; /** * Unique identifier of the site in SharePoint, in the form of a Guid. */ siteId: string; /** * Unique identifier of the drive, in the form of a Guid. */ driveId: string; } export type BoardType = 'shared' | 'personal' | 'buddybar'; export type UserRole = 'administrator' | 'board-owner' | 'widget-administrator'; /** Defines the different types of releases an application can have, e.g. alpha, beta, release. */ export type ReleaseType = 'alpha' | 'beta' | 'release'; export interface ExportData { data: object[]; } export interface BadgeProperties { isVisible?: boolean; count?: number; color?: string; } export interface ColorOption { id: string; title: string; color: string; }