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. * Currently only "command" is allowed. */ type: 'command'; /** * 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). */ iconImageUrl?: string; } //# sourceMappingURL=ICommandSetExtensionManifest.d.ts.map