import type { ILocalizedString } from './IClientSideComponentManifest'; import type { IClientSideExtensionManifest } from './IClientSideExtensionManifest'; /** * This is the manifest for a client-side extension that defines a set of custom commands * that can be shown in a menu, tool bar, etc. * * @privateRemarks * * Why is this called "ICommandSetExtensionManifest" and not "IListViewCommandSetExtensionManifest"? * Eventually other command set classes will be introduced, for example something like: * BaseListViewCommandSet, BasePublishingCommandSet, BaseSharePointHomeCommandSet, etc. * Although their contexts will be different, most likely they will all share the same * manifest type. Thus the manifest schema will remain the same, but the extensionType * will expand to something like this: * * extensionType: 'ListViewCommandSet' | 'PublishingCommandSet' | 'SharePointHomeCommandSet'; * * @public */ export interface ICommandSetExtensionManifest extends IClientSideExtensionManifest { /** * {@inheritDoc IClientSideExtensionManifest.extensionType} */ extensionType: 'ListViewCommandSet'; /** * A table of items defined by this command set. The object key is the Item ID. * * @remarks * * The Item ID is a unique identifier that event handlers use to recognize the command * The identifier must consist of upper-case letters, numbers, and underscores. * Example: "SHOW_INFO" */ items: { [itemId: string]: ICommandDefinition; }; } /** * Used by ICommandSetExtensionManifest, this defines a command to be displayed by * a UI surface such as a menu, tool bar, etc. * * @public */ export interface ICommandDefinition { /** * A short label to be displayed by the associated button, menu item, etc. * Example: "Show information" */ title: ILocalizedString; /** * Type of the item. * - 'command': A standard executable command * - 'group': A group that contains child commands (renders as submenu) */ type: 'command' | 'group'; /** * Custom accessibility text for the browser's "aria-label" attribute. If omitted, the title property * will be used by default. * Example: "Show information. Press ENTER to select." */ ariaLabel?: ILocalizedString; /** * An optional URL for an image to be displayed next to the command. The requirements for this image * are defined by the type of extension; some extension types may not display the image at all. * * @remarks * This value can be an absolute URL (e.g. "http://example.com/icons/my-icon.png") or * a relative file path (e.g. "./icons/my-icon.png"). In the latter case, the path will be resolved relative to * the folder containing the input manifest. The icon file will be copied to the deployment folder like an asset, * and the output manifest's iconImageUrl will be replaced with a URL relative to the URL used to load all other * assets (the loaderConfig.internalModuleBaseUrls property). * * For groups, this icon is displayed on the parent button. */ iconImageUrl?: string; /** * Optional ID of the parent group this command/group belongs to. * Used to build hierarchical command structures where commands appear in submenus. * * @remarks * - Must reference a valid group item ID defined in the same manifest * - Both commands and groups can have a group property (for nested groups) * - Maximum nesting depth is 2 levels, where a top-level group can contain one additional nested group * - Child commands are displayed in manifest definition order within their group * - If the parent group ID is not found, the command appears at top level * - Groups are automatically hidden if all their children are invisible * * Example: "EXPORT_GROUP" (where EXPORT_GROUP is defined as type: 'group') */ group?: string; } //# sourceMappingURL=ICommandSetExtensionManifest.d.ts.map