@fluidframework/map 1.0.1 → 1.1.0-75972

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. These events only emit on the ISharedDirectory itself,\n * and not on subdirectories.\n *\n * ### \"valueChanged\"\n *\n * The valueChanged event is emitted when a key is set or deleted. This is emitted for any key in the ISharedDirectory\n * or any subdirectory.\n *\n * #### Listener signature\n *\n * ```typescript\n * (\n * changed: IDirectoryValueChanged,\n * local: boolean,\n * target: IEventThisPlaceHolder,\n * ) => void\n * ```\n * - `changed` - Information on the key that changed, its value prior to the change, and the path to the key that\n * changed.\n *\n * - `local` - Whether the change originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"clear\"\n *\n * The clear event is emitted when the ISharedDirectory is cleared.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"subDirectoryCreated\"\n *\n * The subDirectoryCreated event is emitted when a subdirectory is created.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the key that is created.It is relative from the object which raises the event.\n *\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * * ### \"subDirectoryDeleted\"\n *\n * The subDirectoryDeleted event is emitted when a subdirectory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the key that is deleted.It is relative from the object which raises the event.\n *\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n */\nexport interface ISharedDirectoryEvents extends ISharedObjectEvents {\n (event: \"valueChanged\", listener: (\n changed: IDirectoryValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\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 *\n * ### \"containedValueChanged\"\n *\n * The containedValueChanged event is emitted when a key is set or deleted. As opposed to the SharedDirectory's\n * valueChanged event, this is emitted only on the IDirectory that directly contains the key.\n *\n * #### Listener signature\n *\n * ```typescript\n * (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from the this client.\n *\n *\n * - `target` - The IDirectory itself.\n * ### \"subDirectoryCreated\"\n *\n * The subDirectoryCreated event is emitted when a subdirectory is created.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the key that is created. It is relative from the object which raises the event.\n *\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * * ### \"subDirectoryDeleted\"\n *\n * The subDirectoryDeleted event is emitted when a subdirectory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `path` - The relative path to the key that is deleted. It is relative from the object which raises the event.\n *\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"disposed\"\n *\n * The dispose event is emitted when this sub directory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n *\n * - `target` - The IDirectory itself.\n */\nexport interface IDirectoryEvents extends IEvent {\n (event: \"containedValueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\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 (event: \"disposed\", listener: (\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Interface describing a shared directory.\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 SharedDirectory\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 map data.\n *\n * ### \"valueChanged\"\n *\n * The valueChanged event is emitted when a key is set or deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (\n * changed: IValueChanged,\n * local: boolean,\n * op: ISequencedDocumentMessage | null,\n * target: IEventThisPlaceHolder,\n * ) => void\n * ```\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from the this client.\n *\n * - `op` - The op that caused the change in value.\n *\n * - `target` - The map itself.\n *\n * ### \"clear\"\n *\n * The clear event is emitted when the map is cleared.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, op: ISequencedDocumentMessage | null, target: IEventThisPlaceHolder) => void\n * ```\n * - `local` - Whether the clear originated from the this client.\n *\n * - `op` - The op that caused the clear.\n *\n * - `target` - The map itself.\n */\nexport interface ISharedMapEvents extends ISharedObjectEvents {\n (event: \"valueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder\n ) => void);\n}\n\n/**\n * Shared map interface\n */\nexport interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {\n /**\n * Retrieves the given key from the map.\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 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 * ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.\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 * 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 * 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. 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\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 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. These events only emit on the ISharedDirectory itself,\n * and not on subdirectories.\n *\n * ### \"valueChanged\"\n *\n * The valueChanged event is emitted when a key is set or deleted. This is emitted for any key in the ISharedDirectory\n * or any subdirectory.\n *\n * #### Listener signature\n *\n * ```typescript\n * (\n * changed: IDirectoryValueChanged,\n * local: boolean,\n * target: IEventThisPlaceHolder,\n * ) => void\n * ```\n * - `changed` - Information on the key that changed, its value prior to the change, and the path to the key that\n * changed.\n *\n * - `local` - Whether the change originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"clear\"\n *\n * The clear event is emitted when the ISharedDirectory is cleared.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The ISharedDirectory itself.\n *\n * ### \"subDirectoryCreated\"\n *\n * The subDirectoryCreated event is emitted when a subdirectory is created.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\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 ISharedDirectory itself.\n *\n * * ### \"subDirectoryDeleted\"\n *\n * The subDirectoryDeleted event is emitted when a subdirectory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\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 ISharedDirectory itself.\n */\nexport interface ISharedDirectoryEvents extends ISharedObjectEvents {\n (event: \"valueChanged\", listener: (\n changed: IDirectoryValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\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 *\n * ### \"containedValueChanged\"\n *\n * The containedValueChanged event is emitted when a key is set or deleted. As opposed to the SharedDirectory's\n * valueChanged event, this is emitted only on the IDirectory that directly contains the key.\n *\n * #### Listener signature\n *\n * ```typescript\n * (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from the this client.\n *\n *\n * - `target` - The IDirectory itself.\n * ### \"subDirectoryCreated\"\n *\n * The subDirectoryCreated event is emitted when a subdirectory is created.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\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 ISharedDirectory itself.\n *\n * * ### \"subDirectoryDeleted\"\n *\n * The subDirectoryDeleted event is emitted when a subdirectory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (path: string, local: boolean, target: IEventThisPlaceHolder) => void\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 ISharedDirectory itself.\n *\n * ### \"disposed\"\n *\n * The dispose event is emitted when this sub directory is deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n *\n * - `target` - The IDirectory itself.\n */\nexport interface IDirectoryEvents extends IEvent {\n (event: \"containedValueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\n (event: \"subDirectoryCreated\", listener: (\n path: string,\n local: boolean,\n target: IEventThisPlaceHolder,\n ) => void);\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 (event: \"disposed\", listener: (\n target: IEventThisPlaceHolder,\n ) => void);\n}\n\n/**\n * Interface describing a shared directory.\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 SharedDirectory\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 map data.\n *\n * ### \"valueChanged\"\n *\n * The valueChanged event is emitted when a key is set or deleted.\n *\n * #### Listener signature\n *\n * ```typescript\n * (\n * changed: IValueChanged,\n * local: boolean,\n * target: IEventThisPlaceHolder,\n * ) => void\n * ```\n * - `changed` - Information on the key that changed and its value prior to the change.\n *\n * - `local` - Whether the change originated from the this client.\n *\n * - `target` - The map itself.\n *\n * ### \"clear\"\n *\n * The clear event is emitted when the map is cleared.\n *\n * #### Listener signature\n *\n * ```typescript\n * (local: boolean, target: IEventThisPlaceHolder) => void\n * ```\n * - `local` - Whether the clear originated from the this client.\n *\n * - `target` - The map itself.\n */\nexport interface ISharedMapEvents extends ISharedObjectEvents {\n (event: \"valueChanged\", listener: (\n changed: IValueChanged,\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n (event: \"clear\", listener: (\n local: boolean,\n target: IEventThisPlaceHolder) => void);\n}\n\n/**\n * Shared map interface\n */\nexport interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {\n /**\n * Retrieves the given key from the map.\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 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 * ISerializableValue.type to understand whether they're storing a Plain JS object, a SharedObject, or a value type.\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 * 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 * 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. 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\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 value: string | undefined;\n}\n"]}
package/lib/map.d.ts CHANGED
@@ -162,5 +162,10 @@ export declare class SharedMap extends SharedObject<ISharedMapEvents> implements
162
162
  * @internal
163
163
  */
164
164
  protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
165
+ /**
166
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
167
+ * @internal
168
+ */
169
+ protected rollback(content: any, localOpMetadata: unknown): void;
165
170
  }
166
171
  //# sourceMappingURL=map.d.ts.map
package/lib/map.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAe,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAE/F,OAAO,EACH,gBAAgB,EAChB,YAAY,EACf,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACH,UAAU,EACV,gBAAgB,EACnB,MAAM,cAAc,CAAC;AAWtB;;;GAGG;AACH,qBAAa,UAAW,YAAW,eAAe;IAC9C;;OAEG;IACH,gBAAuB,IAAI,2CAA2C;IAEtE;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,WAEd;IAED;;OAEG;IACH,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CACb,OAAO,EAAE,sBAAsB,EA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AAI,WAEd;IAED;;;OAGG;IACI,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,GAAG,IAAI;IAI1F;;OAEG;IACI,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAI/C;;;;OAIG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIhC;;OAEG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAKzC;;;;OAIG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAInC;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;;OAGG;IACH,SAAS,CAAC,aAAa,CACnB,UAAU,EAAE,gBAAgB,EAC5B,gBAAgB,CAAC,EAAE,iBAAiB,GACrC,qBAAqB;IAsExB;;;OAGG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB;IAcxD;;;OAGG;IACH,SAAS,CAAC,YAAY;IAEtB;;;OAGG;IACH,SAAS,CAAC,YAAY,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;IAI7D;;;OAGG;IACH,SAAS,CAAC,cAAc,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO;IAK/C;;;OAGG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO;IAMlG;;;MAGE;IACH,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO;CAG3D"}
package/lib/map.js CHANGED
@@ -290,5 +290,12 @@ export class SharedMap extends SharedObject {
290
290
  this.kernel.tryProcessMessage(message.contents, local, localOpMetadata);
291
291
  }
292
292
  }
293
+ /**
294
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
295
+ * @internal
296
+ */
297
+ rollback(content, localOpMetadata) {
298
+ this.kernel.rollback(content, localOpMetadata);
299
+ }
293
300
  }
294
301
  //# sourceMappingURL=map.js.map
package/lib/map.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAA6B,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAS9F,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAEH,YAAY,GACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAKnE,OAAO,EAA8B,SAAS,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAO9C,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;;GAGG;AACH,MAAM,OAAO,UAAU;IAenB;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,UAAU,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACjB,OAAO,UAAU,CAAC,UAAU,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CACb,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAC9B,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEzB,OAAO,GAAG,CAAC;IACf,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACrD,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;QAC9D,GAAG,C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BAAwB,CAAC,OAAO,CAAC,CAAC;YAClD,CAAC,CAAC,CAAC,CAAC;SACP;aAAM;YACH,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAkC,CAAC,CAAC;SAC5E;IACL,CAAC;IAED;;;OAGG;IACO,YAAY,KAAI,CAAC;IAE3B;;;OAGG;IACO,YAAY,CAAC,OAAY,EAAE,eAAwB;QACzD,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACO,cAAc,CAAC,OAAY;QACjC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc,EAAE,eAAwB;QAC9F,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,SAAS,EAAE;YACxC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;SAC3E;IACL,CAAC;CACJ","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelStorageService,\n IChannelServices,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats, ITelemetryContext } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n IFluidSerializer,\n SharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils\";\nimport {\n ISharedMap,\n ISharedMapEvents,\n} from \"./interfaces\";\nimport { IMapDataObjectSerializable, MapKernel } from \"./mapKernel\";\nimport { pkgVersion } from \"./packageVersion\";\n\ninterface IMapSerializationFormat {\n blobs?: string[];\n content: IMapDataObjectSerializable;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * The factory that defines the map.\n * @sealed\n */\nexport class MapFactory implements IChannelFactory {\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public static readonly Type = \"https://graph.microsoft.com/types/map\";\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public static readonly Attributes: IChannelAttributes = {\n type: MapFactory.Type,\n snapshotFormatVersion: \"0.2\",\n packageVersion: pkgVersion,\n };\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public get type() {\n return MapFactory.Type;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public get attributes() {\n return MapFactory.Attributes;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n */\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes): Promise<ISharedMap> {\n const map = new SharedMap(id, runtime, attributes);\n await map.load(services);\n\n return map;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n */\n public create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap {\n const map = new SharedMap(id, runtime, MapFactory.Attributes);\n map.initializeLocal();\n\n return map;\n }\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.\n */\nexport class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {\n /**\n * Create a new shared map.\n * @param runtime - The data store runtime that the new shared map belongs to.\n * @param id - Optional name of the shared map.\n * @returns Newly created shared map.\n *\n * @example\n * To create a `SharedMap`, call the static create method:\n *\n * ```typescript\n * const myMap = SharedMap.create(this.runtime, id);\n * ```\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string): SharedMap {\n return runtime.createChannel(id, MapFactory.Type) as SharedMap;\n }\n\n /**\n * Get a factory for SharedMap to register with the data store.\n * @returns A factory that creates SharedMaps and loads them from storage.\n */\n public static getFactory(): IChannelFactory {\n return new MapFactory();\n }\n\n /**\n * String representation for the class.\n */\n public readonly [Symbol.toStringTag]: string = \"SharedMap\";\n\n /**\n * MapKernel which manages actual map operations.\n */\n private readonly kernel: MapKernel;\n\n /**\n * Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}.\n *\n * @param id - String identifier.\n * @param runtime - Data store runtime.\n * @param attributes - The attributes for the map.\n */\n constructor(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n ) {\n super(id, runtime, attributes, \"fluid_map_\");\n this.kernel = new MapKernel(\n this.serializer,\n this.handle,\n (op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata),\n () => this.isAttached(),\n this,\n );\n }\n\n /**\n * Get an iterator over the keys in this map.\n * @returns The iterator\n */\n public keys(): IterableIterator<string> {\n return this.kernel.keys();\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public entries(): IterableIterator<[string, any]> {\n return this.kernel.entries();\n }\n\n /**\n * Get an iterator over the values in this map.\n * @returns The iterator\n */\n public values(): IterableIterator<any> {\n return this.kernel.values();\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public [Symbol.iterator](): IterableIterator<[string, any]> {\n return this.kernel.entries();\n }\n\n /**\n * The number of key/value pairs stored in the map.\n */\n public get size() {\n return this.kernel.size;\n }\n\n /**\n * Executes the given callback on each entry in the map.\n * @param callbackFn - Callback function\n */\n public forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void {\n this.kernel.forEach(callbackFn);\n }\n\n /**\n * {@inheritDoc ISharedMap.get}\n */\n public get<T = any>(key: string): T | undefined {\n return this.kernel.get<T>(key);\n }\n\n /**\n * Check if a key exists in the map.\n * @param key - The key to check\n * @returns True if the key exists, false otherwise\n */\n public has(key: string): boolean {\n return this.kernel.has(key);\n }\n\n /**\n * {@inheritDoc ISharedMap.set}\n */\n public set(key: string, value: any): this {\n this.kernel.set(key, value);\n return this;\n }\n\n /**\n * Delete a key from the map.\n * @param key - Key to delete\n * @returns True if the key existed and was deleted, false if it did not exist\n */\n public delete(key: string): boolean {\n return this.kernel.delete(key);\n }\n\n /**\n * Clear all data from the map.\n */\n public clear(): void {\n this.kernel.clear();\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n * @internal\n */\n protected summarizeCore(\n serializer: IFluidSerializer,\n telemetryContext?: ITelemetryContext,\n ): ISummaryTreeWithStats {\n let currentSize = 0;\n let counter = 0;\n let headerBlob: IMapDataObjectSerializable = {};\n const blobs: string[] = [];\n\n const builder = new SummaryTreeBuilder();\n\n const data = this.kernel.getSerializedStorage(serializer);\n\n // If single property exceeds this size, it goes into its own blob\n const MinValueSizeSeparateSnapshotBlob = 8 * 1024;\n\n // Maximum blob size for multiple map properties\n // Should be bigger than MinValueSizeSeparateSnapshotBlob\n const MaxSnapshotBlobSize = 16 * 1024;\n\n // Partitioning algorithm:\n // 1) Split large (over MinValueSizeSeparateSnapshotBlob = 8K) properties into their own blobs.\n // Naming (across snapshots) of such blob does not have to be stable across snapshots,\n // As de-duping process (in driver) should not care about paths, only content.\n // 2) Split remaining properties into blobs of MaxSnapshotBlobSize (16K) size.\n // This process does not produce stable partitioning. This means\n // modification (including addition / deletion) of property can shift properties across blobs\n // and result in non-incremental snapshot.\n // This can be improved in the future, without being format breaking change, as loading sequence\n // loads all blobs at once and partitioning schema has no impact on that process.\n for (const key of Object.keys(data)) {\n const value = data[key];\n if (value.value && value.value.length >= MinValueSizeSeparateSnapshotBlob) {\n const blobName = `blob${counter}`;\n counter++;\n blobs.push(blobName);\n const content: IMapDataObjectSerializable = {\n [key]: {\n type: value.type,\n value: JSON.parse(value.value),\n },\n };\n builder.addBlob(blobName, JSON.stringify(content));\n } else {\n currentSize += value.type.length + 21; // Approximation cost of property header\n if (value.value) {\n currentSize += value.value.length;\n }\n\n if (currentSize > MaxSnapshotBlobSize) {\n const blobName = `blob${counter}`;\n counter++;\n blobs.push(blobName);\n builder.addBlob(blobName, JSON.stringify(headerBlob));\n headerBlob = {};\n currentSize = 0;\n }\n headerBlob[key] = {\n type: value.type,\n value: value.value === undefined ? undefined : JSON.parse(value.value),\n };\n }\n }\n\n const header: IMapSerializationFormat = {\n blobs,\n content: headerBlob,\n };\n builder.addBlob(snapshotFileName, JSON.stringify(header));\n\n return builder.getSummaryTree();\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n * @internal\n */\n protected async loadCore(storage: IChannelStorageService) {\n const json = await readAndParse<object>(storage, snapshotFileName);\n const newFormat = json as IMapSerializationFormat;\n if (Array.isArray(newFormat.blobs)) {\n this.kernel.populateFromSerializable(newFormat.content);\n await Promise.all(newFormat.blobs.map(async (value) => {\n const content = await readAndParse<IMapDataObjectSerializable>(storage, value);\n this.kernel.populateFromSerializable(content);\n }));\n } else {\n this.kernel.populateFromSerializable(json as IMapDataObjectSerializable);\n }\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n * @internal\n */\n protected onDisconnect() {}\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}\n * @internal\n */\n protected reSubmitCore(content: any, localOpMetadata: unknown) {\n this.kernel.trySubmitMessage(content, localOpMetadata);\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}\n * @internal\n */\n protected applyStashedOp(content: any): unknown {\n this.kernel.tryProcessMessage(content, false, undefined);\n return this.kernel.tryGetStashedOpLocalMetadata(content);\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n * @internal\n */\n protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) {\n if (message.type === MessageType.Operation) {\n this.kernel.tryProcessMessage(message.contents, local, localOpMetadata);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;GAGG;;AAEH,OAAO,EAA6B,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAS9F,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAEH,YAAY,GACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAKnE,OAAO,EAA8B,SAAS,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAO9C,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAElC;;;GAGG;AACH,MAAM,OAAO,UAAU;IAenB;;OAEG;IACH,IAAW,IAAI;QACX,OAAO,UAAU,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACjB,OAAO,UAAU,CAAC,UAAU,CAAC;IACjC,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CACb,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAC9B,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QACnD,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEzB,OAAO,GAAG,CAAC;IACf,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACrD,MAAM,GAAG,GAAG,IAAI,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;QAC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AM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;YAClD,CAAC,CAAC,CAAC,CAAC;SACP;aAAM;YACH,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC,IAAkC,CAAC,CAAC;SAC5E;IACL,CAAC;IAED;;;OAGG;IACO,YAAY,KAAI,CAAC;IAE3B;;;OAGG;IACO,YAAY,CAAC,OAAY,EAAE,eAAwB;QACzD,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAC3D,CAAC;IAED;;;OAGG;IACO,cAAc,CAAC,OAAY;QACjC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED;;;OAGG;IACO,WAAW,CAAC,OAAkC,EAAE,KAAc,EAAE,eAAwB;QAC9F,IAAI,OAAO,CAAC,IAAI,KAAK,WAAW,CAAC,SAAS,EAAE;YACxC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC,CAAC;SAC3E;IACL,CAAC;IAED;;;MAGE;IACO,QAAQ,CAAC,OAAY,EAAE,eAAwB;QACrD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IACnD,CAAC;CACH","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage, MessageType } from \"@fluidframework/protocol-definitions\";\nimport {\n IChannelAttributes,\n IFluidDataStoreRuntime,\n IChannelStorageService,\n IChannelServices,\n IChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats, ITelemetryContext } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n IFluidSerializer,\n SharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SummaryTreeBuilder } from \"@fluidframework/runtime-utils\";\nimport {\n ISharedMap,\n ISharedMapEvents,\n} from \"./interfaces\";\nimport { IMapDataObjectSerializable, MapKernel } from \"./mapKernel\";\nimport { pkgVersion } from \"./packageVersion\";\n\ninterface IMapSerializationFormat {\n blobs?: string[];\n content: IMapDataObjectSerializable;\n}\n\nconst snapshotFileName = \"header\";\n\n/**\n * The factory that defines the map.\n * @sealed\n */\nexport class MapFactory implements IChannelFactory {\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public static readonly Type = \"https://graph.microsoft.com/types/map\";\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public static readonly Attributes: IChannelAttributes = {\n type: MapFactory.Type,\n snapshotFormatVersion: \"0.2\",\n packageVersion: pkgVersion,\n };\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n */\n public get type() {\n return MapFactory.Type;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n */\n public get attributes() {\n return MapFactory.Attributes;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n */\n public async load(\n runtime: IFluidDataStoreRuntime,\n id: string,\n services: IChannelServices,\n attributes: IChannelAttributes): Promise<ISharedMap> {\n const map = new SharedMap(id, runtime, attributes);\n await map.load(services);\n\n return map;\n }\n\n /**\n * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n */\n public create(runtime: IFluidDataStoreRuntime, id: string): ISharedMap {\n const map = new SharedMap(id, runtime, MapFactory.Attributes);\n map.initializeLocal();\n\n return map;\n }\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.\n */\nexport class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {\n /**\n * Create a new shared map.\n * @param runtime - The data store runtime that the new shared map belongs to.\n * @param id - Optional name of the shared map.\n * @returns Newly created shared map.\n *\n * @example\n * To create a `SharedMap`, call the static create method:\n *\n * ```typescript\n * const myMap = SharedMap.create(this.runtime, id);\n * ```\n */\n public static create(runtime: IFluidDataStoreRuntime, id?: string): SharedMap {\n return runtime.createChannel(id, MapFactory.Type) as SharedMap;\n }\n\n /**\n * Get a factory for SharedMap to register with the data store.\n * @returns A factory that creates SharedMaps and loads them from storage.\n */\n public static getFactory(): IChannelFactory {\n return new MapFactory();\n }\n\n /**\n * String representation for the class.\n */\n public readonly [Symbol.toStringTag]: string = \"SharedMap\";\n\n /**\n * MapKernel which manages actual map operations.\n */\n private readonly kernel: MapKernel;\n\n /**\n * Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}.\n *\n * @param id - String identifier.\n * @param runtime - Data store runtime.\n * @param attributes - The attributes for the map.\n */\n constructor(\n id: string,\n runtime: IFluidDataStoreRuntime,\n attributes: IChannelAttributes,\n ) {\n super(id, runtime, attributes, \"fluid_map_\");\n this.kernel = new MapKernel(\n this.serializer,\n this.handle,\n (op, localOpMetadata) => this.submitLocalMessage(op, localOpMetadata),\n () => this.isAttached(),\n this,\n );\n }\n\n /**\n * Get an iterator over the keys in this map.\n * @returns The iterator\n */\n public keys(): IterableIterator<string> {\n return this.kernel.keys();\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public entries(): IterableIterator<[string, any]> {\n return this.kernel.entries();\n }\n\n /**\n * Get an iterator over the values in this map.\n * @returns The iterator\n */\n public values(): IterableIterator<any> {\n return this.kernel.values();\n }\n\n /**\n * Get an iterator over the entries in this map.\n * @returns The iterator\n */\n public [Symbol.iterator](): IterableIterator<[string, any]> {\n return this.kernel.entries();\n }\n\n /**\n * The number of key/value pairs stored in the map.\n */\n public get size() {\n return this.kernel.size;\n }\n\n /**\n * Executes the given callback on each entry in the map.\n * @param callbackFn - Callback function\n */\n public forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void {\n this.kernel.forEach(callbackFn);\n }\n\n /**\n * {@inheritDoc ISharedMap.get}\n */\n public get<T = any>(key: string): T | undefined {\n return this.kernel.get<T>(key);\n }\n\n /**\n * Check if a key exists in the map.\n * @param key - The key to check\n * @returns True if the key exists, false otherwise\n */\n public has(key: string): boolean {\n return this.kernel.has(key);\n }\n\n /**\n * {@inheritDoc ISharedMap.set}\n */\n public set(key: string, value: any): this {\n this.kernel.set(key, value);\n return this;\n }\n\n /**\n * Delete a key from the map.\n * @param key - Key to delete\n * @returns True if the key existed and was deleted, false if it did not exist\n */\n public delete(key: string): boolean {\n return this.kernel.delete(key);\n }\n\n /**\n * Clear all data from the map.\n */\n public clear(): void {\n this.kernel.clear();\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n * @internal\n */\n protected summarizeCore(\n serializer: IFluidSerializer,\n telemetryContext?: ITelemetryContext,\n ): ISummaryTreeWithStats {\n let currentSize = 0;\n let counter = 0;\n let headerBlob: IMapDataObjectSerializable = {};\n const blobs: string[] = [];\n\n const builder = new SummaryTreeBuilder();\n\n const data = this.kernel.getSerializedStorage(serializer);\n\n // If single property exceeds this size, it goes into its own blob\n const MinValueSizeSeparateSnapshotBlob = 8 * 1024;\n\n // Maximum blob size for multiple map properties\n // Should be bigger than MinValueSizeSeparateSnapshotBlob\n const MaxSnapshotBlobSize = 16 * 1024;\n\n // Partitioning algorithm:\n // 1) Split large (over MinValueSizeSeparateSnapshotBlob = 8K) properties into their own blobs.\n // Naming (across snapshots) of such blob does not have to be stable across snapshots,\n // As de-duping process (in driver) should not care about paths, only content.\n // 2) Split remaining properties into blobs of MaxSnapshotBlobSize (16K) size.\n // This process does not produce stable partitioning. This means\n // modification (including addition / deletion) of property can shift properties across blobs\n // and result in non-incremental snapshot.\n // This can be improved in the future, without being format breaking change, as loading sequence\n // loads all blobs at once and partitioning schema has no impact on that process.\n for (const key of Object.keys(data)) {\n const value = data[key];\n if (value.value && value.value.length >= MinValueSizeSeparateSnapshotBlob) {\n const blobName = `blob${counter}`;\n counter++;\n blobs.push(blobName);\n const content: IMapDataObjectSerializable = {\n [key]: {\n type: value.type,\n value: JSON.parse(value.value),\n },\n };\n builder.addBlob(blobName, JSON.stringify(content));\n } else {\n currentSize += value.type.length + 21; // Approximation cost of property header\n if (value.value) {\n currentSize += value.value.length;\n }\n\n if (currentSize > MaxSnapshotBlobSize) {\n const blobName = `blob${counter}`;\n counter++;\n blobs.push(blobName);\n builder.addBlob(blobName, JSON.stringify(headerBlob));\n headerBlob = {};\n currentSize = 0;\n }\n headerBlob[key] = {\n type: value.type,\n value: value.value === undefined ? undefined : JSON.parse(value.value),\n };\n }\n }\n\n const header: IMapSerializationFormat = {\n blobs,\n content: headerBlob,\n };\n builder.addBlob(snapshotFileName, JSON.stringify(header));\n\n return builder.getSummaryTree();\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n * @internal\n */\n protected async loadCore(storage: IChannelStorageService) {\n const json = await readAndParse<object>(storage, snapshotFileName);\n const newFormat = json as IMapSerializationFormat;\n if (Array.isArray(newFormat.blobs)) {\n this.kernel.populateFromSerializable(newFormat.content);\n await Promise.all(newFormat.blobs.map(async (value) => {\n const content = await readAndParse<IMapDataObjectSerializable>(storage, value);\n this.kernel.populateFromSerializable(content);\n }));\n } else {\n this.kernel.populateFromSerializable(json as IMapDataObjectSerializable);\n }\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n * @internal\n */\n protected onDisconnect() {}\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}\n * @internal\n */\n protected reSubmitCore(content: any, localOpMetadata: unknown) {\n this.kernel.trySubmitMessage(content, localOpMetadata);\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}\n * @internal\n */\n protected applyStashedOp(content: any): unknown {\n this.kernel.tryProcessMessage(content, false, undefined);\n return this.kernel.tryGetStashedOpLocalMetadata(content);\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n * @internal\n */\n protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown) {\n if (message.type === MessageType.Operation) {\n this.kernel.tryProcessMessage(message.contents, local, localOpMetadata);\n }\n }\n\n /**\n * {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}\n * @internal\n */\n protected rollback(content: any, localOpMetadata: unknown) {\n this.kernel.rollback(content, localOpMetadata);\n }\n}\n"]}
@@ -93,10 +93,9 @@ export declare class MapKernel {
93
93
  */
94
94
  private pendingMessageId;
95
95
  /**
96
- * If a clear has been performed locally but not yet ack'd from the server, then this stores the pending id
97
- * of that clear operation. Otherwise, is -1.
96
+ * The pending ids of any clears that have been performed locally but not yet ack'd from the server
98
97
  */
99
- private pendingClearMessageId;
98
+ private readonly pendingClearMessageIds;
100
99
  /**
101
100
  * Object to create encapsulations of the values stored in the map.
102
101
  */
@@ -186,33 +185,37 @@ export declare class MapKernel {
186
185
  tryGetStashedOpLocalMetadata(op: any): unknown;
187
186
  /**
188
187
  * Process the given op if a handler is registered.
189
- * @param message - The message to process
188
+ * @param op - The message to process
190
189
  * @param local - Whether the message originated from the local client
191
190
  * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
192
191
  * For messages from a remote client, this will be undefined.
193
192
  * @returns True if the operation was processed, false otherwise.
194
193
  */
195
194
  tryProcessMessage(op: IMapOperation, local: boolean, localOpMetadata: unknown): boolean;
195
+ /**
196
+ * Rollback a local op
197
+ * @param op - The operation to rollback
198
+ * @param localOpMetadata - The local metadata associated with the op.
199
+ */
200
+ rollback(op: any, localOpMetadata: unknown): void;
196
201
  /**
197
202
  * Set implementation used for both locally sourced sets as well as incoming remote sets.
198
203
  * @param key - The key being set
199
204
  * @param value - The value being set
200
205
  * @param local - Whether the message originated from the local client
201
- * @param op - The message if from a remote set, or null if from a local set
206
+ * @returns Previous local value of the key, if any
202
207
  */
203
208
  private setCore;
204
209
  /**
205
210
  * Clear implementation used for both locally sourced clears as well as incoming remote clears.
206
211
  * @param local - Whether the message originated from the local client
207
- * @param op - The message if from a remote clear, or null if from a local clear
208
212
  */
209
213
  private clearCore;
210
214
  /**
211
215
  * Delete implementation used for both locally sourced deletes as well as incoming remote deletes.
212
216
  * @param key - The key being deleted
213
217
  * @param local - Whether the message originated from the local client
214
- * @param op - The message if from a remote delete, or null if from a local delete
215
- * @returns True if the key existed and was deleted, false if it did not exist
218
+ * @returns Previous local value of the key if it existed, undefined if it did not exist
216
219
  */
217
220
  private deleteCore;
218
221
  /**
@@ -235,7 +238,6 @@ export declare class MapKernel {
235
238
  * not process the incoming operation.
236
239
  * @param op - Operation to check
237
240
  * @param local - Whether the message originated from the local client
238
- * @param message - The message
239
241
  * @param localOpMetadata - For local client messages, this is the metadata that was submitted with the message.
240
242
  * For messages from a remote client, this will be undefined.
241
243
  * @returns True if the operation should be processed, false otherwise
@@ -246,17 +248,24 @@ export declare class MapKernel {
246
248
  * @returns A map of string op names to IMapMessageHandlers for those ops
247
249
  */
248
250
  private getMessageHandlers;
249
- private getMapClearMessageLocalMetadata;
251
+ private getMapClearMessageId;
250
252
  /**
251
253
  * Submit a clear message to remote clients.
252
254
  * @param op - The clear message
253
255
  */
254
256
  private submitMapClearMessage;
255
- private getMapKeyMessageLocalMetadata;
257
+ private getMapKeyMessageId;
256
258
  /**
257
259
  * Submit a map key message to remote clients.
258
260
  * @param op - The map key message
261
+ * @param previousValue - The value of the key before this op
259
262
  */
260
263
  private submitMapKeyMessage;
264
+ /**
265
+ * Submit a map key message to remote clients based on a previous submit.
266
+ * @param op - The map key message
267
+ * @param localOpMetadata - Metadata from the previous submit
268
+ */
269
+ private resubmitMapKeyMessage;
261
270
  }
262
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