packageDocumentation module import { BadgeType } from "../items/BadgeType" ; import { ConditionalBooleanValue } from "../items/ConditionalBooleanValue" ; import { ConditionalStringValue } from "../items/ConditionalStringValue" ; import { ProvidedItem } from "../items/ProvidedItem" ; public export enum StatusBarSection { /** area for tool assistance and messages */ Message = 0 , /** area for tool assistance and messages */ Left = 0 , /** items specific to stage/task */ Stage = 1 , /** items specific to stage/task */ Center = 1 , /** Select scope and selection info */ Selection = 2 , /** Select scope and selection info */ Right = 2 , /** items that only show based on context */ Context = 3 } public export enum StatusBarLabelSide { /** Label is placed left side of icon. This is the default if not specified */ Left , /** Label is placed on right side of icon. */ Right } public export type StatusBarItemId = CommonStatusBarItem [ "id" ] ; public export interface AbstractStatusBarItem extends ProvidedItem { /** can be used by application to store miscellaneous data. */ applicationData ? : any ; /** Describes badge. Renders no badge if not specified. */ readonly badgeType ? : BadgeType ; /** Required unique id of the item. To ensure uniqueness it is suggested that a namespace prefix of the extension name be used. */ readonly id : string ; /** optional data to used by item implementor. */ readonly internalData ? : Map < string , any > ; /** Describes if the item is visible or hidden. The default is for the item to be visible. */ readonly isHidden ? : boolean | ConditionalBooleanValue ; /** Describes if the item is enabled or disabled. The default is for the item to be enabled. */ readonly isDisabled ? : boolean | ConditionalBooleanValue ; /** Priority within a section (recommend using values 1 through 100). */ readonly itemPriority : number ; /** status bar section */ readonly section : StatusBarSection ; } public export interface AbstractStatusBarActionItem extends AbstractStatusBarItem { /** method to execute when icon is pressed */ readonly execute : ( ) => void ; /** Name of icon WebFont entry or if specifying an SVG symbol added by plug on use "svg:" prefix to imported symbol Id. */ readonly icon ? : string | ConditionalStringValue ; /** Label. */ readonly label ? : string | ConditionalStringValue ; /** tooltip. */ readonly tooltip ? : string | ConditionalStringValue ; } public export interface AbstractStatusBarLabelItem extends AbstractStatusBarItem { /** Name of icon WebFont entry or if specifying an SVG symbol added by plug on use "svg:" prefix to imported symbol Id. */ readonly icon ? : string | ConditionalStringValue ; /** Label. */ readonly label : string | ConditionalStringValue ; /** Defines which side of icon to display label if icon is defined. */ readonly labelSide ? : StatusBarLabelSide ; } public export interface AbstractStatusBarCustomItem extends AbstractStatusBarItem { readonly isCustom : true ; } public export type CommonStatusBarItem = AbstractStatusBarActionItem | AbstractStatusBarLabelItem | AbstractStatusBarCustomItem ; public export const isAbstractStatusBarActionItem = ( item ) : item is AbstractStatusBarActionItem => { return ( item as AbstractStatusBarActionItem ) . execute !== undefined ; } ; public export const isAbstractStatusBarLabelItem = ( item ) : item is AbstractStatusBarLabelItem => { return ( item as AbstractStatusBarLabelItem ) . label !== undefined && ( item as AbstractStatusBarActionItem ) . execute === undefined ; } ; public export const isAbstractStatusBarCustomItem = ( item ) : item is AbstractStatusBarCustomItem => { return ! ! ( item as AbstractStatusBarCustomItem ) . isCustom ; } ; public export class AbstractStatusBarItemUtilities { /** Creates a StatusBar item to perform an action */ public static createActionItem = ( id , section , itemPriority , icon , tooltip , execute , overrides ? ) : AbstractStatusBarActionItem => ( { id , section , itemPriority , icon , tooltip , execute , ... overrides } ) ; /** Creates a StatusBar item to display a label */ public static createLabelItem = ( id , section , itemPriority , icon , label , labelSide = StatusBarLabelSide . Right , overrides ? ) : AbstractStatusBarLabelItem => ( { id , section , itemPriority , icon , label , labelSide , ... overrides } ) ; }