UNPKG

office-ui-fabric-react

Version:

Reusable React components for building experiences for Office 365.

81 lines (80 loc) 2.77 kB
import { IKeytipProps } from '../../Keytip'; export interface IUniqueKeytip { uniqueID: string; keytip: IKeytipProps; } /** * This class is responsible for handling registering, updating, and unregistering of keytips */ export declare class KeytipManager { private static _instance; keytips: IUniqueKeytip[]; persistedKeytips: IUniqueKeytip[]; inKeytipMode: boolean; shouldEnterKeytipMode: boolean; /** * Static function to get singleton KeytipManager instance * * @returns {KeytipManager} Singleton KeytipManager instance */ static getInstance(): KeytipManager; /** * Registers a keytip * * @param keytipProps - Keytip to register * @param persisted - T/F if this keytip should be persisted, default is false * @returns {string} Unique ID for this keytip */ register(keytipProps: IKeytipProps, persisted?: boolean): string; /** * Update a keytip * * @param keytipProps - Keytip to update * @param uniqueID - Unique ID of this keytip */ update(keytipProps: IKeytipProps, uniqueID: string): void; /** * Unregisters a keytip * * @param keytipToRemove - IKeytipProps of the keytip to remove * @param uniqueID - Unique ID of this keytip * @param persisted - T/F if this keytip should be persisted, default is false */ unregister(keytipToRemove: IKeytipProps, uniqueID: string, persisted?: boolean): void; /** * Manual call to enter keytip mode */ enterKeytipMode(): void; /** * Manual call to exit keytip mode */ exitKeytipMode(): void; /** * Gets all IKeytipProps from this.keytips * * @returns {IKeytipProps[]} All keytips stored in the manager */ getKeytips(): IKeytipProps[]; /** * Adds the overflowSetSequence to the keytipProps if its parent keytip also has it * * @param keytipProps - Keytip props to add overflowSetSequence to if necessary * @returns {IKeytipProps} - Modified keytip props, if needed to be modified */ addParentOverflow(keytipProps: IKeytipProps): IKeytipProps; /** * Public function to bind for overflow items that have a submenu * * @param overflowButtonSequences * @param keytipSequences */ menuExecute(overflowButtonSequences: string[], keytipSequences: string[]): void; /** * Creates an IUniqueKeytip object * * @param keytipProps - IKeytipProps * @param uniqueID - Unique ID, will default to the next unique ID if not passed * @returns {IUniqueKeytip} IUniqueKeytip object */ private _getUniqueKtp(keytipProps, uniqueID?); }