@fluid-internal/client-utils 2.0.0-dev-rc.3.0.0.254513 → 2.0.0-dev-rc.3.0.0.254674

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.
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+ export {
11
+ // Unrestricted APIs
12
+ EventEmitter,
13
+
14
+ // public APIs
15
+ EventEmitterEventType,
16
+ TypedEventEmitter,
17
+ TypedEventTransform,
18
+
19
+ // alpha APIs
20
+ bufferToString
21
+ } from "./index.js";
package/dist/beta.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+ export {
11
+ // Unrestricted APIs
12
+ EventEmitter,
13
+
14
+ // public APIs
15
+ EventEmitterEventType,
16
+ TypedEventEmitter,
17
+ TypedEventTransform
18
+ } from "./index.js";
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+ export {
11
+ // Unrestricted APIs
12
+ EventEmitter,
13
+
14
+ // public APIs
15
+ EventEmitterEventType,
16
+ TypedEventEmitter,
17
+ TypedEventTransform
18
+ } from "./index.js";
package/lib/alpha.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+ export {
11
+ // Unrestricted APIs
12
+ EventEmitter,
13
+
14
+ // public APIs
15
+ EventEmitterEventType,
16
+ TypedEventEmitter,
17
+ TypedEventTransform,
18
+
19
+ // alpha APIs
20
+ bufferToString
21
+ } from "./index.js";
package/lib/beta.d.ts ADDED
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+ export {
11
+ // Unrestricted APIs
12
+ EventEmitter,
13
+
14
+ // public APIs
15
+ EventEmitterEventType,
16
+ TypedEventEmitter,
17
+ TypedEventTransform
18
+ } from "./index.js";
@@ -0,0 +1,18 @@
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ /*
7
+ * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
8
+ * Generated by "flub generate entrypoints" in @fluidframework/build-tools.
9
+ */
10
+ export {
11
+ // Unrestricted APIs
12
+ EventEmitter,
13
+
14
+ // public APIs
15
+ EventEmitterEventType,
16
+ TypedEventEmitter,
17
+ TypedEventTransform
18
+ } from "./index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-internal/client-utils",
3
- "version": "2.0.0-dev-rc.3.0.0.254513",
3
+ "version": "2.0.0-dev-rc.3.0.0.254674",
4
4
  "description": "Not intended for use outside the Fluid Framework.",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -53,8 +53,8 @@
53
53
  "temp-directory": "nyc/.nyc_output"
54
54
  },
55
55
  "dependencies": {
56
- "@fluidframework/core-interfaces": "2.0.0-dev-rc.3.0.0.254513",
57
- "@fluidframework/core-utils": "2.0.0-dev-rc.3.0.0.254513",
56
+ "@fluidframework/core-interfaces": "2.0.0-dev-rc.3.0.0.254674",
57
+ "@fluidframework/core-utils": "2.0.0-dev-rc.3.0.0.254674",
58
58
  "@types/events_pkg": "npm:@types/events@^3.0.0",
59
59
  "base64-js": "^1.5.1",
60
60
  "buffer": "^6.0.3",
@@ -66,7 +66,7 @@
66
66
  "@arethetypeswrong/cli": "^0.15.2",
67
67
  "@biomejs/biome": "^1.6.2",
68
68
  "@fluid-internal/client-utils-previous": "npm:@fluid-internal/client-utils@2.0.0-internal.8.0.0",
69
- "@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.3.0.0.254513",
69
+ "@fluid-internal/mocha-test-setup": "2.0.0-dev-rc.3.0.0.254674",
70
70
  "@fluid-tools/build-cli": "^0.35.0",
71
71
  "@fluidframework/build-common": "^2.0.3",
72
72
  "@fluidframework/build-tools": "^0.35.0",
@@ -74,7 +74,7 @@
74
74
  "@microsoft/api-extractor": "^7.42.3",
75
75
  "@types/base64-js": "^1.3.0",
76
76
  "@types/jest": "29.5.3",
77
- "@types/jest-environment-puppeteer": "2.0.0-dev-rc.3.0.0.254513",
77
+ "@types/jest-environment-puppeteer": "2.0.0-dev-rc.3.0.0.254674",
78
78
  "@types/mocha": "^9.1.1",
79
79
  "@types/node": "^18.19.0",
80
80
  "@types/rewire": "^2.5.28",
@@ -112,14 +112,6 @@
112
112
  "build:test:jest",
113
113
  "build:test:types"
114
114
  ],
115
- "build:docs": {
116
- "dependsOn": [
117
- "...",
118
- "api-extractor:commonjs",
119
- "api-extractor:esnext"
120
- ],
121
- "script": false
122
- },
123
115
  "build:test:jest": [
124
116
  "tsc"
125
117
  ],
@@ -147,12 +139,12 @@
147
139
  },
148
140
  "scripts": {
149
141
  "api": "fluid-build . --task api",
150
- "api-extractor:commonjs": "api-extractor run --config ./api-extractor-cjs.json",
151
- "api-extractor:esnext": "api-extractor run --local",
142
+ "api-extractor:commonjs": "flub generate entrypoints --outDir ./dist",
143
+ "api-extractor:esnext": "flub generate entrypoints --outDir ./lib",
152
144
  "build": "fluid-build . --task build",
153
145
  "build:commonjs": "fluid-build . --task commonjs",
154
146
  "build:compile": "fluid-build . --task compile",
155
- "build:docs": "fluid-build . --task api",
147
+ "build:docs": "api-extractor run --local",
156
148
  "build:esnext": "tsc --project ./tsconfig.json",
157
149
  "build:test": "concurrently npm:build:test:mocha npm:build:test:jest npm:build:test:types",
158
150
  "build:test:jest": "fluid-tsc commonjs --project ./src/test/jest/tsconfig.cjs.json",
@@ -1,8 +0,0 @@
1
- {
2
- "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "../../../common/build/build-common/api-extractor-base.cjs.primary.json",
4
- // CJS is actually secondary; so, no report.
5
- "apiReport": {
6
- "enabled": false
7
- }
8
- }
@@ -1,77 +0,0 @@
1
- import { EventEmitter } from 'events_pkg';
2
- import { IEvent } from '@fluidframework/core-interfaces';
3
- import { IEventProvider } from '@fluidframework/core-interfaces';
4
- import { IEventTransformer } from '@fluidframework/core-interfaces';
5
- import { TransformedEvent } from '@fluidframework/core-interfaces';
6
-
7
- /* Excluded from this release type: Buffer */
8
-
9
- /**
10
- * Convert binary blob to string format
11
- *
12
- * @param blob - The binary blob
13
- * @param encoding - Output string's encoding
14
- * @returns The blob in string format
15
- *
16
- * @alpha
17
- */
18
- export declare const bufferToString: (blob: ArrayBufferLike, encoding: "utf8" | "utf-8" | "base64") => string;
19
-
20
- export { EventEmitter }
21
-
22
- /**
23
- * The event emitter polyfill and the node event emitter have different event types:
24
- * string | symbol vs. string | number
25
- *
26
- * The polyfill is now always used, but string is the only event type preferred.
27
- * @public
28
- */
29
- export declare type EventEmitterEventType = string;
30
-
31
- /* Excluded from this release type: fromBase64ToUtf8 */
32
-
33
- /* Excluded from this release type: fromUtf8ToBase64 */
34
-
35
- /* Excluded from this release type: gitHashFile */
36
-
37
- /* Excluded from this release type: hashFile */
38
-
39
- /* Excluded from this release type: IsoBuffer */
40
-
41
- /* Excluded from this release type: IsomorphicPerformance */
42
-
43
- /* Excluded from this release type: ITraceEvent */
44
-
45
- /* Excluded from this release type: performance_2 */
46
-
47
- /* Excluded from this release type: stringToBuffer */
48
-
49
- /* Excluded from this release type: toUtf8 */
50
-
51
- /* Excluded from this release type: Trace */
52
-
53
- /**
54
- * Event Emitter helper class the supports emitting typed events
55
- * @public
56
- */
57
- export declare class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
58
- constructor();
59
- readonly addListener: TypedEventTransform<this, TEvent>;
60
- readonly on: TypedEventTransform<this, TEvent>;
61
- readonly once: TypedEventTransform<this, TEvent>;
62
- readonly prependListener: TypedEventTransform<this, TEvent>;
63
- readonly prependOnceListener: TypedEventTransform<this, TEvent>;
64
- readonly removeListener: TypedEventTransform<this, TEvent>;
65
- readonly off: TypedEventTransform<this, TEvent>;
66
- }
67
-
68
- /**
69
- * @public
70
- */
71
- export declare type TypedEventTransform<TThis, TEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent & IEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
72
-
73
- /* Excluded from this release type: Uint8ArrayToArrayBuffer */
74
-
75
- /* Excluded from this release type: Uint8ArrayToString */
76
-
77
- export { }
@@ -1,67 +0,0 @@
1
- import { EventEmitter } from 'events_pkg';
2
- import { IEvent } from '@fluidframework/core-interfaces';
3
- import { IEventProvider } from '@fluidframework/core-interfaces';
4
- import { IEventTransformer } from '@fluidframework/core-interfaces';
5
- import { TransformedEvent } from '@fluidframework/core-interfaces';
6
-
7
- /* Excluded from this release type: Buffer */
8
-
9
- /* Excluded from this release type: bufferToString */
10
- export { EventEmitter }
11
-
12
- /**
13
- * The event emitter polyfill and the node event emitter have different event types:
14
- * string | symbol vs. string | number
15
- *
16
- * The polyfill is now always used, but string is the only event type preferred.
17
- * @public
18
- */
19
- export declare type EventEmitterEventType = string;
20
-
21
- /* Excluded from this release type: fromBase64ToUtf8 */
22
-
23
- /* Excluded from this release type: fromUtf8ToBase64 */
24
-
25
- /* Excluded from this release type: gitHashFile */
26
-
27
- /* Excluded from this release type: hashFile */
28
-
29
- /* Excluded from this release type: IsoBuffer */
30
-
31
- /* Excluded from this release type: IsomorphicPerformance */
32
-
33
- /* Excluded from this release type: ITraceEvent */
34
-
35
- /* Excluded from this release type: performance_2 */
36
-
37
- /* Excluded from this release type: stringToBuffer */
38
-
39
- /* Excluded from this release type: toUtf8 */
40
-
41
- /* Excluded from this release type: Trace */
42
-
43
- /**
44
- * Event Emitter helper class the supports emitting typed events
45
- * @public
46
- */
47
- export declare class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
48
- constructor();
49
- readonly addListener: TypedEventTransform<this, TEvent>;
50
- readonly on: TypedEventTransform<this, TEvent>;
51
- readonly once: TypedEventTransform<this, TEvent>;
52
- readonly prependListener: TypedEventTransform<this, TEvent>;
53
- readonly prependOnceListener: TypedEventTransform<this, TEvent>;
54
- readonly removeListener: TypedEventTransform<this, TEvent>;
55
- readonly off: TypedEventTransform<this, TEvent>;
56
- }
57
-
58
- /**
59
- * @public
60
- */
61
- export declare type TypedEventTransform<TThis, TEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent & IEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
62
-
63
- /* Excluded from this release type: Uint8ArrayToArrayBuffer */
64
-
65
- /* Excluded from this release type: Uint8ArrayToString */
66
-
67
- export { }
@@ -1,67 +0,0 @@
1
- import { EventEmitter } from 'events_pkg';
2
- import { IEvent } from '@fluidframework/core-interfaces';
3
- import { IEventProvider } from '@fluidframework/core-interfaces';
4
- import { IEventTransformer } from '@fluidframework/core-interfaces';
5
- import { TransformedEvent } from '@fluidframework/core-interfaces';
6
-
7
- /* Excluded from this release type: Buffer */
8
-
9
- /* Excluded from this release type: bufferToString */
10
- export { EventEmitter }
11
-
12
- /**
13
- * The event emitter polyfill and the node event emitter have different event types:
14
- * string | symbol vs. string | number
15
- *
16
- * The polyfill is now always used, but string is the only event type preferred.
17
- * @public
18
- */
19
- export declare type EventEmitterEventType = string;
20
-
21
- /* Excluded from this release type: fromBase64ToUtf8 */
22
-
23
- /* Excluded from this release type: fromUtf8ToBase64 */
24
-
25
- /* Excluded from this release type: gitHashFile */
26
-
27
- /* Excluded from this release type: hashFile */
28
-
29
- /* Excluded from this release type: IsoBuffer */
30
-
31
- /* Excluded from this release type: IsomorphicPerformance */
32
-
33
- /* Excluded from this release type: ITraceEvent */
34
-
35
- /* Excluded from this release type: performance_2 */
36
-
37
- /* Excluded from this release type: stringToBuffer */
38
-
39
- /* Excluded from this release type: toUtf8 */
40
-
41
- /* Excluded from this release type: Trace */
42
-
43
- /**
44
- * Event Emitter helper class the supports emitting typed events
45
- * @public
46
- */
47
- export declare class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
48
- constructor();
49
- readonly addListener: TypedEventTransform<this, TEvent>;
50
- readonly on: TypedEventTransform<this, TEvent>;
51
- readonly once: TypedEventTransform<this, TEvent>;
52
- readonly prependListener: TypedEventTransform<this, TEvent>;
53
- readonly prependOnceListener: TypedEventTransform<this, TEvent>;
54
- readonly removeListener: TypedEventTransform<this, TEvent>;
55
- readonly off: TypedEventTransform<this, TEvent>;
56
- }
57
-
58
- /**
59
- * @public
60
- */
61
- export declare type TypedEventTransform<TThis, TEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent & IEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
62
-
63
- /* Excluded from this release type: Uint8ArrayToArrayBuffer */
64
-
65
- /* Excluded from this release type: Uint8ArrayToString */
66
-
67
- export { }
@@ -1,217 +0,0 @@
1
- import { EventEmitter } from 'events_pkg';
2
- import { IEvent } from '@fluidframework/core-interfaces';
3
- import { IEventProvider } from '@fluidframework/core-interfaces';
4
- import { IEventTransformer } from '@fluidframework/core-interfaces';
5
- import { TransformedEvent } from '@fluidframework/core-interfaces';
6
-
7
- /**
8
- * Declare the subset of Buffer functionality we want to make available instead of
9
- * exposing the entirely of Node's typings. This should match the public interface
10
- * of the browser implementation, so any changes made in one should be made in both.
11
- *
12
- * @internal
13
- */
14
- export declare class Buffer extends Uint8Array {
15
- toString(encoding?: "utf8" | "utf-8" | "base64"): string;
16
- /**
17
- * Static constructor
18
- *
19
- * @param value - (string | ArrayBuffer).
20
- * @param encodingOrOffset - (string | number).
21
- * @param length - (number).
22
- *
23
- * @privateRemarks TODO: Use actual types
24
- */
25
- static from(value: unknown, encodingOrOffset?: unknown, length?: unknown): IsoBuffer;
26
- static isBuffer(obj: unknown): obj is Buffer;
27
- }
28
-
29
- /**
30
- * Convert binary blob to string format
31
- *
32
- * @param blob - The binary blob
33
- * @param encoding - Output string's encoding
34
- * @returns The blob in string format
35
- *
36
- * @alpha
37
- */
38
- export declare const bufferToString: (blob: ArrayBufferLike, encoding: "utf8" | "utf-8" | "base64") => string;
39
-
40
- export { EventEmitter }
41
-
42
- /**
43
- * The event emitter polyfill and the node event emitter have different event types:
44
- * string | symbol vs. string | number
45
- *
46
- * The polyfill is now always used, but string is the only event type preferred.
47
- * @public
48
- */
49
- export declare type EventEmitterEventType = string;
50
-
51
- /**
52
- * Converts the provided {@link https://en.wikipedia.org/wiki/Base64 | base64}-encoded string
53
- * to {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8}.
54
- *
55
- * @internal
56
- */
57
- export declare const fromBase64ToUtf8: (input: string) => string;
58
-
59
- /**
60
- * Converts the provided {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8}-encoded string
61
- * to {@link https://en.wikipedia.org/wiki/Base64 | base64}.
62
- *
63
- * @internal
64
- */
65
- export declare const fromUtf8ToBase64: (input: string) => string;
66
-
67
- /**
68
- * Create a github hash (Github hashes the string with blob and size)
69
- * Must be called under secure context for browsers
70
- *
71
- * @param file - The contents of the file in a buffer
72
- * @returns The sha1 hash of the content of the buffer with the `blob` prefix and size
73
- *
74
- * @internal
75
- */
76
- export declare function gitHashFile(file: IsoBuffer): Promise<string>;
77
-
78
- /**
79
- * Hash a file. Consistent within a session, but should not be persisted and
80
- * is not consistent with git.
81
- * If called under an insecure context for a browser, this will fallback to
82
- * using the node implementation.
83
- *
84
- * @param file - The contents of the file in a buffer.
85
- * @param algorithm - The hash algorithm to use, artificially constrained by what is used internally.
86
- * @param hashEncoding - The encoding of the returned hash, also artificially constrained.
87
- * @returns The hash of the content of the buffer.
88
- *
89
- * @internal
90
- */
91
- export declare function hashFile(file: IsoBuffer, algorithm?: "SHA-1" | "SHA-256", hashEncoding?: "hex" | "base64"): Promise<string>;
92
-
93
- /**
94
- * @internal
95
- */
96
- export declare const IsoBuffer: typeof Buffer;
97
-
98
- /**
99
- * @internal
100
- */
101
- export declare type IsoBuffer = Buffer;
102
-
103
- /**
104
- * This type contains all browser performance properties as optional, and some
105
- * of the intersecting properties of node and browser performance as required.
106
- *
107
- * @internal
108
- */
109
- export declare type IsomorphicPerformance = Partial<Performance> & Pick<Performance, "clearMarks" | "mark" | "measure" | "now">;
110
-
111
- /**
112
- * Event in a performance trace including time elapsed.
113
- *
114
- * @internal
115
- */
116
- export declare interface ITraceEvent {
117
- /**
118
- * Total time elapsed since the start of the Trace.
119
- * Measured in milliseconds as a floating point with a decimal
120
- */
121
- readonly totalTimeElapsed: number;
122
- /**
123
- * Time elapsed since the last trace event.
124
- * Measured in milliseconds as a floating point with a decimal
125
- */
126
- readonly duration: number;
127
- /**
128
- * This number represents a relative time which should
129
- * be consistent for all trace ticks.
130
- */
131
- readonly tick: number;
132
- }
133
-
134
- /**
135
- * This exported "performance" member masks the built-in globalThis.performance object
136
- * as an IsomorphicPerformance, which hides all of its features that aren't compatible
137
- * between Node and browser implementations. Anything exposed on this performance object
138
- * is considered safe to use regarless of the environment it runs in.
139
- *
140
- * @internal
141
- */
142
- declare const performance_2: IsomorphicPerformance;
143
- export { performance_2 as performance }
144
-
145
- /**
146
- * Convert base64 or utf8 string to array buffer.
147
- * @param encoding - The input string's encoding.
148
- *
149
- * @internal
150
- */
151
- export declare function stringToBuffer(input: string, encoding: string): ArrayBufferLike;
152
-
153
- /**
154
- * Convenience function to convert unknown encoding to utf8 that avoids
155
- * buffer copies/encode ops when no conversion is needed.
156
- * @param input - The source string to convert.
157
- * @param encoding - The source string's encoding.
158
- *
159
- * @internal
160
- */
161
- export declare const toUtf8: (input: string, encoding: string) => string;
162
-
163
- /**
164
- * Helper class for tracing performance of events
165
- * Time measurements are in milliseconds as a floating point with a decimal
166
- *
167
- * @internal
168
- */
169
- export declare class Trace {
170
- readonly startTick: number;
171
- static start(): Trace;
172
- protected lastTick: number;
173
- protected constructor(startTick: number);
174
- trace(): ITraceEvent;
175
- }
176
-
177
- /**
178
- * Event Emitter helper class the supports emitting typed events
179
- * @public
180
- */
181
- export declare class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
182
- constructor();
183
- readonly addListener: TypedEventTransform<this, TEvent>;
184
- readonly on: TypedEventTransform<this, TEvent>;
185
- readonly once: TypedEventTransform<this, TEvent>;
186
- readonly prependListener: TypedEventTransform<this, TEvent>;
187
- readonly prependOnceListener: TypedEventTransform<this, TEvent>;
188
- readonly removeListener: TypedEventTransform<this, TEvent>;
189
- readonly off: TypedEventTransform<this, TEvent>;
190
- }
191
-
192
- /**
193
- * @public
194
- */
195
- export declare type TypedEventTransform<TThis, TEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent & IEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
196
-
197
- /**
198
- * Converts a Uint8Array array to an ArrayBuffer.
199
- * @param array - Array to convert to ArrayBuffer.
200
- *
201
- * @internal
202
- */
203
- export declare function Uint8ArrayToArrayBuffer(array: Uint8Array): ArrayBuffer;
204
-
205
- /**
206
- * Converts a Uint8Array to a string of the provided encoding.
207
- * @remarks Useful when the array might be an IsoBuffer.
208
- * @param arr - The array to convert.
209
- * @param encoding - Optional target encoding; only "utf8" and "base64" are
210
- * supported, with "utf8" being default.
211
- * @returns The converted string.
212
- *
213
- * @internal
214
- */
215
- export declare function Uint8ArrayToString(arr: Uint8Array, encoding?: "utf8" | "utf-8" | "base64"): string;
216
-
217
- export { }
@@ -1,11 +0,0 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.42.3"
9
- }
10
- ]
11
- }
@@ -1,77 +0,0 @@
1
- import { EventEmitter } from 'events_pkg';
2
- import { IEvent } from '@fluidframework/core-interfaces';
3
- import { IEventProvider } from '@fluidframework/core-interfaces';
4
- import { IEventTransformer } from '@fluidframework/core-interfaces';
5
- import { TransformedEvent } from '@fluidframework/core-interfaces';
6
-
7
- /* Excluded from this release type: Buffer */
8
-
9
- /**
10
- * Convert binary blob to string format
11
- *
12
- * @param blob - The binary blob
13
- * @param encoding - Output string's encoding
14
- * @returns The blob in string format
15
- *
16
- * @alpha
17
- */
18
- export declare const bufferToString: (blob: ArrayBufferLike, encoding: "utf8" | "utf-8" | "base64") => string;
19
-
20
- export { EventEmitter }
21
-
22
- /**
23
- * The event emitter polyfill and the node event emitter have different event types:
24
- * string | symbol vs. string | number
25
- *
26
- * The polyfill is now always used, but string is the only event type preferred.
27
- * @public
28
- */
29
- export declare type EventEmitterEventType = string;
30
-
31
- /* Excluded from this release type: fromBase64ToUtf8 */
32
-
33
- /* Excluded from this release type: fromUtf8ToBase64 */
34
-
35
- /* Excluded from this release type: gitHashFile */
36
-
37
- /* Excluded from this release type: hashFile */
38
-
39
- /* Excluded from this release type: IsoBuffer */
40
-
41
- /* Excluded from this release type: IsomorphicPerformance */
42
-
43
- /* Excluded from this release type: ITraceEvent */
44
-
45
- /* Excluded from this release type: performance_2 */
46
-
47
- /* Excluded from this release type: stringToBuffer */
48
-
49
- /* Excluded from this release type: toUtf8 */
50
-
51
- /* Excluded from this release type: Trace */
52
-
53
- /**
54
- * Event Emitter helper class the supports emitting typed events
55
- * @public
56
- */
57
- export declare class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
58
- constructor();
59
- readonly addListener: TypedEventTransform<this, TEvent>;
60
- readonly on: TypedEventTransform<this, TEvent>;
61
- readonly once: TypedEventTransform<this, TEvent>;
62
- readonly prependListener: TypedEventTransform<this, TEvent>;
63
- readonly prependOnceListener: TypedEventTransform<this, TEvent>;
64
- readonly removeListener: TypedEventTransform<this, TEvent>;
65
- readonly off: TypedEventTransform<this, TEvent>;
66
- }
67
-
68
- /**
69
- * @public
70
- */
71
- export declare type TypedEventTransform<TThis, TEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent & IEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
72
-
73
- /* Excluded from this release type: Uint8ArrayToArrayBuffer */
74
-
75
- /* Excluded from this release type: Uint8ArrayToString */
76
-
77
- export { }
@@ -1,67 +0,0 @@
1
- import { EventEmitter } from 'events_pkg';
2
- import { IEvent } from '@fluidframework/core-interfaces';
3
- import { IEventProvider } from '@fluidframework/core-interfaces';
4
- import { IEventTransformer } from '@fluidframework/core-interfaces';
5
- import { TransformedEvent } from '@fluidframework/core-interfaces';
6
-
7
- /* Excluded from this release type: Buffer */
8
-
9
- /* Excluded from this release type: bufferToString */
10
- export { EventEmitter }
11
-
12
- /**
13
- * The event emitter polyfill and the node event emitter have different event types:
14
- * string | symbol vs. string | number
15
- *
16
- * The polyfill is now always used, but string is the only event type preferred.
17
- * @public
18
- */
19
- export declare type EventEmitterEventType = string;
20
-
21
- /* Excluded from this release type: fromBase64ToUtf8 */
22
-
23
- /* Excluded from this release type: fromUtf8ToBase64 */
24
-
25
- /* Excluded from this release type: gitHashFile */
26
-
27
- /* Excluded from this release type: hashFile */
28
-
29
- /* Excluded from this release type: IsoBuffer */
30
-
31
- /* Excluded from this release type: IsomorphicPerformance */
32
-
33
- /* Excluded from this release type: ITraceEvent */
34
-
35
- /* Excluded from this release type: performance_2 */
36
-
37
- /* Excluded from this release type: stringToBuffer */
38
-
39
- /* Excluded from this release type: toUtf8 */
40
-
41
- /* Excluded from this release type: Trace */
42
-
43
- /**
44
- * Event Emitter helper class the supports emitting typed events
45
- * @public
46
- */
47
- export declare class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
48
- constructor();
49
- readonly addListener: TypedEventTransform<this, TEvent>;
50
- readonly on: TypedEventTransform<this, TEvent>;
51
- readonly once: TypedEventTransform<this, TEvent>;
52
- readonly prependListener: TypedEventTransform<this, TEvent>;
53
- readonly prependOnceListener: TypedEventTransform<this, TEvent>;
54
- readonly removeListener: TypedEventTransform<this, TEvent>;
55
- readonly off: TypedEventTransform<this, TEvent>;
56
- }
57
-
58
- /**
59
- * @public
60
- */
61
- export declare type TypedEventTransform<TThis, TEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent & IEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
62
-
63
- /* Excluded from this release type: Uint8ArrayToArrayBuffer */
64
-
65
- /* Excluded from this release type: Uint8ArrayToString */
66
-
67
- export { }
@@ -1,67 +0,0 @@
1
- import { EventEmitter } from 'events_pkg';
2
- import { IEvent } from '@fluidframework/core-interfaces';
3
- import { IEventProvider } from '@fluidframework/core-interfaces';
4
- import { IEventTransformer } from '@fluidframework/core-interfaces';
5
- import { TransformedEvent } from '@fluidframework/core-interfaces';
6
-
7
- /* Excluded from this release type: Buffer */
8
-
9
- /* Excluded from this release type: bufferToString */
10
- export { EventEmitter }
11
-
12
- /**
13
- * The event emitter polyfill and the node event emitter have different event types:
14
- * string | symbol vs. string | number
15
- *
16
- * The polyfill is now always used, but string is the only event type preferred.
17
- * @public
18
- */
19
- export declare type EventEmitterEventType = string;
20
-
21
- /* Excluded from this release type: fromBase64ToUtf8 */
22
-
23
- /* Excluded from this release type: fromUtf8ToBase64 */
24
-
25
- /* Excluded from this release type: gitHashFile */
26
-
27
- /* Excluded from this release type: hashFile */
28
-
29
- /* Excluded from this release type: IsoBuffer */
30
-
31
- /* Excluded from this release type: IsomorphicPerformance */
32
-
33
- /* Excluded from this release type: ITraceEvent */
34
-
35
- /* Excluded from this release type: performance_2 */
36
-
37
- /* Excluded from this release type: stringToBuffer */
38
-
39
- /* Excluded from this release type: toUtf8 */
40
-
41
- /* Excluded from this release type: Trace */
42
-
43
- /**
44
- * Event Emitter helper class the supports emitting typed events
45
- * @public
46
- */
47
- export declare class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
48
- constructor();
49
- readonly addListener: TypedEventTransform<this, TEvent>;
50
- readonly on: TypedEventTransform<this, TEvent>;
51
- readonly once: TypedEventTransform<this, TEvent>;
52
- readonly prependListener: TypedEventTransform<this, TEvent>;
53
- readonly prependOnceListener: TypedEventTransform<this, TEvent>;
54
- readonly removeListener: TypedEventTransform<this, TEvent>;
55
- readonly off: TypedEventTransform<this, TEvent>;
56
- }
57
-
58
- /**
59
- * @public
60
- */
61
- export declare type TypedEventTransform<TThis, TEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent & IEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
62
-
63
- /* Excluded from this release type: Uint8ArrayToArrayBuffer */
64
-
65
- /* Excluded from this release type: Uint8ArrayToString */
66
-
67
- export { }
@@ -1,217 +0,0 @@
1
- import { EventEmitter } from 'events_pkg';
2
- import { IEvent } from '@fluidframework/core-interfaces';
3
- import { IEventProvider } from '@fluidframework/core-interfaces';
4
- import { IEventTransformer } from '@fluidframework/core-interfaces';
5
- import { TransformedEvent } from '@fluidframework/core-interfaces';
6
-
7
- /**
8
- * Declare the subset of Buffer functionality we want to make available instead of
9
- * exposing the entirely of Node's typings. This should match the public interface
10
- * of the browser implementation, so any changes made in one should be made in both.
11
- *
12
- * @internal
13
- */
14
- export declare class Buffer extends Uint8Array {
15
- toString(encoding?: "utf8" | "utf-8" | "base64"): string;
16
- /**
17
- * Static constructor
18
- *
19
- * @param value - (string | ArrayBuffer).
20
- * @param encodingOrOffset - (string | number).
21
- * @param length - (number).
22
- *
23
- * @privateRemarks TODO: Use actual types
24
- */
25
- static from(value: unknown, encodingOrOffset?: unknown, length?: unknown): IsoBuffer;
26
- static isBuffer(obj: unknown): obj is Buffer;
27
- }
28
-
29
- /**
30
- * Convert binary blob to string format
31
- *
32
- * @param blob - The binary blob
33
- * @param encoding - Output string's encoding
34
- * @returns The blob in string format
35
- *
36
- * @alpha
37
- */
38
- export declare const bufferToString: (blob: ArrayBufferLike, encoding: "utf8" | "utf-8" | "base64") => string;
39
-
40
- export { EventEmitter }
41
-
42
- /**
43
- * The event emitter polyfill and the node event emitter have different event types:
44
- * string | symbol vs. string | number
45
- *
46
- * The polyfill is now always used, but string is the only event type preferred.
47
- * @public
48
- */
49
- export declare type EventEmitterEventType = string;
50
-
51
- /**
52
- * Converts the provided {@link https://en.wikipedia.org/wiki/Base64 | base64}-encoded string
53
- * to {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8}.
54
- *
55
- * @internal
56
- */
57
- export declare const fromBase64ToUtf8: (input: string) => string;
58
-
59
- /**
60
- * Converts the provided {@link https://en.wikipedia.org/wiki/UTF-8 | utf-8}-encoded string
61
- * to {@link https://en.wikipedia.org/wiki/Base64 | base64}.
62
- *
63
- * @internal
64
- */
65
- export declare const fromUtf8ToBase64: (input: string) => string;
66
-
67
- /**
68
- * Create a github hash (Github hashes the string with blob and size)
69
- * Must be called under secure context for browsers
70
- *
71
- * @param file - The contents of the file in a buffer
72
- * @returns The sha1 hash of the content of the buffer with the `blob` prefix and size
73
- *
74
- * @internal
75
- */
76
- export declare function gitHashFile(file: IsoBuffer): Promise<string>;
77
-
78
- /**
79
- * Hash a file. Consistent within a session, but should not be persisted and
80
- * is not consistent with git.
81
- * If called under an insecure context for a browser, this will fallback to
82
- * using the node implementation.
83
- *
84
- * @param file - The contents of the file in a buffer.
85
- * @param algorithm - The hash algorithm to use, artificially constrained by what is used internally.
86
- * @param hashEncoding - The encoding of the returned hash, also artificially constrained.
87
- * @returns The hash of the content of the buffer.
88
- *
89
- * @internal
90
- */
91
- export declare function hashFile(file: IsoBuffer, algorithm?: "SHA-1" | "SHA-256", hashEncoding?: "hex" | "base64"): Promise<string>;
92
-
93
- /**
94
- * @internal
95
- */
96
- export declare const IsoBuffer: typeof Buffer;
97
-
98
- /**
99
- * @internal
100
- */
101
- export declare type IsoBuffer = Buffer;
102
-
103
- /**
104
- * This type contains all browser performance properties as optional, and some
105
- * of the intersecting properties of node and browser performance as required.
106
- *
107
- * @internal
108
- */
109
- export declare type IsomorphicPerformance = Partial<Performance> & Pick<Performance, "clearMarks" | "mark" | "measure" | "now">;
110
-
111
- /**
112
- * Event in a performance trace including time elapsed.
113
- *
114
- * @internal
115
- */
116
- export declare interface ITraceEvent {
117
- /**
118
- * Total time elapsed since the start of the Trace.
119
- * Measured in milliseconds as a floating point with a decimal
120
- */
121
- readonly totalTimeElapsed: number;
122
- /**
123
- * Time elapsed since the last trace event.
124
- * Measured in milliseconds as a floating point with a decimal
125
- */
126
- readonly duration: number;
127
- /**
128
- * This number represents a relative time which should
129
- * be consistent for all trace ticks.
130
- */
131
- readonly tick: number;
132
- }
133
-
134
- /**
135
- * This exported "performance" member masks the built-in globalThis.performance object
136
- * as an IsomorphicPerformance, which hides all of its features that aren't compatible
137
- * between Node and browser implementations. Anything exposed on this performance object
138
- * is considered safe to use regarless of the environment it runs in.
139
- *
140
- * @internal
141
- */
142
- declare const performance_2: IsomorphicPerformance;
143
- export { performance_2 as performance }
144
-
145
- /**
146
- * Convert base64 or utf8 string to array buffer.
147
- * @param encoding - The input string's encoding.
148
- *
149
- * @internal
150
- */
151
- export declare function stringToBuffer(input: string, encoding: string): ArrayBufferLike;
152
-
153
- /**
154
- * Convenience function to convert unknown encoding to utf8 that avoids
155
- * buffer copies/encode ops when no conversion is needed.
156
- * @param input - The source string to convert.
157
- * @param encoding - The source string's encoding.
158
- *
159
- * @internal
160
- */
161
- export declare const toUtf8: (input: string, encoding: string) => string;
162
-
163
- /**
164
- * Helper class for tracing performance of events
165
- * Time measurements are in milliseconds as a floating point with a decimal
166
- *
167
- * @internal
168
- */
169
- export declare class Trace {
170
- readonly startTick: number;
171
- static start(): Trace;
172
- protected lastTick: number;
173
- protected constructor(startTick: number);
174
- trace(): ITraceEvent;
175
- }
176
-
177
- /**
178
- * Event Emitter helper class the supports emitting typed events
179
- * @public
180
- */
181
- export declare class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
182
- constructor();
183
- readonly addListener: TypedEventTransform<this, TEvent>;
184
- readonly on: TypedEventTransform<this, TEvent>;
185
- readonly once: TypedEventTransform<this, TEvent>;
186
- readonly prependListener: TypedEventTransform<this, TEvent>;
187
- readonly prependOnceListener: TypedEventTransform<this, TEvent>;
188
- readonly removeListener: TypedEventTransform<this, TEvent>;
189
- readonly off: TypedEventTransform<this, TEvent>;
190
- }
191
-
192
- /**
193
- * @public
194
- */
195
- export declare type TypedEventTransform<TThis, TEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent & IEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
196
-
197
- /**
198
- * Converts a Uint8Array array to an ArrayBuffer.
199
- * @param array - Array to convert to ArrayBuffer.
200
- *
201
- * @internal
202
- */
203
- export declare function Uint8ArrayToArrayBuffer(array: Uint8Array): ArrayBuffer;
204
-
205
- /**
206
- * Converts a Uint8Array to a string of the provided encoding.
207
- * @remarks Useful when the array might be an IsoBuffer.
208
- * @param arr - The array to convert.
209
- * @param encoding - Optional target encoding; only "utf8" and "base64" are
210
- * supported, with "utf8" being default.
211
- * @returns The converted string.
212
- *
213
- * @internal
214
- */
215
- export declare function Uint8ArrayToString(arr: Uint8Array, encoding?: "utf8" | "utf-8" | "base64"): string;
216
-
217
- export { }