All files / tour si-tour-token.model.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33                                                              1x  
/**
 * Copyright (c) Siemens 2016 - 2025
 * SPDX-License-Identifier: MIT
 */
import { ConnectedOverlayPositionChange } from '@angular/cdk/overlay';
import { ElementRef, InjectionToken, WritableSignal } from '@angular/core';
import { Subject } from 'rxjs';
 
import { TourStep } from './si-tour.model';
 
export interface TourStepInternal {
  step: TourStep;
  stepNumber: number;
  totalSteps: number;
  anchor?: ElementRef<HTMLElement>;
}
 
export type TourAction = 'next' | 'back' | 'cancel' | 'complete';
 
export interface PositionChange {
  change: ConnectedOverlayPositionChange;
  anchor: ElementRef;
}
export interface TourToken {
  currentStep: Subject<TourStepInternal>;
  blocked: WritableSignal<boolean>;
  positionChange: Subject<PositionChange | undefined>;
  sizeChange: Subject<void>;
  control: Subject<TourAction>;
}
 
export const SI_TOUR_TOKEN = new InjectionToken<TourToken>('SI_TOUR_TOKEN');