@fluidframework/shared-summary-block 1.4.0-121020 → 2.0.0-dev-rc.1.0.0.224419

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 (83) hide show
  1. package/.eslintrc.js +5 -7
  2. package/.mocharc.js +12 -0
  3. package/CHANGELOG.md +135 -0
  4. package/README.md +22 -1
  5. package/api-extractor-lint.json +4 -0
  6. package/api-extractor.json +2 -2
  7. package/api-report/shared-summary-block.api.md +62 -0
  8. package/dist/index.cjs +12 -0
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/{interfaces.js → interfaces.cjs} +1 -1
  13. package/dist/interfaces.cjs.map +1 -0
  14. package/dist/interfaces.d.ts +4 -0
  15. package/dist/interfaces.d.ts.map +1 -1
  16. package/dist/{packageVersion.js → packageVersion.cjs} +2 -2
  17. package/dist/packageVersion.cjs.map +1 -0
  18. package/dist/packageVersion.d.ts +1 -1
  19. package/dist/packageVersion.d.ts.map +1 -1
  20. package/dist/shared-summary-block-alpha.d.ts +100 -0
  21. package/dist/shared-summary-block-beta.d.ts +21 -0
  22. package/dist/shared-summary-block-public.d.ts +21 -0
  23. package/dist/shared-summary-block-untrimmed.d.ts +131 -0
  24. package/dist/{sharedSummaryBlock.js → sharedSummaryBlock.cjs} +18 -17
  25. package/dist/sharedSummaryBlock.cjs.map +1 -0
  26. package/dist/sharedSummaryBlock.d.ts +1 -0
  27. package/dist/sharedSummaryBlock.d.ts.map +1 -1
  28. package/dist/{sharedSummaryBlockFactory.js → sharedSummaryBlockFactory.cjs} +5 -3
  29. package/dist/sharedSummaryBlockFactory.cjs.map +1 -0
  30. package/dist/sharedSummaryBlockFactory.d.ts +2 -0
  31. package/dist/sharedSummaryBlockFactory.d.ts.map +1 -1
  32. package/dist/tsdoc-metadata.json +11 -0
  33. package/lib/index.d.mts +8 -0
  34. package/lib/index.d.mts.map +1 -0
  35. package/lib/index.mjs +7 -0
  36. package/lib/index.mjs.map +1 -0
  37. package/lib/{interfaces.d.ts → interfaces.d.mts} +4 -0
  38. package/lib/interfaces.d.mts.map +1 -0
  39. package/lib/{interfaces.js → interfaces.mjs} +1 -1
  40. package/lib/interfaces.mjs.map +1 -0
  41. package/lib/{packageVersion.d.ts → packageVersion.d.mts} +1 -1
  42. package/lib/{packageVersion.d.ts.map → packageVersion.d.mts.map} +1 -1
  43. package/lib/{packageVersion.js → packageVersion.mjs} +2 -2
  44. package/lib/packageVersion.mjs.map +1 -0
  45. package/lib/shared-summary-block-alpha.d.mts +100 -0
  46. package/lib/shared-summary-block-beta.d.mts +21 -0
  47. package/lib/shared-summary-block-public.d.mts +21 -0
  48. package/lib/shared-summary-block-untrimmed.d.mts +131 -0
  49. package/lib/{sharedSummaryBlock.d.ts → sharedSummaryBlock.d.mts} +2 -1
  50. package/lib/sharedSummaryBlock.d.mts.map +1 -0
  51. package/lib/{sharedSummaryBlock.js → sharedSummaryBlock.mjs} +18 -17
  52. package/lib/sharedSummaryBlock.mjs.map +1 -0
  53. package/lib/{sharedSummaryBlockFactory.d.ts → sharedSummaryBlockFactory.d.mts} +2 -0
  54. package/lib/sharedSummaryBlockFactory.d.mts.map +1 -0
  55. package/lib/{sharedSummaryBlockFactory.js → sharedSummaryBlockFactory.mjs} +5 -3
  56. package/lib/sharedSummaryBlockFactory.mjs.map +1 -0
  57. package/package.json +95 -62
  58. package/prettier.config.cjs +8 -0
  59. package/src/index.ts +3 -3
  60. package/src/interfaces.ts +16 -12
  61. package/src/packageVersion.ts +1 -1
  62. package/src/sharedSummaryBlock.ts +92 -88
  63. package/src/sharedSummaryBlockFactory.ts +56 -51
  64. package/tsc-multi.test.json +4 -0
  65. package/tsconfig.json +11 -13
  66. package/dist/index.js +0 -20
  67. package/dist/index.js.map +0 -1
  68. package/dist/interfaces.js.map +0 -1
  69. package/dist/packageVersion.js.map +0 -1
  70. package/dist/sharedSummaryBlock.js.map +0 -1
  71. package/dist/sharedSummaryBlockFactory.js.map +0 -1
  72. package/lib/index.d.ts +0 -8
  73. package/lib/index.d.ts.map +0 -1
  74. package/lib/index.js +0 -8
  75. package/lib/index.js.map +0 -1
  76. package/lib/interfaces.d.ts.map +0 -1
  77. package/lib/interfaces.js.map +0 -1
  78. package/lib/packageVersion.js.map +0 -1
  79. package/lib/sharedSummaryBlock.d.ts.map +0 -1
  80. package/lib/sharedSummaryBlock.js.map +0 -1
  81. package/lib/sharedSummaryBlockFactory.d.ts.map +0 -1
  82. package/lib/sharedSummaryBlockFactory.js.map +0 -1
  83. package/tsconfig.esnext.json +0 -7
@@ -7,28 +7,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.SharedSummaryBlock = void 0;
8
8
  const driver_utils_1 = require("@fluidframework/driver-utils");
9
9
  const shared_object_base_1 = require("@fluidframework/shared-object-base");
10
- const sharedSummaryBlockFactory_1 = require("./sharedSummaryBlockFactory");
10
+ const sharedSummaryBlockFactory_1 = require("./sharedSummaryBlockFactory.cjs");
11
11
  const snapshotFileName = "header";
12
12
  /**
13
13
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
14
14
  * Data should be set in this object in response to a remote op.
15
+ * @alpha
15
16
  */
16
17
  class SharedSummaryBlock extends shared_object_base_1.SharedObject {
17
- /**
18
- * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
19
- * be provided.
20
- *
21
- * @param id - optional name of the shared summary block.
22
- * @param runtime - data store runtime thee object belongs to.
23
- * @param attributes - The attributes for the object.
24
- */
25
- constructor(id, runtime, attributes) {
26
- super(id, runtime, attributes, "fluid_sharedSummaryBlock_");
27
- /**
28
- * The data held by this object.
29
- */
30
- this.data = new Map();
31
- }
32
18
  /**
33
19
  * Create a new shared summary block
34
20
  *
@@ -47,6 +33,21 @@ class SharedSummaryBlock extends shared_object_base_1.SharedObject {
47
33
  static getFactory() {
48
34
  return new sharedSummaryBlockFactory_1.SharedSummaryBlockFactory();
49
35
  }
36
+ /**
37
+ * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
38
+ * be provided.
39
+ *
40
+ * @param id - optional name of the shared summary block.
41
+ * @param runtime - data store runtime thee object belongs to.
42
+ * @param attributes - The attributes for the object.
43
+ */
44
+ constructor(id, runtime, attributes) {
45
+ super(id, runtime, attributes, "fluid_sharedSummaryBlock_");
46
+ /**
47
+ * The data held by this object.
48
+ */
49
+ this.data = new Map();
50
+ }
50
51
  /**
51
52
  * {@inheritDoc ISharedSummaryBlock.get}
52
53
  */
@@ -95,4 +96,4 @@ class SharedSummaryBlock extends shared_object_base_1.SharedObject {
95
96
  }
96
97
  }
97
98
  exports.SharedSummaryBlock = SharedSummaryBlock;
98
- //# sourceMappingURL=sharedSummaryBlock.js.map
99
+ //# sourceMappingURL=sharedSummaryBlock.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlock.cjs","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,+DAA4D;AAC5D,2EAI4C;AAC5C,+EAAwE;AAGxE,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,iCAAY;IACnD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,qDAAyB,CAAC,IAAI,CAAuB,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,qDAAyB,EAAE,CAAC;IACxC,CAAC;IAOD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,2BAA2B,CAAC,CAAC;QAd7D;;WAEG;QACc,SAAI,GAAG,IAAI,GAAG,EAA6B,CAAC;IAY7D,CAAC;IA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rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tJsonable,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n\tcreateSingleBlobSummary,\n\tIFluidSerializer,\n\tSharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\nimport { ISharedSummaryBlock } from \"./interfaces\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse.\n */\ninterface ISharedSummaryBlockDataSerializable {\n\t[key: string]: Jsonable<unknown>;\n}\n\n/**\n * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.\n * Data should be set in this object in response to a remote op.\n * @alpha\n */\nexport class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {\n\t/**\n\t * Create a new shared summary block\n\t *\n\t * @param runtime - data store runtime the new shared summary block belongs to.\n\t * @param id - optional name of the shared summary block.\n\t * @returns newly created shared summary block (but not attached yet).\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;\n\t}\n\n\t/**\n\t * Get a factory for SharedSummaryBlock to register with the data store.\n\t *\n\t * @returns a factory that creates and loads SharedSummaryBlock.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedSummaryBlockFactory();\n\t}\n\n\t/**\n\t * The data held by this object.\n\t */\n\tprivate readonly data = new Map<string, Jsonable<unknown>>();\n\n\t/**\n\t * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n\t * be provided.\n\t *\n\t * @param id - optional name of the shared summary block.\n\t * @param runtime - data store runtime thee object belongs to.\n\t * @param attributes - The attributes for the object.\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.get}\n\t */\n\tpublic get<T>(key: string): Jsonable<T> {\n\t\treturn this.data.get(key) as Jsonable<T>;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.set}\n\t */\n\tpublic set<T>(key: string, value: Jsonable<T>): void {\n\t\tthis.data.set(key, value);\n\t\t// Set this object as dirty so that it is part of the next summary.\n\t\tthis.dirty();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst contentsBlob: ISharedSummaryBlockDataSerializable = {};\n\t\tthis.data.forEach((value, key) => {\n\t\t\tcontentsBlob[key] = value;\n\t\t});\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst contents = await readAndParse<ISharedSummaryBlockDataSerializable>(\n\t\t\tstorage,\n\t\t\tsnapshotFileName,\n\t\t);\n\t\tfor (const [key, value] of Object.entries(contents)) {\n\t\t\tthis.data.set(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean) {\n\t\tthrow new Error(\"shared summary block should not generate any ops.\");\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
@@ -10,6 +10,7 @@ import { ISharedSummaryBlock } from "./interfaces";
10
10
  /**
11
11
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
12
12
  * Data should be set in this object in response to a remote op.
13
+ * @alpha
13
14
  */
14
15
  export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
15
16
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sharedSummaryBlock.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,OAAO,EAEH,gBAAgB,EAChB,YAAY,EACf,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAYnD;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,YAAa,YAAW,mBAAmB;IAC/E;;;;;;OAMG;WACW,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM;IAIjE;;;;OAIG;WACW,UAAU,IAAI,eAAe;IAI3C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA+B;IAEpD;;;;;;;OAOG;gBACS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB;IAIvF;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;IAIvC;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,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,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAMpD;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,qBAAqB;IAQ5E;;OAEG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAUxE;;OAEG;IACH,SAAS,CAAC,YAAY;IAEtB;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO;IAIxE,SAAS,CAAC,cAAc;CAGxB"}
@@ -5,11 +5,13 @@
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.SharedSummaryBlockFactory = void 0;
8
- const packageVersion_1 = require("./packageVersion");
9
- const sharedSummaryBlock_1 = require("./sharedSummaryBlock");
8
+ const packageVersion_1 = require("./packageVersion.cjs");
9
+ const sharedSummaryBlock_1 = require("./sharedSummaryBlock.cjs");
10
10
  /**
11
11
  * The factory that defines the shared summary block.
12
+ *
12
13
  * @sealed
14
+ * @internal
13
15
  */
14
16
  class SharedSummaryBlockFactory {
15
17
  /**
@@ -54,4 +56,4 @@ SharedSummaryBlockFactory.Attributes = {
54
56
  snapshotFormatVersion: "0.1",
55
57
  packageVersion: packageVersion_1.pkgVersion,
56
58
  };
57
- //# sourceMappingURL=sharedSummaryBlockFactory.js.map
59
+ //# sourceMappingURL=sharedSummaryBlockFactory.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlockFactory.cjs","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,yDAA8C;AAC9C,iEAA0D;AAE1D;;;;;GAKG;AACH,MAAa,yBAAyB;IAerC;;OAEG;IACH,IAAW,IAAI;QACd,OAAO,yBAAyB,CAAC,IAAI,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,IAAW,UAAU;QACpB,OAAO,yBAAyB,CAAC,UAAU,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,IAAI,CAChB,OAA+B,EAC/B,EAAU,EACV,QAA0B,EAC1B,UAA8B;QAE9B,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAAC,EAAE,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAC3E,MAAM,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAExC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,OAA+B,EAAE,EAAU;QACxD,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,CAChD,EAAE,EACF,OAAO,EACP,yBAAyB,CAAC,UAAU,CACpC,CAAC;QACF,kBAAkB,CAAC,eAAe,EAAE,CAAC;QAErC,OAAO,kBAAkB,CAAC;IAC3B,CAAC;;AAxDF,8DAyDC;AAxDA;;GAEG;AACoB,8BAAI,GAAG,wDAAwD,CAAC;AAEvF;;GAEG;AACoB,oCAAU,GAAuB;IACvD,IAAI,EAAE,yBAAyB,CAAC,IAAI;IACpC,qBAAqB,EAAE,KAAK;IAC5B,cAAc,EAAE,2BAAU;CAC1B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelServices,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\nimport { pkgVersion } from \"./packageVersion\";\nimport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\n\n/**\n * The factory that defines the shared summary block.\n *\n * @sealed\n * @internal\n */\nexport class SharedSummaryBlockFactory implements IChannelFactory {\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic static readonly Type = \"https://graph.microsoft.com/types/shared-summary-block\";\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic static readonly Attributes: IChannelAttributes = {\n\t\ttype: SharedSummaryBlockFactory.Type,\n\t\tsnapshotFormatVersion: \"0.1\",\n\t\tpackageVersion: pkgVersion,\n\t};\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.\"type\"}\n\t */\n\tpublic get type() {\n\t\treturn SharedSummaryBlockFactory.Type;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}\n\t */\n\tpublic get attributes() {\n\t\treturn SharedSummaryBlockFactory.Attributes;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}\n\t */\n\tpublic async load(\n\t\truntime: IFluidDataStoreRuntime,\n\t\tid: string,\n\t\tservices: IChannelServices,\n\t\tattributes: IChannelAttributes,\n\t): Promise<ISharedObject> {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(id, runtime, attributes);\n\t\tawait sharedSummaryBlock.load(services);\n\n\t\treturn sharedSummaryBlock;\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}\n\t */\n\tpublic create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject {\n\t\tconst sharedSummaryBlock = new SharedSummaryBlock(\n\t\t\tid,\n\t\t\truntime,\n\t\t\tSharedSummaryBlockFactory.Attributes,\n\t\t);\n\t\tsharedSummaryBlock.initializeLocal();\n\n\t\treturn sharedSummaryBlock;\n\t}\n}\n"]}
@@ -6,7 +6,9 @@ import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices, IChannelF
6
6
  import { ISharedObject } from "@fluidframework/shared-object-base";
7
7
  /**
8
8
  * The factory that defines the shared summary block.
9
+ *
9
10
  * @sealed
11
+ * @internal
10
12
  */
11
13
  export declare class SharedSummaryBlockFactory implements IChannelFactory {
12
14
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"sharedSummaryBlockFactory.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACH,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EAClB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACH,aAAa,EAChB,MAAM,oCAAoC,CAAC;AAI5C;;;GAGG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAC7D;;OAEG;IACH,gBAAuB,IAAI,4DAA4D;IAEvF;;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,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;IAO3D;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAM5E"}
1
+ {"version":3,"file":"sharedSummaryBlockFactory.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAInE;;;;;GAKG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAChE;;OAEG;IACH,gBAAuB,IAAI,4DAA4D;IAEvF;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,WAEd;IAED;;OAEG;IACH,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,aAAa,CAAC;IAOzB;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAUzE"}
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.38.3"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,8 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export { ISharedSummaryBlock } from "./interfaces.mjs";
6
+ export { SharedSummaryBlock } from "./sharedSummaryBlock.mjs";
7
+ export { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory.mjs";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,mBAAmB,EAAE;OACvB,EAAE,kBAAkB,EAAE;OACtB,EAAE,yBAAyB,EAAE"}
package/lib/index.mjs ADDED
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+ export { SharedSummaryBlock } from "./sharedSummaryBlock.mjs";
6
+ export { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory.mjs";
7
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAGI,EAAE,kBAAkB,EAAE;OACtB,EAAE,yBAAyB,EAAE","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { ISharedSummaryBlock } from \"./interfaces\";\nexport { SharedSummaryBlock } from \"./sharedSummaryBlock\";\nexport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\n"]}
@@ -9,12 +9,16 @@ import { ISharedObject } from "@fluidframework/shared-object-base";
9
9
  * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
10
10
  * the set of calls on this interface to set data should be the same. This is critical because the object does not
11
11
  * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
12
+ * @alpha
12
13
  */
13
14
  export interface ISharedSummaryBlock extends ISharedObject {
14
15
  /**
15
16
  * Retrieves the given key from the map.
16
17
  * @param key - Key to retrieve from.
17
18
  * @returns The stored value, or undefined if the key is not set.
19
+ *
20
+ * @privateRemarks
21
+ * The return type is underspecified to allow for the possibility of objects with function or undefined values.
18
22
  */
19
23
  get<T>(key: string): Jsonable<T>;
20
24
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,QAAQ,EAAE,MAAM,uCAAuC;OACzD,EAAE,aAAa,EAAE,MAAM,oCAAoC;AAElE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACzD;;;;;;;OAOG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEjC;;;;OAIG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CAC9C"}
@@ -3,4 +3,4 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=interfaces.js.map
6
+ //# sourceMappingURL=interfaces.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.mjs","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 { Jsonable } from \"@fluidframework/datastore-definitions\";\nimport { ISharedObject } from \"@fluidframework/shared-object-base\";\n\n/**\n * Shared summary block interface. A shared summary block is part of the summary but it does not generate any ops.\n * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,\n * the set of calls on this interface to set data should be the same. This is critical because the object does not\n * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.\n * @alpha\n */\nexport interface ISharedSummaryBlock extends ISharedObject {\n\t/**\n\t * Retrieves the given key from the map.\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 * @privateRemarks\n\t * The return type is underspecified to allow for the possibility of objects with function or undefined values.\n\t */\n\tget<T>(key: string): Jsonable<T>;\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 - Jsonable type value to set.\n\t */\n\tset<T>(key: string, value: Jsonable<T>): void;\n}\n"]}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export declare const pkgName = "@fluidframework/shared-summary-block";
8
- export declare const pkgVersion = "1.4.0-121020";
8
+ export declare const pkgVersion = "2.0.0-dev-rc.1.0.0.224419";
9
9
  //# sourceMappingURL=packageVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yCAAyC,CAAC;AAC9D,eAAO,MAAM,UAAU,iBAAiB,CAAC"}
1
+ {"version":3,"file":"packageVersion.d.ts","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,OAAO,yCAAyC,CAAC;AAC9D,eAAO,MAAM,UAAU,8BAA8B,CAAC"}
@@ -5,5 +5,5 @@
5
5
  * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
6
6
  */
7
7
  export const pkgName = "@fluidframework/shared-summary-block";
8
- export const pkgVersion = "1.4.0-121020";
9
- //# sourceMappingURL=packageVersion.js.map
8
+ export const pkgVersion = "2.0.0-dev-rc.1.0.0.224419";
9
+ //# sourceMappingURL=packageVersion.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageVersion.mjs","sourceRoot":"","sources":["../src/packageVersion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,sCAAsC,CAAC;AAC9D,MAAM,CAAC,MAAM,UAAU,GAAG,2BAA2B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n *\n * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY\n */\n\nexport const pkgName = \"@fluidframework/shared-summary-block\";\nexport const pkgVersion = \"2.0.0-dev-rc.1.0.0.224419\";\n"]}
@@ -0,0 +1,100 @@
1
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
2
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
3
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
4
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
5
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
6
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
7
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
+ import { ISharedObject } from '@fluidframework/shared-object-base';
9
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
+ import { Jsonable } from '@fluidframework/datastore-definitions';
11
+ import { SharedObject } from '@fluidframework/shared-object-base';
12
+
13
+ /**
14
+ * Shared summary block interface. A shared summary block is part of the summary but it does not generate any ops.
15
+ * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
16
+ * the set of calls on this interface to set data should be the same. This is critical because the object does not
17
+ * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
18
+ * @alpha
19
+ */
20
+ export declare interface ISharedSummaryBlock extends ISharedObject {
21
+ /**
22
+ * Retrieves the given key from the map.
23
+ * @param key - Key to retrieve from.
24
+ * @returns The stored value, or undefined if the key is not set.
25
+ *
26
+ * @privateRemarks
27
+ * The return type is underspecified to allow for the possibility of objects with function or undefined values.
28
+ */
29
+ get<T>(key: string): Jsonable<T>;
30
+ /**
31
+ * Sets the value stored at key to the provided value.
32
+ * @param key - Key to set at.
33
+ * @param value - Jsonable type value to set.
34
+ */
35
+ set<T>(key: string, value: Jsonable<T>): void;
36
+ }
37
+
38
+ /**
39
+ * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
40
+ * Data should be set in this object in response to a remote op.
41
+ * @alpha
42
+ */
43
+ export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
44
+ /**
45
+ * Create a new shared summary block
46
+ *
47
+ * @param runtime - data store runtime the new shared summary block belongs to.
48
+ * @param id - optional name of the shared summary block.
49
+ * @returns newly created shared summary block (but not attached yet).
50
+ */
51
+ static create(runtime: IFluidDataStoreRuntime, id?: string): SharedSummaryBlock;
52
+ /**
53
+ * Get a factory for SharedSummaryBlock to register with the data store.
54
+ *
55
+ * @returns a factory that creates and loads SharedSummaryBlock.
56
+ */
57
+ static getFactory(): IChannelFactory;
58
+ /**
59
+ * The data held by this object.
60
+ */
61
+ private readonly data;
62
+ /**
63
+ * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
64
+ * be provided.
65
+ *
66
+ * @param id - optional name of the shared summary block.
67
+ * @param runtime - data store runtime thee object belongs to.
68
+ * @param attributes - The attributes for the object.
69
+ */
70
+ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
71
+ /**
72
+ * {@inheritDoc ISharedSummaryBlock.get}
73
+ */
74
+ get<T>(key: string): Jsonable<T>;
75
+ /**
76
+ * {@inheritDoc ISharedSummaryBlock.set}
77
+ */
78
+ set<T>(key: string, value: Jsonable<T>): void;
79
+ /**
80
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
81
+ */
82
+ protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
83
+ /**
84
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
85
+ */
86
+ protected loadCore(storage: IChannelStorageService): Promise<void>;
87
+ /**
88
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
89
+ */
90
+ protected onDisconnect(): void;
91
+ /**
92
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
93
+ */
94
+ protected processCore(message: ISequencedDocumentMessage, local: boolean): void;
95
+ protected applyStashedOp(): void;
96
+ }
97
+
98
+ /* Excluded from this release type: SharedSummaryBlockFactory */
99
+
100
+ export { }
@@ -0,0 +1,21 @@
1
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
2
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
3
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
4
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
5
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
6
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
7
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
+ import { ISharedObject } from '@fluidframework/shared-object-base';
9
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
+ import { Jsonable } from '@fluidframework/datastore-definitions';
11
+ import { SharedObject } from '@fluidframework/shared-object-base';
12
+
13
+ /* Excluded from this release type: ISharedSummaryBlock */
14
+
15
+ /* Excluded from this release type: Jsonable */
16
+
17
+ /* Excluded from this release type: SharedSummaryBlock */
18
+
19
+ /* Excluded from this release type: SharedSummaryBlockFactory */
20
+
21
+ export { }
@@ -0,0 +1,21 @@
1
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
2
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
3
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
4
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
5
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
6
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
7
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
+ import { ISharedObject } from '@fluidframework/shared-object-base';
9
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
+ import { Jsonable } from '@fluidframework/datastore-definitions';
11
+ import { SharedObject } from '@fluidframework/shared-object-base';
12
+
13
+ /* Excluded from this release type: ISharedSummaryBlock */
14
+
15
+ /* Excluded from this release type: Jsonable */
16
+
17
+ /* Excluded from this release type: SharedSummaryBlock */
18
+
19
+ /* Excluded from this release type: SharedSummaryBlockFactory */
20
+
21
+ export { }
@@ -0,0 +1,131 @@
1
+ import { IChannelAttributes } from '@fluidframework/datastore-definitions';
2
+ import { IChannelFactory } from '@fluidframework/datastore-definitions';
3
+ import { IChannelServices } from '@fluidframework/datastore-definitions';
4
+ import { IChannelStorageService } from '@fluidframework/datastore-definitions';
5
+ import { IFluidDataStoreRuntime } from '@fluidframework/datastore-definitions';
6
+ import { IFluidSerializer } from '@fluidframework/shared-object-base';
7
+ import { ISequencedDocumentMessage } from '@fluidframework/protocol-definitions';
8
+ import { ISharedObject } from '@fluidframework/shared-object-base';
9
+ import { ISummaryTreeWithStats } from '@fluidframework/runtime-definitions';
10
+ import { Jsonable } from '@fluidframework/datastore-definitions';
11
+ import { SharedObject } from '@fluidframework/shared-object-base';
12
+
13
+ /**
14
+ * Shared summary block interface. A shared summary block is part of the summary but it does not generate any ops.
15
+ * The set on this interface must only be called in response to a remote op. Basically, if we replay same ops,
16
+ * the set of calls on this interface to set data should be the same. This is critical because the object does not
17
+ * generate ops of its own, but relies on the above principle to maintain eventual consistency and to summarize.
18
+ * @alpha
19
+ */
20
+ export declare interface ISharedSummaryBlock extends ISharedObject {
21
+ /**
22
+ * Retrieves the given key from the map.
23
+ * @param key - Key to retrieve from.
24
+ * @returns The stored value, or undefined if the key is not set.
25
+ *
26
+ * @privateRemarks
27
+ * The return type is underspecified to allow for the possibility of objects with function or undefined values.
28
+ */
29
+ get<T>(key: string): Jsonable<T>;
30
+ /**
31
+ * Sets the value stored at key to the provided value.
32
+ * @param key - Key to set at.
33
+ * @param value - Jsonable type value to set.
34
+ */
35
+ set<T>(key: string, value: Jsonable<T>): void;
36
+ }
37
+
38
+ /**
39
+ * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
40
+ * Data should be set in this object in response to a remote op.
41
+ * @alpha
42
+ */
43
+ export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
44
+ /**
45
+ * Create a new shared summary block
46
+ *
47
+ * @param runtime - data store runtime the new shared summary block belongs to.
48
+ * @param id - optional name of the shared summary block.
49
+ * @returns newly created shared summary block (but not attached yet).
50
+ */
51
+ static create(runtime: IFluidDataStoreRuntime, id?: string): SharedSummaryBlock;
52
+ /**
53
+ * Get a factory for SharedSummaryBlock to register with the data store.
54
+ *
55
+ * @returns a factory that creates and loads SharedSummaryBlock.
56
+ */
57
+ static getFactory(): IChannelFactory;
58
+ /**
59
+ * The data held by this object.
60
+ */
61
+ private readonly data;
62
+ /**
63
+ * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
64
+ * be provided.
65
+ *
66
+ * @param id - optional name of the shared summary block.
67
+ * @param runtime - data store runtime thee object belongs to.
68
+ * @param attributes - The attributes for the object.
69
+ */
70
+ constructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes);
71
+ /**
72
+ * {@inheritDoc ISharedSummaryBlock.get}
73
+ */
74
+ get<T>(key: string): Jsonable<T>;
75
+ /**
76
+ * {@inheritDoc ISharedSummaryBlock.set}
77
+ */
78
+ set<T>(key: string, value: Jsonable<T>): void;
79
+ /**
80
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}
81
+ */
82
+ protected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats;
83
+ /**
84
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}
85
+ */
86
+ protected loadCore(storage: IChannelStorageService): Promise<void>;
87
+ /**
88
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}
89
+ */
90
+ protected onDisconnect(): void;
91
+ /**
92
+ * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}
93
+ */
94
+ protected processCore(message: ISequencedDocumentMessage, local: boolean): void;
95
+ protected applyStashedOp(): void;
96
+ }
97
+
98
+ /**
99
+ * The factory that defines the shared summary block.
100
+ *
101
+ * @sealed
102
+ * @internal
103
+ */
104
+ export declare class SharedSummaryBlockFactory implements IChannelFactory {
105
+ /**
106
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
107
+ */
108
+ static readonly Type = "https://graph.microsoft.com/types/shared-summary-block";
109
+ /**
110
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
111
+ */
112
+ static readonly Attributes: IChannelAttributes;
113
+ /**
114
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory."type"}
115
+ */
116
+ get type(): string;
117
+ /**
118
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.attributes}
119
+ */
120
+ get attributes(): IChannelAttributes;
121
+ /**
122
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.load}
123
+ */
124
+ load(runtime: IFluidDataStoreRuntime, id: string, services: IChannelServices, attributes: IChannelAttributes): Promise<ISharedObject>;
125
+ /**
126
+ * {@inheritDoc @fluidframework/datastore-definitions#IChannelFactory.create}
127
+ */
128
+ create(runtime: IFluidDataStoreRuntime, id: string): ISharedObject;
129
+ }
130
+
131
+ export { }
@@ -6,10 +6,11 @@ import { ISequencedDocumentMessage } from "@fluidframework/protocol-definitions"
6
6
  import { IChannelAttributes, IFluidDataStoreRuntime, IChannelStorageService, Jsonable, IChannelFactory } from "@fluidframework/datastore-definitions";
7
7
  import { ISummaryTreeWithStats } from "@fluidframework/runtime-definitions";
8
8
  import { IFluidSerializer, SharedObject } from "@fluidframework/shared-object-base";
9
- import { ISharedSummaryBlock } from "./interfaces";
9
+ import { ISharedSummaryBlock } from "./interfaces.mjs";
10
10
  /**
11
11
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
12
12
  * Data should be set in this object in response to a remote op.
13
+ * @alpha
13
14
  */
14
15
  export declare class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {
15
16
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlock.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EAAE,yBAAyB,EAAE,MAAM,sCAAsC;OACzE,EACN,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,QAAQ,EACR,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,qBAAqB,EAAE,MAAM,qCAAqC;OAEpE,EAEN,gBAAgB,EAChB,YAAY,EACZ,MAAM,oCAAoC;OAEpC,EAAE,mBAAmB,EAAE;AAY9B;;;;GAIG;AACH,qBAAa,kBAAmB,SAAQ,YAAa,YAAW,mBAAmB;IAClF;;;;;;OAMG;WACW,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,CAAC,EAAE,MAAM;IAIjE;;;;OAIG;WACW,UAAU,IAAI,eAAe;IAI3C;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwC;IAE7D;;;;;;;OAOG;gBACS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,kBAAkB;IAIvF;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC;IAIvC;;OAEG;IACI,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI;IAMpD;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,gBAAgB,GAAG,qBAAqB;IAQ5E;;OAEG;cACa,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAUxE;;OAEG;IACH,SAAS,CAAC,YAAY;IAEtB;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,OAAO;IAIxE,SAAS,CAAC,cAAc;CAGxB"}
@@ -4,28 +4,14 @@
4
4
  */
5
5
  import { readAndParse } from "@fluidframework/driver-utils";
6
6
  import { createSingleBlobSummary, SharedObject, } from "@fluidframework/shared-object-base";
7
- import { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory";
7
+ import { SharedSummaryBlockFactory } from "./sharedSummaryBlockFactory.mjs";
8
8
  const snapshotFileName = "header";
9
9
  /**
10
10
  * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.
11
11
  * Data should be set in this object in response to a remote op.
12
+ * @alpha
12
13
  */
13
14
  export class SharedSummaryBlock extends SharedObject {
14
- /**
15
- * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
16
- * be provided.
17
- *
18
- * @param id - optional name of the shared summary block.
19
- * @param runtime - data store runtime thee object belongs to.
20
- * @param attributes - The attributes for the object.
21
- */
22
- constructor(id, runtime, attributes) {
23
- super(id, runtime, attributes, "fluid_sharedSummaryBlock_");
24
- /**
25
- * The data held by this object.
26
- */
27
- this.data = new Map();
28
- }
29
15
  /**
30
16
  * Create a new shared summary block
31
17
  *
@@ -44,6 +30,21 @@ export class SharedSummaryBlock extends SharedObject {
44
30
  static getFactory() {
45
31
  return new SharedSummaryBlockFactory();
46
32
  }
33
+ /**
34
+ * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will
35
+ * be provided.
36
+ *
37
+ * @param id - optional name of the shared summary block.
38
+ * @param runtime - data store runtime thee object belongs to.
39
+ * @param attributes - The attributes for the object.
40
+ */
41
+ constructor(id, runtime, attributes) {
42
+ super(id, runtime, attributes, "fluid_sharedSummaryBlock_");
43
+ /**
44
+ * The data held by this object.
45
+ */
46
+ this.data = new Map();
47
+ }
47
48
  /**
48
49
  * {@inheritDoc ISharedSummaryBlock.get}
49
50
  */
@@ -91,4 +92,4 @@ export class SharedSummaryBlock extends SharedObject {
91
92
  throw new Error("not implemented");
92
93
  }
93
94
  }
94
- //# sourceMappingURL=sharedSummaryBlock.js.map
95
+ //# sourceMappingURL=sharedSummaryBlock.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlock.mjs","sourceRoot":"","sources":["../src/sharedSummaryBlock.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAWI,EAAE,YAAY,EAAE,MAAM,8BAA8B;OACpD,EACN,uBAAuB,EAEvB,YAAY,GACZ,MAAM,oCAAoC;OACpC,EAAE,yBAAyB,EAAE;AAGpC,MAAM,gBAAgB,GAAG,QAAQ,CAAC;AAUlC;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,YAAY;IACnD;;;;;;OAMG;IACI,MAAM,CAAC,MAAM,CAAC,OAA+B,EAAE,EAAW;QAChE,OAAO,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,yBAAyB,CAAC,IAAI,CAAuB,CAAC;IACxF,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU;QACvB,OAAO,IAAI,yBAAyB,EAAE,CAAC;IACxC,CAAC;IAOD;;;;;;;OAOG;IACH,YAAY,EAAU,EAAE,OAA+B,EAAE,UAA8B;QACtF,KAAK,CAAC,EAAE,EAAE,OAAO,EAAE,UAA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CAAC,CAAC;IACpC,CAAC;CACD","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISequencedDocumentMessage } from \"@fluidframework/protocol-definitions\";\nimport {\n\tIChannelAttributes,\n\tIFluidDataStoreRuntime,\n\tIChannelStorageService,\n\tJsonable,\n\tIChannelFactory,\n} from \"@fluidframework/datastore-definitions\";\nimport { ISummaryTreeWithStats } from \"@fluidframework/runtime-definitions\";\nimport { readAndParse } from \"@fluidframework/driver-utils\";\nimport {\n\tcreateSingleBlobSummary,\n\tIFluidSerializer,\n\tSharedObject,\n} from \"@fluidframework/shared-object-base\";\nimport { SharedSummaryBlockFactory } from \"./sharedSummaryBlockFactory\";\nimport { ISharedSummaryBlock } from \"./interfaces\";\n\nconst snapshotFileName = \"header\";\n\n/**\n * Defines the in-memory object structure to be used for the conversion to/from serialized.\n * Directly used in JSON.stringify, direct result from JSON.parse.\n */\ninterface ISharedSummaryBlockDataSerializable {\n\t[key: string]: Jsonable<unknown>;\n}\n\n/**\n * Implementation of a shared summary block. It does not generate any ops. It is only part of the summary.\n * Data should be set in this object in response to a remote op.\n * @alpha\n */\nexport class SharedSummaryBlock extends SharedObject implements ISharedSummaryBlock {\n\t/**\n\t * Create a new shared summary block\n\t *\n\t * @param runtime - data store runtime the new shared summary block belongs to.\n\t * @param id - optional name of the shared summary block.\n\t * @returns newly created shared summary block (but not attached yet).\n\t */\n\tpublic static create(runtime: IFluidDataStoreRuntime, id?: string) {\n\t\treturn runtime.createChannel(id, SharedSummaryBlockFactory.Type) as SharedSummaryBlock;\n\t}\n\n\t/**\n\t * Get a factory for SharedSummaryBlock to register with the data store.\n\t *\n\t * @returns a factory that creates and loads SharedSummaryBlock.\n\t */\n\tpublic static getFactory(): IChannelFactory {\n\t\treturn new SharedSummaryBlockFactory();\n\t}\n\n\t/**\n\t * The data held by this object.\n\t */\n\tprivate readonly data = new Map<string, Jsonable<unknown>>();\n\n\t/**\n\t * Constructs a new SharedSummaryBlock. If the object is non-local, an id and service interfaces will\n\t * be provided.\n\t *\n\t * @param id - optional name of the shared summary block.\n\t * @param runtime - data store runtime thee object belongs to.\n\t * @param attributes - The attributes for the object.\n\t */\n\tconstructor(id: string, runtime: IFluidDataStoreRuntime, attributes: IChannelAttributes) {\n\t\tsuper(id, runtime, attributes, \"fluid_sharedSummaryBlock_\");\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.get}\n\t */\n\tpublic get<T>(key: string): Jsonable<T> {\n\t\treturn this.data.get(key) as Jsonable<T>;\n\t}\n\n\t/**\n\t * {@inheritDoc ISharedSummaryBlock.set}\n\t */\n\tpublic set<T>(key: string, value: Jsonable<T>): void {\n\t\tthis.data.set(key, value);\n\t\t// Set this object as dirty so that it is part of the next summary.\n\t\tthis.dirty();\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.summarizeCore}\n\t */\n\tprotected summarizeCore(serializer: IFluidSerializer): ISummaryTreeWithStats {\n\t\tconst contentsBlob: ISharedSummaryBlockDataSerializable = {};\n\t\tthis.data.forEach((value, key) => {\n\t\t\tcontentsBlob[key] = value;\n\t\t});\n\t\treturn createSingleBlobSummary(snapshotFileName, JSON.stringify(contentsBlob));\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.loadCore}\n\t */\n\tprotected async loadCore(storage: IChannelStorageService): Promise<void> {\n\t\tconst contents = await readAndParse<ISharedSummaryBlockDataSerializable>(\n\t\t\tstorage,\n\t\t\tsnapshotFileName,\n\t\t);\n\t\tfor (const [key, value] of Object.entries(contents)) {\n\t\t\tthis.data.set(key, value);\n\t\t}\n\t}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.onDisconnect}\n\t */\n\tprotected onDisconnect() {}\n\n\t/**\n\t * {@inheritDoc @fluidframework/shared-object-base#SharedObject.processCore}\n\t */\n\tprotected processCore(message: ISequencedDocumentMessage, local: boolean) {\n\t\tthrow new Error(\"shared summary block should not generate any ops.\");\n\t}\n\n\tprotected applyStashedOp() {\n\t\tthrow new Error(\"not implemented\");\n\t}\n}\n"]}
@@ -6,7 +6,9 @@ import { IChannelAttributes, IFluidDataStoreRuntime, IChannelServices, IChannelF
6
6
  import { ISharedObject } from "@fluidframework/shared-object-base";
7
7
  /**
8
8
  * The factory that defines the shared summary block.
9
+ *
9
10
  * @sealed
11
+ * @internal
10
12
  */
11
13
  export declare class SharedSummaryBlockFactory implements IChannelFactory {
12
14
  /**
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedSummaryBlockFactory.d.ts","sourceRoot":"","sources":["../src/sharedSummaryBlockFactory.ts"],"names":[],"mappings":"AAAA;;;GAGG;OAEI,EACN,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,MAAM,uCAAuC;OACvC,EAAE,aAAa,EAAE,MAAM,oCAAoC;AAIlE;;;;;GAKG;AACH,qBAAa,yBAA0B,YAAW,eAAe;IAChE;;OAEG;IACH,gBAAuB,IAAI,4DAA4D;IAEvF;;OAEG;IACH,gBAAuB,UAAU,EAAE,kBAAkB,CAInD;IAEF;;OAEG;IACH,IAAW,IAAI,WAEd;IAED;;OAEG;IACH,IAAW,UAAU,uBAEpB;IAED;;OAEG;IACU,IAAI,CAChB,OAAO,EAAE,sBAAsB,EAC/B,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,gBAAgB,EAC1B,UAAU,EAAE,kBAAkB,GAC5B,OAAO,CAAC,aAAa,CAAC;IAOzB;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa;CAUzE"}