@fluidframework/map 2.0.0-internal.8.0.1 → 2.0.0-rc.1.0.1

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.
Files changed (87) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +0 -11
  3. package/api-extractor-esm.json +4 -0
  4. package/api-extractor-lint.json +1 -10
  5. package/api-extractor.json +1 -9
  6. package/api-report/map.api.md +4 -4
  7. package/dist/{directory.cjs → directory.js} +7 -27
  8. package/dist/directory.js.map +1 -0
  9. package/dist/{index.cjs → index.js} +4 -4
  10. package/dist/index.js.map +1 -0
  11. package/dist/interfaces.d.ts +6 -3
  12. package/dist/interfaces.d.ts.map +1 -1
  13. package/dist/{interfaces.cjs → interfaces.js} +1 -1
  14. package/dist/interfaces.js.map +1 -0
  15. package/dist/{internalInterfaces.cjs → internalInterfaces.js} +1 -1
  16. package/dist/internalInterfaces.js.map +1 -0
  17. package/dist/localValues.d.ts.map +1 -1
  18. package/dist/{localValues.cjs → localValues.js} +1 -1
  19. package/dist/localValues.js.map +1 -0
  20. package/dist/map-alpha.d.ts +8 -4
  21. package/dist/map-beta.d.ts +193 -36
  22. package/dist/map-public.d.ts +193 -36
  23. package/dist/map-untrimmed.d.ts +8 -4
  24. package/dist/map.d.ts +2 -1
  25. package/dist/map.d.ts.map +1 -1
  26. package/dist/{map.cjs → map.js} +5 -4
  27. package/dist/map.js.map +1 -0
  28. package/dist/{mapKernel.cjs → mapKernel.js} +2 -2
  29. package/dist/mapKernel.js.map +1 -0
  30. package/dist/packageVersion.d.ts +1 -1
  31. package/dist/packageVersion.d.ts.map +1 -1
  32. package/dist/{packageVersion.cjs → packageVersion.js} +2 -2
  33. package/dist/packageVersion.js.map +1 -0
  34. package/lib/{directory.d.ts → directory.d.mts} +1 -1
  35. package/lib/directory.d.mts.map +1 -0
  36. package/lib/directory.mjs +1 -1
  37. package/lib/directory.mjs.map +1 -1
  38. package/lib/{index.d.ts → index.d.mts} +1 -1
  39. package/lib/index.d.mts.map +1 -0
  40. package/lib/{interfaces.d.ts → interfaces.d.mts} +7 -4
  41. package/lib/interfaces.d.mts.map +1 -0
  42. package/lib/interfaces.mjs.map +1 -1
  43. package/lib/{internalInterfaces.d.ts → internalInterfaces.d.mts} +1 -1
  44. package/lib/internalInterfaces.d.mts.map +1 -0
  45. package/lib/{localValues.d.ts → localValues.d.mts} +1 -1
  46. package/lib/localValues.d.mts.map +1 -0
  47. package/lib/localValues.mjs.map +1 -1
  48. package/lib/{map-alpha.d.ts → map-alpha.d.mts} +8 -16
  49. package/lib/map-beta.d.mts +264 -0
  50. package/lib/map-public.d.mts +264 -0
  51. package/lib/{map-untrimmed.d.ts → map-untrimmed.d.mts} +8 -16
  52. package/lib/{map.d.ts → map.d.mts} +3 -2
  53. package/lib/map.d.mts.map +1 -0
  54. package/lib/map.mjs +2 -1
  55. package/lib/map.mjs.map +1 -1
  56. package/lib/{mapKernel.d.ts → mapKernel.d.mts} +1 -1
  57. package/lib/mapKernel.d.mts.map +1 -0
  58. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +2 -2
  59. package/lib/packageVersion.d.mts.map +1 -0
  60. package/lib/packageVersion.mjs +1 -1
  61. package/lib/packageVersion.mjs.map +1 -1
  62. package/package.json +84 -31
  63. package/src/directory.ts +1 -1
  64. package/src/interfaces.ts +6 -3
  65. package/src/localValues.ts +1 -1
  66. package/src/map.ts +2 -1
  67. package/src/packageVersion.ts +1 -1
  68. package/dist/directory.cjs.map +0 -1
  69. package/dist/index.cjs.map +0 -1
  70. package/dist/interfaces.cjs.map +0 -1
  71. package/dist/internalInterfaces.cjs.map +0 -1
  72. package/dist/localValues.cjs.map +0 -1
  73. package/dist/map.cjs.map +0 -1
  74. package/dist/mapKernel.cjs.map +0 -1
  75. package/dist/packageVersion.cjs.map +0 -1
  76. package/lib/directory.d.ts.map +0 -1
  77. package/lib/index.d.ts.map +0 -1
  78. package/lib/interfaces.d.ts.map +0 -1
  79. package/lib/internalInterfaces.d.ts.map +0 -1
  80. package/lib/localValues.d.ts.map +0 -1
  81. package/lib/map-beta.d.ts +0 -119
  82. package/lib/map-public.d.ts +0 -119
  83. package/lib/map.d.ts.map +0 -1
  84. package/lib/mapKernel.d.ts.map +0 -1
  85. package/lib/packageVersion.d.ts.map +0 -1
  86. package/map.test-files.tar +0 -0
  87. package/tsc-multi.test.json +0 -4
@@ -0,0 +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 {\n\tIDisposable,\n\tIEvent,\n\tIEventProvider,\n\tIEventThisPlaceHolder,\n} from \"@fluidframework/core-interfaces\";\n\n/**\n * Type of \"valueChanged\" event parameter.\n * @sealed\n * @public\n */\nexport interface IValueChanged {\n\t/**\n\t * The key storing the value that changed.\n\t */\n\tkey: string;\n\n\t/**\n\t * The value that was stored at the key prior to the change.\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tpreviousValue: any;\n}\n\n/**\n * Interface describing actions on a directory.\n *\n * @remarks When used as a Map, operates on its keys.\n * @alpha\n */\n// TODO: Use `unknown` instead (breaking change).\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IDirectory\n\textends Map<string, any>,\n\t\tIEventProvider<IDirectoryEvents>,\n\t\tPartial<IDisposable> {\n\t/**\n\t * The absolute path of the directory.\n\t */\n\treadonly absolutePath: string;\n\n\t/**\n\t * Retrieves the value stored at the given key from the directory.\n\t * @param key - Key to retrieve from\n\t * @returns The stored value, or undefined if the key is not set\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tget<T = any>(key: string): T | undefined;\n\n\t/**\n\t * Sets the value stored at key to the provided value.\n\t * @param key - Key to set at\n\t * @param value - Value to set\n\t * @returns The IDirectory itself\n\t */\n\tset<T = unknown>(key: string, value: T): this;\n\n\t/**\n\t * Get the number of sub directory within the directory.\n\t * @returns The number of sub directory within a directory.\n\t */\n\tcountSubDirectory?(): number;\n\n\t/**\n\t * Creates an IDirectory child of this IDirectory, or retrieves the existing IDirectory child if one with the\n\t * same name already exists.\n\t * @param subdirName - Name of the new child directory to create\n\t * @returns The IDirectory child that was created or retrieved\n\t */\n\tcreateSubDirectory(subdirName: string): IDirectory;\n\n\t/**\n\t * Gets an IDirectory child of this IDirectory, if it exists.\n\t * @param subdirName - Name of the child directory to get\n\t * @returns The requested IDirectory\n\t */\n\tgetSubDirectory(subdirName: string): IDirectory | undefined;\n\n\t/**\n\t * Checks whether this directory has a child directory with the given name.\n\t * @param subdirName - Name of the child directory to check\n\t * @returns True if it exists, false otherwise\n\t */\n\thasSubDirectory(subdirName: string): boolean;\n\n\t/**\n\t * Deletes an IDirectory child of this IDirectory, if it exists, along with all descendent keys and directories.\n\t * @param subdirName - Name of the child directory to delete\n\t * @returns True if the IDirectory existed and was deleted, false if it did not exist\n\t */\n\tdeleteSubDirectory(subdirName: string): boolean;\n\n\t/**\n\t * Gets an iterator over the IDirectory children of this IDirectory.\n\t * @returns The IDirectory iterator\n\t */\n\tsubdirectories(): IterableIterator<[string, IDirectory]>;\n\n\t/**\n\t * Get an IDirectory within the directory, in order to use relative paths from that location.\n\t * @param relativePath - Path of the IDirectory to get, relative to this IDirectory\n\t * @returns The requested IDirectory\n\t */\n\tgetWorkingDirectory(relativePath: string): IDirectory | undefined;\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n *\n * @remarks\n * These events only emit on the {@link ISharedDirectory} itself, and not on subdirectories.\n * @alpha\n */\nexport interface ISharedDirectoryEvents extends ISharedObjectEvents {\n\t/**\n\t * Emitted when a key is set or deleted. This is emitted for any key in the {@link ISharedDirectory} or any\n\t * subdirectory.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `changed` - Information on the key that changed, its value prior to the change, and the path to the\n\t * key that changed.\n\t *\n\t * - `local` - Whether the change originated from this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"valueChanged\",\n\t\tlistener: (\n\t\t\tchanged: IDirectoryValueChanged,\n\t\t\tlocal: boolean,\n\t\t\ttarget: IEventThisPlaceHolder,\n\t\t) => void,\n\t);\n\n\t/**\n\t * Emitted when the {@link ISharedDirectory} is cleared.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `local` - Whether the clear originated from this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(event: \"clear\", listener: (local: boolean, target: IEventThisPlaceHolder) => void);\n\n\t/**\n\t * Emitted when a subdirectory is created.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is created.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the create originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryCreated\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when a subdirectory is deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is deleted.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the delete originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryDeleted\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n}\n\n/**\n * Events emitted in response to changes to the directory data.\n * @alpha\n */\nexport interface IDirectoryEvents extends IEvent {\n\t/**\n\t * Emitted when a key is set or deleted. As opposed to the\n\t * {@link SharedDirectory}'s valueChanged event, this is emitted only on the {@link IDirectory} that directly\n\t * contains the key.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `changed` - Information on the key that changed and its value prior to the change.\n\t *\n\t * - `local` - Whether the change originated from this client.\n\t *\n\t * - `target` - The {@link IDirectory} itself.\n\t */\n\t(\n\t\tevent: \"containedValueChanged\",\n\t\tlistener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when a subdirectory is created. Also emitted when a delete\n\t * of a subdirectory is rolled back.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is created.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the creation originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryCreated\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when a subdirectory is deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `path` - The relative path to the subdirectory that is deleted.\n\t * It is relative from the object which raises the event.\n\t *\n\t * - `local` - Whether the delete originated from the this client.\n\t *\n\t * - `target` - The {@link ISharedDirectory} itself.\n\t */\n\t(\n\t\tevent: \"subDirectoryDeleted\",\n\t\tlistener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when this sub directory is deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `target` - The {@link IDirectory} itself.\n\t */\n\t(event: \"disposed\", listener: (target: IEventThisPlaceHolder) => void);\n\n\t/**\n\t * Emitted when this previously deleted sub directory is restored.\n\t * This event only needs to be handled in the case of rollback. If your application does\n\t * not use the local rollback feature, you can ignore this event.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `target` - The {@link IDirectory} itself.\n\t */\n\t(event: \"undisposed\", listener: (target: IEventThisPlaceHolder) => 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 * @alpha\n */\nexport interface ISharedDirectory\n\textends ISharedObject<ISharedDirectoryEvents & IDirectoryEvents>,\n\t\tOmit<IDirectory, \"on\" | \"once\" | \"off\"> {\n\t// The Omit type excludes symbols, which we don't want to exclude. Adding them back here manually.\n\t// https://github.com/microsoft/TypeScript/issues/31671\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t[Symbol.iterator](): IterableIterator<[string, any]>;\n\treadonly [Symbol.toStringTag]: string;\n}\n\n/**\n * Type of \"valueChanged\" event parameter for {@link ISharedDirectory}.\n * @alpha\n */\nexport interface IDirectoryValueChanged extends IValueChanged {\n\t/**\n\t * The absolute path to the IDirectory storing the key which changed.\n\t */\n\tpath: string;\n}\n\n/**\n * Events emitted in response to changes to the {@link ISharedMap | map} data.\n * @sealed\n * @public\n */\nexport interface ISharedMapEvents extends ISharedObjectEvents {\n\t/**\n\t * Emitted when a key is set or deleted.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `changed` - Information on the key that changed and its value prior to the change.\n\t *\n\t * - `local` - Whether the change originated from this client.\n\t *\n\t * - `target` - The {@link ISharedMap} itself.\n\t */\n\t(\n\t\tevent: \"valueChanged\",\n\t\tlistener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void,\n\t);\n\n\t/**\n\t * Emitted when the map is cleared.\n\t *\n\t * @remarks Listener parameters:\n\t *\n\t * - `local` - Whether the clear originated from this client.\n\t *\n\t * - `target` - The {@link ISharedMap} itself.\n\t */\n\t(event: \"clear\", listener: (local: boolean, 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 * @sealed\n * @public\n */\n// TODO: Use `unknown` instead (breaking change).\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {\n\t/**\n\t * Retrieves the given key from the map if it exists.\n\t * @param key - Key to retrieve from\n\t * @returns The stored value, or undefined if the key is not set\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tget<T = any>(key: string): T | undefined;\n\n\t/**\n\t * Sets the value stored at key to the provided value.\n\t * @param key - Key to set\n\t * @param value - Value to set\n\t * @returns The {@link ISharedMap} itself\n\t */\n\tset<T = unknown>(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 * @alpha\n */\nexport interface ISerializableValue {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * The JSONable representation of the value.\n\t */\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\tvalue: any;\n}\n\n/**\n * Serialized {@link ISerializableValue} counterpart.\n * @alpha\n */\nexport interface ISerializedValue {\n\t/**\n\t * A type annotation to help indicate how the value serializes.\n\t */\n\ttype: string;\n\n\t/**\n\t * String representation of the value.\n\t *\n\t * @remarks Will be undefined if the original value was undefined.\n\t */\n\tvalue: string | undefined;\n}\n"]}
@@ -4,4 +4,4 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- //# sourceMappingURL=internalInterfaces.cjs.map
7
+ //# sourceMappingURL=internalInterfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internalInterfaces.js","sourceRoot":"","sources":["../src/internalInterfaces.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// eslint-disable-next-line import/no-deprecated\nimport { ISerializableValue } from \"./interfaces\";\nimport { ILocalValue } from \"./localValues\";\n\n/**\n * Operation indicating a value should be set for a key.\n */\nexport interface IMapSetOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"set\";\n\n\t/**\n\t * Map key being modified.\n\t */\n\tkey: string;\n\n\t/**\n\t * Value to be set on the key.\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tvalue: ISerializableValue;\n}\n\n/**\n * Operation indicating the map should be cleared.\n */\nexport interface IMapClearOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"clear\";\n}\n\n/**\n * Operation indicating a key should be deleted from the map.\n */\nexport interface IMapDeleteOperation {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"delete\";\n\n\t/**\n\t * Map key being modified.\n\t */\n\tkey: string;\n}\n\n/**\n * Metadata for an local `edit` operation.\n */\nexport interface IMapKeyEditLocalOpMetadata {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"edit\";\n\n\t/**\n\t * Unique identifier for the local operation.\n\t */\n\tpendingMessageId: number;\n\n\t/**\n\t * Local value prior to the edit.\n\t */\n\tpreviousValue: ILocalValue;\n}\n\n/**\n * Metadata for an local `add` operation.\n */\nexport interface IMapKeyAddLocalOpMetadata {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"add\";\n\n\t/**\n\t * Unique identifier for the local operation.\n\t */\n\tpendingMessageId: number;\n}\n\n/**\n * Metadata for an local `clear` operation.\n */\nexport interface IMapClearLocalOpMetadata {\n\t/**\n\t * String identifier of the operation type.\n\t */\n\ttype: \"clear\";\n\n\t/**\n\t * Unique identifier for the local operation.\n\t */\n\tpendingMessageId: number;\n\n\t/**\n\t * Local map contents prior to clearing it.\n\t */\n\tpreviousMap?: Map<string, ILocalValue>;\n}\n\n/**\n * Metadata for a local operation associated with a specific key entry in the map.\n */\nexport type MapKeyLocalOpMetadata = IMapKeyEditLocalOpMetadata | IMapKeyAddLocalOpMetadata;\n\n/**\n * Metadata for a local operation.\n */\nexport type MapLocalOpMetadata = IMapClearLocalOpMetadata | MapKeyLocalOpMetadata;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"localValues.d.ts","sourceRoot":"","sources":["../src/localValues.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACN,gBAAgB,EAKhB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IAGH,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC;IAEpB;;;;;OAKG;IACH,cAAc,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,GAAG,gBAAgB,CAAC;CACnF;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC/B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,YAAY,GAEhB,kBAAkB,CAOpB;AAED;;GAEG;AACH,qBAAa,eAAgB,YAAW,WAAW;aAKf,KAAK,EAAE,OAAO;IAJjD;;;OAGG;gBACgC,KAAK,EAAE,OAAO;IAEjD;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;OAEG;IACI,cAAc,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,GAAG,gBAAgB;CAUzF;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAKR,OAAO,CAAC,QAAQ,CAAC,UAAU;IAJ9C;;;OAGG;gBACiC,UAAU,EAAE,gBAAgB;IAEhE;;;OAGG;IAEI,gBAAgB,CAAC,YAAY,EAAE,kBAAkB,GAAG,WAAW;IAgBtE;;;;OAIG;IACI,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW;CAGhD"}
1
+ {"version":3,"file":"localValues.d.ts","sourceRoot":"","sources":["../src/localValues.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EACN,gBAAgB,EAIhB,MAAM,oCAAoC,CAAC;AAG5C,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEpE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC3B;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IAGH,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC;IAEpB;;;;;OAKG;IACH,cAAc,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,GAAG,gBAAgB,CAAC;CACnF;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC/B,UAAU,EAAE,WAAW,EACvB,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,YAAY,GAEhB,kBAAkB,CAOpB;AAED;;GAEG;AACH,qBAAa,eAAgB,YAAW,WAAW;aAKf,KAAK,EAAE,OAAO;IAJjD;;;OAGG;gBACgC,KAAK,EAAE,OAAO;IAEjD;;OAEG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;OAEG;IACI,cAAc,CAAC,UAAU,EAAE,gBAAgB,EAAE,IAAI,EAAE,YAAY,GAAG,gBAAgB;CAUzF;AAED;;;;GAIG;AACH,qBAAa,eAAe;IAKR,OAAO,CAAC,QAAQ,CAAC,UAAU;IAJ9C;;;OAGG;gBACiC,UAAU,EAAE,gBAAgB;IAEhE;;;OAGG;IAEI,gBAAgB,CAAC,YAAY,EAAE,kBAAkB,GAAG,WAAW;IAgBtE;;;;OAIG;IACI,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW;CAGhD"}
@@ -96,4 +96,4 @@ class LocalValueMaker {
96
96
  }
97
97
  }
98
98
  exports.LocalValueMaker = LocalValueMaker;
99
- //# sourceMappingURL=localValues.cjs.map
99
+ //# sourceMappingURL=localValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"localValues.js","sourceRoot":"","sources":["../src/localValues.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,2EAK4C;AA+B5C;;;;;;;;GAQG;AACH,SAAgB,gBAAgB,CAC/B,UAAuB,EACvB,UAA4B,EAC5B,IAAkB;IAGlB,MAAM,KAAK,GAAG,UAAU,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC1D,OAAO;QACN,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,mEAAmE;QACnE,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;KAC7C,CAAC;AACH,CAAC;AAZD,4CAYC;AAED;;GAEG;AACH,MAAa,eAAe;IAC3B;;;OAGG;IACH,YAAmC,KAAc;QAAd,UAAK,GAAL,KAAK,CAAS;IAAG,CAAC;IAErD;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,8BAAS,CAAC,8BAAS,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED;;OAEG;IACI,cAAc,CAAC,UAA4B,EAAE,IAAkB;QACrE,2FAA2F;QAC3F,oBAAoB;QACpB,MAAM,KAAK,GAAG,IAAA,qCAAgB,EAAC,IAAI,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QAE7D,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK;SACL,CAAC;IACH,CAAC;CACD;AA3BD,0CA2BC;AAED;;;;GAIG;AACH,MAAa,eAAe;IAC3B;;;OAGG;IACH,YAAoC,UAA4B;QAA5B,eAAU,GAAV,UAAU,CAAkB;IAAG,CAAC;IAEpE;;;OAGG;IACH,gDAAgD;IACzC,gBAAgB,CAAC,YAAgC;QACvD,2CAA2C;QAC3C,IAAI,YAAY,CAAC,IAAI,KAAK,8BAAS,CAAC,8BAAS,CAAC,MAAM,CAAC,EAAE;YACtD,YAAY,CAAC,IAAI,GAAG,8BAAS,CAAC,8BAAS,CAAC,KAAK,CAAC,CAAC;YAC/C,MAAM,MAAM,GAAsB;gBACjC,IAAI,EAAE,kBAAkB;gBACxB,GAAG,EAAE,YAAY,CAAC,KAAe;aACjC,CAAC;YACF,YAAY,CAAC,KAAK,GAAG,MAAM,CAAC;SAC5B;QAED,MAAM,eAAe,GAAY,IAAA,iCAAY,EAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAEnF,OAAO,IAAI,eAAe,CAAC,eAAe,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACI,YAAY,CAAC,KAAc;QACjC,OAAO,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACD;AApCD,0CAoCC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IFluidHandle } from \"@fluidframework/core-interfaces\";\nimport {\n\tIFluidSerializer,\n\tparseHandles,\n\tserializeHandles,\n\tValueType,\n} from \"@fluidframework/shared-object-base\";\nimport { ISerializedHandle } from \"@fluidframework/runtime-utils\";\n// eslint-disable-next-line import/no-deprecated\nimport { ISerializableValue, ISerializedValue } from \"./interfaces\";\n\n/**\n * A local value to be stored in a container type Distributed Data Store (DDS).\n * @alpha\n */\nexport interface ILocalValue {\n\t/**\n\t * Type indicator of the value stored within.\n\t */\n\treadonly type: string;\n\n\t/**\n\t * The in-memory value stored within.\n\t */\n\t// TODO: Use `unknown` instead (breaking change).\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\treadonly value: any;\n\n\t/**\n\t * Retrieve the serialized form of the value stored within.\n\t * @param serializer - Data store runtime's serializer\n\t * @param bind - Container type's handle\n\t * @returns The serialized form of the contained value\n\t */\n\tmakeSerialized(serializer: IFluidSerializer, bind: IFluidHandle): ISerializedValue;\n}\n\n/**\n * Converts the provided `localValue` to its serialized form.\n *\n * @param localValue - The value to serialize.\n * @param serializer - Data store runtime's serializer.\n * @param bind - Container type's handle.\n *\n * @see {@link ILocalValue.makeSerialized}\n */\nexport function makeSerializable(\n\tlocalValue: ILocalValue,\n\tserializer: IFluidSerializer,\n\tbind: IFluidHandle,\n\t// eslint-disable-next-line import/no-deprecated\n): ISerializableValue {\n\tconst value = localValue.makeSerialized(serializer, bind);\n\treturn {\n\t\ttype: value.type,\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n\t\tvalue: value.value && JSON.parse(value.value),\n\t};\n}\n\n/**\n * Manages a contained plain value. May also contain shared object handles.\n */\nexport class PlainLocalValue implements ILocalValue {\n\t/**\n\t * Create a new PlainLocalValue.\n\t * @param value - The value to store, which may contain shared object handles\n\t */\n\tpublic constructor(public readonly value: unknown) {}\n\n\t/**\n\t * {@inheritDoc ILocalValue.\"type\"}\n\t */\n\tpublic get type(): string {\n\t\treturn ValueType[ValueType.Plain];\n\t}\n\n\t/**\n\t * {@inheritDoc ILocalValue.makeSerialized}\n\t */\n\tpublic makeSerialized(serializer: IFluidSerializer, bind: IFluidHandle): ISerializedValue {\n\t\t// Stringify to convert to the serialized handle values - and then parse in order to create\n\t\t// a POJO for the op\n\t\tconst value = serializeHandles(this.value, serializer, bind);\n\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tvalue,\n\t\t};\n\t}\n}\n\n/**\n * Enables a container type {@link https://fluidframework.com/docs/build/dds/ | DDS} to produce and store local\n * values with minimal awareness of how those objects are stored, serialized, and deserialized.\n * @alpha\n */\nexport class LocalValueMaker {\n\t/**\n\t * Create a new LocalValueMaker.\n\t * @param serializer - The serializer to serialize / parse handles.\n\t */\n\tpublic constructor(private readonly serializer: IFluidSerializer) {}\n\n\t/**\n\t * Create a new local value from an incoming serialized value.\n\t * @param serializable - The serializable value to make local\n\t */\n\t// eslint-disable-next-line import/no-deprecated\n\tpublic fromSerializable(serializable: ISerializableValue): ILocalValue {\n\t\t// Migrate from old shared value to handles\n\t\tif (serializable.type === ValueType[ValueType.Shared]) {\n\t\t\tserializable.type = ValueType[ValueType.Plain];\n\t\t\tconst handle: ISerializedHandle = {\n\t\t\t\ttype: \"__fluid_handle__\",\n\t\t\t\turl: serializable.value as string,\n\t\t\t};\n\t\t\tserializable.value = handle;\n\t\t}\n\n\t\tconst translatedValue: unknown = parseHandles(serializable.value, this.serializer);\n\n\t\treturn new PlainLocalValue(translatedValue);\n\t}\n\n\t/**\n\t * Create a new local value containing a given plain object.\n\t * @param value - The value to store\n\t * @returns An ILocalValue containing the value\n\t */\n\tpublic fromInMemory(value: unknown): ILocalValue {\n\t\treturn new PlainLocalValue(value);\n\t}\n}\n"]}
@@ -526,7 +526,8 @@ export declare interface ISharedDirectoryEvents extends ISharedObjectEvents {
526
526
  * {@link @fluidframework/datastore#FluidObjectHandle}.
527
527
  *
528
528
  * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.
529
- * @alpha
529
+ * @sealed
530
+ * @public
530
531
  */
531
532
  export declare interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
532
533
  /**
@@ -546,7 +547,8 @@ export declare interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map
546
547
 
547
548
  /**
548
549
  * Events emitted in response to changes to the {@link ISharedMap | map} data.
549
- * @alpha
550
+ * @sealed
551
+ * @public
550
552
  */
551
553
  export declare interface ISharedMapEvents extends ISharedObjectEvents {
552
554
  /**
@@ -575,7 +577,8 @@ export declare interface ISharedMapEvents extends ISharedObjectEvents {
575
577
 
576
578
  /**
577
579
  * Type of "valueChanged" event parameter.
578
- * @alpha
580
+ * @sealed
581
+ * @public
579
582
  */
580
583
  export declare interface IValueChanged {
581
584
  /**
@@ -855,7 +858,8 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
855
858
 
856
859
  /**
857
860
  * {@inheritDoc ISharedMap}
858
- * @alpha
861
+ * @public
862
+ * @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
859
863
  */
860
864
  export declare class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {
861
865
  /**
@@ -30,14 +30,6 @@ import { SharedObject } from '@fluidframework/shared-object-base';
30
30
 
31
31
  /* Excluded from this release type: DirectoryFactory */
32
32
 
33
- /* Excluded from this release type: IChannelAttributes */
34
-
35
- /* Excluded from this release type: IChannelFactory */
36
-
37
- /* Excluded from this release type: IChannelServices */
38
-
39
- /* Excluded from this release type: IChannelStorageService */
40
-
41
33
  /* Excluded from this release type: ICreateInfo */
42
34
 
43
35
  /* Excluded from this release type: IDirectory */
@@ -68,20 +60,6 @@ import { SharedObject } from '@fluidframework/shared-object-base';
68
60
 
69
61
  /* Excluded from this release type: IDirectoryValueChanged */
70
62
 
71
- /* Excluded from this release type: IDisposable */
72
-
73
- /* Excluded from this release type: IEvent */
74
-
75
- /* Excluded from this release type: IEventProvider */
76
-
77
- /* Excluded from this release type: IEventThisPlaceHolder */
78
-
79
- /* Excluded from this release type: IFluidDataStoreRuntime */
80
-
81
- /* Excluded from this release type: IFluidHandle */
82
-
83
- /* Excluded from this release type: IFluidSerializer */
84
-
85
63
  /* Excluded from this release type: ILocalValue */
86
64
 
87
65
  /* Excluded from this release type: ISerializableValue */
@@ -92,19 +70,78 @@ import { SharedObject } from '@fluidframework/shared-object-base';
92
70
 
93
71
  /* Excluded from this release type: ISharedDirectoryEvents */
94
72
 
95
- /* Excluded from this release type: ISharedMap */
96
-
97
- /* Excluded from this release type: ISharedMapEvents */
98
-
99
- /* Excluded from this release type: ISharedObject */
100
-
101
- /* Excluded from this release type: ISharedObjectEvents */
102
-
103
- /* Excluded from this release type: ISummaryTreeWithStats */
73
+ /**
74
+ * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting
75
+ * and retrieving values that JavaScript developers are accustomed to with the
76
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.
77
+ * However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a
78
+ * {@link @fluidframework/datastore#FluidObjectHandle}.
79
+ *
80
+ * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.
81
+ * @sealed
82
+ * @public
83
+ */
84
+ export declare interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
85
+ /**
86
+ * Retrieves the given key from the map if it exists.
87
+ * @param key - Key to retrieve from
88
+ * @returns The stored value, or undefined if the key is not set
89
+ */
90
+ get<T = any>(key: string): T | undefined;
91
+ /**
92
+ * Sets the value stored at key to the provided value.
93
+ * @param key - Key to set
94
+ * @param value - Value to set
95
+ * @returns The {@link ISharedMap} itself
96
+ */
97
+ set<T = unknown>(key: string, value: T): this;
98
+ }
104
99
 
105
- /* Excluded from this release type: ITelemetryContext */
100
+ /**
101
+ * Events emitted in response to changes to the {@link ISharedMap | map} data.
102
+ * @sealed
103
+ * @public
104
+ */
105
+ export declare interface ISharedMapEvents extends ISharedObjectEvents {
106
+ /**
107
+ * Emitted when a key is set or deleted.
108
+ *
109
+ * @remarks Listener parameters:
110
+ *
111
+ * - `changed` - Information on the key that changed and its value prior to the change.
112
+ *
113
+ * - `local` - Whether the change originated from this client.
114
+ *
115
+ * - `target` - The {@link ISharedMap} itself.
116
+ */
117
+ (event: "valueChanged", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
118
+ /**
119
+ * Emitted when the map is cleared.
120
+ *
121
+ * @remarks Listener parameters:
122
+ *
123
+ * - `local` - Whether the clear originated from this client.
124
+ *
125
+ * - `target` - The {@link ISharedMap} itself.
126
+ */
127
+ (event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
128
+ }
106
129
 
107
- /* Excluded from this release type: IValueChanged */
130
+ /**
131
+ * Type of "valueChanged" event parameter.
132
+ * @sealed
133
+ * @public
134
+ */
135
+ export declare interface IValueChanged {
136
+ /**
137
+ * The key storing the value that changed.
138
+ */
139
+ key: string;
140
+ /**
141
+ * The value that was stored at the key prior to the change.
142
+ */
143
+ previousValue: any;
144
+ }
108
145
 
109
146
  /* Excluded from this release type: LocalValueMaker */
110
147
 
@@ -112,8 +149,128 @@ import { SharedObject } from '@fluidframework/shared-object-base';
112
149
 
113
150
  /* Excluded from this release type: SharedDirectory */
114
151
 
115
- /* Excluded from this release type: SharedMap */
116
-
117
- /* Excluded from this release type: SharedObject */
152
+ /**
153
+ * {@inheritDoc ISharedMap}
154
+ * @public
155
+ * @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
156
+ */
157
+ export declare class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {
158
+ /**
159
+ * Create a new shared map.
160
+ * @param runtime - The data store runtime that the new shared map belongs to.
161
+ * @param id - Optional name of the shared map.
162
+ * @returns Newly created shared map.
163
+ *
164
+ * @example
165
+ * To create a `SharedMap`, call the static create method:
166
+ *
167
+ * ```typescript
168
+ * const myMap = SharedMap.create(this.runtime, id);
169
+ * ```
170
+ */
171
+ static create(runtime: IFluidDataStoreRuntime, id?: string): SharedMap;
172
+ /**
173
+ * Get a factory for SharedMap to register with the data store.
174
+ * @returns A factory that creates SharedMaps and loads them from storage.
175
+ */
176
+ static getFactory(): IChannelFactory;
177
+ /**
178
+ * String representation for the class.
179
+ */
180
+ readonly [Symbol.toStringTag]: string;
181
+ /**
182
+ * MapKernel which manages actual map operations.
183
+ */
184
+ private readonly kernel;
185
+ /**
186
+ * Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}.
187
+ *
188
+ * @param id - String identifier.
189
+ * @param runtime - Data store runtime.
190
+ * @param attributes - The attributes for the map.
191
+ */
192
+ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
193
+ /**
194
+ * Get an iterator over the keys in this map.
195
+ * @returns The iterator
196
+ */
197
+ keys(): IterableIterator<string>;
198
+ /**
199
+ * Get an iterator over the entries in this map.
200
+ * @returns The iterator
201
+ */
202
+ entries(): IterableIterator<[string, any]>;
203
+ /**
204
+ * Get an iterator over the values in this map.
205
+ * @returns The iterator
206
+ */
207
+ values(): IterableIterator<any>;
208
+ /**
209
+ * Get an iterator over the entries in this map.
210
+ * @returns The iterator
211
+ */
212
+ [Symbol.iterator](): IterableIterator<[string, any]>;
213
+ /**
214
+ * The number of key/value pairs stored in the map.
215
+ */
216
+ get size(): number;
217
+ /**
218
+ * Executes the given callback on each entry in the map.
219
+ * @param callbackFn - Callback function
220
+ */
221
+ forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void;
222
+ /**
223
+ * {@inheritDoc ISharedMap.get}
224
+ */
225
+ get<T = any>(key: string): T | undefined;
226
+ /**
227
+ * Check if a key exists in the map.
228
+ * @param key - The key to check
229
+ * @returns True if the key exists, false otherwise
230
+ */
231
+ has(key: string): boolean;
232
+ /**
233
+ * {@inheritDoc ISharedMap.set}
234
+ */
235
+ set(key: string, value: unknown): this;
236
+ /**
237
+ * Delete a key from the map.
238
+ * @param key - Key to delete
239
+ * @returns True if the key existed and was deleted, false if it did not exist
240
+ */
241
+ delete(key: string): boolean;
242
+ /**
243
+ * Clear all data from the map.
244
+ */
245
+ clear(): void;
246
+ /**
247
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
248
+ */
249
+ protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
250
+ /**
251
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
252
+ */
253
+ protected loadCore(storage: IChannelStorageService): Promise<void>;
254
+ /**
255
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
256
+ */
257
+ protected onDisconnect(): void;
258
+ /**
259
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
260
+ */
261
+ protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
262
+ /**
263
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
264
+ */
265
+ protected applyStashedOp(content: unknown): unknown;
266
+ /**
267
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
268
+ */
269
+ protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
270
+ /**
271
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
272
+ */
273
+ protected rollback(content: unknown, localOpMetadata: unknown): void;
274
+ }
118
275
 
119
276
  export { }
@@ -30,14 +30,6 @@ import { SharedObject } from '@fluidframework/shared-object-base';
30
30
 
31
31
  /* Excluded from this release type: DirectoryFactory */
32
32
 
33
- /* Excluded from this release type: IChannelAttributes */
34
-
35
- /* Excluded from this release type: IChannelFactory */
36
-
37
- /* Excluded from this release type: IChannelServices */
38
-
39
- /* Excluded from this release type: IChannelStorageService */
40
-
41
33
  /* Excluded from this release type: ICreateInfo */
42
34
 
43
35
  /* Excluded from this release type: IDirectory */
@@ -68,20 +60,6 @@ import { SharedObject } from '@fluidframework/shared-object-base';
68
60
 
69
61
  /* Excluded from this release type: IDirectoryValueChanged */
70
62
 
71
- /* Excluded from this release type: IDisposable */
72
-
73
- /* Excluded from this release type: IEvent */
74
-
75
- /* Excluded from this release type: IEventProvider */
76
-
77
- /* Excluded from this release type: IEventThisPlaceHolder */
78
-
79
- /* Excluded from this release type: IFluidDataStoreRuntime */
80
-
81
- /* Excluded from this release type: IFluidHandle */
82
-
83
- /* Excluded from this release type: IFluidSerializer */
84
-
85
63
  /* Excluded from this release type: ILocalValue */
86
64
 
87
65
  /* Excluded from this release type: ISerializableValue */
@@ -92,19 +70,78 @@ import { SharedObject } from '@fluidframework/shared-object-base';
92
70
 
93
71
  /* Excluded from this release type: ISharedDirectoryEvents */
94
72
 
95
- /* Excluded from this release type: ISharedMap */
96
-
97
- /* Excluded from this release type: ISharedMapEvents */
98
-
99
- /* Excluded from this release type: ISharedObject */
100
-
101
- /* Excluded from this release type: ISharedObjectEvents */
102
-
103
- /* Excluded from this release type: ISummaryTreeWithStats */
73
+ /**
74
+ * The SharedMap distributed data structure can be used to store key-value pairs. It provides the same API for setting
75
+ * and retrieving values that JavaScript developers are accustomed to with the
76
+ * {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | Map} built-in object.
77
+ * However, the keys of a SharedMap must be strings, and the values must either be a JSON-serializable object or a
78
+ * {@link @fluidframework/datastore#FluidObjectHandle}.
79
+ *
80
+ * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.
81
+ * @sealed
82
+ * @public
83
+ */
84
+ export declare interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
85
+ /**
86
+ * Retrieves the given key from the map if it exists.
87
+ * @param key - Key to retrieve from
88
+ * @returns The stored value, or undefined if the key is not set
89
+ */
90
+ get<T = any>(key: string): T | undefined;
91
+ /**
92
+ * Sets the value stored at key to the provided value.
93
+ * @param key - Key to set
94
+ * @param value - Value to set
95
+ * @returns The {@link ISharedMap} itself
96
+ */
97
+ set<T = unknown>(key: string, value: T): this;
98
+ }
104
99
 
105
- /* Excluded from this release type: ITelemetryContext */
100
+ /**
101
+ * Events emitted in response to changes to the {@link ISharedMap | map} data.
102
+ * @sealed
103
+ * @public
104
+ */
105
+ export declare interface ISharedMapEvents extends ISharedObjectEvents {
106
+ /**
107
+ * Emitted when a key is set or deleted.
108
+ *
109
+ * @remarks Listener parameters:
110
+ *
111
+ * - `changed` - Information on the key that changed and its value prior to the change.
112
+ *
113
+ * - `local` - Whether the change originated from this client.
114
+ *
115
+ * - `target` - The {@link ISharedMap} itself.
116
+ */
117
+ (event: "valueChanged", listener: (changed: IValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
118
+ /**
119
+ * Emitted when the map is cleared.
120
+ *
121
+ * @remarks Listener parameters:
122
+ *
123
+ * - `local` - Whether the clear originated from this client.
124
+ *
125
+ * - `target` - The {@link ISharedMap} itself.
126
+ */
127
+ (event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
128
+ }
106
129
 
107
- /* Excluded from this release type: IValueChanged */
130
+ /**
131
+ * Type of "valueChanged" event parameter.
132
+ * @sealed
133
+ * @public
134
+ */
135
+ export declare interface IValueChanged {
136
+ /**
137
+ * The key storing the value that changed.
138
+ */
139
+ key: string;
140
+ /**
141
+ * The value that was stored at the key prior to the change.
142
+ */
143
+ previousValue: any;
144
+ }
108
145
 
109
146
  /* Excluded from this release type: LocalValueMaker */
110
147
 
@@ -112,8 +149,128 @@ import { SharedObject } from '@fluidframework/shared-object-base';
112
149
 
113
150
  /* Excluded from this release type: SharedDirectory */
114
151
 
115
- /* Excluded from this release type: SharedMap */
116
-
117
- /* Excluded from this release type: SharedObject */
152
+ /**
153
+ * {@inheritDoc ISharedMap}
154
+ * @public
155
+ * @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
156
+ */
157
+ export declare class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {
158
+ /**
159
+ * Create a new shared map.
160
+ * @param runtime - The data store runtime that the new shared map belongs to.
161
+ * @param id - Optional name of the shared map.
162
+ * @returns Newly created shared map.
163
+ *
164
+ * @example
165
+ * To create a `SharedMap`, call the static create method:
166
+ *
167
+ * ```typescript
168
+ * const myMap = SharedMap.create(this.runtime, id);
169
+ * ```
170
+ */
171
+ static create(runtime: IFluidDataStoreRuntime, id?: string): SharedMap;
172
+ /**
173
+ * Get a factory for SharedMap to register with the data store.
174
+ * @returns A factory that creates SharedMaps and loads them from storage.
175
+ */
176
+ static getFactory(): IChannelFactory;
177
+ /**
178
+ * String representation for the class.
179
+ */
180
+ readonly [Symbol.toStringTag]: string;
181
+ /**
182
+ * MapKernel which manages actual map operations.
183
+ */
184
+ private readonly kernel;
185
+ /**
186
+ * Do not call the constructor. Instead, you should use the {@link SharedMap.create | create method}.
187
+ *
188
+ * @param id - String identifier.
189
+ * @param runtime - Data store runtime.
190
+ * @param attributes - The attributes for the map.
191
+ */
192
+ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
193
+ /**
194
+ * Get an iterator over the keys in this map.
195
+ * @returns The iterator
196
+ */
197
+ keys(): IterableIterator<string>;
198
+ /**
199
+ * Get an iterator over the entries in this map.
200
+ * @returns The iterator
201
+ */
202
+ entries(): IterableIterator<[string, any]>;
203
+ /**
204
+ * Get an iterator over the values in this map.
205
+ * @returns The iterator
206
+ */
207
+ values(): IterableIterator<any>;
208
+ /**
209
+ * Get an iterator over the entries in this map.
210
+ * @returns The iterator
211
+ */
212
+ [Symbol.iterator](): IterableIterator<[string, any]>;
213
+ /**
214
+ * The number of key/value pairs stored in the map.
215
+ */
216
+ get size(): number;
217
+ /**
218
+ * Executes the given callback on each entry in the map.
219
+ * @param callbackFn - Callback function
220
+ */
221
+ forEach(callbackFn: (value: any, key: string, map: Map<string, any>) => void): void;
222
+ /**
223
+ * {@inheritDoc ISharedMap.get}
224
+ */
225
+ get<T = any>(key: string): T | undefined;
226
+ /**
227
+ * Check if a key exists in the map.
228
+ * @param key - The key to check
229
+ * @returns True if the key exists, false otherwise
230
+ */
231
+ has(key: string): boolean;
232
+ /**
233
+ * {@inheritDoc ISharedMap.set}
234
+ */
235
+ set(key: string, value: unknown): this;
236
+ /**
237
+ * Delete a key from the map.
238
+ * @param key - Key to delete
239
+ * @returns True if the key existed and was deleted, false if it did not exist
240
+ */
241
+ delete(key: string): boolean;
242
+ /**
243
+ * Clear all data from the map.
244
+ */
245
+ clear(): void;
246
+ /**
247
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
248
+ */
249
+ protected summarizeCore(serializer: IFluidSerializer, telemetryContext?: ITelemetryContext): ISummaryTreeWithStats;
250
+ /**
251
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
252
+ */
253
+ protected loadCore(storage: IChannelStorageService): Promise<void>;
254
+ /**
255
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
256
+ */
257
+ protected onDisconnect(): void;
258
+ /**
259
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.reSubmitCore}
260
+ */
261
+ protected reSubmitCore(content: unknown, localOpMetadata: unknown): void;
262
+ /**
263
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObjectCore.applyStashedOp}
264
+ */
265
+ protected applyStashedOp(content: unknown): unknown;
266
+ /**
267
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
268
+ */
269
+ protected processCore(message: ISequencedDocumentMessage, local: boolean, localOpMetadata: unknown): void;
270
+ /**
271
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.rollback}
272
+ */
273
+ protected rollback(content: unknown, localOpMetadata: unknown): void;
274
+ }
118
275
 
119
276
  export { }
@@ -540,7 +540,8 @@ export declare interface ISharedDirectoryEvents extends ISharedObjectEvents {
540
540
  * {@link @fluidframework/datastore#FluidObjectHandle}.
541
541
  *
542
542
  * For more information, including example usages, see {@link https://fluidframework.com/docs/data-structures/map/}.
543
- * @alpha
543
+ * @sealed
544
+ * @public
544
545
  */
545
546
  export declare interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map<string, any> {
546
547
  /**
@@ -560,7 +561,8 @@ export declare interface ISharedMap extends ISharedObject<ISharedMapEvents>, Map
560
561
 
561
562
  /**
562
563
  * Events emitted in response to changes to the {@link ISharedMap | map} data.
563
- * @alpha
564
+ * @sealed
565
+ * @public
564
566
  */
565
567
  export declare interface ISharedMapEvents extends ISharedObjectEvents {
566
568
  /**
@@ -589,7 +591,8 @@ export declare interface ISharedMapEvents extends ISharedObjectEvents {
589
591
 
590
592
  /**
591
593
  * Type of "valueChanged" event parameter.
592
- * @alpha
594
+ * @sealed
595
+ * @public
593
596
  */
594
597
  export declare interface IValueChanged {
595
598
  /**
@@ -869,7 +872,8 @@ export declare class SharedDirectory extends SharedObject<ISharedDirectoryEvents
869
872
 
870
873
  /**
871
874
  * {@inheritDoc ISharedMap}
872
- * @alpha
875
+ * @public
876
+ * @deprecated Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.0 containers only.
873
877
  */
874
878
  export declare class SharedMap extends SharedObject<ISharedMapEvents> implements ISharedMap {
875
879
  /**