moh-common-lib
Version:
A library of Angular components, services, and styles for B.C. Government Ministry of Health (MoH).
52 lines (51 loc) • 1.62 kB
TypeScript
import { Router } from '@angular/router';
import { AbstractPgCheckService } from './abstract-pg-check.service';
/**
* Interface for used when checking completeness of item
*/
export interface PageListInterface {
route: string;
isComplete: boolean;
[key: string]: any;
}
/**
* Extend this class when creating a service to create your custom Route Guard
* logic. This class should work as-is for simple use-cases. For Route Guard
* setup @see RouteGuardService.
*
* @see RouteGuardService
*/
export declare class CheckCompleteBaseService implements AbstractPgCheckService {
protected router: Router;
pageCheckList: PageListInterface[];
private _startUrl;
private _bypassGuards;
constructor(router: Router);
startUrl: string;
bypassGuards: boolean;
canBypassGuards(): boolean;
getStartUrl(): string;
/** Any prerequisites that need list of pages */
isPrerequisiteComplete(): boolean;
/**
* Sets page to not be completed, so applicants cannot complete application out of sequence
*/
setPageIncomplete(): void;
/**
* Sets the page to completed, allowing applicant to proceed to next page.
*/
setPageComplete(): void;
/**
* Indicates whether page has been completed or not.
*/
isPageComplete(url: string): boolean;
/**
* Check for incomplete pages
*/
isComplete(): boolean;
/**
* Index of URL in the items list, -1 if not exist
*/
protected getUrlIndex(url: string): number;
protected isPageListEmpty(): boolean;
}