@covalent/guided-tour
Version:
Covalent Guided Tour Module
122 lines (117 loc) • 3.92 kB
TypeScript
import * as i0 from '@angular/core';
import * as i1 from '@angular/common';
import { NavigationExtras, ParamMap } from '@angular/router';
import Shepherd from 'shepherd.js';
import { Observable } from 'rxjs';
declare class CovalentGuidedTourModule {
static ɵfac: i0.ɵɵFactoryDeclaration<CovalentGuidedTourModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<CovalentGuidedTourModule, never, [typeof i1.CommonModule], never>;
static ɵinj: i0.ɵɵInjectorDeclaration<CovalentGuidedTourModule>;
}
type TourStep = Shepherd.Step.StepOptions;
type TourStepButton = Shepherd.Step.StepOptionsButton;
declare enum ITourEvent {
'click' = "click",
'pointerover' = "pointerover",
'keyup' = "keyup",
'added' = "added",// added to DOM
'removed' = "removed"
}
interface ITourEventOn {
selector?: string;
event?: keyof typeof ITourEvent;
}
interface ITourEventOnOptions {
timeBeforeShow?: number;
interval?: number;
}
interface ITourOptions extends Shepherd.Tour.TourOptions {
abortOn?: ITourEventOn[];
}
interface ITourStepAttachToOptions extends ITourEventOnOptions {
highlight?: boolean;
retries?: number;
skipIfNotFound?: boolean;
else?: string;
goBackTo?: string;
skipFromStepCount?: boolean;
}
interface ITourStepAdvanceOnOptions extends ITourEventOnOptions {
jumpTo?: string;
allowGoBack?: boolean;
}
interface ITourStep extends TourStep {
attachToOptions?: ITourStepAttachToOptions;
advanceOnOptions?: ITourStepAdvanceOnOptions;
advanceOn?: ITourEventOn[] | ITourEventOn | any;
abortOn?: ITourEventOn[];
count?: number;
}
declare abstract class TourButtonsActions {
abstract next(): void;
abstract back(): void;
abstract cancel(): void;
abstract finish(): void;
}
declare class CovalentGuidedTour extends TourButtonsActions {
private _destroyedEvent$;
shepherdTour: Shepherd.Tour;
stepOptions: ITourStep;
constructor(stepOptions?: ITourStep);
newTour(opts?: ITourOptions): void;
back(): void;
cancel(): void;
next(): void;
finish(): void;
addSteps(steps: ITourStep[]): void;
start(): void;
protected _prepareTour(originalSteps: ITourStep[], finishLabel?: string): ITourStep[];
private _bindEvent;
}
interface IGuidedTour extends ITourOptions {
steps: IGuidedTourStep[];
finishButtonText?: string;
}
interface IGuidedTourStep extends ITourStep {
routing?: {
route: string;
extras?: NavigationExtras;
};
}
/**
* Router enabled Shepherd tour
*/
declare enum TourEvents {
complete = "complete",
cancel = "cancel",
hide = "hide",
show = "show",
start = "start",
active = "active",
inactive = "inactive"
}
interface IGuidedTourEvent {
step: any;
previous: any;
tour: any;
}
declare class CovalentGuidedTourService extends CovalentGuidedTour {
private _router;
private _route;
private _httpClient;
private _toursMap;
private _tourStepURLs;
constructor();
tourEvent$(str: TourEvents): Observable<IGuidedTourEvent>;
registerTour(tourName: string, tour: IGuidedTour | string): Promise<void>;
startTour(tourName: string): Shepherd.Tour | undefined;
initializeOnQueryParams(queryParam?: string): Observable<ParamMap>;
setNextBtnDisability(stepId: string, isDisabled: boolean): void;
private _loadTour;
private _getTour;
private _configureRoutesForSteps;
static ɵfac: i0.ɵɵFactoryDeclaration<CovalentGuidedTourService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<CovalentGuidedTourService>;
}
export { CovalentGuidedTour, CovalentGuidedTourModule, CovalentGuidedTourService, ITourEvent, TourEvents };
export type { IGuidedTour, IGuidedTourEvent, IGuidedTourStep, ITourEventOn, ITourEventOnOptions, ITourOptions, ITourStep, ITourStepAdvanceOnOptions, ITourStepAttachToOptions, TourStep, TourStepButton };