@fluid-internal/client-utils 2.0.0-dev-rc.5.0.0.267932 → 2.0.0-dev-rc.5.0.0.270401
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/README.md +23 -0
- package/api-extractor/api-extractor-lint-bundle.json +5 -0
- package/api-extractor/api-extractor-lint-indexBrowser.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-indexBrowser.esm.json +5 -0
- package/api-extractor/api-extractor-lint-indexNode.cjs.json +5 -0
- package/api-extractor/api-extractor-lint-indexNode.esm.json +5 -0
- package/api-report/client-utils.alpha.api.md +47 -0
- package/api-report/client-utils.beta.api.md +19 -0
- package/api-report/client-utils.public.api.md +19 -0
- package/dist/base64EncodingBrowser.d.ts +28 -0
- package/dist/base64EncodingBrowser.d.ts.map +1 -0
- package/dist/{base64Encoding.js → base64EncodingBrowser.js} +6 -2
- package/dist/base64EncodingBrowser.js.map +1 -0
- package/dist/{base64Encoding.d.ts → base64EncodingNode.d.ts} +1 -1
- package/dist/base64EncodingNode.d.ts.map +1 -0
- package/dist/base64EncodingNode.js +51 -0
- package/dist/base64EncodingNode.js.map +1 -0
- package/dist/hashFileBrowser.d.ts.map +1 -1
- package/dist/hashFileBrowser.js +1 -0
- package/dist/hashFileBrowser.js.map +1 -1
- package/dist/hashFileNode.d.ts.map +1 -1
- package/dist/hashFileNode.js.map +1 -1
- package/dist/indexBrowser.d.ts +1 -1
- package/dist/indexBrowser.d.ts.map +1 -1
- package/dist/indexBrowser.js +6 -4
- package/dist/indexBrowser.js.map +1 -1
- package/dist/indexNode.d.ts +1 -1
- package/dist/indexNode.d.ts.map +1 -1
- package/dist/indexNode.js +4 -4
- package/dist/indexNode.js.map +1 -1
- package/dist/package.json +1 -5
- package/dist/trace.js +5 -3
- package/dist/trace.js.map +1 -1
- package/dist/typedEventEmitter.js +7 -0
- package/dist/typedEventEmitter.js.map +1 -1
- package/lib/base64EncodingBrowser.d.ts +28 -0
- package/lib/base64EncodingBrowser.d.ts.map +1 -0
- package/lib/{base64Encoding.js → base64EncodingBrowser.js} +6 -2
- package/lib/base64EncodingBrowser.js.map +1 -0
- package/lib/{base64Encoding.d.ts → base64EncodingNode.d.ts} +1 -1
- package/lib/base64EncodingNode.d.ts.map +1 -0
- package/lib/base64EncodingNode.js +45 -0
- package/lib/base64EncodingNode.js.map +1 -0
- package/lib/hashFileBrowser.d.ts.map +1 -1
- package/lib/hashFileBrowser.js +1 -0
- package/lib/hashFileBrowser.js.map +1 -1
- package/lib/hashFileNode.d.ts.map +1 -1
- package/lib/hashFileNode.js.map +1 -1
- package/lib/indexBrowser.d.ts +1 -1
- package/lib/indexBrowser.d.ts.map +1 -1
- package/lib/indexBrowser.js +3 -1
- package/lib/indexBrowser.js.map +1 -1
- package/lib/indexNode.d.ts +1 -1
- package/lib/indexNode.d.ts.map +1 -1
- package/lib/indexNode.js +1 -1
- package/lib/indexNode.js.map +1 -1
- package/lib/trace.js +3 -1
- package/lib/trace.js.map +1 -1
- package/lib/typedEventEmitter.js +7 -0
- package/lib/typedEventEmitter.js.map +1 -1
- package/package.json +16 -32
- package/src/{base64Encoding.ts → base64EncodingBrowser.ts} +5 -1
- package/src/base64EncodingNode.ts +50 -0
- package/src/hashFileBrowser.ts +1 -0
- package/src/hashFileNode.ts +1 -0
- package/src/indexBrowser.ts +4 -1
- package/src/indexNode.ts +4 -1
- package/src/trace.ts +1 -1
- package/tsconfig.json +1 -0
- package/api-report/client-utils.api.md +0 -111
- package/bufferBrowser.d.ts +0 -16
- package/dist/base64Encoding.d.ts.map +0 -1
- package/dist/base64Encoding.js.map +0 -1
- package/lib/base64Encoding.d.ts.map +0 -1
- package/lib/base64Encoding.js.map +0 -1
- package/src/cjs/package.json +0 -7
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
## API Report File for "@fluid-internal/client-utils"
|
|
2
|
-
|
|
3
|
-
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
|
|
7
|
-
import { EventEmitter } from 'events_pkg';
|
|
8
|
-
import { IEvent } from '@fluidframework/core-interfaces';
|
|
9
|
-
import { IEventProvider } from '@fluidframework/core-interfaces';
|
|
10
|
-
import { IEventTransformer } from '@fluidframework/core-interfaces';
|
|
11
|
-
import { TransformedEvent } from '@fluidframework/core-interfaces';
|
|
12
|
-
|
|
13
|
-
// @internal
|
|
14
|
-
export class Buffer extends Uint8Array {
|
|
15
|
-
static from(value: unknown, encodingOrOffset?: unknown, length?: unknown): IsoBuffer;
|
|
16
|
-
// (undocumented)
|
|
17
|
-
static isBuffer(obj: unknown): obj is Buffer;
|
|
18
|
-
// (undocumented)
|
|
19
|
-
toString(encoding?: "utf8" | "utf-8" | "base64"): string;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// @alpha
|
|
23
|
-
export const bufferToString: (blob: ArrayBufferLike, encoding: "utf8" | "utf-8" | "base64") => string;
|
|
24
|
-
|
|
25
|
-
export { EventEmitter }
|
|
26
|
-
|
|
27
|
-
// @alpha
|
|
28
|
-
export type EventEmitterEventType = string;
|
|
29
|
-
|
|
30
|
-
// @internal
|
|
31
|
-
export const fromBase64ToUtf8: (input: string) => string;
|
|
32
|
-
|
|
33
|
-
// @internal
|
|
34
|
-
export const fromUtf8ToBase64: (input: string) => string;
|
|
35
|
-
|
|
36
|
-
// @internal
|
|
37
|
-
export function gitHashFile(file: IsoBuffer): Promise<string>;
|
|
38
|
-
|
|
39
|
-
// @internal
|
|
40
|
-
export function hashFile(file: IsoBuffer, algorithm?: "SHA-1" | "SHA-256", hashEncoding?: "hex" | "base64"): Promise<string>;
|
|
41
|
-
|
|
42
|
-
// @internal (undocumented)
|
|
43
|
-
export const IsoBuffer: typeof Buffer;
|
|
44
|
-
|
|
45
|
-
// @internal (undocumented)
|
|
46
|
-
export type IsoBuffer = Buffer;
|
|
47
|
-
|
|
48
|
-
// @internal
|
|
49
|
-
export type IsomorphicPerformance = Partial<Performance> & Pick<Performance, "clearMarks" | "mark" | "measure" | "now">;
|
|
50
|
-
|
|
51
|
-
// @internal
|
|
52
|
-
export interface ITraceEvent {
|
|
53
|
-
readonly duration: number;
|
|
54
|
-
readonly tick: number;
|
|
55
|
-
readonly totalTimeElapsed: number;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// @internal
|
|
59
|
-
const performance_2: IsomorphicPerformance;
|
|
60
|
-
export { performance_2 as performance }
|
|
61
|
-
|
|
62
|
-
// @internal
|
|
63
|
-
export function stringToBuffer(input: string, encoding: string): ArrayBufferLike;
|
|
64
|
-
|
|
65
|
-
// @internal
|
|
66
|
-
export const toUtf8: (input: string, encoding: string) => string;
|
|
67
|
-
|
|
68
|
-
// @internal
|
|
69
|
-
export class Trace {
|
|
70
|
-
protected constructor(startTick: number);
|
|
71
|
-
// (undocumented)
|
|
72
|
-
protected lastTick: number;
|
|
73
|
-
// (undocumented)
|
|
74
|
-
static start(): Trace;
|
|
75
|
-
// (undocumented)
|
|
76
|
-
readonly startTick: number;
|
|
77
|
-
// (undocumented)
|
|
78
|
-
trace(): ITraceEvent;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// @alpha
|
|
82
|
-
export class TypedEventEmitter<TEvent> extends EventEmitter implements IEventProvider<TEvent & IEvent> {
|
|
83
|
-
constructor();
|
|
84
|
-
// (undocumented)
|
|
85
|
-
readonly addListener: TypedEventTransform<this, TEvent>;
|
|
86
|
-
// (undocumented)
|
|
87
|
-
readonly off: TypedEventTransform<this, TEvent>;
|
|
88
|
-
// (undocumented)
|
|
89
|
-
readonly on: TypedEventTransform<this, TEvent>;
|
|
90
|
-
// (undocumented)
|
|
91
|
-
readonly once: TypedEventTransform<this, TEvent>;
|
|
92
|
-
// (undocumented)
|
|
93
|
-
readonly prependListener: TypedEventTransform<this, TEvent>;
|
|
94
|
-
// (undocumented)
|
|
95
|
-
readonly prependOnceListener: TypedEventTransform<this, TEvent>;
|
|
96
|
-
// (undocumented)
|
|
97
|
-
readonly removeListener: TypedEventTransform<this, TEvent>;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// @alpha (undocumented)
|
|
101
|
-
export type TypedEventTransform<TThis, TEvent> = TransformedEvent<TThis, "newListener" | "removeListener", Parameters<(event: string, listener: (...args: any[]) => void) => void>> & IEventTransformer<TThis, TEvent & IEvent> & TransformedEvent<TThis, EventEmitterEventType, any[]>;
|
|
102
|
-
|
|
103
|
-
// @internal
|
|
104
|
-
export function Uint8ArrayToArrayBuffer(array: Uint8Array): ArrayBuffer;
|
|
105
|
-
|
|
106
|
-
// @internal
|
|
107
|
-
export function Uint8ArrayToString(arr: Uint8Array, encoding?: "utf8" | "utf-8" | "base64"): string;
|
|
108
|
-
|
|
109
|
-
// (No @packageDocumentation comment for this package)
|
|
110
|
-
|
|
111
|
-
```
|
package/bufferBrowser.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* THIS FILE SHOULD NOT BE DELETED.
|
|
8
|
-
*
|
|
9
|
-
* This file is needed for compatibility with TypeScript's Node10 module resolution. In most other packages it is
|
|
10
|
-
* auto-generated by `flub generate entrypoints` in @fluid-tools/build-cli, and is thus gitignored in most packages.
|
|
11
|
-
*
|
|
12
|
-
* However, this package is unique in that it does not need to use API trimming or `flub generate entrypoints`,
|
|
13
|
-
* but instead uses conditional exports to isomorphically support both Node and browser environments.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
export * from "./lib/bufferBrowser.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base64Encoding.d.ts","sourceRoot":"","sources":["../src/base64Encoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MACA,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MACA,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,UAAW,MAAM,YAAY,MAAM,KAAG,MAWxD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base64Encoding.js","sourceRoot":"","sources":["../src/base64Encoding.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,2GAA2G;AAC3G,yDAA+C;AAE/C;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAU,EAAE,CACzD,4BAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AADrC,QAAA,gBAAgB,oBACqB;AAElD;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAU,EAAE,CACzD,4BAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AADrC,QAAA,gBAAgB,oBACqB;AAElD;;;;;;;GAOG;AACI,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,QAAgB,EAAU,EAAE;IACjE,QAAQ,QAAQ,EAAE,CAAC;QAClB,KAAK,MAAM,CAAC;QACZ,8GAA8G;QAC9G,KAAK,OAAO,CAAC,CAAC,CAAC;YACd,OAAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,OAAO,4BAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;QACnD,CAAC;IACF,CAAC;AACF,CAAC,CAAC;AAXW,QAAA,MAAM,UAWjB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Note: The exports map in package.json will correct this import to \"./bufferNode.js\" in node environments\nimport { IsoBuffer } from \"./bufferBrowser.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"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base64Encoding.d.ts","sourceRoot":"","sources":["../src/base64Encoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MACA,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MACA,CAAC;AAElD;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,UAAW,MAAM,YAAY,MAAM,KAAG,MAWxD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base64Encoding.js","sourceRoot":"","sources":["../src/base64Encoding.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,2GAA2G;AAC3G,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;;;;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,CAAC;QAClB,KAAK,MAAM,CAAC;QACZ,8GAA8G;QAC9G,KAAK,OAAO,CAAC,CAAC,CAAC;YACd,OAAO,KAAK,CAAC;QACd,CAAC;QACD,OAAO,CAAC,CAAC,CAAC;YACT,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;QACnD,CAAC;IACF,CAAC;AACF,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// Note: The exports map in package.json will correct this import to \"./bufferNode.js\" in node environments\nimport { IsoBuffer } from \"./bufferBrowser.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"]}
|