/** * @slynova/fence * * @license MIT * @copyright Slynova - Romain Lanz */ import { TGate } from '../Contracts'; declare class Storage { /** * Storage where all the gates reside. */ private $gates; /** * Storage where all the polices reside. */ private $policies; /** * Constructor. */ private constructor(); /** * Returns the unique instance of the storage. */ static readonly instance: Storage; /** * Retrieves a gate with the given name. * * @param name Name of the gate */ retrieveGate(name: string): TGate | undefined; /** * Retrieves a policy with the given resource. * * @param resource Name of the resource */ retrievePolicy(resource: string): object | undefined; /** * Stores a gate inside the storage. * * @param name Name of the gate * @param callback Gate */ storeGate(name: string, callback: TGate): void; /** * Stores a policy inside the storage. * * @param resource Name of the resource * @param policy Policy for the given resource */ storePolicy(resource: string, policy: object): void; /** * Resets the state of the storage. */ private $reset; } export { Storage };