@fluid-internal/client-utils 2.0.0-dev-rc.1.0.0.232845 → 2.0.0-dev-rc.2.0.0.246488
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.
- package/.eslintrc.cjs +1 -1
- package/{.mocharc.js → .mocharc.cjs} +1 -1
- package/CHANGELOG.md +4 -0
- package/{api-extractor-esm.json → api-extractor-cjs.json} +5 -1
- package/api-extractor-lint.json +1 -1
- package/api-extractor.json +1 -1
- package/api-report/client-utils.api.md +8 -27
- package/dist/base64Encoding.js +4 -4
- package/dist/base64Encoding.js.map +1 -1
- package/dist/client-utils-alpha.d.ts +6 -11
- package/dist/client-utils-beta.d.ts +5 -11
- package/dist/client-utils-public.d.ts +5 -11
- package/dist/client-utils-untrimmed.d.ts +9 -39
- package/dist/eventEmitter.cjs +11 -0
- package/dist/eventEmitter.cjs.map +1 -0
- package/{lib/index.d.mts → dist/eventEmitter.d.cts} +2 -2
- package/dist/eventEmitter.d.cts.map +1 -0
- package/dist/hashFileBrowser.d.ts +1 -1
- package/dist/hashFileBrowser.d.ts.map +1 -1
- package/dist/hashFileBrowser.js +2 -2
- package/dist/hashFileBrowser.js.map +1 -1
- package/dist/hashFileNode.d.ts +1 -1
- package/dist/hashFileNode.d.ts.map +1 -1
- package/dist/hashFileNode.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/indexBrowser.d.ts +9 -9
- package/dist/indexBrowser.d.ts.map +1 -1
- package/dist/indexBrowser.js +24 -24
- package/dist/indexBrowser.js.map +1 -1
- package/dist/indexNode.d.ts +10 -10
- package/dist/indexNode.d.ts.map +1 -1
- package/dist/indexNode.js +23 -23
- package/dist/indexNode.js.map +1 -1
- package/dist/package.json +7 -0
- package/dist/trace.js +3 -3
- package/dist/trace.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/typedEventEmitter.d.ts +3 -6
- package/dist/typedEventEmitter.d.ts.map +1 -1
- package/dist/typedEventEmitter.js +2 -4
- package/dist/typedEventEmitter.js.map +1 -1
- package/{jest-puppeteer.config.js → jest-puppeteer.config.cjs} +4 -1
- package/{jest.config.js → jest.config.cjs} +1 -0
- package/lib/{base64Encoding.d.mts → base64Encoding.d.ts} +1 -1
- package/lib/base64Encoding.d.ts.map +1 -0
- package/lib/{base64Encoding.mjs → base64Encoding.js} +2 -2
- package/lib/base64Encoding.js.map +1 -0
- package/lib/{bufferBrowser.d.mts → bufferBrowser.d.ts} +1 -1
- package/lib/bufferBrowser.d.ts.map +1 -0
- package/lib/{bufferBrowser.mjs → bufferBrowser.js} +1 -1
- package/lib/bufferBrowser.js.map +1 -0
- package/lib/{bufferNode.d.mts → bufferNode.d.ts} +1 -1
- package/lib/bufferNode.d.ts.map +1 -0
- package/lib/{bufferNode.mjs → bufferNode.js} +1 -1
- package/lib/bufferNode.js.map +1 -0
- package/lib/{bufferShared.d.mts → bufferShared.d.ts} +1 -1
- package/lib/bufferShared.d.ts.map +1 -0
- package/lib/{bufferShared.mjs → bufferShared.js} +1 -1
- package/lib/bufferShared.js.map +1 -0
- package/lib/{client-utils-alpha.d.mts → client-utils-alpha.d.ts} +6 -11
- package/lib/{client-utils-public.d.mts → client-utils-beta.d.ts} +5 -11
- package/lib/{client-utils-beta.d.mts → client-utils-public.d.ts} +5 -11
- package/lib/{client-utils-untrimmed.d.mts → client-utils-untrimmed.d.ts} +9 -39
- package/lib/eventEmitter.cjs +11 -0
- package/lib/eventEmitter.cjs.map +1 -0
- package/lib/eventEmitter.d.cts +6 -0
- package/lib/eventEmitter.d.cts.map +1 -0
- package/lib/{hashFileNode.d.mts → hashFileBrowser.d.ts} +2 -2
- package/lib/hashFileBrowser.d.ts.map +1 -0
- package/lib/{hashFileBrowser.mjs → hashFileBrowser.js} +5 -3
- package/lib/{hashFileBrowser.mjs.map → hashFileBrowser.js.map} +1 -1
- package/lib/{hashFileBrowser.d.mts → hashFileNode.d.ts} +2 -2
- package/lib/hashFileNode.d.ts.map +1 -0
- package/lib/{hashFileNode.mjs → hashFileNode.js} +1 -1
- package/lib/hashFileNode.js.map +1 -0
- package/lib/{index.mjs → index.d.ts} +2 -2
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -0
- package/lib/indexBrowser.d.ts +14 -0
- package/lib/indexBrowser.d.ts.map +1 -0
- package/lib/indexBrowser.js +13 -0
- package/lib/indexBrowser.js.map +1 -0
- package/lib/indexNode.d.ts +15 -0
- package/lib/indexNode.d.ts.map +1 -0
- package/lib/indexNode.js +13 -0
- package/lib/indexNode.js.map +1 -0
- package/lib/{performanceIsomorphic.d.mts → performanceIsomorphic.d.ts} +1 -1
- package/lib/performanceIsomorphic.d.ts.map +1 -0
- package/lib/{performanceIsomorphic.mjs → performanceIsomorphic.js} +1 -1
- package/lib/performanceIsomorphic.js.map +1 -0
- package/lib/test/mocha/typedEventEmitter.spec.js +43 -0
- package/lib/test/mocha/typedEventEmitter.spec.js.map +1 -0
- package/lib/test/types/validateClientUtilsPrevious.generated.js +42 -0
- package/lib/test/types/validateClientUtilsPrevious.generated.js.map +1 -0
- package/lib/{trace.d.mts → trace.d.ts} +1 -1
- package/lib/trace.d.ts.map +1 -0
- package/lib/{trace.mjs → trace.js} +2 -2
- package/lib/trace.js.map +1 -0
- package/lib/{typedEventEmitter.d.mts → typedEventEmitter.d.ts} +4 -7
- package/lib/typedEventEmitter.d.ts.map +1 -0
- package/lib/{typedEventEmitter.mjs → typedEventEmitter.js} +2 -2
- package/lib/typedEventEmitter.js.map +1 -0
- package/package.json +50 -35
- package/src/base64Encoding.ts +1 -1
- package/src/cjs/package.json +7 -0
- package/src/eventEmitter.cts +7 -0
- package/src/hashFileBrowser.ts +1 -1
- package/src/hashFileNode.ts +1 -1
- package/src/index.ts +1 -1
- package/src/indexBrowser.ts +13 -9
- package/src/indexNode.ts +14 -10
- package/src/trace.ts +1 -1
- package/src/typedEventEmitter.ts +3 -8
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.json +4 -7
- package/dist/eventForwarder.d.ts +0 -34
- package/dist/eventForwarder.d.ts.map +0 -1
- package/dist/eventForwarder.js +0 -98
- package/dist/eventForwarder.js.map +0 -1
- package/lib/base64Encoding.d.mts.map +0 -1
- package/lib/base64Encoding.mjs.map +0 -1
- package/lib/bufferBrowser.d.mts.map +0 -1
- package/lib/bufferBrowser.mjs.map +0 -1
- package/lib/bufferNode.d.mts.map +0 -1
- package/lib/bufferNode.mjs.map +0 -1
- package/lib/bufferShared.d.mts.map +0 -1
- package/lib/bufferShared.mjs.map +0 -1
- package/lib/eventForwarder.d.mts +0 -34
- package/lib/eventForwarder.d.mts.map +0 -1
- package/lib/eventForwarder.mjs +0 -94
- package/lib/eventForwarder.mjs.map +0 -1
- package/lib/hashFileBrowser.d.mts.map +0 -1
- package/lib/hashFileNode.d.mts.map +0 -1
- package/lib/hashFileNode.mjs.map +0 -1
- package/lib/index.d.mts.map +0 -1
- package/lib/index.mjs.map +0 -1
- package/lib/indexBrowser.d.mts +0 -14
- package/lib/indexBrowser.d.mts.map +0 -1
- package/lib/indexBrowser.mjs +0 -13
- package/lib/indexBrowser.mjs.map +0 -1
- package/lib/indexNode.d.mts +0 -15
- package/lib/indexNode.d.mts.map +0 -1
- package/lib/indexNode.mjs +0 -13
- package/lib/indexNode.mjs.map +0 -1
- package/lib/performanceIsomorphic.d.mts.map +0 -1
- package/lib/performanceIsomorphic.mjs.map +0 -1
- package/lib/trace.d.mts.map +0 -1
- package/lib/trace.mjs.map +0 -1
- package/lib/typedEventEmitter.d.mts.map +0 -1
- package/lib/typedEventEmitter.mjs.map +0 -1
- package/src/eventForwarder.ts +0 -122
package/dist/indexBrowser.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexBrowser.js","sourceRoot":"","sources":["../src/indexBrowser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"indexBrowser.js","sourceRoot":"","sources":["../src/indexBrowser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,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;AAC9B,uEAAyD;AAAhD,uHAAA,WAAW,OAAA;AAEpB,yDAAiF;AAAxE,qHAAA,gBAAgB,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAAE,2GAAA,MAAM,OAAA;AACnD,qDAA4D;AAAnD,0HAAA,uBAAuB,OAAA;AAChC,uDAAkD;AAAzC,gHAAA,YAAY,OAAA;AAErB,uCAAqD;AAA1B,iGAAA,KAAK,OAAA;AAChC,+DAIgC;AAF/B,yHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport {\n\tbufferToString,\n\tisArrayBuffer,\n\tIsoBuffer,\n\tstringToBuffer,\n\tUint8ArrayToString,\n} from \"./bufferBrowser.js\";\nexport { gitHashFile, hashFile } from \"./hashFileBrowser.js\";\nexport { performance } from \"./performanceIsomorphic.js\";\n\nexport { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from \"./base64Encoding.js\";\nexport { Uint8ArrayToArrayBuffer } from \"./bufferShared.js\";\nexport { EventEmitter } from \"./eventEmitter.cjs\";\nexport { type IsomorphicPerformance } from \"./performanceIsomorphic.js\";\nexport { type ITraceEvent, Trace } from \"./trace.js\";\nexport {\n\ttype EventEmitterEventType,\n\tTypedEventEmitter,\n\ttype TypedEventTransform,\n} from \"./typedEventEmitter.js\";\n"]}
|
package/dist/indexNode.d.ts
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
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";
|
|
6
|
-
export { bufferToString, IsoBuffer, stringToBuffer, Uint8ArrayToString } from "./bufferNode";
|
|
7
|
-
export { gitHashFile, hashFile } from "./hashFileNode";
|
|
8
|
-
export { performance } from "./performanceIsomorphic";
|
|
9
|
-
export { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from "./base64Encoding";
|
|
10
|
-
export { Uint8ArrayToArrayBuffer } from "./bufferShared";
|
|
11
|
-
export {
|
|
12
|
-
export { IsomorphicPerformance } from "./performanceIsomorphic";
|
|
13
|
-
export { ITraceEvent, Trace } from "./trace";
|
|
14
|
-
export { EventEmitterEventType, TypedEventEmitter, TypedEventTransform } from "./typedEventEmitter";
|
|
5
|
+
export { type Buffer } from "./bufferNode.js";
|
|
6
|
+
export { bufferToString, IsoBuffer, stringToBuffer, Uint8ArrayToString } from "./bufferNode.js";
|
|
7
|
+
export { gitHashFile, hashFile } from "./hashFileNode.js";
|
|
8
|
+
export { performance } from "./performanceIsomorphic.js";
|
|
9
|
+
export { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from "./base64Encoding.js";
|
|
10
|
+
export { Uint8ArrayToArrayBuffer } from "./bufferShared.js";
|
|
11
|
+
export { EventEmitter } from "./eventEmitter.cjs";
|
|
12
|
+
export { IsomorphicPerformance } from "./performanceIsomorphic.js";
|
|
13
|
+
export { type ITraceEvent, Trace } from "./trace.js";
|
|
14
|
+
export { type EventEmitterEventType, TypedEventEmitter, type TypedEventTransform, } from "./typedEventEmitter.js";
|
|
15
15
|
//# sourceMappingURL=indexNode.d.ts.map
|
package/dist/indexNode.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexNode.d.ts","sourceRoot":"","sources":["../src/indexNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"indexNode.d.ts","sourceRoot":"","sources":["../src/indexNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EACN,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,mBAAmB,GACxB,MAAM,wBAAwB,CAAC"}
|
package/dist/indexNode.js
CHANGED
|
@@ -4,27 +4,27 @@
|
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.TypedEventEmitter = exports.Trace = exports.
|
|
8
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "bufferToString", { enumerable: true, get: function () { return
|
|
10
|
-
Object.defineProperty(exports, "IsoBuffer", { enumerable: true, get: function () { return
|
|
11
|
-
Object.defineProperty(exports, "stringToBuffer", { enumerable: true, get: function () { return
|
|
12
|
-
Object.defineProperty(exports, "Uint8ArrayToString", { enumerable: true, get: function () { return
|
|
13
|
-
var
|
|
14
|
-
Object.defineProperty(exports, "gitHashFile", { enumerable: true, get: function () { return
|
|
15
|
-
Object.defineProperty(exports, "hashFile", { enumerable: true, get: function () { return
|
|
16
|
-
var
|
|
17
|
-
Object.defineProperty(exports, "performance", { enumerable: true, get: function () { return
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "fromBase64ToUtf8", { enumerable: true, get: function () { return
|
|
20
|
-
Object.defineProperty(exports, "fromUtf8ToBase64", { enumerable: true, get: function () { return
|
|
21
|
-
Object.defineProperty(exports, "toUtf8", { enumerable: true, get: function () { return
|
|
22
|
-
var
|
|
23
|
-
Object.defineProperty(exports, "Uint8ArrayToArrayBuffer", { enumerable: true, get: function () { return
|
|
24
|
-
var
|
|
25
|
-
Object.defineProperty(exports, "
|
|
26
|
-
var
|
|
27
|
-
Object.defineProperty(exports, "Trace", { enumerable: true, get: function () { return
|
|
28
|
-
var
|
|
29
|
-
Object.defineProperty(exports, "TypedEventEmitter", { enumerable: true, get: function () { return
|
|
7
|
+
exports.TypedEventEmitter = exports.Trace = exports.EventEmitter = exports.Uint8ArrayToArrayBuffer = exports.toUtf8 = exports.fromUtf8ToBase64 = exports.fromBase64ToUtf8 = exports.performance = exports.hashFile = exports.gitHashFile = exports.Uint8ArrayToString = exports.stringToBuffer = exports.IsoBuffer = exports.bufferToString = void 0;
|
|
8
|
+
var bufferNode_js_1 = require("./bufferNode.js");
|
|
9
|
+
Object.defineProperty(exports, "bufferToString", { enumerable: true, get: function () { return bufferNode_js_1.bufferToString; } });
|
|
10
|
+
Object.defineProperty(exports, "IsoBuffer", { enumerable: true, get: function () { return bufferNode_js_1.IsoBuffer; } });
|
|
11
|
+
Object.defineProperty(exports, "stringToBuffer", { enumerable: true, get: function () { return bufferNode_js_1.stringToBuffer; } });
|
|
12
|
+
Object.defineProperty(exports, "Uint8ArrayToString", { enumerable: true, get: function () { return bufferNode_js_1.Uint8ArrayToString; } });
|
|
13
|
+
var hashFileNode_js_1 = require("./hashFileNode.js");
|
|
14
|
+
Object.defineProperty(exports, "gitHashFile", { enumerable: true, get: function () { return hashFileNode_js_1.gitHashFile; } });
|
|
15
|
+
Object.defineProperty(exports, "hashFile", { enumerable: true, get: function () { return hashFileNode_js_1.hashFile; } });
|
|
16
|
+
var performanceIsomorphic_js_1 = require("./performanceIsomorphic.js");
|
|
17
|
+
Object.defineProperty(exports, "performance", { enumerable: true, get: function () { return performanceIsomorphic_js_1.performance; } });
|
|
18
|
+
var base64Encoding_js_1 = require("./base64Encoding.js");
|
|
19
|
+
Object.defineProperty(exports, "fromBase64ToUtf8", { enumerable: true, get: function () { return base64Encoding_js_1.fromBase64ToUtf8; } });
|
|
20
|
+
Object.defineProperty(exports, "fromUtf8ToBase64", { enumerable: true, get: function () { return base64Encoding_js_1.fromUtf8ToBase64; } });
|
|
21
|
+
Object.defineProperty(exports, "toUtf8", { enumerable: true, get: function () { return base64Encoding_js_1.toUtf8; } });
|
|
22
|
+
var bufferShared_js_1 = require("./bufferShared.js");
|
|
23
|
+
Object.defineProperty(exports, "Uint8ArrayToArrayBuffer", { enumerable: true, get: function () { return bufferShared_js_1.Uint8ArrayToArrayBuffer; } });
|
|
24
|
+
var eventEmitter_cjs_1 = require("./eventEmitter.cjs");
|
|
25
|
+
Object.defineProperty(exports, "EventEmitter", { enumerable: true, get: function () { return eventEmitter_cjs_1.EventEmitter; } });
|
|
26
|
+
var trace_js_1 = require("./trace.js");
|
|
27
|
+
Object.defineProperty(exports, "Trace", { enumerable: true, get: function () { return trace_js_1.Trace; } });
|
|
28
|
+
var typedEventEmitter_js_1 = require("./typedEventEmitter.js");
|
|
29
|
+
Object.defineProperty(exports, "TypedEventEmitter", { enumerable: true, get: function () { return typedEventEmitter_js_1.TypedEventEmitter; } });
|
|
30
30
|
//# sourceMappingURL=indexNode.js.map
|
package/dist/indexNode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexNode.js","sourceRoot":"","sources":["../src/indexNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,
|
|
1
|
+
{"version":3,"file":"indexNode.js","sourceRoot":"","sources":["../src/indexNode.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAGH,iDAAgG;AAAvF,+GAAA,cAAc,OAAA;AAAE,0GAAA,SAAS,OAAA;AAAE,+GAAA,cAAc,OAAA;AAAE,mHAAA,kBAAkB,OAAA;AACtE,qDAA0D;AAAjD,8GAAA,WAAW,OAAA;AAAE,2GAAA,QAAQ,OAAA;AAC9B,uEAAyD;AAAhD,uHAAA,WAAW,OAAA;AAEpB,yDAAiF;AAAxE,qHAAA,gBAAgB,OAAA;AAAE,qHAAA,gBAAgB,OAAA;AAAE,2GAAA,MAAM,OAAA;AACnD,qDAA4D;AAAnD,0HAAA,uBAAuB,OAAA;AAChC,uDAAkD;AAAzC,gHAAA,YAAY,OAAA;AAErB,uCAAqD;AAA1B,iGAAA,KAAK,OAAA;AAChC,+DAIgC;AAF/B,yHAAA,iBAAiB,OAAA","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { type Buffer } from \"./bufferNode.js\";\nexport { bufferToString, IsoBuffer, stringToBuffer, Uint8ArrayToString } from \"./bufferNode.js\";\nexport { gitHashFile, hashFile } from \"./hashFileNode.js\";\nexport { performance } from \"./performanceIsomorphic.js\";\n\nexport { fromBase64ToUtf8, fromUtf8ToBase64, toUtf8 } from \"./base64Encoding.js\";\nexport { Uint8ArrayToArrayBuffer } from \"./bufferShared.js\";\nexport { EventEmitter } from \"./eventEmitter.cjs\";\nexport { IsomorphicPerformance } from \"./performanceIsomorphic.js\";\nexport { type ITraceEvent, Trace } from \"./trace.js\";\nexport {\n\ttype EventEmitterEventType,\n\tTypedEventEmitter,\n\ttype TypedEventTransform,\n} from \"./typedEventEmitter.js\";\n"]}
|
package/dist/trace.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.Trace = void 0;
|
|
8
|
-
const
|
|
8
|
+
const indexNode_js_1 = require("./indexNode.js");
|
|
9
9
|
/**
|
|
10
10
|
* Helper class for tracing performance of events
|
|
11
11
|
* Time measurements are in milliseconds as a floating point with a decimal
|
|
@@ -14,7 +14,7 @@ const indexNode_1 = require("./indexNode");
|
|
|
14
14
|
*/
|
|
15
15
|
class Trace {
|
|
16
16
|
static start() {
|
|
17
|
-
const startTick =
|
|
17
|
+
const startTick = indexNode_js_1.performance.now();
|
|
18
18
|
return new Trace(startTick);
|
|
19
19
|
}
|
|
20
20
|
constructor(startTick) {
|
|
@@ -22,7 +22,7 @@ class Trace {
|
|
|
22
22
|
this.lastTick = startTick;
|
|
23
23
|
}
|
|
24
24
|
trace() {
|
|
25
|
-
const tick =
|
|
25
|
+
const tick = indexNode_js_1.performance.now();
|
|
26
26
|
const event = {
|
|
27
27
|
totalTimeElapsed: tick - this.startTick,
|
|
28
28
|
duration: tick - this.lastTick,
|
package/dist/trace.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../src/trace.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iDAA6C;AAE7C;;;;;GAKG;AACH,MAAa,KAAK;IACV,MAAM,CAAC,KAAK;QAClB,MAAM,SAAS,GAAG,0BAAW,CAAC,GAAG,EAAE,CAAC;QACpC,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,0BAAW,CAAC,GAAG,EAAE,CAAC;QAC/B,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 { performance } from \"./indexNode.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 = performance.now();\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 = performance.now();\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"]}
|
package/dist/tsdoc-metadata.json
CHANGED
|
@@ -2,19 +2,16 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
/// <reference types="node" />
|
|
6
|
-
import { EventEmitter } from "events";
|
|
7
5
|
import { IEvent, TransformedEvent, IEventTransformer, IEventProvider } from "@fluidframework/core-interfaces";
|
|
6
|
+
import { EventEmitter } from "./eventEmitter.cjs";
|
|
8
7
|
/**
|
|
9
8
|
* The event emitter polyfill and the node event emitter have different event types:
|
|
10
9
|
* string | symbol vs. string | number
|
|
11
10
|
*
|
|
12
|
-
*
|
|
11
|
+
* The polyfill is now always used, but string is the only event type preferred.
|
|
13
12
|
* @public
|
|
14
13
|
*/
|
|
15
|
-
export type EventEmitterEventType =
|
|
16
|
-
on(event: infer E, listener: any): any;
|
|
17
|
-
} ? E : never;
|
|
14
|
+
export type EventEmitterEventType = string;
|
|
18
15
|
/**
|
|
19
16
|
* @public
|
|
20
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedEventEmitter.d.ts","sourceRoot":"","sources":["../src/typedEventEmitter.ts"],"names":[],"mappings":"AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"typedEventEmitter.d.ts","sourceRoot":"","sources":["../src/typedEventEmitter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACN,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C;;GAEG;AACH,MAAM,MAAM,mBAAmB,CAAC,KAAK,EAAE,MAAM,IAK5C,gBAAgB,CACf,KAAK,EACL,aAAa,GAAG,gBAAgB,EAEhC,UAAU,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,KAAK,IAAI,CAAC,CACvE,GAEA,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,GAGzC,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,EAAE,GAAG,EAAE,CAAC,CAAC;AAExD;;;GAGG;AACH,qBAAa,iBAAiB,CAAC,MAAM,CACpC,SAAQ,YACR,YAAW,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC;;IAkB1C,QAAQ,CAAC,WAAW,EAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACxD,QAAQ,CAAC,EAAE,EAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/C,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACjD,QAAQ,CAAC,eAAe,EAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5D,QAAQ,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAChE,QAAQ,CAAC,cAAc,EAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC3D,QAAQ,CAAC,GAAG,EAAE,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;CAChD"}
|
|
@@ -5,14 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.TypedEventEmitter = void 0;
|
|
8
|
-
|
|
9
|
-
// eslint-disable-next-line unicorn/prefer-node-protocol
|
|
10
|
-
const events_1 = require("events");
|
|
8
|
+
const eventEmitter_cjs_1 = require("./eventEmitter.cjs");
|
|
11
9
|
/**
|
|
12
10
|
* Event Emitter helper class the supports emitting typed events
|
|
13
11
|
* @public
|
|
14
12
|
*/
|
|
15
|
-
class TypedEventEmitter extends
|
|
13
|
+
class TypedEventEmitter extends eventEmitter_cjs_1.EventEmitter {
|
|
16
14
|
constructor() {
|
|
17
15
|
super();
|
|
18
16
|
this.addListener = super.addListener.bind(this);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedEventEmitter.js","sourceRoot":"","sources":["../src/typedEventEmitter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;
|
|
1
|
+
{"version":3,"file":"typedEventEmitter.js","sourceRoot":"","sources":["../src/typedEventEmitter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAQH,yDAAkD;AA+BlD;;;GAGG;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 {\n\tIEvent,\n\tTransformedEvent,\n\tIEventTransformer,\n\tIEventProvider,\n} from \"@fluidframework/core-interfaces\";\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 * @public\n */\nexport type EventEmitterEventType = string;\n\n/**\n * @public\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\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\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 * @public\n */\nexport class TypedEventEmitter<TEvent>\n\textends EventEmitter\n\timplements IEventProvider<TEvent & IEvent>\n{\n\tconstructor() {\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\treadonly addListener: TypedEventTransform<this, TEvent>;\n\treadonly on: TypedEventTransform<this, TEvent>;\n\treadonly once: TypedEventTransform<this, TEvent>;\n\treadonly prependListener: TypedEventTransform<this, TEvent>;\n\treadonly prependOnceListener: TypedEventTransform<this, TEvent>;\n\treadonly removeListener: TypedEventTransform<this, TEvent>;\n\treadonly off: TypedEventTransform<this, TEvent>;\n}\n"]}
|
|
@@ -8,6 +8,9 @@ module.exports = {
|
|
|
8
8
|
args: ["--no-sandbox", "--disable-setuid-sandbox"], // https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md#setting-up-chrome-linux-sandbox
|
|
9
9
|
dumpio: true, // output browser console to cmd line
|
|
10
10
|
// slowMo: 500, // slows down process for easier viewing
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
// Use chrome-headless-shell since some tests don't work as-is with the new headless mode.
|
|
13
|
+
// AB#7150: Remove this once we have fixed the tests.
|
|
14
|
+
headless: "shell",
|
|
12
15
|
},
|
|
13
16
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64Encoding.d.ts","sourceRoot":"","sources":["../src/base64Encoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;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"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { IsoBuffer } from "./indexNode.
|
|
5
|
+
import { IsoBuffer } from "./indexNode.js";
|
|
6
6
|
/**
|
|
7
7
|
* Converts the provided {@link https://en.wikipedia.org/wiki/Base64 | base64}-encoded string
|
|
8
8
|
* to {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8}.
|
|
@@ -37,4 +37,4 @@ export const toUtf8 = (input, encoding) => {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=base64Encoding.
|
|
40
|
+
//# sourceMappingURL=base64Encoding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base64Encoding.js","sourceRoot":"","sources":["../src/base64Encoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAU,EAAE,CACzD,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAElD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAU,EAAE,CACzD,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAU,EAAE;IACjE,QAAQ,QAAQ,EAAE;QACjB,KAAK,MAAM,CAAC;QACZ,8GAA8G;QAC9G,KAAK,OAAO,CAAC,CAAC;YACb,OAAO,KAAK,CAAC;SACb;QACD,OAAO,CAAC,CAAC;YACR,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;SAClD;KACD;AACF,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IsoBuffer } from \"./indexNode.js\";\n\n/**\n * Converts the provided {@link https://en.wikipedia.org/wiki/Base64 | base64}-encoded string\n * to {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8}.\n *\n * @internal\n */\nexport const fromBase64ToUtf8 = (input: string): string =>\n\tIsoBuffer.from(input, \"base64\").toString(\"utf8\");\n\n/**\n * Converts the provided {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8}-encoded string\n * to {@link https://en.wikipedia.org/wiki/Base64 | base64}.\n *\n * @internal\n */\nexport const fromUtf8ToBase64 = (input: string): string =>\n\tIsoBuffer.from(input, \"utf8\").toString(\"base64\");\n\n/**\n * Convenience function to convert unknown encoding to utf8 that avoids\n * buffer copies/encode ops when no conversion is needed.\n * @param input - The source string to convert.\n * @param encoding - The source string's encoding.\n *\n * @internal\n */\nexport const toUtf8 = (input: string, encoding: string): string => {\n\tswitch (encoding) {\n\t\tcase \"utf8\":\n\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\t\tcase \"utf-8\": {\n\t\t\treturn input;\n\t\t}\n\t\tdefault: {\n\t\t\treturn IsoBuffer.from(input, encoding).toString();\n\t\t}\n\t}\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferBrowser.d.ts","sourceRoot":"","sources":["../src/bufferBrowser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,UAAU,EAEf,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GACpC,MAAM,CAeR;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,UAAW,MAAM,YAAY,MAAM,KAAG,eAC1B,CAAC;AAExC;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,SACpB,eAAe,YAEX,MAAM,GAAG,OAAO,GAAG,QAAQ,KACnC,MAAiD,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,WAAW,CAW9D;AAED;;;;GAIG;AACH,qBAAa,SAAU,SAAQ,UAAU;IACxC;;;;;;OAMG;IAEI,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;IAI/D;;;;;;;OAOG;IAEH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,gBAAgB,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,SAAS;IAsBxE,MAAM,CAAC,eAAe,CACrB,WAAW,EAAE,WAAW,EACxB,UAAU,CAAC,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,GACjB,SAAS;IAeZ,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS;IAoB5D,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO;IAItC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;CAkB7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferBrowser.js","sourceRoot":"","sources":["../src/bufferBrowser.ts"],"names":[],"mappings":"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","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/**\n * Converts a Uint8Array to a string of the provided encoding\n * Useful when the array might be an {@link IsoBuffer}.\n *\n * @param arr - The array to convert.\n * @param encoding - Optional target encoding; only \"utf8\" and \"base64\" are\n * supported, with \"utf8\" being default.\n * @returns The converted string.\n *\n * @internal\n */\nexport function Uint8ArrayToString(\n\tarr: Uint8Array,\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\tencoding?: \"utf8\" | \"utf-8\" | \"base64\",\n): string {\n\tswitch (encoding) {\n\t\tcase \"base64\": {\n\t\t\treturn base64js.fromByteArray(arr);\n\t\t}\n\t\tcase \"utf8\":\n\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\t\tcase \"utf-8\":\n\t\tcase undefined: {\n\t\t\treturn new TextDecoder().decode(arr);\n\t\t}\n\t\tdefault: {\n\t\t\tthrow new Error(\"invalid/unsupported encoding\");\n\t\t}\n\t}\n}\n\n/**\n * Converts a {@link https://en.wikipedia.org/wiki/Base64 | base64} or\n * {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8} string to array buffer.\n *\n * @param encoding - The input string's encoding.\n *\n * @internal\n */\nexport const stringToBuffer = (input: string, encoding: string): ArrayBufferLike =>\n\tIsoBuffer.from(input, encoding).buffer;\n\n/**\n * Convert binary blob to string format\n *\n * @param blob - the binary blob\n * @param encoding - output string's encoding\n * @returns the blob in string format\n *\n * @alpha\n */\nexport const bufferToString = (\n\tblob: ArrayBufferLike,\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\tencoding: \"utf8\" | \"utf-8\" | \"base64\",\n): string => IsoBuffer.from(blob).toString(encoding);\n\n/**\n * Determines if an object is an array buffer.\n *\n * @remarks Will detect and reject TypedArrays, like Uint8Array.\n * Reason - they can be viewport into Array, they can be accepted, but caller has to deal with\n * math properly (i.e. Take into account byteOffset at minimum).\n * For example, construction of new TypedArray can be in the form of new TypedArray(typedArray) or\n * new TypedArray(buffer, byteOffset, length), but passing TypedArray will result in fist path (and\n * ignoring byteOffice, length).\n *\n * @param obj - The object to determine if it is an ArrayBuffer.\n *\n * @internal\n */\nexport function isArrayBuffer(obj: unknown): obj is ArrayBuffer {\n\tconst maybe = obj as (Partial<ArrayBuffer> & Partial<Uint8Array>) | undefined;\n\treturn (\n\t\tobj instanceof ArrayBuffer ||\n\t\t(typeof maybe === \"object\" &&\n\t\t\tmaybe !== null &&\n\t\t\ttypeof maybe.byteLength === \"number\" &&\n\t\t\ttypeof maybe.slice === \"function\" &&\n\t\t\tmaybe.byteOffset === undefined &&\n\t\t\tmaybe.buffer === undefined)\n\t);\n}\n\n/**\n * Minimal implementation of Buffer for our usages in the browser environment.\n *\n * @internal\n */\nexport class IsoBuffer extends Uint8Array {\n\t/**\n\t * Convert the buffer to a string.\n\t * Only supports encoding the whole string (unlike the Node Buffer equivalent)\n\t * and only utf8 and base64 encodings.\n\t *\n\t * @param encoding - The encoding to use.\n\t */\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\tpublic toString(encoding?: \"utf8\" | \"utf-8\" | \"base64\"): string {\n\t\treturn Uint8ArrayToString(this, encoding);\n\t}\n\n\t/**\n\t * Static constructor\n\t * @param value - (string | ArrayBuffer)\n\t * @param encodingOrOffset - (string | number)\n\t * @param length - (number)\n\t *\n\t * @privateRemarks TODO: Use actual types\n\t */\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\n\tstatic from(value: any, encodingOrOffset?: any, length?: any): IsoBuffer {\n\t\tif (typeof value === \"string\") {\n\t\t\treturn IsoBuffer.fromString(value, encodingOrOffset as string | undefined);\n\t\t\t// Capture any typed arrays, including Uint8Array (and thus - IsoBuffer!)\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\t} else if (value !== null && typeof value === \"object\" && isArrayBuffer(value.buffer)) {\n\t\t\t// The version of the from function for the node buffer, which takes a buffer or typed array\n\t\t\t// as first parameter, does not have any offset or length parameters. Those are just silently\n\t\t\t// ignored and not taken into account\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access\n\t\t\treturn IsoBuffer.fromArrayBuffer(value.buffer, value.byteOffset, value.byteLength);\n\t\t} else if (isArrayBuffer(value)) {\n\t\t\treturn IsoBuffer.fromArrayBuffer(\n\t\t\t\tvalue,\n\t\t\t\tencodingOrOffset as number | undefined,\n\t\t\t\tlength as number,\n\t\t\t);\n\t\t} else {\n\t\t\tthrow new TypeError(\"Input value was neither a string nor an ArrayBuffer.\");\n\t\t}\n\t}\n\n\tstatic fromArrayBuffer(\n\t\tarrayBuffer: ArrayBuffer,\n\t\tbyteOffset?: number,\n\t\tbyteLength?: number,\n\t): IsoBuffer {\n\t\tconst offset = byteOffset ?? 0;\n\t\tconst validLength = byteLength ?? arrayBuffer.byteLength - offset;\n\t\tif (\n\t\t\toffset < 0 ||\n\t\t\toffset > arrayBuffer.byteLength ||\n\t\t\tvalidLength < 0 ||\n\t\t\tvalidLength + offset > arrayBuffer.byteLength\n\t\t) {\n\t\t\tthrow new RangeError(\"Invalid range specified.\");\n\t\t}\n\n\t\treturn new IsoBuffer(arrayBuffer, offset, validLength);\n\t}\n\n\tstatic fromString(str: string, encoding?: string): IsoBuffer {\n\t\tswitch (encoding) {\n\t\t\tcase \"base64\": {\n\t\t\t\tconst sanitizedString = this.sanitizeBase64(str);\n\t\t\t\tconst encoded = base64js.toByteArray(sanitizedString);\n\t\t\t\treturn new IsoBuffer(encoded.buffer);\n\t\t\t}\n\t\t\tcase \"utf8\":\n\t\t\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\t\t\tcase \"utf-8\":\n\t\t\tcase undefined: {\n\t\t\t\tconst encoded = new TextEncoder().encode(str);\n\t\t\t\treturn new IsoBuffer(encoded.buffer);\n\t\t\t}\n\t\t\tdefault: {\n\t\t\t\tthrow new Error(\"invalid/unsupported encoding\");\n\t\t\t}\n\t\t}\n\t}\n\n\tstatic isBuffer(obj: unknown): boolean {\n\t\tthrow new Error(\"unimplemented\");\n\t}\n\n\t/**\n\t * Sanitize a base64 string to provide to base64-js library.\n\t * {@link https://www.npmjs.com/package/base64-js} is not as tolerant of the same malformed base64 as Node'\n\t * Buffer is.\n\t */\n\tprivate static sanitizeBase64(str: string): string {\n\t\tlet sanitizedStr = str;\n\t\t// Remove everything after padding - Node buffer ignores everything\n\t\t// after any padding whereas base64-js does not\n\t\tsanitizedStr = sanitizedStr.split(\"=\")[0];\n\n\t\t// Remove invalid characters - Node buffer strips invalid characters\n\t\t// whereas base64-js replaces them with \"A\"\n\t\tsanitizedStr = sanitizedStr.replace(/[^\\w+-/]/g, \"\");\n\n\t\t// Check for missing padding - Node buffer tolerates missing padding\n\t\t// whereas base64-js does not\n\t\tif (sanitizedStr.length % 4 !== 0) {\n\t\t\tconst paddingArray = [\"\", \"===\", \"==\", \"=\"];\n\t\t\tsanitizedStr += paddingArray[sanitizedStr.length % 4];\n\t\t}\n\t\treturn sanitizedStr;\n\t}\n}\n"]}
|
|
@@ -59,4 +59,4 @@ export declare function stringToBuffer(input: string, encoding: string): ArrayBu
|
|
|
59
59
|
* @alpha
|
|
60
60
|
*/
|
|
61
61
|
export declare const bufferToString: (blob: ArrayBufferLike, encoding: "utf8" | "utf-8" | "base64") => string;
|
|
62
|
-
//# sourceMappingURL=bufferNode.d.
|
|
62
|
+
//# sourceMappingURL=bufferNode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferNode.d.ts","sourceRoot":"","sources":["../src/bufferNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,UAAU;IAE7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM;IAExD;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,gBAAgB,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS;IACpF,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM;CAC5C;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,eAAS,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAE/B;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CACjC,GAAG,EAAE,UAAU,EAEf,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GACpC,MAAM,CAIR;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,eAAe,CAQ/E;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,SACpB,eAAe,YAEX,MAAM,GAAG,OAAO,GAAG,QAAQ,KACnC,MAAiD,CAAC"}
|
|
@@ -50,4 +50,4 @@ export function stringToBuffer(input, encoding) {
|
|
|
50
50
|
export const bufferToString = (blob,
|
|
51
51
|
// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged
|
|
52
52
|
encoding) => IsoBuffer.from(blob).toString(encoding);
|
|
53
|
-
//# sourceMappingURL=bufferNode.
|
|
53
|
+
//# sourceMappingURL=bufferNode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferNode.js","sourceRoot":"","sources":["../src/bufferNode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA0BH;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;AAOhC;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CACjC,GAAe;AACf,8GAA8G;AAC9G,QAAsC;IAEtC,2EAA2E;IAC3E,6EAA6E;IAC7E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,QAAgB;IAC7D,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC5C,0EAA0E;IAC1E,2EAA2E;IAC3E,uDAAuD;IACvD,OAAO,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,MAAM,CAAC,UAAU;QAC9C,CAAC,CAAC,GAAG,CAAC,MAAM;QACZ,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC;AACtE,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC7B,IAAqB;AACrB,8GAA8G;AAC9G,QAAqC,EAC5B,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Declare the subset of Buffer functionality we want to make available instead of\n * exposing the entirely of Node's typings. This should match the public interface\n * of the browser implementation, so any changes made in one should be made in both.\n *\n * @internal\n */\nexport declare class Buffer extends Uint8Array {\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\ttoString(encoding?: \"utf8\" | \"utf-8\" | \"base64\"): string;\n\n\t/**\n\t * Static constructor\n\t *\n\t * @param value - (string | ArrayBuffer).\n\t * @param encodingOrOffset - (string | number).\n\t * @param length - (number).\n\t *\n\t * @privateRemarks TODO: Use actual types\n\t */\n\tstatic from(value: unknown, encodingOrOffset?: unknown, length?: unknown): IsoBuffer;\n\tstatic isBuffer(obj: unknown): obj is Buffer;\n}\n\n/**\n * @internal\n */\nexport const IsoBuffer = Buffer;\n\n/**\n * @internal\n */\nexport type IsoBuffer = Buffer;\n\n/**\n * Converts a Uint8Array to a string of the provided encoding.\n * @remarks Useful when the array might be an IsoBuffer.\n * @param arr - The array to convert.\n * @param encoding - Optional target encoding; only \"utf8\" and \"base64\" are\n * supported, with \"utf8\" being default.\n * @returns The converted string.\n *\n * @internal\n */\nexport function Uint8ArrayToString(\n\tarr: Uint8Array,\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\tencoding?: \"utf8\" | \"utf-8\" | \"base64\",\n): string {\n\t// Buffer extends Uint8Array. Therefore, 'arr' may already be a Buffer, in\n\t// which case we can avoid copying the Uint8Array into a new Buffer instance.\n\treturn (Buffer.isBuffer(arr) ? arr : Buffer.from(arr)).toString(encoding);\n}\n\n/**\n * Convert base64 or utf8 string to array buffer.\n * @param encoding - The input string's encoding.\n *\n * @internal\n */\nexport function stringToBuffer(input: string, encoding: string): ArrayBufferLike {\n\tconst iso = IsoBuffer.from(input, encoding);\n\t// In a Node environment, IsoBuffer may be a Node.js Buffer. Node.js will\n\t// pool multiple small Buffer instances into a single ArrayBuffer, in which\n\t// case we need to slice the appropriate span of bytes.\n\treturn iso.byteLength === iso.buffer.byteLength\n\t\t? iso.buffer\n\t\t: iso.buffer.slice(iso.byteOffset, iso.byteOffset + iso.byteLength);\n}\n\n/**\n * Convert binary blob to string format\n *\n * @param blob - The binary blob\n * @param encoding - Output string's encoding\n * @returns The blob in string format\n *\n * @alpha\n */\nexport const bufferToString = (\n\tblob: ArrayBufferLike,\n\t// eslint-disable-next-line unicorn/text-encoding-identifier-case -- this value is supported, just discouraged\n\tencoding: \"utf8\" | \"utf-8\" | \"base64\",\n): string => IsoBuffer.from(blob).toString(encoding);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferShared.d.ts","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW,CAKtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bufferShared.js","sourceRoot":"","sources":["../src/bufferShared.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,KAAiB;IACxD,IAAI,KAAK,CAAC,UAAU,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE;QAC3E,OAAO,KAAK,CAAC,MAAM,CAAC;KACpB;IACD,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;AAClF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Converts a Uint8Array array to an ArrayBuffer.\n * @param array - Array to convert to ArrayBuffer.\n *\n * @internal\n */\nexport function Uint8ArrayToArrayBuffer(array: Uint8Array): ArrayBuffer {\n\tif (array.byteOffset === 0 && array.byteLength === array.buffer.byteLength) {\n\t\treturn array.buffer;\n\t}\n\treturn array.buffer.slice(array.byteOffset, array.byteOffset + array.byteLength);\n}\n"]}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { EventEmitter } from 'events';
|
|
4
|
-
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
1
|
+
import { EventEmitter } from 'events_pkg';
|
|
5
2
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
6
3
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
7
4
|
import { IEventTransformer } from '@fluidframework/core-interfaces';
|
|
8
5
|
import { TransformedEvent } from '@fluidframework/core-interfaces';
|
|
9
6
|
|
|
10
|
-
/* Excluded from this release type:
|
|
7
|
+
/* Excluded from this release type: Buffer */
|
|
11
8
|
|
|
12
9
|
/**
|
|
13
10
|
* Convert binary blob to string format
|
|
@@ -20,18 +17,16 @@ import { TransformedEvent } from '@fluidframework/core-interfaces';
|
|
|
20
17
|
*/
|
|
21
18
|
export declare const bufferToString: (blob: ArrayBufferLike, encoding: "utf8" | "utf-8" | "base64") => string;
|
|
22
19
|
|
|
20
|
+
export { EventEmitter }
|
|
21
|
+
|
|
23
22
|
/**
|
|
24
23
|
* The event emitter polyfill and the node event emitter have different event types:
|
|
25
24
|
* string | symbol vs. string | number
|
|
26
25
|
*
|
|
27
|
-
*
|
|
26
|
+
* The polyfill is now always used, but string is the only event type preferred.
|
|
28
27
|
* @public
|
|
29
28
|
*/
|
|
30
|
-
export declare type EventEmitterEventType =
|
|
31
|
-
on(event: infer E, listener: any): any;
|
|
32
|
-
} ? E : never;
|
|
33
|
-
|
|
34
|
-
/* Excluded from this release type: EventForwarder */
|
|
29
|
+
export declare type EventEmitterEventType = string;
|
|
35
30
|
|
|
36
31
|
/* Excluded from this release type: fromBase64ToUtf8 */
|
|
37
32
|
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { EventEmitter } from 'events';
|
|
4
|
-
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
1
|
+
import { EventEmitter } from 'events_pkg';
|
|
5
2
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
6
3
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
7
4
|
import { IEventTransformer } from '@fluidframework/core-interfaces';
|
|
8
5
|
import { TransformedEvent } from '@fluidframework/core-interfaces';
|
|
9
6
|
|
|
10
|
-
/* Excluded from this release type:
|
|
7
|
+
/* Excluded from this release type: Buffer */
|
|
11
8
|
|
|
12
9
|
/* Excluded from this release type: bufferToString */
|
|
10
|
+
export { EventEmitter }
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
13
|
* The event emitter polyfill and the node event emitter have different event types:
|
|
16
14
|
* string | symbol vs. string | number
|
|
17
15
|
*
|
|
18
|
-
*
|
|
16
|
+
* The polyfill is now always used, but string is the only event type preferred.
|
|
19
17
|
* @public
|
|
20
18
|
*/
|
|
21
|
-
export declare type EventEmitterEventType =
|
|
22
|
-
on(event: infer E, listener: any): any;
|
|
23
|
-
} ? E : never;
|
|
24
|
-
|
|
25
|
-
/* Excluded from this release type: EventForwarder */
|
|
19
|
+
export declare type EventEmitterEventType = string;
|
|
26
20
|
|
|
27
21
|
/* Excluded from this release type: fromBase64ToUtf8 */
|
|
28
22
|
|
|
@@ -1,28 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { EventEmitter } from 'events';
|
|
4
|
-
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
1
|
+
import { EventEmitter } from 'events_pkg';
|
|
5
2
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
6
3
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
7
4
|
import { IEventTransformer } from '@fluidframework/core-interfaces';
|
|
8
5
|
import { TransformedEvent } from '@fluidframework/core-interfaces';
|
|
9
6
|
|
|
10
|
-
/* Excluded from this release type:
|
|
7
|
+
/* Excluded from this release type: Buffer */
|
|
11
8
|
|
|
12
9
|
/* Excluded from this release type: bufferToString */
|
|
10
|
+
export { EventEmitter }
|
|
13
11
|
|
|
14
12
|
/**
|
|
15
13
|
* The event emitter polyfill and the node event emitter have different event types:
|
|
16
14
|
* string | symbol vs. string | number
|
|
17
15
|
*
|
|
18
|
-
*
|
|
16
|
+
* The polyfill is now always used, but string is the only event type preferred.
|
|
19
17
|
* @public
|
|
20
18
|
*/
|
|
21
|
-
export declare type EventEmitterEventType =
|
|
22
|
-
on(event: infer E, listener: any): any;
|
|
23
|
-
} ? E : never;
|
|
24
|
-
|
|
25
|
-
/* Excluded from this release type: EventForwarder */
|
|
19
|
+
export declare type EventEmitterEventType = string;
|
|
26
20
|
|
|
27
21
|
/* Excluded from this release type: fromBase64ToUtf8 */
|
|
28
22
|
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { EventEmitter } from 'events';
|
|
4
|
-
import { IDisposable } from '@fluidframework/core-interfaces';
|
|
1
|
+
import { EventEmitter } from 'events_pkg';
|
|
5
2
|
import { IEvent } from '@fluidframework/core-interfaces';
|
|
6
3
|
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
7
4
|
import { IEventTransformer } from '@fluidframework/core-interfaces';
|
|
@@ -14,7 +11,7 @@ import { TransformedEvent } from '@fluidframework/core-interfaces';
|
|
|
14
11
|
*
|
|
15
12
|
* @internal
|
|
16
13
|
*/
|
|
17
|
-
declare class
|
|
14
|
+
export declare class Buffer extends Uint8Array {
|
|
18
15
|
toString(encoding?: "utf8" | "utf-8" | "base64"): string;
|
|
19
16
|
/**
|
|
20
17
|
* Static constructor
|
|
@@ -26,9 +23,8 @@ declare class Buffer_2 extends Uint8Array {
|
|
|
26
23
|
* @privateRemarks TODO: Use actual types
|
|
27
24
|
*/
|
|
28
25
|
static from(value: unknown, encodingOrOffset?: unknown, length?: unknown): IsoBuffer;
|
|
29
|
-
static isBuffer(obj: unknown): obj is
|
|
26
|
+
static isBuffer(obj: unknown): obj is Buffer;
|
|
30
27
|
}
|
|
31
|
-
export { Buffer_2 as Buffer }
|
|
32
28
|
|
|
33
29
|
/**
|
|
34
30
|
* Convert binary blob to string format
|
|
@@ -41,42 +37,16 @@ export { Buffer_2 as Buffer }
|
|
|
41
37
|
*/
|
|
42
38
|
export declare const bufferToString: (blob: ArrayBufferLike, encoding: "utf8" | "utf-8" | "base64") => string;
|
|
43
39
|
|
|
40
|
+
export { EventEmitter }
|
|
41
|
+
|
|
44
42
|
/**
|
|
45
43
|
* The event emitter polyfill and the node event emitter have different event types:
|
|
46
44
|
* string | symbol vs. string | number
|
|
47
45
|
*
|
|
48
|
-
*
|
|
46
|
+
* The polyfill is now always used, but string is the only event type preferred.
|
|
49
47
|
* @public
|
|
50
48
|
*/
|
|
51
|
-
export declare type EventEmitterEventType =
|
|
52
|
-
on(event: infer E, listener: any): any;
|
|
53
|
-
} ? E : never;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Base class used for forwarding events from a source EventEmitter.
|
|
57
|
-
* This can be useful when all arbitrary listeners need to be removed,
|
|
58
|
-
* but the primary source needs to stay intact.
|
|
59
|
-
*
|
|
60
|
-
* @internal
|
|
61
|
-
*/
|
|
62
|
-
export declare class EventForwarder<TEvent = IEvent> extends TypedEventEmitter<TEvent> implements IDisposable {
|
|
63
|
-
protected static isEmitterEvent(event: string): boolean;
|
|
64
|
-
private static readonly newListenerEvent;
|
|
65
|
-
private static readonly removeListenerEvent;
|
|
66
|
-
/**
|
|
67
|
-
* {@inheritDoc @fluidframework/core-interfaces#IDisposable.disposed}
|
|
68
|
-
*/
|
|
69
|
-
get disposed(): boolean;
|
|
70
|
-
private isDisposed;
|
|
71
|
-
private readonly forwardingEvents;
|
|
72
|
-
constructor(source?: EventEmitter | IEventProvider<TEvent & IEvent>);
|
|
73
|
-
/**
|
|
74
|
-
* {@inheritDoc @fluidframework/core-interfaces#IDisposable.dispose}
|
|
75
|
-
*/
|
|
76
|
-
dispose(): void;
|
|
77
|
-
protected forwardEvent(source: EventEmitter | IEventProvider<TEvent & IEvent>, ...events: string[]): void;
|
|
78
|
-
protected unforwardEvent(source: EventEmitter | IEventProvider<TEvent & IEvent>, ...events: string[]): void;
|
|
79
|
-
}
|
|
49
|
+
export declare type EventEmitterEventType = string;
|
|
80
50
|
|
|
81
51
|
/**
|
|
82
52
|
* Converts the provided {@link https://en.wikipedia.org/wiki/Base64 | base64}-encoded string
|
|
@@ -123,12 +93,12 @@ export declare function hashFile(file: IsoBuffer, algorithm?: "SHA-1" | "SHA-256
|
|
|
123
93
|
/**
|
|
124
94
|
* @internal
|
|
125
95
|
*/
|
|
126
|
-
export declare const IsoBuffer: typeof
|
|
96
|
+
export declare const IsoBuffer: typeof Buffer;
|
|
127
97
|
|
|
128
98
|
/**
|
|
129
99
|
* @internal
|
|
130
100
|
*/
|
|
131
|
-
export declare type IsoBuffer =
|
|
101
|
+
export declare type IsoBuffer = Buffer;
|
|
132
102
|
|
|
133
103
|
/**
|
|
134
104
|
* This type contains all browser performance properties as optional, and some
|