@fluid-internal/client-utils 2.118.1 → 3.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 (120) hide show
  1. package/CHANGELOG.md +1 -5
  2. package/README.md +13 -15
  3. package/dist/base64EncodingBrowser.d.ts +2 -1
  4. package/dist/base64EncodingBrowser.d.ts.map +1 -1
  5. package/dist/base64EncodingBrowser.js +1 -1
  6. package/dist/base64EncodingBrowser.js.map +1 -1
  7. package/dist/base64EncodingNode.d.ts +2 -1
  8. package/dist/base64EncodingNode.d.ts.map +1 -1
  9. package/dist/base64EncodingNode.js.map +1 -1
  10. package/dist/buffer.d.ts +93 -0
  11. package/dist/buffer.d.ts.map +1 -0
  12. package/dist/buffer.js +7 -0
  13. package/dist/buffer.js.map +1 -0
  14. package/dist/bufferBrowser.d.ts +18 -49
  15. package/dist/bufferBrowser.d.ts.map +1 -1
  16. package/dist/bufferBrowser.js +49 -52
  17. package/dist/bufferBrowser.js.map +1 -1
  18. package/dist/bufferNode.d.ts +67 -19
  19. package/dist/bufferNode.d.ts.map +1 -1
  20. package/dist/bufferNode.js +10 -12
  21. package/dist/bufferNode.js.map +1 -1
  22. package/dist/bufferShared.d.ts +38 -3
  23. package/dist/bufferShared.d.ts.map +1 -1
  24. package/dist/bufferShared.js +67 -5
  25. package/dist/bufferShared.js.map +1 -1
  26. package/dist/events/emitter.d.ts.map +1 -1
  27. package/dist/events/emitter.js +4 -3
  28. package/dist/events/emitter.js.map +1 -1
  29. package/dist/hashFileBrowser.d.ts +1 -1
  30. package/dist/hashFileBrowser.d.ts.map +1 -1
  31. package/dist/hashFileBrowser.js +23 -11
  32. package/dist/hashFileBrowser.js.map +1 -1
  33. package/dist/hashFileNode.d.ts +10 -2
  34. package/dist/hashFileNode.d.ts.map +1 -1
  35. package/dist/hashFileNode.js +10 -3
  36. package/dist/hashFileNode.js.map +1 -1
  37. package/dist/indexBrowser.d.ts +5 -3
  38. package/dist/indexBrowser.d.ts.map +1 -1
  39. package/dist/indexBrowser.js +5 -5
  40. package/dist/indexBrowser.js.map +1 -1
  41. package/dist/indexNode.d.ts +4 -3
  42. package/dist/indexNode.d.ts.map +1 -1
  43. package/dist/indexNode.js +5 -2
  44. package/dist/indexNode.js.map +1 -1
  45. package/dist/layerCompat.d.ts +37 -13
  46. package/dist/layerCompat.d.ts.map +1 -1
  47. package/dist/layerCompat.js +19 -14
  48. package/dist/layerCompat.js.map +1 -1
  49. package/dist/trace.js +2 -0
  50. package/dist/trace.js.map +1 -1
  51. package/dist/typedEventEmitter.js +7 -0
  52. package/dist/typedEventEmitter.js.map +1 -1
  53. package/eslint.config.mts +2 -2
  54. package/lib/base64EncodingBrowser.d.ts +2 -1
  55. package/lib/base64EncodingBrowser.d.ts.map +1 -1
  56. package/lib/base64EncodingBrowser.js +1 -1
  57. package/lib/base64EncodingBrowser.js.map +1 -1
  58. package/lib/base64EncodingNode.d.ts +2 -1
  59. package/lib/base64EncodingNode.d.ts.map +1 -1
  60. package/lib/base64EncodingNode.js.map +1 -1
  61. package/lib/buffer.d.ts +93 -0
  62. package/lib/buffer.d.ts.map +1 -0
  63. package/lib/buffer.js +6 -0
  64. package/lib/buffer.js.map +1 -0
  65. package/lib/bufferBrowser.d.ts +18 -49
  66. package/lib/bufferBrowser.d.ts.map +1 -1
  67. package/lib/bufferBrowser.js +29 -40
  68. package/lib/bufferBrowser.js.map +1 -1
  69. package/lib/bufferNode.d.ts +67 -19
  70. package/lib/bufferNode.d.ts.map +1 -1
  71. package/lib/bufferNode.js +7 -9
  72. package/lib/bufferNode.js.map +1 -1
  73. package/lib/bufferShared.d.ts +38 -3
  74. package/lib/bufferShared.d.ts.map +1 -1
  75. package/lib/bufferShared.js +64 -3
  76. package/lib/bufferShared.js.map +1 -1
  77. package/lib/events/emitter.d.ts.map +1 -1
  78. package/lib/events/emitter.js +2 -1
  79. package/lib/events/emitter.js.map +1 -1
  80. package/lib/hashFileBrowser.d.ts +1 -1
  81. package/lib/hashFileBrowser.d.ts.map +1 -1
  82. package/lib/hashFileBrowser.js +4 -1
  83. package/lib/hashFileBrowser.js.map +1 -1
  84. package/lib/hashFileNode.d.ts +10 -2
  85. package/lib/hashFileNode.d.ts.map +1 -1
  86. package/lib/hashFileNode.js +8 -0
  87. package/lib/hashFileNode.js.map +1 -1
  88. package/lib/indexBrowser.d.ts +5 -3
  89. package/lib/indexBrowser.d.ts.map +1 -1
  90. package/lib/indexBrowser.js +3 -5
  91. package/lib/indexBrowser.js.map +1 -1
  92. package/lib/indexNode.d.ts +4 -3
  93. package/lib/indexNode.d.ts.map +1 -1
  94. package/lib/indexNode.js +2 -2
  95. package/lib/indexNode.js.map +1 -1
  96. package/lib/layerCompat.d.ts +37 -13
  97. package/lib/layerCompat.d.ts.map +1 -1
  98. package/lib/layerCompat.js +17 -12
  99. package/lib/layerCompat.js.map +1 -1
  100. package/lib/trace.js +2 -0
  101. package/lib/trace.js.map +1 -1
  102. package/lib/typedEventEmitter.js +7 -0
  103. package/lib/typedEventEmitter.js.map +1 -1
  104. package/package.json +65 -62
  105. package/playwright.config.ts +23 -0
  106. package/src/base64EncodingBrowser.ts +3 -2
  107. package/src/base64EncodingNode.ts +2 -1
  108. package/src/buffer.ts +112 -0
  109. package/src/bufferBrowser.ts +98 -60
  110. package/src/bufferNode.ts +86 -30
  111. package/src/bufferShared.ts +74 -4
  112. package/src/hashFileBrowser.ts +6 -3
  113. package/src/hashFileNode.ts +10 -2
  114. package/src/indexBrowser.ts +13 -2
  115. package/src/indexNode.ts +13 -2
  116. package/src/layerCompat.ts +41 -13
  117. package/tsconfig.json +1 -2
  118. package/webpack.playwright.cjs +22 -0
  119. package/jest-puppeteer.config.cjs +0 -16
  120. package/jest.config.cjs +0 -21
@@ -1 +1 @@
1
- {"version":3,"file":"hashFileBrowser.js","sourceRoot":"","sources":["../src/hashFileBrowser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,oD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AC;IAED,+EAA+E;IAC/E,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACtD,OAAO,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAC9C,CAAC;AApBD,4BAoBC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,WAAW,CAAC,IAAe;IAChD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;IAC7B,qDAAqD;IACrD,MAAM,UAAU,GAAG,QAAQ,IAAI,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,MAAM,UAAU,GAAG,4BAAS,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEhE,mEAAmE;IACnE,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC;AARD,kCAQC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as base64js from \"base64-js\";\n\n// Note: See 'Isomorphic Code' section in the package README.md\nimport { IsoBuffer } from \"./bufferBrowser.js\";\n\nasync function digestBuffer(\n\tfile: IsoBuffer,\n\talgorithm: \"SHA-1\" | \"SHA-256\",\n): Promise<Uint8Array> {\n\tconst hash = await crypto.subtle.digest(algorithm, file);\n\treturn new Uint8Array(hash);\n}\n\nfunction encodeDigest(hashArray: Uint8Array, encoding: \"hex\" | \"base64\"): string {\n\t// eslint-disable-next-line default-case\n\tswitch (encoding) {\n\t\tcase \"hex\": {\n\t\t\tconst hashHex = Array.prototype.map\n\t\t\t\t.call(hashArray, (byte) => {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n\t\t\t\t\treturn byte.toString(16).padStart(2, \"0\") as string;\n\t\t\t\t})\n\t\t\t\t.join(\"\");\n\t\t\treturn hashHex;\n\t\t}\n\t\tcase \"base64\": {\n\t\t\treturn base64js.fromByteArray(hashArray);\n\t\t}\n\t}\n}\n\n/**\n * Hash a file. Consistent within a session, but should not be persisted and\n * is not consistent with git.\n * If called under an insecure context for a browser, this will fallback to\n * using the node implementation.\n *\n * @param file - The contents of the file in a buffer.\n * @param algorithm - The hash algorithm to use, artificially constrained by what is used internally.\n * @param hashEncoding - The encoding of the returned hash, also artificially constrained.\n * @returns The hash of the content of the buffer.\n *\n * @internal\n */\nexport async function hashFile(\n\tfile: IsoBuffer,\n\talgorithm: \"SHA-1\" | \"SHA-256\" = \"SHA-1\",\n\thashEncoding: \"hex\" | \"base64\" = \"hex\",\n): Promise<string> {\n\t// Handle insecure contexts (e.g. running with local services)\n\t// by deferring to Node version, which uses a hash polyfill\n\t// When packed, this chunk will show as \"FluidFramework-HashFallback\" separately\n\t// from the main chunk and will be of non-trivial size. It will not be served\n\t// under normal circumstances.\n\tif (crypto.subtle === undefined) {\n\t\treturn import(\n\t\t\t/* webpackChunkName: \"FluidFramework-HashFallback\" */\n\t\t\t\"./hashFileNode.js\"\n\t\t).then(async (m) => m.hashFile(file, algorithm, hashEncoding));\n\t}\n\n\t// This is split up this way to facilitate testing (see the test for more info)\n\tconst hashArray = await digestBuffer(file, algorithm);\n\treturn encodeDigest(hashArray, hashEncoding);\n}\n\n/**\n * Create a github hash (Github hashes the string with blob and size)\n * Must be called under secure context for browsers\n *\n * @param file - The contents of the file in a buffer\n * @returns The sha1 hash of the content of the buffer with the `blob` prefix and size\n *\n * @internal\n */\nexport async function gitHashFile(file: IsoBuffer): Promise<string> {\n\tconst size = file.byteLength;\n\t// eslint-disable-next-line unicorn/prefer-code-point\n\tconst filePrefix = `blob ${size.toString()}${String.fromCharCode(0)}`;\n\tconst hashBuffer = IsoBuffer.from(filePrefix + file.toString());\n\n\t// hashFile uses sha1; if that changes this will need to change too\n\treturn hashFile(hashBuffer);\n}\n"]}
1
+ {"version":3,"file":"hashFileBrowser.js","sourceRoot":"","sources":["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AC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,+EAA+E;IAC/E,MAAM,SAAS,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IACtD,OAAO,YAAY,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AAC9C,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,WAAW,CAAC,IAAe;IAChD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;IAC7B,qDAAqD;IACrD,MAAM,UAAU,GAAG,QAAQ,IAAI,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,MAAM,YAAY,GAAG,4BAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,IAAI,4BAAS,CAAC,YAAY,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC;IAC5E,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC7B,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,YAAY,CAAC,UAAU,CAAC,CAAC;IAE9C,mEAAmE;IACnE,OAAO,QAAQ,CAAC,UAAU,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport * as base64js from \"base64-js\";\n\n// Note: See 'Isomorphic Code' section in the package README.md\nimport { IsoBuffer } from \"./bufferBrowser.js\";\n\nasync function digestBuffer(\n\tfile: IsoBuffer<ArrayBuffer>,\n\talgorithm: \"SHA-1\" | \"SHA-256\",\n): Promise<Uint8Array> {\n\tconst hash = await crypto.subtle.digest(algorithm, file);\n\treturn new Uint8Array(hash);\n}\n\nfunction encodeDigest(hashArray: Uint8Array, encoding: \"hex\" | \"base64\"): string {\n\t// eslint-disable-next-line default-case\n\tswitch (encoding) {\n\t\tcase \"hex\": {\n\t\t\tconst hashHex = Array.prototype.map\n\t\t\t\t.call(hashArray, (byte) => {\n\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n\t\t\t\t\treturn byte.toString(16).padStart(2, \"0\") as string;\n\t\t\t\t})\n\t\t\t\t.join(\"\");\n\t\t\treturn hashHex;\n\t\t}\n\t\tcase \"base64\": {\n\t\t\treturn base64js.fromByteArray(hashArray);\n\t\t}\n\t}\n}\n\n/**\n * Hash a file. Consistent within a session, but should not be persisted and\n * is not consistent with git.\n * If called under an insecure context for a browser, this will fallback to\n * using the node implementation.\n *\n * @param file - The contents of the file in a buffer.\n * @param algorithm - The hash algorithm to use, artificially constrained by what is used internally.\n * @param hashEncoding - The encoding of the returned hash, also artificially constrained.\n * @returns The hash of the content of the buffer.\n *\n * @internal\n */\nexport async function hashFile(\n\tfile: IsoBuffer<ArrayBuffer>,\n\talgorithm: \"SHA-1\" | \"SHA-256\" = \"SHA-1\",\n\thashEncoding: \"hex\" | \"base64\" = \"hex\",\n): Promise<string> {\n\t// Handle insecure contexts (e.g. running with local services)\n\t// by deferring to Node version, which uses a hash polyfill\n\t// When packed, this chunk will show as \"FluidFramework-HashFallback\" separately\n\t// from the main chunk and will be of non-trivial size. It will not be served\n\t// under normal circumstances.\n\tif (crypto.subtle === undefined) {\n\t\treturn import(\n\t\t\t/* webpackChunkName: \"FluidFramework-HashFallback\" */\n\t\t\t\"./hashFileNode.js\"\n\t\t).then(async (m) => m.hashFile(file, algorithm, hashEncoding));\n\t}\n\n\t// This is split up this way to facilitate testing (see the test for more info)\n\tconst hashArray = await digestBuffer(file, algorithm);\n\treturn encodeDigest(hashArray, hashEncoding);\n}\n\n/**\n * Create a github hash (Github hashes the string with blob and size)\n * Must be called under secure context for browsers\n *\n * @param file - The contents of the file in a buffer\n * @returns The sha1 hash of the content of the buffer with the `blob` prefix and size\n *\n * @internal\n */\nexport async function gitHashFile(file: IsoBuffer): Promise<string> {\n\tconst size = file.byteLength;\n\t// eslint-disable-next-line unicorn/prefer-code-point\n\tconst filePrefix = `blob ${size.toString()}${String.fromCharCode(0)}`;\n\tconst prefixBuffer = IsoBuffer.from(filePrefix);\n\tconst hashBuffer = new IsoBuffer(prefixBuffer.byteLength + file.byteLength);\n\thashBuffer.set(prefixBuffer);\n\thashBuffer.set(file, prefixBuffer.byteLength);\n\n\t// hashFile uses sha1; if that changes this will need to change too\n\treturn hashFile(hashBuffer);\n}\n"]}
@@ -15,8 +15,12 @@ import type { IsoBuffer } from "./bufferNode.js";
15
15
  * @returns The hash of the content of the buffer.
16
16
  *
17
17
  * @internal
18
+ *
19
+ * @privateRemarks
20
+ * This function does not strictly require `<ArrayBuffer>` backing, but it is typed
21
+ * that way to match the browser implementation, which does require `<ArrayBuffer>` backing.
18
22
  */
19
- export declare function hashFile(file: IsoBuffer, algorithm?: "SHA-1" | "SHA-256", hashEncoding?: "hex" | "base64"): Promise<string>;
23
+ export declare function hashFile(file: IsoBuffer<ArrayBuffer>, algorithm?: "SHA-1" | "SHA-256", hashEncoding?: "hex" | "base64"): Promise<string>;
20
24
  /**
21
25
  * Create a github hash (Github hashes the string with blob and size)
22
26
  * Must be called under secure context for browsers
@@ -25,6 +29,10 @@ export declare function hashFile(file: IsoBuffer, algorithm?: "SHA-1" | "SHA-256
25
29
  * @returns The sha1 hash of the content of the buffer with the `blob` prefix and size
26
30
  *
27
31
  * @internal
32
+ *
33
+ * @privateRemarks
34
+ * This function does not strictly require `<ArrayBuffer>` backing, but it is typed
35
+ * that way to match the browser implementation, which does require `<ArrayBuffer>` backing.
28
36
  */
29
- export declare function gitHashFile(file: IsoBuffer): Promise<string>;
37
+ export declare function gitHashFile(file: IsoBuffer<ArrayBuffer>): Promise<string>;
30
38
  //# sourceMappingURL=hashFileNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hashFileNode.d.ts","sourceRoot":"","sources":["../src/hashFileNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;;;;;;;GAYG;AACH,wBAAsB,QAAQ,CAC7B,IAAI,EAAE,SAAS,EACf,SAAS,GAAE,OAAO,GAAG,SAAmB,EACxC,YAAY,GAAE,KAAK,GAAG,QAAgB,GACpC,OAAO,CAAC,MAAM,CAAC,CAejB;AAED;;;;;;;;GAQG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAMlE"}
1
+ {"version":3,"file":"hashFileNode.d.ts","sourceRoot":"","sources":["../src/hashFileNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,QAAQ,CAC7B,IAAI,EAAE,SAAS,CAAC,WAAW,CAAC,EAC5B,SAAS,GAAE,OAAO,GAAG,SAAmB,EACxC,YAAY,GAAE,KAAK,GAAG,QAAgB,GACpC,OAAO,CAAC,MAAM,CAAC,CAejB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAM/E"}
@@ -4,7 +4,8 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.gitHashFile = exports.hashFile = void 0;
7
+ exports.hashFile = hashFile;
8
+ exports.gitHashFile = gitHashFile;
8
9
  const sha_js_1 = require("sha.js");
9
10
  /**
10
11
  * Hash a file. Consistent within a session, but should not be persisted and
@@ -18,6 +19,10 @@ const sha_js_1 = require("sha.js");
18
19
  * @returns The hash of the content of the buffer.
19
20
  *
20
21
  * @internal
22
+ *
23
+ * @privateRemarks
24
+ * This function does not strictly require `<ArrayBuffer>` backing, but it is typed
25
+ * that way to match the browser implementation, which does require `<ArrayBuffer>` backing.
21
26
  */
22
27
  async function hashFile(file, algorithm = "SHA-1", hashEncoding = "hex") {
23
28
  let engine;
@@ -35,7 +40,6 @@ async function hashFile(file, algorithm = "SHA-1", hashEncoding = "hex") {
35
40
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
36
41
  return engine.update(file).digest(hashEncoding);
37
42
  }
38
- exports.hashFile = hashFile;
39
43
  /**
40
44
  * Create a github hash (Github hashes the string with blob and size)
41
45
  * Must be called under secure context for browsers
@@ -44,6 +48,10 @@ exports.hashFile = hashFile;
44
48
  * @returns The sha1 hash of the content of the buffer with the `blob` prefix and size
45
49
  *
46
50
  * @internal
51
+ *
52
+ * @privateRemarks
53
+ * This function does not strictly require `<ArrayBuffer>` backing, but it is typed
54
+ * that way to match the browser implementation, which does require `<ArrayBuffer>` backing.
47
55
  */
48
56
  async function gitHashFile(file) {
49
57
  const size = file.byteLength;
@@ -52,5 +60,4 @@ async function gitHashFile(file) {
52
60
  const engine = new sha_js_1.sha1();
53
61
  return engine.update(filePrefix).update(file).digest("hex");
54
62
  }
55
- exports.gitHashFile = gitHashFile;
56
63
  //# sourceMappingURL=hashFileNode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hashFileNode.js","sourceRoot":"","sources":["../src/hashFileNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,mCAAsC;AAKtC;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,QAAQ,CAC7B,IAAe,EACf,YAAiC,OAAO,EACxC,eAAiC,KAAK;IAEtC,IAAI,MAAM,CAAC;IACX,wCAAwC;IACxC,QAAQ,SAAS,EAAE,CAAC;QACnB,KAAK,OAAO,CAAC,CAAC,CAAC;YACd,MAAM,GAAG,IAAI,aAAI,EAAE,CAAC;YACpB,MAAM;QACP,CAAC;QACD,KAAK,SAAS,CAAC,CAAC,CAAC;YAChB,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;YACtB,MAAM;QACP,CAAC;IACF,CAAC;IACD,yGAAyG;IACzG,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,YAAY,CAAW,CAAC;AAC3D,CAAC;AAnBD,4BAmBC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,WAAW,CAAC,IAAe;IAChD,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;IAC7B,qDAAqD;IACrD,MAAM,UAAU,GAAG,QAAQ,IAAI,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,MAAM,MAAM,GAAG,IAAI,aAAI,EAAE,CAAC;IAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7D,CAAC;AAND,kCAMC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { sha1, sha256 } from \"sha.js\";\n\n// Note: See 'Isomorphic Code' section in the package README.md\nimport type { IsoBuffer } from \"./bufferNode.js\";\n\n/**\n * Hash a file. Consistent within a session, but should not be persisted and\n * is not consistent with git.\n * If called under an insecure context for a browser, this will fallback to\n * using the node implementation.\n *\n * @param file - The contents of the file in a buffer.\n * @param algorithm - The hash algorithm to use, artificially constrained by what is used internally.\n * @param hashEncoding - The encoding of the returned hash, also artificially constrained.\n * @returns The hash of the content of the buffer.\n *\n * @internal\n */\nexport async function hashFile(\n\tfile: IsoBuffer,\n\talgorithm: \"SHA-1\" | \"SHA-256\" = \"SHA-1\",\n\thashEncoding: \"hex\" | \"base64\" = \"hex\",\n): Promise<string> {\n\tlet engine;\n\t// eslint-disable-next-line default-case\n\tswitch (algorithm) {\n\t\tcase \"SHA-1\": {\n\t\t\tengine = new sha1();\n\t\t\tbreak;\n\t\t}\n\t\tcase \"SHA-256\": {\n\t\t\tengine = new sha256();\n\t\t\tbreak;\n\t\t}\n\t}\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n\treturn engine.update(file).digest(hashEncoding) as string;\n}\n\n/**\n * Create a github hash (Github hashes the string with blob and size)\n * Must be called under secure context for browsers\n *\n * @param file - The contents of the file in a buffer\n * @returns The sha1 hash of the content of the buffer with the `blob` prefix and size\n *\n * @internal\n */\nexport async function gitHashFile(file: IsoBuffer): Promise<string> {\n\tconst size = file.byteLength;\n\t// eslint-disable-next-line unicorn/prefer-code-point\n\tconst filePrefix = `blob ${size.toString()}${String.fromCharCode(0)}`;\n\tconst engine = new sha1();\n\treturn engine.update(filePrefix).update(file).digest(\"hex\");\n}\n"]}
1
+ {"version":3,"file":"hashFileNode.js","sourceRoot":"","sources":["../src/hashFileNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAwBH,4BAmBC;AAeD,kCAMC;AA9DD,mCAAsC;AAKtC;;;;;;;;;;;;;;;;GAgBG;AACI,KAAK,UAAU,QAAQ,CAC7B,IAA4B,EAC5B,YAAiC,OAAO,EACxC,eAAiC,KAAK;IAEtC,IAAI,MAAM,CAAC;IACX,wCAAwC;IACxC,QAAQ,SAAS,EAAE,CAAC;QACnB,KAAK,OAAO,CAAC,CAAC,CAAC;YACd,MAAM,GAAG,IAAI,aAAI,EAAE,CAAC;YACpB,MAAM;QACP,CAAC;QACD,KAAK,SAAS,CAAC,CAAC,CAAC;YAChB,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;YACtB,MAAM;QACP,CAAC;IACF,CAAC;IACD,yGAAyG;IACzG,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,YAAY,CAAW,CAAC;AAC3D,CAAC;AAED;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,WAAW,CAAC,IAA4B;IAC7D,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;IAC7B,qDAAqD;IACrD,MAAM,UAAU,GAAG,QAAQ,IAAI,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;IACtE,MAAM,MAAM,GAAG,IAAI,aAAI,EAAE,CAAC;IAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { sha1, sha256 } from \"sha.js\";\n\n// Note: See 'Isomorphic Code' section in the package README.md\nimport type { IsoBuffer } from \"./bufferNode.js\";\n\n/**\n * Hash a file. Consistent within a session, but should not be persisted and\n * is not consistent with git.\n * If called under an insecure context for a browser, this will fallback to\n * using the node implementation.\n *\n * @param file - The contents of the file in a buffer.\n * @param algorithm - The hash algorithm to use, artificially constrained by what is used internally.\n * @param hashEncoding - The encoding of the returned hash, also artificially constrained.\n * @returns The hash of the content of the buffer.\n *\n * @internal\n *\n * @privateRemarks\n * This function does not strictly require `<ArrayBuffer>` backing, but it is typed\n * that way to match the browser implementation, which does require `<ArrayBuffer>` backing.\n */\nexport async function hashFile(\n\tfile: IsoBuffer<ArrayBuffer>,\n\talgorithm: \"SHA-1\" | \"SHA-256\" = \"SHA-1\",\n\thashEncoding: \"hex\" | \"base64\" = \"hex\",\n): Promise<string> {\n\tlet engine;\n\t// eslint-disable-next-line default-case\n\tswitch (algorithm) {\n\t\tcase \"SHA-1\": {\n\t\t\tengine = new sha1();\n\t\t\tbreak;\n\t\t}\n\t\tcase \"SHA-256\": {\n\t\t\tengine = new sha256();\n\t\t\tbreak;\n\t\t}\n\t}\n\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call\n\treturn engine.update(file).digest(hashEncoding) as string;\n}\n\n/**\n * Create a github hash (Github hashes the string with blob and size)\n * Must be called under secure context for browsers\n *\n * @param file - The contents of the file in a buffer\n * @returns The sha1 hash of the content of the buffer with the `blob` prefix and size\n *\n * @internal\n *\n * @privateRemarks\n * This function does not strictly require `<ArrayBuffer>` backing, but it is typed\n * that way to match the browser implementation, which does require `<ArrayBuffer>` backing.\n */\nexport async function gitHashFile(file: IsoBuffer<ArrayBuffer>): Promise<string> {\n\tconst size = file.byteLength;\n\t// eslint-disable-next-line unicorn/prefer-code-point\n\tconst filePrefix = `blob ${size.toString()}${String.fromCharCode(0)}`;\n\tconst engine = new sha1();\n\treturn engine.update(filePrefix).update(file).digest(\"hex\");\n}\n"]}
@@ -2,15 +2,17 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { bufferToString, isArrayBuffer, IsoBuffer, stringToBuffer, Uint8ArrayToString, } from "./bufferBrowser.js";
5
+ export type { IsoBuffer as IsoBufferInterface } from "./buffer.js";
6
+ export type { IsoBufferConstructor, IsoBufferEncoding, } from "./bufferBrowser.js";
7
+ export { bufferToString, IsoBuffer, stringToBuffer, Uint8ArrayToString, } from "./bufferBrowser.js";
6
8
  export { gitHashFile, hashFile } from "./hashFileBrowser.js";
7
9
  export { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from "./base64EncodingBrowser.js";
8
- export { Uint8ArrayToArrayBuffer } from "./bufferShared.js";
10
+ export { AnyUint8ArrayToArrayBuffer, ArrayBufferLikeToArrayBuffer, Uint8ArrayToArrayBufferLike, } from "./bufferShared.js";
9
11
  export { EventEmitter } from "./eventEmitter.cjs";
10
12
  export { performanceNow } from "./performanceIsomorphic.js";
11
13
  export { type ITraceEvent, Trace } from "./trace.js";
12
14
  export { type EventEmitterEventType, TypedEventEmitter, type TypedEventTransform, } from "./typedEventEmitter.js";
13
15
  export { createEmitter } from "./events/index.js";
14
- export { type FluidLayer, checkLayerCompatibility, type LayerCompatCheckResult, type ILayerCompatDetails, type IProvideLayerCompatDetails, type ILayerCompatSupportRequirements, LayerCompatibilityPolicyWindowMonths, } from "./layerCompat.js";
16
+ export { type FluidLayer, checkLayerCompatibility, type LayerCompatCheckResult, type ILayerCompatDetails, type IProvideLayerCompatDetails, type ILayerCompatSupportRequirements, type IProvideLayerCompatSupportRequirements, defaultLayerCompatDetails, LayerCompatibilityPolicyWindowMonths, } from "./layerCompat.js";
15
17
  export { generation } from "./layerGenerationState.js";
16
18
  //# sourceMappingURL=indexBrowser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexBrowser.d.ts","sourceRoot":"","sources":["../src/indexBrowser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,cAAc,EACd,aAAa,EACb,SAAS,EACT,cAAc,EACd,kBAAkB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EACN,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,mBAAmB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EACN,KAAK,UAAU,EACf,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,oCAAoC,GACpC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"indexBrowser.d.ts","sourceRoot":"","sources":["../src/indexBrowser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,YAAY,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,YAAY,EACX,oBAAoB,EACpB,iBAAiB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,cAAc,EACd,SAAS,EACT,cAAc,EACd,kBAAkB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,EACN,0BAA0B,EAC1B,4BAA4B,EAC5B,2BAA2B,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EACN,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,mBAAmB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EACN,KAAK,UAAU,EACf,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,sCAAsC,EAC3C,yBAAyB,EACzB,oCAAoC,GACpC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
@@ -4,12 +4,9 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.generation = exports.LayerCompatibilityPolicyWindowMonths = exports.checkLayerCompatibility = exports.createEmitter = exports.TypedEventEmitter = exports.Trace = exports.performanceNow = exports.EventEmitter = exports.Uint8ArrayToArrayBuffer = exports.toUtf8 = exports.fromUtf8ToBase64 = exports.fromBase64ToUtf8 = exports.hashFile = exports.gitHashFile = exports.Uint8ArrayToString = exports.stringToBuffer = exports.IsoBuffer = exports.isArrayBuffer = exports.bufferToString = void 0;
8
- // Entrypoint for browser-specific code in the package.
9
- // (See 'Isomorphic Code' section in the package README.md.)
7
+ exports.generation = exports.LayerCompatibilityPolicyWindowMonths = exports.defaultLayerCompatDetails = exports.checkLayerCompatibility = exports.createEmitter = exports.TypedEventEmitter = exports.Trace = exports.performanceNow = exports.EventEmitter = exports.Uint8ArrayToArrayBufferLike = exports.ArrayBufferLikeToArrayBuffer = exports.AnyUint8ArrayToArrayBuffer = exports.toUtf8 = exports.fromUtf8ToBase64 = exports.fromBase64ToUtf8 = exports.hashFile = exports.gitHashFile = exports.Uint8ArrayToString = exports.stringToBuffer = exports.IsoBuffer = exports.bufferToString = void 0;
10
8
  var bufferBrowser_js_1 = require("./bufferBrowser.js");
11
9
  Object.defineProperty(exports, "bufferToString", { enumerable: true, get: function () { return bufferBrowser_js_1.bufferToString; } });
12
- Object.defineProperty(exports, "isArrayBuffer", { enumerable: true, get: function () { return bufferBrowser_js_1.isArrayBuffer; } });
13
10
  Object.defineProperty(exports, "IsoBuffer", { enumerable: true, get: function () { return bufferBrowser_js_1.IsoBuffer; } });
14
11
  Object.defineProperty(exports, "stringToBuffer", { enumerable: true, get: function () { return bufferBrowser_js_1.stringToBuffer; } });
15
12
  Object.defineProperty(exports, "Uint8ArrayToString", { enumerable: true, get: function () { return bufferBrowser_js_1.Uint8ArrayToString; } });
@@ -21,7 +18,9 @@ Object.defineProperty(exports, "fromBase64ToUtf8", { enumerable: true, get: func
21
18
  Object.defineProperty(exports, "fromUtf8ToBase64", { enumerable: true, get: function () { return base64EncodingBrowser_js_1.fromUtf8ToBase64; } });
22
19
  Object.defineProperty(exports, "toUtf8", { enumerable: true, get: function () { return base64EncodingBrowser_js_1.toUtf8; } });
23
20
  var bufferShared_js_1 = require("./bufferShared.js");
24
- Object.defineProperty(exports, "Uint8ArrayToArrayBuffer", { enumerable: true, get: function () { return bufferShared_js_1.Uint8ArrayToArrayBuffer; } });
21
+ Object.defineProperty(exports, "AnyUint8ArrayToArrayBuffer", { enumerable: true, get: function () { return bufferShared_js_1.AnyUint8ArrayToArrayBuffer; } });
22
+ Object.defineProperty(exports, "ArrayBufferLikeToArrayBuffer", { enumerable: true, get: function () { return bufferShared_js_1.ArrayBufferLikeToArrayBuffer; } });
23
+ Object.defineProperty(exports, "Uint8ArrayToArrayBufferLike", { enumerable: true, get: function () { return bufferShared_js_1.Uint8ArrayToArrayBufferLike; } });
25
24
  var eventEmitter_cjs_1 = require("./eventEmitter.cjs");
26
25
  Object.defineProperty(exports, "EventEmitter", { enumerable: true, get: function () { return eventEmitter_cjs_1.EventEmitter; } });
27
26
  var performanceIsomorphic_js_1 = require("./performanceIsomorphic.js");
@@ -34,6 +33,7 @@ var index_js_1 = require("./events/index.js");
34
33
  Object.defineProperty(exports, "createEmitter", { enumerable: true, get: function () { return index_js_1.createEmitter; } });
35
34
  var layerCompat_js_1 = require("./layerCompat.js");
36
35
  Object.defineProperty(exports, "checkLayerCompatibility", { enumerable: true, get: function () { return layerCompat_js_1.checkLayerCompatibility; } });
36
+ Object.defineProperty(exports, "defaultLayerCompatDetails", { enumerable: true, get: function () { return layerCompat_js_1.defaultLayerCompatDetails; } });
37
37
  Object.defineProperty(exports, "LayerCompatibilityPolicyWindowMonths", { enumerable: true, get: function () { return layerCompat_js_1.LayerCompatibilityPolicyWindowMonths; } });
38
38
  var layerGenerationState_js_1 = require("./layerGenerationState.js");
39
39
  Object.defineProperty(exports, "generation", { enumerable: true, get: function () { return layerGenerationState_js_1.generation; } });
@@ -1 +1 @@
1
- {"version":3,"file":"indexBrowser.js","sourceRoot":"","sources":["../src/indexBrowser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,uDAAuD;AACvD,4DAA4D;AAE5D,uDAM4B;AAL3B,kHAAA,cAAc,OAAA;AACd,iHAAA,aAAa,OAAA;AACb,6GAAA,SAAS,OAAA;AACT,kHAAA,cAAc,OAAA;AACd,sHAAA,kBAAkB,OAAA;AAEnB,2DAA6D;AAApD,iHAAA,WAAW,OAAA;AAAE,8GAAA,QAAQ,OAAA;AAE9B,uEAAwF;AAA/E,4HAAA,gBAAgB,OAAA;AAAE,4HAAA,gBAAgB,OAAA;AAAE,kHAAA,MAAM,OAAA;AACnD,qDAA4D;AAAnD,0HAAA,uBAAuB,OAAA;AAChC,uDAAkD;AAAzC,gHAAA,YAAY,OAAA;AACrB,uEAA4D;AAAnD,0HAAA,cAAc,OAAA;AACvB,uCAAqD;AAA1B,iGAAA,KAAK,OAAA;AAChC,+DAIgC;AAF/B,yHAAA,iBAAiB,OAAA;AAIlB,8CAAkD;AAAzC,yGAAA,aAAa,OAAA;AAEtB,mDAQ0B;AANzB,yHAAA,uBAAuB,OAAA;AAKvB,sIAAA,oCAAoC,OAAA;AAErC,qEAAuD;AAA9C,qHAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Entrypoint for browser-specific code in the package.\n// (See 'Isomorphic Code' section in the package README.md.)\n\nexport {\n\tbufferToString,\n\tisArrayBuffer,\n\tIsoBuffer,\n\tstringToBuffer,\n\tUint8ArrayToString,\n} from \"./bufferBrowser.js\";\nexport { gitHashFile, hashFile } from \"./hashFileBrowser.js\";\n\nexport { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from \"./base64EncodingBrowser.js\";\nexport { Uint8ArrayToArrayBuffer } from \"./bufferShared.js\";\nexport { EventEmitter } from \"./eventEmitter.cjs\";\nexport { performanceNow } from \"./performanceIsomorphic.js\";\nexport { type ITraceEvent, Trace } from \"./trace.js\";\nexport {\n\ttype EventEmitterEventType,\n\tTypedEventEmitter,\n\ttype TypedEventTransform,\n} from \"./typedEventEmitter.js\";\n\nexport { createEmitter } from \"./events/index.js\";\n\nexport {\n\ttype FluidLayer,\n\tcheckLayerCompatibility,\n\ttype LayerCompatCheckResult,\n\ttype ILayerCompatDetails,\n\ttype IProvideLayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n\tLayerCompatibilityPolicyWindowMonths,\n} from \"./layerCompat.js\";\nexport { generation } from \"./layerGenerationState.js\";\n"]}
1
+ {"version":3,"file":"indexBrowser.js","sourceRoot":"","sources":["../src/indexBrowser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,uDAK4B;AAJ3B,kHAAA,cAAc,OAAA;AACd,6GAAA,SAAS,OAAA;AACT,kHAAA,cAAc,OAAA;AACd,sHAAA,kBAAkB,OAAA;AAEnB,2DAA6D;AAApD,iHAAA,WAAW,OAAA;AAAE,8GAAA,QAAQ,OAAA;AAE9B,uEAAwF;AAA/E,4HAAA,gBAAgB,OAAA;AAAE,4HAAA,gBAAgB,OAAA;AAAE,kHAAA,MAAM,OAAA;AACnD,qDAI2B;AAH1B,6HAAA,0BAA0B,OAAA;AAC1B,+HAAA,4BAA4B,OAAA;AAC5B,8HAAA,2BAA2B,OAAA;AAE5B,uDAAkD;AAAzC,gHAAA,YAAY,OAAA;AACrB,uEAA4D;AAAnD,0HAAA,cAAc,OAAA;AACvB,uCAAqD;AAA1B,iGAAA,KAAK,OAAA;AAChC,+DAIgC;AAF/B,yHAAA,iBAAiB,OAAA;AAIlB,8CAAkD;AAAzC,yGAAA,aAAa,OAAA;AAEtB,mDAU0B;AARzB,yHAAA,uBAAuB,OAAA;AAMvB,2HAAA,yBAAyB,OAAA;AACzB,sIAAA,oCAAoC,OAAA;AAErC,qEAAuD;AAA9C,qHAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Entrypoint for browser-specific code in the package.\n// (See 'Isomorphic Code' section in the package README.md.)\n\n// This export is needed for api-extractor compliance.\nexport type { IsoBuffer as IsoBufferInterface } from \"./buffer.js\";\nexport type {\n\tIsoBufferConstructor,\n\tIsoBufferEncoding,\n} from \"./bufferBrowser.js\";\nexport {\n\tbufferToString,\n\tIsoBuffer,\n\tstringToBuffer,\n\tUint8ArrayToString,\n} from \"./bufferBrowser.js\";\nexport { gitHashFile, hashFile } from \"./hashFileBrowser.js\";\n\nexport { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from \"./base64EncodingBrowser.js\";\nexport {\n\tAnyUint8ArrayToArrayBuffer,\n\tArrayBufferLikeToArrayBuffer,\n\tUint8ArrayToArrayBufferLike,\n} from \"./bufferShared.js\";\nexport { EventEmitter } from \"./eventEmitter.cjs\";\nexport { performanceNow } from \"./performanceIsomorphic.js\";\nexport { type ITraceEvent, Trace } from \"./trace.js\";\nexport {\n\ttype EventEmitterEventType,\n\tTypedEventEmitter,\n\ttype TypedEventTransform,\n} from \"./typedEventEmitter.js\";\n\nexport { createEmitter } from \"./events/index.js\";\n\nexport {\n\ttype FluidLayer,\n\tcheckLayerCompatibility,\n\ttype LayerCompatCheckResult,\n\ttype ILayerCompatDetails,\n\ttype IProvideLayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n\ttype IProvideLayerCompatSupportRequirements,\n\tdefaultLayerCompatDetails,\n\tLayerCompatibilityPolicyWindowMonths,\n} from \"./layerCompat.js\";\nexport { generation } from \"./layerGenerationState.js\";\n"]}
@@ -2,16 +2,17 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { type Buffer } from "./bufferNode.js";
5
+ export type { IsoBuffer as IsoBufferInterface } from "./buffer.js";
6
+ export type { Buffer, IsoBufferConstructor, IsoBufferEncoding, } from "./bufferNode.js";
6
7
  export { bufferToString, IsoBuffer, stringToBuffer, Uint8ArrayToString, } from "./bufferNode.js";
7
8
  export { gitHashFile, hashFile } from "./hashFileNode.js";
8
9
  export { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from "./base64EncodingNode.js";
9
- export { Uint8ArrayToArrayBuffer } from "./bufferShared.js";
10
+ export { AnyUint8ArrayToArrayBuffer, ArrayBufferLikeToArrayBuffer, Uint8ArrayToArrayBufferLike, } from "./bufferShared.js";
10
11
  export { EventEmitter } from "./eventEmitter.cjs";
11
12
  export { performanceNow } from "./performanceIsomorphic.js";
12
13
  export { type ITraceEvent, Trace } from "./trace.js";
13
14
  export { type EventEmitterEventType, TypedEventEmitter, type TypedEventTransform, } from "./typedEventEmitter.js";
14
15
  export { createEmitter } from "./events/index.js";
15
- export { type FluidLayer, checkLayerCompatibility, type LayerCompatCheckResult, type ILayerCompatDetails, type IProvideLayerCompatDetails, type ILayerCompatSupportRequirements, LayerCompatibilityPolicyWindowMonths, } from "./layerCompat.js";
16
+ export { type FluidLayer, checkLayerCompatibility, type LayerCompatCheckResult, type ILayerCompatDetails, type IProvideLayerCompatDetails, type ILayerCompatSupportRequirements, type IProvideLayerCompatSupportRequirements, defaultLayerCompatDetails, LayerCompatibilityPolicyWindowMonths, } from "./layerCompat.js";
16
17
  export { generation } from "./layerGenerationState.js";
17
18
  //# sourceMappingURL=indexNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"indexNode.d.ts","sourceRoot":"","sources":["../src/indexNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EACN,cAAc,EACd,SAAS,EACT,cAAc,EACd,kBAAkB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE1D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;A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C5D,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EACN,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,mBAAmB,GACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,EACN,KAAK,UAAU,EACf,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,sCAAsC,EAC3C,yBAAyB,EACzB,oCAAoC,GACpC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
package/dist/indexNode.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.generation = exports.LayerCompatibilityPolicyWindowMonths = exports.checkLayerCompatibility = exports.createEmitter = exports.TypedEventEmitter = exports.Trace = exports.performanceNow = exports.EventEmitter = exports.Uint8ArrayToArrayBuffer = exports.toUtf8 = exports.fromUtf8ToBase64 = exports.fromBase64ToUtf8 = exports.hashFile = exports.gitHashFile = exports.Uint8ArrayToString = exports.stringToBuffer = exports.IsoBuffer = exports.bufferToString = void 0;
7
+ exports.generation = exports.LayerCompatibilityPolicyWindowMonths = exports.defaultLayerCompatDetails = exports.checkLayerCompatibility = exports.createEmitter = exports.TypedEventEmitter = exports.Trace = exports.performanceNow = exports.EventEmitter = exports.Uint8ArrayToArrayBufferLike = exports.ArrayBufferLikeToArrayBuffer = exports.AnyUint8ArrayToArrayBuffer = exports.toUtf8 = exports.fromUtf8ToBase64 = exports.fromBase64ToUtf8 = exports.hashFile = exports.gitHashFile = exports.Uint8ArrayToString = exports.stringToBuffer = exports.IsoBuffer = exports.bufferToString = void 0;
8
8
  var bufferNode_js_1 = require("./bufferNode.js");
9
9
  Object.defineProperty(exports, "bufferToString", { enumerable: true, get: function () { return bufferNode_js_1.bufferToString; } });
10
10
  Object.defineProperty(exports, "IsoBuffer", { enumerable: true, get: function () { return bufferNode_js_1.IsoBuffer; } });
@@ -18,7 +18,9 @@ Object.defineProperty(exports, "fromBase64ToUtf8", { enumerable: true, get: func
18
18
  Object.defineProperty(exports, "fromUtf8ToBase64", { enumerable: true, get: function () { return base64EncodingNode_js_1.fromUtf8ToBase64; } });
19
19
  Object.defineProperty(exports, "toUtf8", { enumerable: true, get: function () { return base64EncodingNode_js_1.toUtf8; } });
20
20
  var bufferShared_js_1 = require("./bufferShared.js");
21
- Object.defineProperty(exports, "Uint8ArrayToArrayBuffer", { enumerable: true, get: function () { return bufferShared_js_1.Uint8ArrayToArrayBuffer; } });
21
+ Object.defineProperty(exports, "AnyUint8ArrayToArrayBuffer", { enumerable: true, get: function () { return bufferShared_js_1.AnyUint8ArrayToArrayBuffer; } });
22
+ Object.defineProperty(exports, "ArrayBufferLikeToArrayBuffer", { enumerable: true, get: function () { return bufferShared_js_1.ArrayBufferLikeToArrayBuffer; } });
23
+ Object.defineProperty(exports, "Uint8ArrayToArrayBufferLike", { enumerable: true, get: function () { return bufferShared_js_1.Uint8ArrayToArrayBufferLike; } });
22
24
  var eventEmitter_cjs_1 = require("./eventEmitter.cjs");
23
25
  Object.defineProperty(exports, "EventEmitter", { enumerable: true, get: function () { return eventEmitter_cjs_1.EventEmitter; } });
24
26
  var performanceIsomorphic_js_1 = require("./performanceIsomorphic.js");
@@ -31,6 +33,7 @@ var index_js_1 = require("./events/index.js");
31
33
  Object.defineProperty(exports, "createEmitter", { enumerable: true, get: function () { return index_js_1.createEmitter; } });
32
34
  var layerCompat_js_1 = require("./layerCompat.js");
33
35
  Object.defineProperty(exports, "checkLayerCompatibility", { enumerable: true, get: function () { return layerCompat_js_1.checkLayerCompatibility; } });
36
+ Object.defineProperty(exports, "defaultLayerCompatDetails", { enumerable: true, get: function () { return layerCompat_js_1.defaultLayerCompatDetails; } });
34
37
  Object.defineProperty(exports, "LayerCompatibilityPolicyWindowMonths", { enumerable: true, get: function () { return layerCompat_js_1.LayerCompatibilityPolicyWindowMonths; } });
35
38
  var layerGenerationState_js_1 = require("./layerGenerationState.js");
36
39
  Object.defineProperty(exports, "generation", { enumerable: true, get: function () { return layerGenerationState_js_1.generation; } });
@@ -1 +1 @@
1
- {"version":3,"file":"indexNode.js","sourceRoot":"","sources":["../src/indexNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAMH,iDAKyB;AAJxB,+GAAA,cAAc,OAAA;AACd,0GAAA,SAAS,OAAA;AACT,+GAAA,cAAc,OAAA;AACd,mHAAA,kBAAkB,OAAA;AAEnB,qDAA0D;AAAjD,8GAAA,WAAW,OAAA;AAAE,2GAAA,QAAQ,OAAA;AAE9B,iEAAqF;AAA5E,yHAAA,gBAAgB,OAAA;AAAE,yHAAA,gBAAgB,OAAA;AAAE,+GAAA,MAAM,OAAA;AACnD,qDAA4D;AAAnD,0HAAA,uBAAuB,OAAA;AAChC,uDAAkD;AAAzC,gHAAA,YAAY,OAAA;AACrB,uEAA4D;AAAnD,0HAAA,cAAc,OAAA;AACvB,uCAAqD;AAA1B,iGAAA,KAAK,OAAA;AAChC,+DAIgC;AAF/B,yHAAA,iBAAiB,OAAA;AAIlB,8CAAkD;AAAzC,yGAAA,aAAa,OAAA;AAEtB,mDAQ0B;AANzB,yHAAA,uBAAuB,OAAA;AAKvB,sIAAA,oCAAoC,OAAA;AAErC,qEAAuD;AAA9C,qHAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Entrypoint for Node.js-specific code in the package.\n// (See 'Isomorphic Code' section in the package README.md.)\n\nexport { type Buffer } from \"./bufferNode.js\";\nexport {\n\tbufferToString,\n\tIsoBuffer,\n\tstringToBuffer,\n\tUint8ArrayToString,\n} from \"./bufferNode.js\";\nexport { gitHashFile, hashFile } from \"./hashFileNode.js\";\n\nexport { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from \"./base64EncodingNode.js\";\nexport { Uint8ArrayToArrayBuffer } from \"./bufferShared.js\";\nexport { EventEmitter } from \"./eventEmitter.cjs\";\nexport { performanceNow } from \"./performanceIsomorphic.js\";\nexport { type ITraceEvent, Trace } from \"./trace.js\";\nexport {\n\ttype EventEmitterEventType,\n\tTypedEventEmitter,\n\ttype TypedEventTransform,\n} from \"./typedEventEmitter.js\";\n\nexport { createEmitter } from \"./events/index.js\";\n\nexport {\n\ttype FluidLayer,\n\tcheckLayerCompatibility,\n\ttype LayerCompatCheckResult,\n\ttype ILayerCompatDetails,\n\ttype IProvideLayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n\tLayerCompatibilityPolicyWindowMonths,\n} from \"./layerCompat.js\";\nexport { generation } from \"./layerGenerationState.js\";\n"]}
1
+ {"version":3,"file":"indexNode.js","sourceRoot":"","sources":["../src/indexNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAWH,iDAKyB;AAJxB,+GAAA,cAAc,OAAA;AACd,0GAAA,SAAS,OAAA;AACT,+GAAA,cAAc,OAAA;AACd,mHAAA,kBAAkB,OAAA;AAEnB,qDAA0D;AAAjD,8GAAA,WAAW,OAAA;AAAE,2GAAA,QAAQ,OAAA;AAE9B,iEAAqF;AAA5E,yHAAA,gBAAgB,OAAA;AAAE,yHAAA,gBAAgB,OAAA;AAAE,+GAAA,MAAM,OAAA;AACnD,qDAI2B;AAH1B,6HAAA,0BAA0B,OAAA;AAC1B,+HAAA,4BAA4B,OAAA;AAC5B,8HAAA,2BAA2B,OAAA;AAE5B,uDAAkD;AAAzC,gHAAA,YAAY,OAAA;AACrB,uEAA4D;AAAnD,0HAAA,cAAc,OAAA;AACvB,uCAAqD;AAA1B,iGAAA,KAAK,OAAA;AAChC,+DAIgC;AAF/B,yHAAA,iBAAiB,OAAA;AAIlB,8CAAkD;AAAzC,yGAAA,aAAa,OAAA;AAEtB,mDAU0B;AARzB,yHAAA,uBAAuB,OAAA;AAMvB,2HAAA,yBAAyB,OAAA;AACzB,sIAAA,oCAAoC,OAAA;AAErC,qEAAuD;AAA9C,qHAAA,UAAU,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Entrypoint for Node.js-specific code in the package.\n// (See 'Isomorphic Code' section in the package README.md.)\n\nexport type { IsoBuffer as IsoBufferInterface } from \"./buffer.js\";\nexport type {\n\tBuffer,\n\tIsoBufferConstructor,\n\tIsoBufferEncoding,\n} from \"./bufferNode.js\";\nexport {\n\tbufferToString,\n\tIsoBuffer,\n\tstringToBuffer,\n\tUint8ArrayToString,\n} from \"./bufferNode.js\";\nexport { gitHashFile, hashFile } from \"./hashFileNode.js\";\n\nexport { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from \"./base64EncodingNode.js\";\nexport {\n\tAnyUint8ArrayToArrayBuffer,\n\tArrayBufferLikeToArrayBuffer,\n\tUint8ArrayToArrayBufferLike,\n} from \"./bufferShared.js\";\nexport { EventEmitter } from \"./eventEmitter.cjs\";\nexport { performanceNow } from \"./performanceIsomorphic.js\";\nexport { type ITraceEvent, Trace } from \"./trace.js\";\nexport {\n\ttype EventEmitterEventType,\n\tTypedEventEmitter,\n\ttype TypedEventTransform,\n} from \"./typedEventEmitter.js\";\n\nexport { createEmitter } from \"./events/index.js\";\n\nexport {\n\ttype FluidLayer,\n\tcheckLayerCompatibility,\n\ttype LayerCompatCheckResult,\n\ttype ILayerCompatDetails,\n\ttype IProvideLayerCompatDetails,\n\ttype ILayerCompatSupportRequirements,\n\ttype IProvideLayerCompatSupportRequirements,\n\tdefaultLayerCompatDetails,\n\tLayerCompatibilityPolicyWindowMonths,\n} from \"./layerCompat.js\";\nexport { generation } from \"./layerGenerationState.js\";\n"]}
@@ -21,29 +21,29 @@ export type FluidLayer = "loader" | "driver" | "runtime" | "dataStore";
21
21
  */
22
22
  export declare const LayerCompatibilityPolicyWindowMonths: {
23
23
  /**
24
- * Driver is compatible with Loader versions up to 12 months (or generations) older.
24
+ * A newer Driver is compatible with Loader versions up to 12 months (or generations) older.
25
25
  */
26
- readonly DriverLoader: 12;
26
+ readonly NewDriverOldLoader: 12;
27
27
  /**
28
- * Loader is compatible with Driver versions up to 12 months (or generations) older.
28
+ * A newer Loader is compatible with Driver versions up to 12 months (or generations) older.
29
29
  */
30
- readonly LoaderDriver: 12;
30
+ readonly NewLoaderOldDriver: 12;
31
31
  /**
32
- * Runtime is compatible with Loader versions up to 12 months (or generations) older.
32
+ * A newer Runtime is compatible with Loader versions up to 12 months (or generations) older.
33
33
  */
34
- readonly RuntimeLoader: 12;
34
+ readonly NewRuntimeOldLoader: 12;
35
35
  /**
36
- * Loader is compatible with Runtime versions up to 3 months (or generations) older.
36
+ * A newer Loader is compatible with Runtime versions up to 3 months (or generations) older.
37
37
  */
38
- readonly LoaderRuntime: 3;
38
+ readonly NewLoaderOldRuntime: 3;
39
39
  /**
40
- * Runtime is compatible with DataStore versions up to 3 months (or generations) older.
40
+ * A newer Runtime is compatible with DataStore versions up to 3 months (or generations) older.
41
41
  */
42
- readonly RuntimeDataStore: 3;
42
+ readonly NewRuntimeOldDataStore: 3;
43
43
  /**
44
- * DataStore is compatible with Runtime versions up to 3 months (or generations) older.
44
+ * A newer DataStore is compatible with Runtime versions up to 3 months (or generations) older.
45
45
  */
46
- readonly DataStoreRuntime: 3;
46
+ readonly NewDataStoreOldRuntime: 3;
47
47
  };
48
48
  /**
49
49
  * Result of a layer compatibility check - whether a layer is compatible with another layer.
@@ -107,11 +107,35 @@ export interface ILayerCompatDetails extends Partial<IProvideLayerCompatDetails>
107
107
  * @internal
108
108
  */
109
109
  export declare const defaultLayerCompatDetails: ILayerCompatDetails;
110
+ /**
111
+ * Key used to look up {@link (ILayerCompatSupportRequirements:interface)} on a `FluidObject`.
112
+ * @internal
113
+ */
114
+ export declare const ILayerCompatSupportRequirements: keyof IProvideLayerCompatSupportRequirements;
115
+ /**
116
+ * Provides {@link (ILayerCompatSupportRequirements:interface)} so that a layer can publish, as a `FluidObject`, the
117
+ * requirements another layer must meet to be compatible with it.
118
+ * @internal
119
+ */
120
+ export interface IProvideLayerCompatSupportRequirements {
121
+ readonly ILayerCompatSupportRequirements: ILayerCompatSupportRequirements;
122
+ }
110
123
  /**
111
124
  * The requirements that a layer needs another layer to support for them to be compatible.
125
+ *
126
+ * @remarks
127
+ * A layer can also publish its requirements across a boundary as a `FluidObject` (via
128
+ * {@link IProvideLayerCompatSupportRequirements}) for the case where this layer cannot run the compatibility
129
+ * validation itself and instead needs the layer on the other side of the boundary to check itself against the
130
+ * published requirements. Most boundaries are validated by both layers because each holds
131
+ * a reference to the other (e.g. the Loader and the Runtime). The Driver / Loader boundary is asymmetric: the
132
+ * Loader holds a reference to the Driver, but the Driver has no reference to the Loader and so cannot validate it.
133
+ * To still validate in both directions, the Driver publishes its requirements for the Loader and the Loader
134
+ * validates itself against them on the Driver's behalf.
135
+ *
112
136
  * @internal
113
137
  */
114
- export interface ILayerCompatSupportRequirements {
138
+ export interface ILayerCompatSupportRequirements extends Partial<IProvideLayerCompatSupportRequirements> {
115
139
  /**
116
140
  * The minimum supported generation the other layer needs to be at.
117
141
  */
@@ -1 +1 @@
1
- {"version":3,"file":"layerCompat.d.ts","sourceRoot":"","sources":["../src/layerCompat.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAEvE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oCAAoC;IAChD;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEM,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,sBAAsB,GAC/B;IAAE,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAA;CAAE,GAC/B;I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QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7C;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACtC,+BAA+B,EAAE,+BAA+B,EAChE,mBAAmB,EAAE,mBAAmB,GAAG,SAAS,GAClD,sBAAsB,CA4BxB"}
@@ -4,7 +4,8 @@
4
4
  * Licensed under the MIT License.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.checkLayerCompatibility = exports.defaultLayerCompatDetails = exports.ILayerCompatDetails = exports.LayerCompatibilityPolicyWindowMonths = void 0;
7
+ exports.ILayerCompatSupportRequirements = exports.defaultLayerCompatDetails = exports.ILayerCompatDetails = exports.LayerCompatibilityPolicyWindowMonths = void 0;
8
+ exports.checkLayerCompatibility = checkLayerCompatibility;
8
9
  /**
9
10
  * The policy for compatibility windows that a layer uses to validate compatibility with another layer.
10
11
  * The other layer must be within this window relative to the layer to be compatible.
@@ -19,29 +20,29 @@ exports.checkLayerCompatibility = exports.defaultLayerCompatDetails = exports.IL
19
20
  */
20
21
  exports.LayerCompatibilityPolicyWindowMonths = {
21
22
  /**
22
- * Driver is compatible with Loader versions up to 12 months (or generations) older.
23
+ * A newer Driver is compatible with Loader versions up to 12 months (or generations) older.
23
24
  */
24
- DriverLoader: 12,
25
+ NewDriverOldLoader: 12,
25
26
  /**
26
- * Loader is compatible with Driver versions up to 12 months (or generations) older.
27
+ * A newer Loader is compatible with Driver versions up to 12 months (or generations) older.
27
28
  */
28
- LoaderDriver: 12,
29
+ NewLoaderOldDriver: 12,
29
30
  /**
30
- * Runtime is compatible with Loader versions up to 12 months (or generations) older.
31
+ * A newer Runtime is compatible with Loader versions up to 12 months (or generations) older.
31
32
  */
32
- RuntimeLoader: 12,
33
+ NewRuntimeOldLoader: 12,
33
34
  /**
34
- * Loader is compatible with Runtime versions up to 3 months (or generations) older.
35
+ * A newer Loader is compatible with Runtime versions up to 3 months (or generations) older.
35
36
  */
36
- LoaderRuntime: 3,
37
+ NewLoaderOldRuntime: 3,
37
38
  /**
38
- * Runtime is compatible with DataStore versions up to 3 months (or generations) older.
39
+ * A newer Runtime is compatible with DataStore versions up to 3 months (or generations) older.
39
40
  */
40
- RuntimeDataStore: 3,
41
+ NewRuntimeOldDataStore: 3,
41
42
  /**
42
- * DataStore is compatible with Runtime versions up to 3 months (or generations) older.
43
+ * A newer DataStore is compatible with Runtime versions up to 3 months (or generations) older.
43
44
  */
44
- DataStoreRuntime: 3,
45
+ NewDataStoreOldRuntime: 3,
45
46
  };
46
47
  /**
47
48
  * @internal
@@ -57,6 +58,11 @@ exports.defaultLayerCompatDetails = {
57
58
  generation: 0, // 0 is reserved for layers before compatibility enforcement was introduced.
58
59
  pkgVersion: "unknown",
59
60
  };
61
+ /**
62
+ * Key used to look up {@link (ILayerCompatSupportRequirements:interface)} on a `FluidObject`.
63
+ * @internal
64
+ */
65
+ exports.ILayerCompatSupportRequirements = "ILayerCompatSupportRequirements";
60
66
  /**
61
67
  * Checks compatibility of a layer (layer1) with another layer (layer2).
62
68
  * @param compatSupportRequirementsLayer1 - The requirements from layer1 that layer2 needs to meet.
@@ -90,5 +96,4 @@ function checkLayerCompatibility(compatSupportRequirementsLayer1, compatDetailsL
90
96
  unsupportedFeatures: unsupportedFeatures.length > 0 ? unsupportedFeatures : undefined,
91
97
  };
92
98
  }
93
- exports.checkLayerCompatibility = checkLayerCompatibility;
94
99
  //# sourceMappingURL=layerCompat.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layerCompat.js","sourceRoot":"","sources":["../src/layerCompat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH;;;;;;;;;;;GAWG;AACU,QAAA,oCAAoC,GAAG;IACnD;;OAEG;IACH,YAAY,EAAE,EAAE;IAChB;;OAEG;IACH,YAAY,EAAE,EAAE;IAChB;;OAEG;IACH,aAAa,EAAE,EAAE;IACjB;;OAEG;IACH,aAAa,EAAE,CAAC;IAChB;;OAEG;IACH,gBAAgB,EAAE,CAAC;IACnB;;OAEG;IACH,gBAAgB,EAAE,CAAC;CACV,CAAC;AAqBX;;GAEG;AACU,QAAA,mBAAmB,GAAqC,qBAAqB,CAAC;AAsC3F;;;;GAIG;AACU,QAAA,yBAAyB,GAAwB;IAC7D,iBAAiB,EAAE,IAAI,GAAG,EAAE;IAC5B,UAAU,EAAE,CAAC,EAAE,4EAA4E;IAC3F,UAAU,EAAE,SAAS;CACrB,CAAC;AAiBF;;;;;;;;GAQG;AACH,SAAgB,uBAAuB,CACtC,+BAAgE,EAChE,mBAAoD;IAEpD,MAAM,wBAAwB,GAAG,mBAAmB,IAAI,iCAAyB,CAAC;IAClF,IAAI,sBAAsB,GAAG,IAAI,CAAC;IAClC,MAAM,mBAAmB,GAAa,EAAE,CAAC;IAEzC,2FAA2F;IAC3F,6BAA6B;IAC7B,IACC,wBAAwB,CAAC,UAAU;QACnC,+BAA+B,CAAC,sBAAsB,EACrD,CAAC;QACF,sBAAsB,GAAG,KAAK,CAAC;IAChC,CAAC;IAED,gFAAgF;IAChF,KAAK,MAAM,OAAO,IAAI,+BAA+B,CAAC,gBAAgB,EAAE,CAAC;QACxE,IAAI,CAAC,wBAAwB,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9D,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC;IACF,CAAC;IAED,OAAO,sBAAsB,IAAI,mBAAmB,CAAC,MAAM,KAAK,CAAC;QAChE,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE;QACxB,CAAC,CAAC;YACA,YAAY,EAAE,KAAK;YACnB,sBAAsB;YACtB,mBAAmB,EAAE,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,SAAS;SACrF,CAAC;AACL,CAAC;AA/BD,0DA+BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The different Fluid layers in a client.\n * @internal\n */\nexport type FluidLayer = \"loader\" | \"driver\" | \"runtime\" | \"dataStore\";\n\n/**\n * The policy for compatibility windows that a layer uses to validate compatibility with another layer.\n * The other layer must be within this window relative to the layer to be compatible.\n * Note that the policy is defined in terms of months, but the actual compatibility check is done using generations.\n * Generations are updated every 1+ months depending on the release cadence so they are mostly 1-to-1 with months,\n * but they are always higher than months since releases are not exactly every month.\n *\n * IMPORTANT: When changing these policy values, update the documentation in \"Layer Compatibility Policy\" section of\n * LayerCompatibility.md at the root of the repository.\n *\n * @internal\n */\nexport const LayerCompatibilityPolicyWindowMonths = {\n\t/**\n\t * Driver is compatible with Loader versions up to 12 months (or generations) older.\n\t */\n\tDriverLoader: 12,\n\t/**\n\t * Loader is compatible with Driver versions up to 12 months (or generations) older.\n\t */\n\tLoaderDriver: 12,\n\t/**\n\t * Runtime is compatible with Loader versions up to 12 months (or generations) older.\n\t */\n\tRuntimeLoader: 12,\n\t/**\n\t * Loader is compatible with Runtime versions up to 3 months (or generations) older.\n\t */\n\tLoaderRuntime: 3,\n\t/**\n\t * Runtime is compatible with DataStore versions up to 3 months (or generations) older.\n\t */\n\tRuntimeDataStore: 3,\n\t/**\n\t * DataStore is compatible with Runtime versions up to 3 months (or generations) older.\n\t */\n\tDataStoreRuntime: 3,\n} as const;\n\n/**\n * Result of a layer compatibility check - whether a layer is compatible with another layer.\n * @internal\n */\nexport type LayerCompatCheckResult =\n\t| { readonly isCompatible: true }\n\t| {\n\t\t\treadonly isCompatible: false;\n\t\t\t/**\n\t\t\t * Whether the generation of the layer is compatible with the other layer.\n\t\t\t */\n\t\t\treadonly isGenerationCompatible: boolean;\n\t\t\t/**\n\t\t\t * The features that are required by the layer but are not supported by the other layer. This will only\n\t\t\t * be set if there are unsupported features.\n\t\t\t */\n\t\t\treadonly unsupportedFeatures: readonly string[] | undefined;\n\t };\n\n/**\n * @internal\n */\nexport const ILayerCompatDetails: keyof IProvideLayerCompatDetails = \"ILayerCompatDetails\";\n\n/**\n * @internal\n */\nexport interface IProvideLayerCompatDetails {\n\treadonly ILayerCompatDetails: ILayerCompatDetails;\n}\n\n/**\n * This interface is used to communicate the compatibility details of a layer to another layer.\n * @internal\n */\nexport interface ILayerCompatDetails extends Partial<IProvideLayerCompatDetails> {\n\t/**\n\t * A list of features supported by the layer at a particular layer boundary. This is used to check if these\n\t * set of features satisfy the requirements of another layer.\n\t */\n\treadonly supportedFeatures: ReadonlySet<string>;\n\t/**\n\t * The generation of the layer. The other layer at the layer boundary uses this to check if this satisfies\n\t * the minimum generation it requires to be compatible.\n\t *\n\t * @remarks Generation is updated on a regular cadence, say, monthly. This will allow us to determine how\n\t * far apart two layers are in terms of time and whether they are compatible.\n\t * For example, say generation is updated every month and the compatibility window between layer1 and layer2 is\n\t * 6 months. Now, if layer1 is at generation 1 and layer2 is at generation 5, then they are 4 months apart and are\n\t * compatible. But if layer1 is at generation 1 and layer2 is at generation 8, then they are 7 months apart and\n\t * are not compatible.\n\t */\n\treadonly generation: number;\n\t/**\n\t * The package version of the layer. When an incompatibility is detected, this is used to provide more context\n\t * on what the versions of the incompatible layers are.\n\t */\n\treadonly pkgVersion: string;\n}\n\n/**\n * This is the default compat details for a layer when it doesn't provide any compat details. This is used for\n * backwards compatibility to allow older layers to work before compatibility enforcement was introduced.\n * @internal\n */\nexport const defaultLayerCompatDetails: ILayerCompatDetails = {\n\tsupportedFeatures: new Set(),\n\tgeneration: 0, // 0 is reserved for layers before compatibility enforcement was introduced.\n\tpkgVersion: \"unknown\",\n};\n\n/**\n * The requirements that a layer needs another layer to support for them to be compatible.\n * @internal\n */\nexport interface ILayerCompatSupportRequirements {\n\t/**\n\t * The minimum supported generation the other layer needs to be at.\n\t */\n\treadonly minSupportedGeneration: number;\n\t/**\n\t * The features that the other layer needs to support.\n\t */\n\treadonly requiredFeatures: readonly string[];\n}\n\n/**\n * Checks compatibility of a layer (layer1) with another layer (layer2).\n * @param compatSupportRequirementsLayer1 - The requirements from layer1 that layer2 needs to meet.\n * @param compatDetailsLayer2 - The compatibility details of the layer2. If this is undefined, then the\n * default compatibility details are used for backwards compatibility.\n * @returns The result of the compatibility check indicating whether layer2 is compatible with layer1.\n *\n * @internal\n */\nexport function checkLayerCompatibility(\n\tcompatSupportRequirementsLayer1: ILayerCompatSupportRequirements,\n\tcompatDetailsLayer2: ILayerCompatDetails | undefined,\n): LayerCompatCheckResult {\n\tconst compatDetailsLayer2ToUse = compatDetailsLayer2 ?? defaultLayerCompatDetails;\n\tlet isGenerationCompatible = true;\n\tconst unsupportedFeatures: string[] = [];\n\n\t// If layer2's generation is less than the required minimum supported generation of layer1,\n\t// then it is not compatible.\n\tif (\n\t\tcompatDetailsLayer2ToUse.generation <\n\t\tcompatSupportRequirementsLayer1.minSupportedGeneration\n\t) {\n\t\tisGenerationCompatible = false;\n\t}\n\n\t// All features required by layer1 must be supported by layer2 to be compatible.\n\tfor (const feature of compatSupportRequirementsLayer1.requiredFeatures) {\n\t\tif (!compatDetailsLayer2ToUse.supportedFeatures.has(feature)) {\n\t\t\tunsupportedFeatures.push(feature);\n\t\t}\n\t}\n\n\treturn isGenerationCompatible && unsupportedFeatures.length === 0\n\t\t? { isCompatible: true }\n\t\t: {\n\t\t\t\tisCompatible: false,\n\t\t\t\tisGenerationCompatible,\n\t\t\t\tunsupportedFeatures: unsupportedFeatures.length > 0 ? unsupportedFeatures : undefined,\n\t\t\t};\n}\n"]}
1
+ {"version":3,"file":"layerCompat.js","sourceRoot":"","sources":["../src/layerCompat.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA0KH,0DA+BC;AAjMD;;;;;;;;;;;GAWG;AACU,QAAA,oCAAoC,GAAG;IACnD;;OAEG;IACH,kBAAkB,EAAE,EAAE;IACtB;;OAEG;IACH,kBAAkB,EAAE,EAAE;IACtB;;OAEG;IACH,mBAAmB,EAAE,EAAE;IACvB;;OAEG;IACH,mBAAmB,EAAE,CAAC;IACtB;;OAEG;IACH,sBAAsB,EAAE,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microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * The different Fluid layers in a client.\n * @internal\n */\nexport type FluidLayer = \"loader\" | \"driver\" | \"runtime\" | \"dataStore\";\n\n/**\n * The policy for compatibility windows that a layer uses to validate compatibility with another layer.\n * The other layer must be within this window relative to the layer to be compatible.\n * Note that the policy is defined in terms of months, but the actual compatibility check is done using generations.\n * Generations are updated every 1+ months depending on the release cadence so they are mostly 1-to-1 with months,\n * but they are always higher than months since releases are not exactly every month.\n *\n * IMPORTANT: When changing these policy values, update the documentation in \"Layer Compatibility Policy\" section of\n * LayerCompatibility.md at the root of the repository.\n *\n * @internal\n */\nexport const LayerCompatibilityPolicyWindowMonths = {\n\t/**\n\t * A newer Driver is compatible with Loader versions up to 12 months (or generations) older.\n\t */\n\tNewDriverOldLoader: 12,\n\t/**\n\t * A newer Loader is compatible with Driver versions up to 12 months (or generations) older.\n\t */\n\tNewLoaderOldDriver: 12,\n\t/**\n\t * A newer Runtime is compatible with Loader versions up to 12 months (or generations) older.\n\t */\n\tNewRuntimeOldLoader: 12,\n\t/**\n\t * A newer Loader is compatible with Runtime versions up to 3 months (or generations) older.\n\t */\n\tNewLoaderOldRuntime: 3,\n\t/**\n\t * A newer Runtime is compatible with DataStore versions up to 3 months (or generations) older.\n\t */\n\tNewRuntimeOldDataStore: 3,\n\t/**\n\t * A newer DataStore is compatible with Runtime versions up to 3 months (or generations) older.\n\t */\n\tNewDataStoreOldRuntime: 3,\n} as const;\n\n/**\n * Result of a layer compatibility check - whether a layer is compatible with another layer.\n * @internal\n */\nexport type LayerCompatCheckResult =\n\t| { readonly isCompatible: true }\n\t| {\n\t\t\treadonly isCompatible: false;\n\t\t\t/**\n\t\t\t * Whether the generation of the layer is compatible with the other layer.\n\t\t\t */\n\t\t\treadonly isGenerationCompatible: boolean;\n\t\t\t/**\n\t\t\t * The features that are required by the layer but are not supported by the other layer. This will only\n\t\t\t * be set if there are unsupported features.\n\t\t\t */\n\t\t\treadonly unsupportedFeatures: readonly string[] | undefined;\n\t };\n\n/**\n * @internal\n */\nexport const ILayerCompatDetails: keyof IProvideLayerCompatDetails = \"ILayerCompatDetails\";\n\n/**\n * @internal\n */\nexport interface IProvideLayerCompatDetails {\n\treadonly ILayerCompatDetails: ILayerCompatDetails;\n}\n\n/**\n * This interface is used to communicate the compatibility details of a layer to another layer.\n * @internal\n */\nexport interface ILayerCompatDetails extends Partial<IProvideLayerCompatDetails> {\n\t/**\n\t * A list of features supported by the layer at a particular layer boundary. This is used to check if these\n\t * set of features satisfy the requirements of another layer.\n\t */\n\treadonly supportedFeatures: ReadonlySet<string>;\n\t/**\n\t * The generation of the layer. The other layer at the layer boundary uses this to check if this satisfies\n\t * the minimum generation it requires to be compatible.\n\t *\n\t * @remarks Generation is updated on a regular cadence, say, monthly. This will allow us to determine how\n\t * far apart two layers are in terms of time and whether they are compatible.\n\t * For example, say generation is updated every month and the compatibility window between layer1 and layer2 is\n\t * 6 months. Now, if layer1 is at generation 1 and layer2 is at generation 5, then they are 4 months apart and are\n\t * compatible. But if layer1 is at generation 1 and layer2 is at generation 8, then they are 7 months apart and\n\t * are not compatible.\n\t */\n\treadonly generation: number;\n\t/**\n\t * The package version of the layer. When an incompatibility is detected, this is used to provide more context\n\t * on what the versions of the incompatible layers are.\n\t */\n\treadonly pkgVersion: string;\n}\n\n/**\n * This is the default compat details for a layer when it doesn't provide any compat details. This is used for\n * backwards compatibility to allow older layers to work before compatibility enforcement was introduced.\n * @internal\n */\nexport const defaultLayerCompatDetails: ILayerCompatDetails = {\n\tsupportedFeatures: new Set(),\n\tgeneration: 0, // 0 is reserved for layers before compatibility enforcement was introduced.\n\tpkgVersion: \"unknown\",\n};\n\n/**\n * Key used to look up {@link (ILayerCompatSupportRequirements:interface)} on a `FluidObject`.\n * @internal\n */\nexport const ILayerCompatSupportRequirements: keyof IProvideLayerCompatSupportRequirements =\n\t\"ILayerCompatSupportRequirements\";\n\n/**\n * Provides {@link (ILayerCompatSupportRequirements:interface)} so that a layer can publish, as a `FluidObject`, the\n * requirements another layer must meet to be compatible with it.\n * @internal\n */\nexport interface IProvideLayerCompatSupportRequirements {\n\treadonly ILayerCompatSupportRequirements: ILayerCompatSupportRequirements;\n}\n\n/**\n * The requirements that a layer needs another layer to support for them to be compatible.\n *\n * @remarks\n * A layer can also publish its requirements across a boundary as a `FluidObject` (via\n * {@link IProvideLayerCompatSupportRequirements}) for the case where this layer cannot run the compatibility\n * validation itself and instead needs the layer on the other side of the boundary to check itself against the\n * published requirements. Most boundaries are validated by both layers because each holds\n * a reference to the other (e.g. the Loader and the Runtime). The Driver / Loader boundary is asymmetric: the\n * Loader holds a reference to the Driver, but the Driver has no reference to the Loader and so cannot validate it.\n * To still validate in both directions, the Driver publishes its requirements for the Loader and the Loader\n * validates itself against them on the Driver's behalf.\n *\n * @internal\n */\nexport interface ILayerCompatSupportRequirements\n\textends Partial<IProvideLayerCompatSupportRequirements> {\n\t/**\n\t * The minimum supported generation the other layer needs to be at.\n\t */\n\treadonly minSupportedGeneration: number;\n\t/**\n\t * The features that the other layer needs to support.\n\t */\n\treadonly requiredFeatures: readonly string[];\n}\n\n/**\n * Checks compatibility of a layer (layer1) with another layer (layer2).\n * @param compatSupportRequirementsLayer1 - The requirements from layer1 that layer2 needs to meet.\n * @param compatDetailsLayer2 - The compatibility details of the layer2. If this is undefined, then the\n * default compatibility details are used for backwards compatibility.\n * @returns The result of the compatibility check indicating whether layer2 is compatible with layer1.\n *\n * @internal\n */\nexport function checkLayerCompatibility(\n\tcompatSupportRequirementsLayer1: ILayerCompatSupportRequirements,\n\tcompatDetailsLayer2: ILayerCompatDetails | undefined,\n): LayerCompatCheckResult {\n\tconst compatDetailsLayer2ToUse = compatDetailsLayer2 ?? defaultLayerCompatDetails;\n\tlet isGenerationCompatible = true;\n\tconst unsupportedFeatures: string[] = [];\n\n\t// If layer2's generation is less than the required minimum supported generation of layer1,\n\t// then it is not compatible.\n\tif (\n\t\tcompatDetailsLayer2ToUse.generation <\n\t\tcompatSupportRequirementsLayer1.minSupportedGeneration\n\t) {\n\t\tisGenerationCompatible = false;\n\t}\n\n\t// All features required by layer1 must be supported by layer2 to be compatible.\n\tfor (const feature of compatSupportRequirementsLayer1.requiredFeatures) {\n\t\tif (!compatDetailsLayer2ToUse.supportedFeatures.has(feature)) {\n\t\t\tunsupportedFeatures.push(feature);\n\t\t}\n\t}\n\n\treturn isGenerationCompatible && unsupportedFeatures.length === 0\n\t\t? { isCompatible: true }\n\t\t: {\n\t\t\t\tisCompatible: false,\n\t\t\t\tisGenerationCompatible,\n\t\t\t\tunsupportedFeatures: unsupportedFeatures.length > 0 ? unsupportedFeatures : undefined,\n\t\t\t};\n}\n"]}
package/dist/trace.js CHANGED
@@ -13,10 +13,12 @@ const performanceIsomorphic_js_1 = require("./performanceIsomorphic.js");
13
13
  * @internal
14
14
  */
15
15
  class Trace {
16
+ startTick;
16
17
  static start() {
17
18
  const startTick = (0, performanceIsomorphic_js_1.performanceNow)();
18
19
  return new Trace(startTick);
19
20
  }
21
+ lastTick;
20
22
  constructor(startTick) {
21
23
  this.startTick = startTick;
22
24
  this.lastTick = startTick;
package/dist/trace.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yEAA4D;AAE5D;;;;;GAKG;AACH,MAAa,KAAK;IACV,MAAM,CAAC,KAAK;QAClB,MAAM,SAAS,GAAG,IAAA,yCAAc,GAAE,CAAC;QACnC,OAAO,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;IAGD,YAAsC,SAAiB;QAAjB,cAAS,GAAT,SAAS,CAAQ;QACtD,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC3B,CAAC;IAEM,KAAK;QACX,MAAM,IAAI,GAAG,IAAA,yCAAc,GAAE,CAAC;QAC9B,MAAM,KAAK,GAAG;YACb,gBAAgB,EAAE,IAAI,GAAG,IAAI,CAAC,SAAS;YACvC,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC,QAAQ;YAC9B,IAAI;SACJ,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AArBD,sBAqBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"./performanceIsomorphic.js\";\n\n/**\n * Helper class for tracing performance of events\n * Time measurements are in milliseconds as a floating point with a decimal\n *\n * @internal\n */\nexport class Trace {\n\tpublic static start(): Trace {\n\t\tconst startTick = performanceNow();\n\t\treturn new Trace(startTick);\n\t}\n\n\tprotected lastTick: number;\n\tprotected constructor(public readonly startTick: number) {\n\t\tthis.lastTick = startTick;\n\t}\n\n\tpublic trace(): ITraceEvent {\n\t\tconst tick = performanceNow();\n\t\tconst event = {\n\t\t\ttotalTimeElapsed: tick - this.startTick,\n\t\t\tduration: tick - this.lastTick,\n\t\t\ttick,\n\t\t};\n\t\tthis.lastTick = tick;\n\t\treturn event;\n\t}\n}\n\n/**\n * Event in a performance trace including time elapsed.\n *\n * @internal\n */\nexport interface ITraceEvent {\n\t/**\n\t * Total time elapsed since the start of the Trace.\n\t * Measured in milliseconds as a floating point with a decimal\n\t */\n\treadonly totalTimeElapsed: number;\n\t/**\n\t * Time elapsed since the last trace event.\n\t * Measured in milliseconds as a floating point with a decimal\n\t */\n\treadonly duration: number;\n\t/**\n\t * This number represents a relative time which should\n\t * be consistent for all trace ticks.\n\t */\n\treadonly tick: number;\n}\n"]}
1
+ {"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,yEAA4D;AAE5D;;;;;GAKG;AACH,MAAa,KAAK;IAOqB;IAN/B,MAAM,CAAC,KAAK;QAClB,MAAM,SAAS,GAAG,IAAA,yCAAc,GAAE,CAAC;QACnC,OAAO,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;IAES,QAAQ,CAAS;IAC3B,YAAsC,SAAiB;QAAjB,cAAS,GAAT,SAAS,CAAQ;QACtD,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC3B,CAAC;IAEM,KAAK;QACX,MAAM,IAAI,GAAG,IAAA,yCAAc,GAAE,CAAC;QAC9B,MAAM,KAAK,GAAG;YACb,gBAAgB,EAAE,IAAI,GAAG,IAAI,CAAC,SAAS;YACvC,QAAQ,EAAE,IAAI,GAAG,IAAI,CAAC,QAAQ;YAC9B,IAAI;SACJ,CAAC;QACF,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AArBD,sBAqBC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { performanceNow } from \"./performanceIsomorphic.js\";\n\n/**\n * Helper class for tracing performance of events\n * Time measurements are in milliseconds as a floating point with a decimal\n *\n * @internal\n */\nexport class Trace {\n\tpublic static start(): Trace {\n\t\tconst startTick = performanceNow();\n\t\treturn new Trace(startTick);\n\t}\n\n\tprotected lastTick: number;\n\tprotected constructor(public readonly startTick: number) {\n\t\tthis.lastTick = startTick;\n\t}\n\n\tpublic trace(): ITraceEvent {\n\t\tconst tick = performanceNow();\n\t\tconst event = {\n\t\t\ttotalTimeElapsed: tick - this.startTick,\n\t\t\tduration: tick - this.lastTick,\n\t\t\ttick,\n\t\t};\n\t\tthis.lastTick = tick;\n\t\treturn event;\n\t}\n}\n\n/**\n * Event in a performance trace including time elapsed.\n *\n * @internal\n */\nexport interface ITraceEvent {\n\t/**\n\t * Total time elapsed since the start of the Trace.\n\t * Measured in milliseconds as a floating point with a decimal\n\t */\n\treadonly totalTimeElapsed: number;\n\t/**\n\t * Time elapsed since the last trace event.\n\t * Measured in milliseconds as a floating point with a decimal\n\t */\n\treadonly duration: number;\n\t/**\n\t * This number represents a relative time which should\n\t * be consistent for all trace ticks.\n\t */\n\treadonly tick: number;\n}\n"]}
@@ -23,6 +23,13 @@ class TypedEventEmitter extends eventEmitter_cjs_1.EventEmitter {
23
23
  this.removeListener = super.removeListener.bind(this);
24
24
  this.off = super.off.bind(this);
25
25
  }
26
+ addListener;
27
+ on;
28
+ once;
29
+ prependListener;
30
+ prependOnceListener;
31
+ removeListener;
32
+ off;
26
33
  }
27
34
  exports.TypedEventEmitter = TypedEventEmitter;
28
35
  //# sourceMappingURL=typedEventEmitter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"typedEventEmitter.js","sourceRoot":"","sources":["../src/typedEventEmitter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,yDAAkD;AA8BlD;;;;;GAKG;AACH,MAAa,iBACZ,SAAQ,+BAAY;IAGpB;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACrF,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACvE,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAGrD,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAG7D,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QAC3F,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;IACtE,CAAC;CAQD;AA3BD,8CA2BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIEvent,\n\tIEventProvider,\n\tIEventTransformer,\n\tTransformedEvent,\n} from \"@fluidframework/core-interfaces\";\n\nimport { EventEmitter } from \"./eventEmitter.cjs\";\n\n/**\n * The event emitter polyfill and the node event emitter have different event types:\n * string | symbol vs. string | number\n *\n * The polyfill is now always used, but string is the only event type preferred.\n * @legacy @beta\n */\nexport type EventEmitterEventType = string;\n\n/**\n * @legacy @beta\n */\nexport type TypedEventTransform<TThis, TEvent> =\n\t// Event emitter supports some special events for the emitter itself to use\n\t// this exposes those events for the TypedEventEmitter.\n\t// Since we know what the shape of these events are, we can describe them directly via a TransformedEvent\n\t// which easier than trying to extend TEvent directly\n\tTransformedEvent<\n\t\tTThis,\n\t\t\"newListener\" | \"removeListener\",\n\t\tParameters<(event: string, listener: (...args: any[]) => void) => void>\n\t> &\n\t\t// Expose all the events provides by TEvent\n\t\tIEventTransformer<TThis, TEvent & IEvent> &\n\t\t// Add the default overload so this is covertable to EventEmitter regardless of environment\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tTransformedEvent<TThis, EventEmitterEventType, any[]>;\n\n/**\n * Event Emitter helper class the supports emitting typed events.\n * @privateRemarks\n * This should become internal once the classes extending it become internal.\n * @legacy @beta\n */\nexport class TypedEventEmitter<TEvent>\n\textends EventEmitter\n\timplements IEventProvider<TEvent & IEvent>\n{\n\tpublic constructor() {\n\t\tsuper();\n\t\tthis.addListener = super.addListener.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.on = super.on.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.once = super.once.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.prependListener = super.prependListener.bind(this) as TypedEventTransform<\n\t\t\tthis,\n\t\t\tTEvent\n\t\t>;\n\t\tthis.prependOnceListener = super.prependOnceListener.bind(this) as TypedEventTransform<\n\t\t\tthis,\n\t\t\tTEvent\n\t\t>;\n\t\tthis.removeListener = super.removeListener.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.off = super.off.bind(this) as TypedEventTransform<this, TEvent>;\n\t}\n\tpublic readonly addListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly on: TypedEventTransform<this, TEvent>;\n\tpublic readonly once: TypedEventTransform<this, TEvent>;\n\tpublic readonly prependListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly prependOnceListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly removeListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly off: TypedEventTransform<this, TEvent>;\n}\n"]}
1
+ {"version":3,"file":"typedEventEmitter.js","sourceRoot":"","sources":["../src/typedEventEmitter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AASH,yDAAkD;AA8BlD;;;;;GAKG;AACH,MAAa,iBACZ,SAAQ,+BAAY;IAGpB;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACrF,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACnE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QACvE,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAGrD,CAAC;QACF,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAG7D,CAAC;QACF,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;QAC3F,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAsC,CAAC;IACtE,CAAC;IACe,WAAW,CAAoC;IAC/C,EAAE,CAAoC;IACtC,IAAI,CAAoC;IACxC,eAAe,CAAoC;IACnD,mBAAmB,CAAoC;IACvD,cAAc,CAAoC;IAClD,GAAG,CAAoC;CACvD;AA3BD,8CA2BC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport type {\n\tIEvent,\n\tIEventProvider,\n\tIEventTransformer,\n\tTransformedEvent,\n} from \"@fluidframework/core-interfaces\";\n\nimport { EventEmitter } from \"./eventEmitter.cjs\";\n\n/**\n * The event emitter polyfill and the node event emitter have different event types:\n * string | symbol vs. string | number\n *\n * The polyfill is now always used, but string is the only event type preferred.\n * @legacy @beta\n */\nexport type EventEmitterEventType = string;\n\n/**\n * @legacy @beta\n */\nexport type TypedEventTransform<TThis, TEvent> =\n\t// Event emitter supports some special events for the emitter itself to use\n\t// this exposes those events for the TypedEventEmitter.\n\t// Since we know what the shape of these events are, we can describe them directly via a TransformedEvent\n\t// which easier than trying to extend TEvent directly\n\tTransformedEvent<\n\t\tTThis,\n\t\t\"newListener\" | \"removeListener\",\n\t\tParameters<(event: string, listener: (...args: any[]) => void) => void>\n\t> &\n\t\t// Expose all the events provides by TEvent\n\t\tIEventTransformer<TThis, TEvent & IEvent> &\n\t\t// Add the default overload so this is covertable to EventEmitter regardless of environment\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tTransformedEvent<TThis, EventEmitterEventType, any[]>;\n\n/**\n * Event Emitter helper class the supports emitting typed events.\n * @privateRemarks\n * This should become internal once the classes extending it become internal.\n * @legacy @beta\n */\nexport class TypedEventEmitter<TEvent>\n\textends EventEmitter\n\timplements IEventProvider<TEvent & IEvent>\n{\n\tpublic constructor() {\n\t\tsuper();\n\t\tthis.addListener = super.addListener.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.on = super.on.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.once = super.once.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.prependListener = super.prependListener.bind(this) as TypedEventTransform<\n\t\t\tthis,\n\t\t\tTEvent\n\t\t>;\n\t\tthis.prependOnceListener = super.prependOnceListener.bind(this) as TypedEventTransform<\n\t\t\tthis,\n\t\t\tTEvent\n\t\t>;\n\t\tthis.removeListener = super.removeListener.bind(this) as TypedEventTransform<this, TEvent>;\n\t\tthis.off = super.off.bind(this) as TypedEventTransform<this, TEvent>;\n\t}\n\tpublic readonly addListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly on: TypedEventTransform<this, TEvent>;\n\tpublic readonly once: TypedEventTransform<this, TEvent>;\n\tpublic readonly prependListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly prependOnceListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly removeListener: TypedEventTransform<this, TEvent>;\n\tpublic readonly off: TypedEventTransform<this, TEvent>;\n}\n"]}
package/eslint.config.mts CHANGED
@@ -10,7 +10,7 @@ const config: Linter.Config[] = [
10
10
  ...strict,
11
11
  {
12
12
  // Override @typescript-eslint/parser to use explicit project list instead of projectService.
13
- // This package has non-standard test directories (mocha/, jest/, types/) that
13
+ // This package has non-standard test directories (mocha/, playwright/, types/) that
14
14
  // typescript-eslint's projectService can't auto-discover.
15
15
  files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
16
16
  languageOptions: {
@@ -19,7 +19,7 @@ const config: Linter.Config[] = [
19
19
  project: [
20
20
  "./tsconfig.json",
21
21
  "./src/test/mocha/tsconfig.json",
22
- "./src/test/jest/tsconfig.cjs.json",
22
+ "./src/test/playwright/tsconfig.json",
23
23
  "./src/test/types/tsconfig.json",
24
24
  ],
25
25
  },
@@ -2,6 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
+ import type { IsoBufferEncoding } from "./buffer.js";
5
6
  /**
6
7
  * Converts the provided {@link https://en.wikipedia.org/wiki/Base64 | base64}-encoded string
7
8
  * to {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8}.
@@ -24,5 +25,5 @@ export declare const fromUtf8ToBase64: (input: string) => string;
24
25
  *
25
26
  * @internal
26
27
  */
27
- export declare const toUtf8: (input: string, encoding: string) => string;
28
+ export declare const toUtf8: (input: string, encoding: IsoBufferEncoding) => string;
28
29
  //# sourceMappingURL=base64EncodingBrowser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base64EncodingBrowser.d.ts","sourceRoot":"","sources":["../src/base64EncodingBrowser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MACA,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MACA,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,UAAW,MAAM,YAAY,MAAM,KAAG,MAWxD,CAAC"}
1
+ {"version":3,"file":"base64EncodingBrowser.d.ts","sourceRoot":"","sources":["../src/base64EncodingBrowser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAQrD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,KAAG,MACA,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,OAAO,MAAM,KAAG,MACA,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,EAAE,UAAU,iBAAiB,KAAG,MAWnE,CAAC"}