import { ProtectableMapView } from './ProtectableMapView' ; /**
 * Constructor parameters for  ProtectableMap public export interface IProtectableMapParameters < K , V > { /**
     * An optional hook that will be invoked before Map.clear() is performed.
     */ onClear ? : ( source : ProtectableMap < K , V > ) => void ; /**
     * An optional hook that will be invoked before Map.delete() is performed.
     */ onDelete ? : ( source : ProtectableMap < K , V > , key : K ) => void ; remarks onSet ? : ( source : ProtectableMap < K , V > , key : K , value : V ) => V ; } remarks The ProtectableMap itself is intended to be a private object that only its owner
 * can access directly.  Any operations performed directly on the ProtectableMap will
 * bypass the hooks and any validation they perform.  The public property that is exposed
 * to API consumers should return  ProtectableMap . protectedView instead.
 *
 * For example, suppose you want to share your `Map<string, number>` data structure,
 * but you want to enforce that the key must always be an upper case string:
 * You could use the onSet() hook to validate the keys and throw an exception
 * if the key is not uppercase.
 *
 *  public export class ProtectableMap < K , V > { private readonly _protectedView : ProtectableMapView < K , V > ; public constructor ( parameters ) { this . _protectedView = new ProtectableMapView < K , V > ( this , parameters ) ; } /**
     * The owner of the protectable map should return this object via its public API.
     */ public get protectedView ( ) : Map < K , V > { return this . _protectedView ; } /**
     * Removes all entries from the map.
     * This operation does NOT invoke the ProtectableMap onClear() hook.
     */ public clear ( ) { this . _protectedView . _clearUnprotected ( ) ; } /**
     * Removes the specified key from the map.
     * This operation does NOT invoke the ProtectableMap onDelete() hook.
     */ public delete ( key ) { return this . _protectedView . _deleteUnprotected ( key ) ; } /**
     * Sets a value for the specified key.
     * This operation does NOT invoke the ProtectableMap onSet() hook.
     */ public set ( key , value ) { this . _protectedView . _setUnprotected ( key , value ) ; return this ; } /**
     * Performs an operation for each (key, value) entries in the map.
     */ public forEach ( callbackfn , thisArg ? ) { this . _protectedView . forEach ( callbackfn ) ; } returns public get ( key ) { return this . _protectedView . get ( key ) ; } /**
     * Returns true if the specified key belongs to the map.
     */ public has ( key ) { return this . _protectedView . has ( key ) ; } /**
     * Returns the number of (key, value) entries in the map.
     */ public get size ( ) : number { return this . _protectedView . size ; } }