@fluidframework/map 2.0.0-internal.2.0.2 → 2.0.0-internal.2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISharedObject, ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\nimport { IDisposable, IEvent, IEventProvider, IEventThisPlaceHolder } from \"@fluidframework/common-definitions\";\n\n/**\n * Type of \"valueChanged\" event parameter.\n */\nexport interface IValueChanged {\n /**\n * The key storing the value that changed.\n */\n key: string;\n\n /**\n * The value that was stored at the key prior to the change.\n */\n previousValue: any;\n}\n\n/**\n * Interface describing actions on a directory.\n *\n * @remarks\n * When used as a Map, operates on its keys.\n */\nexport interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {\n /**\n * The absolute path of the directory.\n */\n readonly absolutePath: string;\n\n /**\n * Retrieves the value stored at the given key from the directory.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set at\n * @param value - Value to set\n * @returns The IDirectory itself\n */\n set<T = any>(key: string, value: T): this;\n\n /**\n * Get the number of sub directory within the directory.\n * @returns The number of sub directory within a directory.\n */\n countSubDirectory?(): number;\n\n /**\n * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the\n * same name already exists.\n * @param subdirName - Name of the new child directory to create\n * @returns The IDirectory child that was created or retrieved\n */\n createSubDirectory(subdirName: string): IDirectory;\n\n /**\n * Gets an IDirectory child of this IDirectory, if it exists.\n * @param subdirName - Name of the child directory to get\n * @returns The requested IDirectory\n */\n getSubDirectory(subdirName: string): IDirectory | undefined;\n\n /**\n * Checks whether this directory has a child directory with the given name.\n * @param subdirName - Name of the child directory to check\n * @returns True if it exists, false otherwise\n */\n hasSubDirectory(subdirName: string): boolean;\n\n /**\n * Deletes an IDirectory child of this IDirectory, if it exists, along with all descendent keys and directories.\n * @param subdirName - Name of the child directory to delete\n * @returns True if the IDirectory existed and was deleted, false if it did not exist\n */\n deleteSubDirectory(subdirName: string): boolean;\n\n /**\n * Gets an iterator over the IDirectory children of this IDirectory.\n * @returns The IDirectory iterator\n */\n subdirectories(): IterableIterator<[string, IDirectory]>;\n\n /**\n * Get an IDirectory within the directory, in order to use relative paths from that location.\n * @param relativePath - Path of the IDirectory to get, relative to this IDirectory\n * @returns The requested IDirectory\n */\n getWorkingDirectory(relativePath: string): IDirectory | undefined;\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n * These events only emit on the {@link ISharedDirectory} itself, and not on subdirectories.\n */\nexport interface ISharedDirectoryEvents extends ISharedObjectEvents {\n /**\n * Emitted when a key is set or deleted. This is emitted for any key in the {@link ISharedDirectory} or any\n * subdirectory.\n *\n * @remarks Listener parameters:\n *\n * - `changed` - Information on the key that changed, its value prior to the change, and the path to the\n * key that changed.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"valueChanged\", listener: (\n changed: IDirectoryValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when the {@link ISharedDirectory} is cleared.\n *\n * @remarks Listener parameters:\n *\n * - `local` - Whether the clear originated from this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is created.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is created.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the create originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is deleted.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is deleted.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the delete originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n (event: \"subDirectoryDeleted\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n */\nexport interface IDirectoryEvents extends IEvent {\n /**\n * Emitted when a key is set or deleted. As opposed to the\n * {@link SharedDirectory}'s valueChanged event, this is emitted only on the {@link IDirectory} that directly\n * contains the key.\n *\n * @remarks Listener parameters:\n *\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The {@link IDirectory} itself.\n */\n (event: \"containedValueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is created.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is created.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the creation originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is deleted.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is deleted.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the delete originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n (event: \"subDirectoryDeleted\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when this sub directory is deleted.\n *\n * @remarks Listener parameters:\n *\n * - `target` - The {@link IDirectory} itself.\n */\n (event: \"disposed\", listener: (\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Provides a hierarchical organization of map-like data structures as SubDirectories.\n * The values stored within can be accessed like a map, and the hierarchy can be navigated using path syntax.\n * SubDirectories can be retrieved for use as working directories.\n */\nexport interface ISharedDirectory extends\n ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,\n Omit<IDirectory, \"on\" | \"once\" | \"off\"> {\n // The Omit type excludes symbols, which we don't want to exclude. Adding them back here manually.\n // https://github.com/microsoft/TypeScript/issues/31671\n [Symbol.iterator](): IterableIterator<[string, any]>;\n readonly [Symbol.toStringTag]: string;\n}\n\n/**\n * Type of \"valueChanged\" event parameter for {@link ISharedDirectory}\n */\nexport interface IDirectoryValueChanged extends IValueChanged {\n /**\n * The absolute path to the IDirectory storing the key which changed.\n */\n path: string;\n}\n\n/**\n * Events emitted in response to changes to the {@link ISharedMap | map} data.\n */\nexport interface ISharedMapEvents extends ISharedObjectEvents {\n /**\n * Emitted when a key is set or deleted.\n *\n * @remarks Listener parameters:\n *\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The {@link ISharedMap} itself.\n */\n (event: \"valueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n\n /**\n * Emitted when the map is cleared.\n *\n * @remarks Listener parameters:\n *\n * - `local` - Whether the clear originated from this client.\n *\n * - `target` - The {@link ISharedMap} itself.\n */\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n}\n\n/**\n * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting\n * and retrieving values that JavaScript developers are accustomed to with the\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.\n * However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a\n * {@link @fluidframework/shared-object-base#SharedObjectHandle}.\n *\n * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.\n */\nexport interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {\n /**\n * Retrieves the given key from the map if it exists.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set\n * @param value - Value to set\n * @returns The {@link ISharedMap} itself\n */\n set<T = any>(key: string, value: T): this;\n}\n\n/**\n * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use\n * {@link ISerializableValue.\"type\"} to understand whether they're storing a Plain JavaScript object,\n * a {@link @fluidframework/shared-object-base#SharedObject}, or a value type.\n *\n * @remarks\n *\n * Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with\n * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to\n * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)\n * and ops (set).\n *\n * If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will\n * just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members\n * that are ISerializedHandle (the serialized form of a handle).\n *\n * If type is a value type then it must be amongst the types registered via registerValueType or we won't know how\n * to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent.\n * If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a\n * channel ID.\n *\n * @deprecated This type is legacy and deprecated.\n */\nexport interface ISerializableValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * The JSONable representation of the value.\n */\n value: any;\n}\n\n/**\n * Serialized {@link ISerializableValue} counterpart.\n */\nexport interface ISerializedValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * String representation of the value.\n *\n * @remarks Will be undefined if the original value was undefined.\n */\n value: string | undefined;\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISharedObject, ISharedObjectEvents } from \"@fluidframework/shared-object-base\";\nimport { IDisposable, IEvent, IEventProvider, IEventThisPlaceHolder } from \"@fluidframework/common-definitions\";\n\n/**\n * Type of \"valueChanged\" event parameter.\n */\nexport interface IValueChanged {\n /**\n * The key storing the value that changed.\n */\n key: string;\n\n /**\n * The value that was stored at the key prior to the change.\n */\n previousValue: any;\n}\n\n/**\n * Interface describing actions on a directory.\n *\n * @remarks\n * When used as a Map, operates on its keys.\n */\nexport interface IDirectory extends Map<string, any>, IEventProvider<IDirectoryEvents>, Partial<IDisposable> {\n /**\n * The absolute path of the directory.\n */\n readonly absolutePath: string;\n\n /**\n * Retrieves the value stored at the given key from the directory.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set at\n * @param value - Value to set\n * @returns The IDirectory itself\n */\n set<T = any>(key: string, value: T): this;\n\n /**\n * Get the number of sub directory within the directory.\n * @returns The number of sub directory within a directory.\n */\n countSubDirectory?(): number;\n\n /**\n * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the\n * same name already exists.\n * @param subdirName - Name of the new child directory to create\n * @returns The IDirectory child that was created or retrieved\n */\n createSubDirectory(subdirName: string): IDirectory;\n\n /**\n * Gets an IDirectory child of this IDirectory, if it exists.\n * @param subdirName - Name of the child directory to get\n * @returns The requested IDirectory\n */\n getSubDirectory(subdirName: string): IDirectory | undefined;\n\n /**\n * Checks whether this directory has a child directory with the given name.\n * @param subdirName - Name of the child directory to check\n * @returns True if it exists, false otherwise\n */\n hasSubDirectory(subdirName: string): boolean;\n\n /**\n * Deletes an IDirectory child of this IDirectory, if it exists, along with all descendent keys and directories.\n * @param subdirName - Name of the child directory to delete\n * @returns True if the IDirectory existed and was deleted, false if it did not exist\n */\n deleteSubDirectory(subdirName: string): boolean;\n\n /**\n * Gets an iterator over the IDirectory children of this IDirectory.\n * @returns The IDirectory iterator\n */\n subdirectories(): IterableIterator<[string, IDirectory]>;\n\n /**\n * Get an IDirectory within the directory, in order to use relative paths from that location.\n * @param relativePath - Path of the IDirectory to get, relative to this IDirectory\n * @returns The requested IDirectory\n */\n getWorkingDirectory(relativePath: string): IDirectory | undefined;\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n * These events only emit on the {@link ISharedDirectory} itself, and not on subdirectories.\n */\nexport interface ISharedDirectoryEvents extends ISharedObjectEvents {\n /**\n * Emitted when a key is set or deleted. This is emitted for any key in the {@link ISharedDirectory} or any\n * subdirectory.\n *\n * @remarks Listener parameters:\n *\n * - `changed` - Information on the key that changed, its value prior to the change, and the path to the\n * key that changed.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"valueChanged\", listener: (\n changed: IDirectoryValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when the {@link ISharedDirectory} is cleared.\n *\n * @remarks Listener parameters:\n *\n * - `local` - Whether the clear originated from this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is created.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is created.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the create originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is deleted.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is deleted.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the delete originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n (event: \"subDirectoryDeleted\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n */\nexport interface IDirectoryEvents extends IEvent {\n /**\n * Emitted when a key is set or deleted. As opposed to the\n * {@link SharedDirectory}'s valueChanged event, this is emitted only on the {@link IDirectory} that directly\n * contains the key.\n *\n * @remarks Listener parameters:\n *\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The {@link IDirectory} itself.\n */\n (event: \"containedValueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is created.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is created.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the creation originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when a subdirectory is deleted.\n *\n * @remarks Listener parameters:\n *\n * - `path` - The relative path to the subdirectory that is deleted.\n * It is relative from the object which raises the event.\n *\n * - `local` - Whether the delete originated from the this client.\n *\n * - `target` - The {@link ISharedDirectory} itself.\n */\n // eslint-disable-next-line @typescript-eslint/unified-signatures\n (event: \"subDirectoryDeleted\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n\n /**\n * Emitted when this sub directory is deleted.\n *\n * @remarks Listener parameters:\n *\n * - `target` - The {@link IDirectory} itself.\n */\n (event: \"disposed\", listener: (\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Provides a hierarchical organization of map-like data structures as SubDirectories.\n * The values stored within can be accessed like a map, and the hierarchy can be navigated using path syntax.\n * SubDirectories can be retrieved for use as working directories.\n */\nexport interface ISharedDirectory extends\n ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,\n Omit<IDirectory, \"on\" | \"once\" | \"off\"> {\n // The Omit type excludes symbols, which we don't want to exclude. Adding them back here manually.\n // https://github.com/microsoft/TypeScript/issues/31671\n [Symbol.iterator](): IterableIterator<[string, any]>;\n readonly [Symbol.toStringTag]: string;\n}\n\n/**\n * Type of \"valueChanged\" event parameter for {@link ISharedDirectory}\n */\nexport interface IDirectoryValueChanged extends IValueChanged {\n /**\n * The absolute path to the IDirectory storing the key which changed.\n */\n path: string;\n}\n\n/**\n * Events emitted in response to changes to the {@link ISharedMap | map} data.\n */\nexport interface ISharedMapEvents extends ISharedObjectEvents {\n /**\n * Emitted when a key is set or deleted.\n *\n * @remarks Listener parameters:\n *\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from this client.\n *\n * - `target` - The {@link ISharedMap} itself.\n */\n (event: \"valueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n\n /**\n * Emitted when the map is cleared.\n *\n * @remarks Listener parameters:\n *\n * - `local` - Whether the clear originated from this client.\n *\n * - `target` - The {@link ISharedMap} itself.\n */\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n}\n\n/**\n * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting\n * and retrieving values that JavaScript developers are accustomed to with the\n * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.\n * However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a\n * {@link @fluidframework/datastore#FluidObjectHandle}.\n *\n * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.\n */\nexport interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {\n /**\n * Retrieves the given key from the map if it exists.\n * @param key - Key to retrieve from\n * @returns The stored value, or undefined if the key is not set\n */\n get<T = any>(key: string): T | undefined;\n\n /**\n * Sets the value stored at key to the provided value.\n * @param key - Key to set\n * @param value - Value to set\n * @returns The {@link ISharedMap} itself\n */\n set<T = any>(key: string, value: T): this;\n}\n\n/**\n * The _ready-for-serialization_ format of values contained in DDS contents. This allows us to use\n * {@link ISerializableValue.\"type\"} to understand whether they're storing a Plain JavaScript object,\n * a {@link @fluidframework/shared-object-base#SharedObject}, or a value type.\n *\n * @remarks\n *\n * Note that the in-memory equivalent of ISerializableValue is ILocalValue (similarly holding a type, but with\n * the _in-memory representation_ of the value instead). An ISerializableValue is what gets passed to\n * JSON.stringify and comes out of JSON.parse. This format is used both for snapshots (loadCore/populate)\n * and ops (set).\n *\n * If type is Plain, it must be a plain JS object that can survive a JSON.stringify/parse. E.g. a URL object will\n * just get stringified to a URL string and not rehydrate as a URL object on the other side. It may contain members\n * that are ISerializedHandle (the serialized form of a handle).\n *\n * If type is a value type then it must be amongst the types registered via registerValueType or we won't know how\n * to serialize/deserialize it (we rely on its factory via .load() and .store()). Its value will be type-dependent.\n * If type is Shared, then the in-memory value will just be a reference to the SharedObject. Its value will be a\n * channel ID.\n *\n * @deprecated This type is legacy and deprecated.\n */\nexport interface ISerializableValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * The JSONable representation of the value.\n */\n value: any;\n}\n\n/**\n * Serialized {@link ISerializableValue} counterpart.\n */\nexport interface ISerializedValue {\n /**\n * A type annotation to help indicate how the value serializes.\n */\n type: string;\n\n /**\n * String representation of the value.\n *\n * @remarks Will be undefined if the original value was undefined.\n */\n value: string | undefined;\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/map";
8
- export declare const pkgVersion = "2.0.0-internal.2.0.2";
8
+ export declare const pkgVersion = "2.0.0-internal.2.1.0";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -8,5 +8,5 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.pkgVersion = exports.pkgName = void 0;
10
10
  exports.pkgName = "@fluidframework/map";
11
- exports.pkgVersion = "2.0.0-internal.2.0.2";
11
+ exports.pkgVersion = "2.0.0-internal.2.1.0";
12
12
  //# sourceMappingURL=packageVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,qBAAqB,CAAC;AAChC,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/map\";\nexport const pkgVersion = \"2.0.0-internal.2.0.2\";\n"]}
1
+ {"version":3,"file":"packageVersion.js","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,OAAO,GAAG,qBAAqB,CAAC;AAChC,QAAA,UAAU,GAAG,sBAAsB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/map\";\nexport const pkgVersion = \"2.0.0-internal.2.1.0\";\n"]}
@@ -382,7 +382,7 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
382
382
  /**
383
383
  * @internal
384
384
  */
385
- protected applyStashedOp(): void;
385
+ protected applyStashedOp(op: any): unknown;
386
386
  private serializeDirectory;
387
387
  }
388
388
  //# sourceMappingURL=directory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../src/directory.ts"],"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AAM,EAAE,UAAU,CAAC,CAAC;IAI/D;;OAEG;IACI,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAiBxE;;;OAGG;IACH,SAAS,CAAC,aAAa,CACnB,UAAU,EAAE,gBAAgB,EAC5B,gBAAgB,CAAC,EAAE,iBAAiB,GACrC,qBAAqB;IAIxB;;;;;;OAMG;IACI,sBAAsB,CAAC,EAAE,EAAE,mBAAmB,EAAE,eAAe,EAAE,OAAO;IAI/E;;;OAGG;IACH,SAAS,CAAC,YAAY;IAEtB;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAO7D;;;OAGG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB;IAgBxD;;;;OAIG;IACH,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,oBAAoB;IAmC7C;;;OAGG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,GAAG,IAAI;IASzG;;;MAGE;IACF,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAQzD;;;OAGG;IACH,OAAO,CAAC,YAAY;IAIpB;;;;;;;;;OASG;IACH,OAAO,CAAC,SAAS;IAYjB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA8H1B;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,EAAE,KAAA;IAQ3B,OAAO,CAAC,kBAAkB;CAiE7B"}
package/lib/directory.js CHANGED
@@ -412,6 +412,12 @@ export class SharedDirectory extends SharedObject {
412
412
  subdir.resubmitClearMessage(op, localOpMetadata);
413
413
  }
414
414
  },
415
+ applyStashedOp: (op) => {
416
+ const subdir = this.getWorkingDirectory(op.path);
417
+ if (subdir) {
418
+ return subdir.applyStashedClearMessage(op);
419
+ }
420
+ },
415
421
  });
416
422
  this.messageHandlers.set("delete", {
417
423
  process: (op, local, localOpMetadata) => {
@@ -426,6 +432,12 @@ export class SharedDirectory extends SharedObject {
426
432
  subdir.resubmitKeyMessage(op, localOpMetadata);
427
433
  }
428
434
  },
435
+ applyStashedOp: (op) => {
436
+ const subdir = this.getWorkingDirectory(op.path);
437
+ if (subdir) {
438
+ return subdir.applyStashedDeleteMessage(op);
439
+ }
440
+ },
429
441
  });
430
442
  this.messageHandlers.set("set", {
431
443
  process: (op, local, localOpMetadata) => {
@@ -441,6 +453,13 @@ export class SharedDirectory extends SharedObject {
441
453
  subdir.resubmitKeyMessage(op, localOpMetadata);
442
454
  }
443
455
  },
456
+ applyStashedOp: (op) => {
457
+ const subdir = this.getWorkingDirectory(op.path);
458
+ if (subdir) {
459
+ const context = this.makeLocal(op.key, op.path, op.value);
460
+ return subdir.applyStashedSetMessage(op, context);
461
+ }
462
+ },
444
463
  });
445
464
  this.messageHandlers.set("createSubDirectory", {
446
465
  process: (op, local, localOpMetadata) => {
@@ -456,6 +475,13 @@ export class SharedDirectory extends SharedObject {
456
475
  parentSubdir.resubmitSubDirectoryMessage(op, localOpMetadata);
457
476
  }
458
477
  },
478
+ // eslint-disable-next-line max-len
479
+ applyStashedOp: (op) => {
480
+ const parentSubdir = this.getWorkingDirectory(op.path);
481
+ if (parentSubdir) {
482
+ return parentSubdir.applyStashedCreateSubDirMessage(op);
483
+ }
484
+ },
459
485
  });
460
486
  this.messageHandlers.set("deleteSubDirectory", {
461
487
  process: (op, local, localOpMetadata) => {
@@ -471,13 +497,24 @@ export class SharedDirectory extends SharedObject {
471
497
  parentSubdir.resubmitSubDirectoryMessage(op, localOpMetadata);
472
498
  }
473
499
  },
500
+ // eslint-disable-next-line max-len
501
+ applyStashedOp: (op) => {
502
+ const parentSubdir = this.getWorkingDirectory(op.path);
503
+ if (parentSubdir) {
504
+ return parentSubdir.applyStashedDeleteSubDirMessage(op);
505
+ }
506
+ },
474
507
  });
475
508
  }
476
509
  /**
477
510
  * @internal
478
511
  */
479
- applyStashedOp() {
480
- throw new Error("not implemented");
512
+ applyStashedOp(op) {
513
+ const handler = this.messageHandlers.get(op.type);
514
+ if (handler === undefined) {
515
+ throw new Error("no apply stashed op handler");
516
+ }
517
+ return handler.applyStashedOp(op);
481
518
  }
482
519
  serializeDirectory(root, serializer, telemetryContext) {
483
520
  const MinValueSizeSeparateSnapshotBlob = 8 * 1024;
@@ -876,7 +913,25 @@ class SubDirectory extends TypedEventEmitter {
876
913
  assert(pendingClearMessageId === localOpMetadata.pendingMessageId, 0x32a /* pendingMessageId does not match */);
877
914
  return;
878
915
  }
879
- this.clearExceptPendingKeys();
916
+ this.clearExceptPendingKeys(false);
917
+ }
918
+ /**
919
+ * Apply clear operation locally and generate metadata
920
+ * @param op - Op to apply
921
+ * @returns metadata generated for stahed op
922
+ */
923
+ applyStashedClearMessage(op) {
924
+ this.throwIfDisposed();
925
+ const previousValue = new Map(this._storage);
926
+ this.clearExceptPendingKeys(true);
927
+ const pendingMsgId = ++this.pendingMessageId;
928
+ this.pendingClearMessageIds.push(pendingMsgId);
929
+ const metadata = {
930
+ type: "clear",
931
+ pendingMessageId: pendingMsgId,
932
+ previousStorage: previousValue,
933
+ };
934
+ return metadata;
880
935
  }
881
936
  /**
882
937
  * Process a delete operation.
@@ -893,6 +948,18 @@ class SubDirectory extends TypedEventEmitter {
893
948
  }
894
949
  this.deleteCore(op.key, local);
895
950
  }
951
+ /**
952
+ * Apply delete operation locally and generate metadata
953
+ * @param op - Op to apply
954
+ * @returns metadata generated for stahed op
955
+ */
956
+ applyStashedDeleteMessage(op) {
957
+ this.throwIfDisposed();
958
+ const previousValue = this.deleteCore(op.key, true);
959
+ const pendingMessageId = this.getKeyMessageId(op);
960
+ const localMetadata = { type: "edit", pendingMessageId, previousValue };
961
+ return localMetadata;
962
+ }
896
963
  /**
897
964
  * Process a set operation.
898
965
  * @param op - The op to process
@@ -911,6 +978,20 @@ class SubDirectory extends TypedEventEmitter {
911
978
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
912
979
  this.setCore(op.key, context, local);
913
980
  }
981
+ /**
982
+ * Apply set operation locally and generate metadata
983
+ * @param op - Op to apply
984
+ * @returns metadata generated for stahed op
985
+ */
986
+ applyStashedSetMessage(op, context) {
987
+ this.throwIfDisposed();
988
+ // Set the value locally.
989
+ const previousValue = this.setCore(op.key, context, true);
990
+ // Create metadata
991
+ const pendingMessageId = this.getKeyMessageId(op);
992
+ const localMetadata = { type: "edit", pendingMessageId, previousValue };
993
+ return localMetadata;
994
+ }
914
995
  /**
915
996
  * Process a create subdirectory operation.
916
997
  * @param op - The op to process
@@ -926,6 +1007,23 @@ class SubDirectory extends TypedEventEmitter {
926
1007
  }
927
1008
  this.createSubDirectoryCore(op.subdirName, local);
928
1009
  }
1010
+ /**
1011
+ * Apply createSubDirectory operation locally and generate metadata
1012
+ * @param op - Op to apply
1013
+ * @returns metadata generated for stahed op
1014
+ */
1015
+ applyStashedCreateSubDirMessage(op) {
1016
+ this.throwIfDisposed();
1017
+ // Create the sub directory locally first.
1018
+ const isNew = this.createSubDirectoryCore(op.subdirName, true);
1019
+ const newMessageId = this.getSubDirMessageId(op);
1020
+ const localOpMetadata = {
1021
+ type: "createSubDir",
1022
+ pendingMessageId: newMessageId,
1023
+ previouslyExisted: !isNew,
1024
+ };
1025
+ return localOpMetadata;
1026
+ }
929
1027
  /**
930
1028
  * Process a delete subdirectory operation.
931
1029
  * @param op - The op to process
@@ -941,6 +1039,22 @@ class SubDirectory extends TypedEventEmitter {
941
1039
  }
942
1040
  this.deleteSubDirectoryCore(op.subdirName, local);
943
1041
  }
1042
+ /**
1043
+ * Apply deleteSubDirectory operation locally and generate metadata
1044
+ * @param op - Op to apply
1045
+ * @returns metadata generated for stahed op
1046
+ */
1047
+ applyStashedDeleteSubDirMessage(op) {
1048
+ this.throwIfDisposed();
1049
+ const subDir = this.deleteSubDirectoryCore(op.subdirName, true);
1050
+ const newMessageId = this.getSubDirMessageId(op);
1051
+ const metadata = {
1052
+ type: "deleteSubDir",
1053
+ pendingMessageId: newMessageId,
1054
+ subDirectory: subDir,
1055
+ };
1056
+ return metadata;
1057
+ }
944
1058
  /**
945
1059
  * Submit a clear operation.
946
1060
  * @param op - The operation
@@ -1257,7 +1371,7 @@ class SubDirectory extends TypedEventEmitter {
1257
1371
  /**
1258
1372
  * Clear all keys in memory in response to a remote clear, but retain keys we have modified but not yet been ack'd.
1259
1373
  */
1260
- clearExceptPendingKeys() {
1374
+ clearExceptPendingKeys(local) {
1261
1375
  // Assuming the pendingKeys is small and the map is large
1262
1376
  // we will get the value for the pendingKeys and clear the map
1263
1377
  const temp = new Map();
@@ -1265,7 +1379,7 @@ class SubDirectory extends TypedEventEmitter {
1265
1379
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1266
1380
  temp.set(key, this._storage.get(key));
1267
1381
  });
1268
- this.clearCore(false);
1382
+ this.clearCore(local);
1269
1383
  temp.forEach((value, key, map) => {
1270
1384
  this.setCore(key, value, true);
1271
1385
  });