File

src/modules/progress-indicator/services/progress-indicator.service.intf.ts

Description

Service to handle the visibility of a progress indicator (e.g., spinner, progress percentage, ...) programmatically.

Index

Methods

Methods

deregister
deregister(topic: string)

Deregisters a progress indicator already existing in the application state.

Parameters :
Name Type Optional Description
topic string No
  • The topic of the progress indicator to be deregistered
Returns : void
hide
hide(topic: string)

Hides the progress indicator.

Parameters :
Name Type Optional Description
topic string No
  • The topic that needs to be hidden
Returns : void
isVisible
isVisible(topic: string)

Returns the latest status of the progress indicator for the given topic (whether is shown or hidden). true if it is shown or undefined in case there is no progress indicator for the given topic.

Parameters :
Name Type Optional Description
topic string No
  • The topic of the progress indicator whose status will be fetched.
Returns : Observable<boolean | undefined>

Observable that will emit a boolean value whenever the status of the progress indicator changes: false if it is hidden, true if it is shown or undefined in case there is no progress indicator for the given topic.

register
register(topic: string, type: StarkProgressIndicatorType)

Registers a new progress indicator in the application state. Each registered progress indicator is identified by a topic, a unique identifier associated with it.

Parameters :
Name Type Optional Description
topic string No
  • The topic of the progress indicator to be registered.
type StarkProgressIndicatorType No
  • Type of progress indicator (i.e. spinner)
Returns : void
show
show(topic: string)

Shows the designated progress indicator

Parameters :
Name Type Optional Description
topic string No
  • The topic that needs to be shown
Returns : void
import { Observable } from "rxjs";
import { StarkProgressIndicatorType } from "../entities";
import { InjectionToken } from "@angular/core";

/**
 * @ignore
 */
export const starkProgressIndicatorServiceName = "StarkProgressIndicatorService";
/**
 * {@link https://v12.angular.io/api/core/InjectionToken|InjectionToken} used to provide the {@link StarkProgressIndicatorService}
 */
export const STARK_PROGRESS_INDICATOR_SERVICE: InjectionToken<StarkProgressIndicatorService> =
	new InjectionToken<StarkProgressIndicatorService>(starkProgressIndicatorServiceName);

/**
 * Service to handle the visibility of a progress indicator (e.g., spinner, progress percentage, ...) programmatically.
 */
export interface StarkProgressIndicatorService {
	/**
	 * Registers a new progress indicator in the application state. Each registered progress indicator is identified by a topic,
	 * a unique identifier associated with it.
	 * @param topic - The topic of the progress indicator to be registered.
	 * @param type - Type of progress indicator (i.e. spinner)
	 */
	register(topic: string, type: StarkProgressIndicatorType): void;

	/**
	 * Deregisters a progress indicator already existing in the application state.
	 * @param topic - The topic of the progress indicator to be deregistered
	 */
	deregister(topic: string): void;

	/**
	 * Shows the designated progress indicator
	 * @param topic - The topic that needs to be shown
	 */
	show(topic: string): void;

	/**
	 * Hides the progress indicator.
	 * @param topic - The topic that needs to be hidden
	 */
	hide(topic: string): void;

	/**
	 * Returns the latest status of the progress indicator for the given topic (whether is shown or hidden).
	 * @param topic - The topic of the progress indicator whose status will be fetched.
	 * @returns Observable that will emit a boolean value whenever the status of the progress indicator changes: `false` if it is hidden,
	 * `true` if it is shown or `undefined` in case there is no progress indicator for the given topic.
	 */
	isVisible(topic: string): Observable<boolean | undefined>;
}

results matching ""

    No results matching ""