import type { ISignal } from '@lumino/signaling'; import type { TranslationBundle } from '@jupyterlab/translation'; import { LabIcon } from '@jupyterlab/ui-components'; import type { ITour, ITourHandler, ITourManager, ITourManagerOptions } from './tokens'; import { TourHandler } from './tour'; /** * The TourManager is needed to manage creation, removal and launching of Tutorials */ export declare class TourManager implements ITourManager { constructor(options?: ITourManagerOptions); /** * The currently active tour. undefined if no tour is currently running. */ get activeTour(): ITourHandler | undefined; /** * Whether the tour manager is disposed. */ get isDisposed(): boolean; /** * Promise that resolves when the manager state is restored. */ get ready(): Promise; /** * Signal emit with the launched tour */ get tourLaunched(): ISignal; /** * A key/value map of the tours that the tour manager contains. * Key: ID of the tour, value: tour object. */ get tours(): Map; /** * Extension translation bundle */ get translator(): TranslationBundle; /** * Creates an interactive TourHandler object that can be customized and run by the TourManager. * @param tour The tour to be created. * * @returns The tour created * * #### Notes * Tour title and steps content will go through a translation bundle if they are strings. */ addTour(tour: ITour): ITourHandler | null; /** * Creates an interactive TourHandler object that can be customized and run by the TourManager. * @param id The id used to track the tour. * @param label The label to use for the tour. If added to help menu, this would be the button text. * @param addToHelpMenu If true, the tour will be added as a button on the help menu. Default = True. * @param options Tour options * * @returns The tour created * * #### Notes * The tour label will not be translated. */ createTour: (args: Omit & { icon?: LabIcon; }) => ITourHandler; /** * Dispose the tour manager. */ dispose(): void; /** * Launches a tour or series of tours one after another in order of the array provided. * If the array is empty or no tours have steps, this will be a no-op. * * @param tours An array of tours or tutorialIDs to launch. * @param force Force the tour execution */ launch(tours: ITourHandler[] | string[], force?: boolean): Promise; /** * Removes the tour and its associated command from the application. * * @param tour The TourHandler object or the id of the tour object to remove */ removeTour(t: string | ITourHandler): void; /** * Order a list of tours by label, if possible, falling back to unique id */ sortTours(tours: ITour[]): ITour[]; private _forgetDoneTour; private _rememberDoneTour; /** * Helper to sort user tours by label, if possible, falling back to unique id */ private _compareTours; private _activeTours; private _isDisposed; private _locale; private _menu; private _menuItems; private _ready; private _state; private _tracker; private _trans; private _translator; private _tours; private _tourLaunched; }