@ks89/angular-modal-gallery
Version:
Image gallery for Angular
26 lines (25 loc) • 1.33 kB
TypeScript
import * as i0 from "@angular/core";
/**
* Service to check if the provided id is unique
*/
export declare class IdValidatorService {
ids: Map<any, any>;
/**
* Method to check and reserve an id for the current instance of the library.
* In this way, no other instances can use the same id.
* @param galleryId number or undefined that represents the unique id of the gallery.
* @return boolean true if success. false is never returned, instead an exception is thrown
* @throws a error with a message if galleryId is neither unique, < 0 or an integer
*/
checkAndAdd(galleryId: number | undefined): boolean;
/**
* Method to remove a reserved id. In this way you are able to use the id again for another instance of the library.
* @param galleryId number or undefined that represents the unique id of the gallery.
* @return boolean true if success. false is never returned, instead an exception is thrown*
* @throws a error with a message if galleryId is neither integer or < 0
* * this should be improved without return true, because it doesn't make sense! :(
*/
remove(galleryId: number | undefined): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<IdValidatorService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<IdValidatorService>;
}