@picovoice/eagle-web 2.0.0 → 3.0.0

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.
@@ -1,114 +1,113 @@
1
- import { EagleModel, EagleProfile, EagleProfilerEnrollResult, EagleProfilerOptions } from './types';
2
- export declare class EagleProfilerWorker {
3
- private readonly _worker;
4
- private readonly _minEnrollSamples;
5
- private readonly _sampleRate;
6
- private readonly _version;
7
- private static _wasmSimd;
8
- private static _wasmSimdLib;
9
- private static _wasmPThread;
10
- private static _wasmPThreadLib;
11
- private static _sdk;
12
- private constructor();
13
- /**
14
- * The minimum length of the input pcm required by `.enroll()`.
15
- */
16
- get minEnrollSamples(): number;
17
- /**
18
- * Audio sample rate required by Eagle.
19
- */
20
- get sampleRate(): number;
21
- /**
22
- * Version of Eagle.
23
- */
24
- get version(): string;
25
- /**
26
- * Set base64 wasm file with SIMD feature.
27
- * @param wasmSimd Base64'd wasm SIMD file to use to initialize wasm.
28
- */
29
- static setWasmSimd(wasmSimd: string): void;
30
- /**
31
- * Set base64 wasm file with SIMD feature in text format.
32
- * @param wasmSimdLib Base64'd wasm SIMD file in text format.
33
- */
34
- static setWasmSimdLib(wasmSimdLib: string): void;
35
- /**
36
- * Set base64 wasm file with SIMD and pthread feature.
37
- * @param wasmPThread Base64'd wasm file to use to initialize wasm.
38
- */
39
- static setWasmPThread(wasmPThread: string): void;
40
- /**
41
- * Set base64 SIMD and thread wasm file in text format.
42
- * @param wasmPThreadLib Base64'd wasm file in text format.
43
- */
44
- static setWasmPThreadLib(wasmPThreadLib: string): void;
45
- static setSdk(sdk: string): void;
46
- /**
47
- * Creates an instance of profiler component of the Eagle Speaker Recognition Engine.
48
- *
49
- * @param accessKey AccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
50
- * @param model Eagle model options.
51
- * @param model.base64 The model in base64 string to initialize Eagle.
52
- * @param model.publicPath The model path relative to the public directory.
53
- * @param model.customWritePath Custom path to save the model in storage.
54
- * Set to a different name to use multiple models across `eagle` instances.
55
- * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
56
- * @param model.version Version of the model file. Increment to update the model file in storage.
57
- * @param options Optional configuration arguments.
58
- * @param options.device String representation of the device (e.g., CPU or GPU) to use. If set to `best`, the most
59
- * suitable device is selected automatically. If set to `gpu`, the engine uses the first available GPU device. To select a specific
60
- * GPU device, set this argument to `gpu:${GPU_INDEX}`, where `${GPU_INDEX}` is the index of the target GPU. If set to
61
- * `cpu`, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this
62
- * argument to `cpu:${NUM_THREADS}`, where `${NUM_THREADS}` is the desired number of threads.
63
- *
64
- * @return An instance of the Eagle Profiler.
65
- */
66
- static create(accessKey: string, model: EagleModel, options?: EagleProfilerOptions): Promise<EagleProfilerWorker>;
67
- /**
68
- * Enrolls a speaker. This function should be called multiple times with different utterances of the same speaker
69
- * until `percentage` reaches `100.0`, at which point a speaker voice profile can be exported using `.export()`.
70
- * Any further enrollment can be used to improve the speaker profile. The minimum length of the input pcm to
71
- * `.enroll()` can be obtained by calling `.minEnrollSamples`.
72
- * The audio data used for enrollment should satisfy the following requirements:
73
- * - only one speaker should be present in the audio
74
- * - the speaker should be speaking in a normal voice
75
- * - the audio should contain no speech from other speakers and no other sounds (e.g. music)
76
- * - it should be captured in a quiet environment with no background noise
77
- * @param pcm Audio data for enrollment. The audio needs to have a sample rate equal to `.sampleRate` and be
78
- * 16-bit linearly-encoded. EagleProfiler operates on single-channel audio.
79
- *
80
- * @return The percentage of completeness of the speaker enrollment process along with the feedback code
81
- * corresponding to the last enrollment attempt:
82
- * - `AUDIO_OK`: The audio is good for enrollment.
83
- * - `AUDIO_TOO_SHORT`: Audio length is insufficient for enrollment,
84
- * i.e. it is shorter than`.min_enroll_samples`.
85
- * - `UNKNOWN_SPEAKER`: There is another speaker in the audio that is different from the speaker
86
- * being enrolled. Too much background noise may cause this error as well.
87
- * - `NO_VOICE_FOUND`: The audio does not contain any voice, i.e. it is silent or
88
- * has a low signal-to-noise ratio.
89
- * - `QUALITY_ISSUE`: The audio quality is too low for enrollment due to a bad microphone
90
- * or recording environment.
91
- */
92
- enroll(pcm: Int16Array): Promise<EagleProfilerEnrollResult>;
93
- /**
94
- * Exports the speaker profile of the current session.
95
- * Will throw error if the profile is not ready.
96
- *
97
- * @return An EagleProfile object.
98
- */
99
- export(): Promise<EagleProfile>;
100
- /**
101
- * Resets the internal state of Eagle Profiler.
102
- * It should be called before starting a new enrollment session.
103
- */
104
- reset(): Promise<void>;
105
- /**
106
- * Releases resources acquired by Eagle Profiler
107
- */
108
- release(): Promise<void>;
109
- /**
110
- * Terminates the active worker. Stops all requests being handled by worker.
111
- */
112
- terminate(): void;
113
- }
1
+ import { EagleModel, EagleProfile, EagleProfilerOptions } from './types';
2
+ export declare class EagleProfilerWorker {
3
+ private readonly _worker;
4
+ private readonly _frameLength;
5
+ private readonly _sampleRate;
6
+ private readonly _version;
7
+ private static _wasmSimd;
8
+ private static _wasmSimdLib;
9
+ private static _wasmPThread;
10
+ private static _wasmPThreadLib;
11
+ private static _sdk;
12
+ private constructor();
13
+ /**
14
+ * The length of the input pcm required by `.enroll()`.
15
+ */
16
+ get frameLength(): number;
17
+ /**
18
+ * Audio sample rate required by Eagle.
19
+ */
20
+ get sampleRate(): number;
21
+ /**
22
+ * Version of Eagle.
23
+ */
24
+ get version(): string;
25
+ /**
26
+ * Set base64 wasm file with SIMD feature.
27
+ * @param wasmSimd Base64'd wasm SIMD file to use to initialize wasm.
28
+ */
29
+ static setWasmSimd(wasmSimd: string): void;
30
+ /**
31
+ * Set base64 wasm file with SIMD feature in text format.
32
+ * @param wasmSimdLib Base64'd wasm SIMD file in text format.
33
+ */
34
+ static setWasmSimdLib(wasmSimdLib: string): void;
35
+ /**
36
+ * Set base64 wasm file with SIMD and pthread feature.
37
+ * @param wasmPThread Base64'd wasm file to use to initialize wasm.
38
+ */
39
+ static setWasmPThread(wasmPThread: string): void;
40
+ /**
41
+ * Set base64 SIMD and thread wasm file in text format.
42
+ * @param wasmPThreadLib Base64'd wasm file in text format.
43
+ */
44
+ static setWasmPThreadLib(wasmPThreadLib: string): void;
45
+ static setSdk(sdk: string): void;
46
+ /**
47
+ * Creates an instance of profiler component of the Eagle Speaker Recognition Engine.
48
+ *
49
+ * @param accessKey AccessKey obtained from Picovoice Console (https://console.picovoice.ai/).
50
+ * @param model Eagle model options.
51
+ * @param model.base64 The model in base64 string to initialize Eagle.
52
+ * @param model.publicPath The model path relative to the public directory.
53
+ * @param model.customWritePath Custom path to save the model in storage.
54
+ * Set to a different name to use multiple models across `eagle` instances.
55
+ * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
56
+ * @param model.version Version of the model file. Increment to update the model file in storage.
57
+ * @param options Optional configuration arguments.
58
+ * @param options.device String representation of the device (e.g., CPU or GPU) to use. If set to `best`, the most
59
+ * suitable device is selected automatically. If set to `gpu`, the engine uses the first available GPU device. To select a specific
60
+ * GPU device, set this argument to `gpu:${GPU_INDEX}`, where `${GPU_INDEX}` is the index of the target GPU. If set to
61
+ * `cpu`, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this
62
+ * argument to `cpu:${NUM_THREADS}`, where `${NUM_THREADS}` is the desired number of threads.
63
+ * @param options.minEnrollmentChunks Minimum number of chunks to be processed before enroll returns 100%
64
+ * @param options.voiceThreshold Sensitivity threshold for detecting voice.
65
+ *
66
+ * @return An instance of the Eagle Profiler.
67
+ */
68
+ static create(accessKey: string, model: EagleModel, options?: EagleProfilerOptions): Promise<EagleProfilerWorker>;
69
+ /**
70
+ * Enrolls a speaker. This function should be called multiple times with different utterances of the same speaker
71
+ * until `percentage` reaches `100.0`, at which point a speaker voice profile can be exported using `.export()`.
72
+ * Any further enrollment can be used to improve the speaker profile. The minimum length of the input pcm to
73
+ * `.enroll()` can be obtained by calling `.minEnrollSamples`.
74
+ * The audio data used for enrollment should satisfy the following requirements:
75
+ * - only one speaker should be present in the audio
76
+ * - the speaker should be speaking in a normal voice
77
+ * - the audio should contain no speech from other speakers and no other sounds (e.g. music)
78
+ * - it should be captured in a quiet environment with no background noise
79
+ * @param pcm Audio data for enrollment. The audio needs to have a sample rate equal to `.sampleRate` and be
80
+ * 16-bit linearly-encoded. EagleProfiler operates on single-channel audio.
81
+ *
82
+ * @return The percentage of completeness of the speaker enrollment process.
83
+ */
84
+ enroll(pcm: Int16Array): Promise<number>;
85
+ /**
86
+ * Marks the end of the audio stream, flushes internal state of the object, and returns the percentage of enrollment
87
+ * completed.
88
+ *
89
+ * @return The percentage of completeness of the speaker enrollment process.
90
+ */
91
+ flush(): Promise<number>;
92
+ /**
93
+ * Exports the speaker profile of the current session.
94
+ * Will throw error if the profile is not ready.
95
+ *
96
+ * @return An EagleProfile object.
97
+ */
98
+ export(): Promise<EagleProfile>;
99
+ /**
100
+ * Resets the internal state of Eagle Profiler.
101
+ * It should be called before starting a new enrollment session.
102
+ */
103
+ reset(): Promise<void>;
104
+ /**
105
+ * Releases resources acquired by Eagle Profiler
106
+ */
107
+ release(): Promise<void>;
108
+ /**
109
+ * Terminates the active worker. Stops all requests being handled by worker.
110
+ */
111
+ terminate(): void;
112
+ }
114
113
  //# sourceMappingURL=eagle_profiler_worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eagle_profiler_worker.d.ts","sourceRoot":"","sources":["../../src/eagle_profiler_worker.ts"],"names":[],"mappings":"AAaA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,yBAAyB,EACzB,oBAAoB,EAOrB,MAAM,SAAS,CAAC;AAIjB,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAElC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAS;IACjC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAS;IACpC,OA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AY,CAAC;IAuC5C;;;OAGG;IACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAqCnC;;OAEG;IACI,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAsC/B;;OAEG;IACI,SAAS,IAAI,IAAI;CAGzB"}
@@ -1,4 +1,4 @@
1
- /// <reference no-default-lib="true"/>
2
- /// <reference lib="webworker" />
3
- export {};
1
+ /// <reference no-default-lib="true"/>
2
+ /// <reference lib="webworker" />
3
+ export {};
4
4
  //# sourceMappingURL=eagle_profiler_worker_handler.d.ts.map
@@ -1,94 +1,89 @@
1
- import { EagleModel, EagleOptions, EagleProfile } from './types';
2
- export declare class EagleWorker {
3
- private readonly _worker;
4
- private readonly _frameLength;
5
- private readonly _sampleRate;
6
- private readonly _version;
7
- private static _wasmSimd;
8
- private static _wasmSimdLib;
9
- private static _wasmPThread;
10
- private static _wasmPThreadLib;
11
- private static _sdk;
12
- private constructor();
13
- /**
14
- * Number of audio samples per frame expected by Eagle (i.e. length of the array passed into `.process()`)
15
- */
16
- get frameLength(): number;
17
- /**
18
- * Audio sample rate required by Eagle.
19
- */
20
- get sampleRate(): number;
21
- /**
22
- * Version of Eagle.
23
- */
24
- get version(): string;
25
- /**
26
- * Set base64 wasm file with SIMD feature.
27
- * @param wasmSimd Base64'd wasm SIMD file to use to initialize wasm.
28
- */
29
- static setWasmSimd(wasmSimd: string): void;
30
- /**
31
- * Set base64 wasm file with SIMD feature in text format.
32
- * @param wasmSimdLib Base64'd wasm SIMD file in text format.
33
- */
34
- static setWasmSimdLib(wasmSimdLib: string): void;
35
- /**
36
- * Set base64 wasm file with SIMD and pthread feature.
37
- * @param wasmPThread Base64'd wasm file to use to initialize wasm.
38
- */
39
- static setWasmPThread(wasmPThread: string): void;
40
- /**
41
- * Set base64 SIMD and thread wasm file in text format.
42
- * @param wasmPThreadLib Base64'd wasm file in text format.
43
- */
44
- static setWasmPThreadLib(wasmPThreadLib: string): void;
45
- static setSdk(sdk: string): void;
46
- /**
47
- * Creates an instance of the Picovoice Eagle Speaker Recognition Engine.
48
- *
49
- * @param accessKey AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
50
- * @param model Eagle model options.
51
- * @param model.base64 The model in base64 string to initialize Eagle.
52
- * @param model.publicPath The model path relative to the public directory.
53
- * @param model.customWritePath Custom path to save the model in storage.
54
- * Set to a different name to use multiple models across `eagle` instances.
55
- * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
56
- * @param model.version Version of the model file. Increment to update the model file in storage.
57
- * @param speakerProfiles One or more Eagle speaker profiles. These can be constructed using `EagleProfiler`.
58
- * @param options Optional configuration arguments.
59
- * @param options.device String representation of the device (e.g., CPU or GPU) to use. If set to `best`, the most
60
- * suitable device is selected automatically. If set to `gpu`, the engine uses the first available GPU device. To select a specific
61
- * GPU device, set this argument to `gpu:${GPU_INDEX}`, where `${GPU_INDEX}` is the index of the target GPU. If set to
62
- * `cpu`, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this
63
- * argument to `cpu:${NUM_THREADS}`, where `${NUM_THREADS}` is the desired number of threads.
64
- *
65
- * @return An instance of the Eagle engine.
66
- */
67
- static create(accessKey: string, model: EagleModel, speakerProfiles: EagleProfile[] | EagleProfile, options?: EagleOptions): Promise<EagleWorker>;
68
- /**
69
- * Processes a frame of audio and returns a list of similarity scores for each speaker profile.
70
- *
71
- * @param pcm A frame of audio samples. The number of samples per frame can be attained by calling
72
- * `.frameLength`. The incoming audio needs to have a sample rate equal to `.sampleRate` and be 16-bit
73
- * linearly-encoded. Eagle operates on single-channel audio.
74
- *
75
- * @return A list of similarity scores for each speaker profile. A higher score indicates that the voice
76
- * belongs to the corresponding speaker. The range is [0, 1] with 1.0 representing a perfect match.
77
- */
78
- process(pcm: Int16Array): Promise<number[]>;
79
- /**
80
- * Resets the internal state of the engine.
81
- * It is best to call before processing a new sequence of audio (e.g. a new voice interaction).
82
- * This ensures that the accuracy of the engine is not affected by a change in audio context.
83
- */
84
- reset(): Promise<void>;
85
- /**
86
- * Releases resources acquired by Eagle
87
- */
88
- release(): Promise<void>;
89
- /**
90
- * Terminates the active worker. Stops all requests being handled by worker.
91
- */
92
- terminate(): void;
93
- }
1
+ import { EagleModel, EagleOptions, EagleProfile } from './types';
2
+ export declare class EagleWorker {
3
+ private readonly _worker;
4
+ private readonly _minProcessSamples;
5
+ private readonly _sampleRate;
6
+ private readonly _version;
7
+ private static _wasmSimd;
8
+ private static _wasmSimdLib;
9
+ private static _wasmPThread;
10
+ private static _wasmPThreadLib;
11
+ private static _sdk;
12
+ private constructor();
13
+ /**
14
+ * Number of audio samples per frame expected by Eagle (i.e. length of the array passed into `.process()`)
15
+ */
16
+ get minProcessSamples(): number;
17
+ /**
18
+ * Audio sample rate required by Eagle.
19
+ */
20
+ get sampleRate(): number;
21
+ /**
22
+ * Version of Eagle.
23
+ */
24
+ get version(): string;
25
+ /**
26
+ * Set base64 wasm file with SIMD feature.
27
+ * @param wasmSimd Base64'd wasm SIMD file to use to initialize wasm.
28
+ */
29
+ static setWasmSimd(wasmSimd: string): void;
30
+ /**
31
+ * Set base64 wasm file with SIMD feature in text format.
32
+ * @param wasmSimdLib Base64'd wasm SIMD file in text format.
33
+ */
34
+ static setWasmSimdLib(wasmSimdLib: string): void;
35
+ /**
36
+ * Set base64 wasm file with SIMD and pthread feature.
37
+ * @param wasmPThread Base64'd wasm file to use to initialize wasm.
38
+ */
39
+ static setWasmPThread(wasmPThread: string): void;
40
+ /**
41
+ * Set base64 SIMD and thread wasm file in text format.
42
+ * @param wasmPThreadLib Base64'd wasm file in text format.
43
+ */
44
+ static setWasmPThreadLib(wasmPThreadLib: string): void;
45
+ static setSdk(sdk: string): void;
46
+ /**
47
+ * Creates an instance of the Picovoice Eagle Speaker Recognition Engine.
48
+ *
49
+ * @param accessKey AccessKey obtained from Picovoice Console (https://console.picovoice.ai/)
50
+ * @param model Eagle model options.
51
+ * @param model.base64 The model in base64 string to initialize Eagle.
52
+ * @param model.publicPath The model path relative to the public directory.
53
+ * @param model.customWritePath Custom path to save the model in storage.
54
+ * Set to a different name to use multiple models across `eagle` instances.
55
+ * @param model.forceWrite Flag to overwrite the model in storage even if it exists.
56
+ * @param model.version Version of the model file. Increment to update the model file in storage.
57
+ * @param options Optional configuration arguments.
58
+ * @param options.device String representation of the device (e.g., CPU or GPU) to use. If set to `best`, the most
59
+ * suitable device is selected automatically. If set to `gpu`, the engine uses the first available GPU device. To select a specific
60
+ * GPU device, set this argument to `gpu:${GPU_INDEX}`, where `${GPU_INDEX}` is the index of the target GPU. If set to
61
+ * `cpu`, the engine will run on the CPU with the default number of threads. To specify the number of threads, set this
62
+ * argument to `cpu:${NUM_THREADS}`, where `${NUM_THREADS}` is the desired number of threads.
63
+ * @param options.voiceThreshold Sensitivity threshold for detecting voice.
64
+ *
65
+ * @return An instance of the Eagle engine.
66
+ */
67
+ static create(accessKey: string, model: EagleModel, options?: EagleOptions): Promise<EagleWorker>;
68
+ /**
69
+ * Processes a frame of audio and returns a list of similarity scores for each speaker profile.
70
+ *
71
+ * @param pcm A frame of audio samples. The number of samples per frame can be attained by calling
72
+ * `.frameLength`. The incoming audio needs to have a sample rate equal to `.sampleRate` and be 16-bit
73
+ * linearly-encoded. Eagle operates on single-channel audio.
74
+ * @param speakerProfiles One or more Eagle speaker profiles. These can be constructed using `EagleProfiler`.
75
+ *
76
+ * @return A list of similarity scores for each speaker profile. A higher score indicates that the voice
77
+ * belongs to the corresponding speaker. The range is [0, 1] with 1.0 representing a perfect match.
78
+ */
79
+ process(pcm: Int16Array, speakerProfiles: EagleProfile[] | EagleProfile): Promise<number[]>;
80
+ /**
81
+ * Releases resources acquired by Eagle
82
+ */
83
+ release(): Promise<void>;
84
+ /**
85
+ * Terminates the active worker. Stops all requests being handled by worker.
86
+ */
87
+ terminate(): void;
88
+ }
94
89
  //# sourceMappingURL=eagle_worker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eagle_worker.d.ts","sourceRoot":"","sources":["../../src/eagle_worker.ts"],"names":[],"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AM,CACxB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,WAAW,CAAC;IA+DvB;;;;;;;;;;OAUG;IACI,OAAO,CACZ,GAAG,EAAE,UAAU,EACf,eAAe,EAAE,YAAY,EAAE,GAAG,YAAY,GAC7C,OAAO,CAAC,MAAM,EAAE,CAAC;IAyCpB;;OAEG;IACI,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAsC/B;;OAEG;IACI,SAAS,IAAI,IAAI;CAGzB"}
@@ -1,4 +1,4 @@
1
- /// <reference no-default-lib="true"/>
2
- /// <reference lib="webworker" />
3
- export {};
1
+ /// <reference no-default-lib="true"/>
2
+ /// <reference lib="webworker" />
3
+ export {};
4
4
  //# sourceMappingURL=eagle_worker_handler.d.ts.map
@@ -1,7 +1,7 @@
1
- import { Eagle, EagleProfiler } from './eagle';
2
- import { EagleProfilerWorker } from './eagle_profiler_worker';
3
- import { EagleWorker } from './eagle_worker';
4
- import * as EagleErrors from './eagle_errors';
5
- import { EagleModel, EagleOptions, EagleProfile, EagleProfilerEnrollFeedback, EagleProfilerEnrollResult, EagleProfilerOptions, EagleProfilerWorkerEnrollRequest, EagleProfilerWorkerEnrollResponse, EagleProfilerWorkerExportRequest, EagleProfilerWorkerExportResponse, EagleProfilerWorkerFailureResponse, EagleProfilerWorkerInitRequest, EagleProfilerWorkerInitResponse, EagleProfilerWorkerReleaseRequest, EagleProfilerWorkerReleaseResponse, EagleProfilerWorkerRequest, EagleProfilerWorkerResetRequest, EagleProfilerWorkerResetResponse, EagleProfilerWorkerResponse, EagleWorkerFailureResponse, EagleWorkerInitRequest, EagleWorkerInitResponse, EagleWorkerProcessRequest, EagleWorkerProcessResponse, EagleWorkerReleaseRequest, EagleWorkerReleaseResponse, EagleWorkerRequest, EagleWorkerResetRequest, EagleWorkerResetResponse, EagleWorkerResponse } from './types';
6
- export { Eagle, EagleErrors, EagleModel, EagleOptions, EagleProfile, EagleProfiler, EagleProfilerEnrollFeedback, EagleProfilerEnrollResult, EagleProfilerOptions, EagleProfilerWorker, EagleProfilerWorkerEnrollRequest, EagleProfilerWorkerEnrollResponse, EagleProfilerWorkerExportRequest, EagleProfilerWorkerExportResponse, EagleProfilerWorkerFailureResponse, EagleProfilerWorkerInitRequest, EagleProfilerWorkerInitResponse, EagleProfilerWorkerReleaseRequest, EagleProfilerWorkerReleaseResponse, EagleProfilerWorkerRequest, EagleProfilerWorkerResetRequest, EagleProfilerWorkerResetResponse, EagleProfilerWorkerResponse, EagleWorker, EagleWorkerFailureResponse, EagleWorkerInitRequest, EagleWorkerInitResponse, EagleWorkerProcessRequest, EagleWorkerProcessResponse, EagleWorkerReleaseRequest, EagleWorkerReleaseResponse, EagleWorkerRequest, EagleWorkerResetRequest, EagleWorkerResetResponse, EagleWorkerResponse, };
1
+ import { Eagle, EagleProfiler } from './eagle';
2
+ import { EagleProfilerWorker } from './eagle_profiler_worker';
3
+ import { EagleWorker } from './eagle_worker';
4
+ import * as EagleErrors from './eagle_errors';
5
+ import { EagleModel, EagleOptions, EagleProfile, EagleProfilerOptions, EagleProfilerWorkerEnrollRequest, EagleProfilerWorkerEnrollResponse, EagleProfilerWorkerExportRequest, EagleProfilerWorkerExportResponse, EagleProfilerWorkerFailureResponse, EagleProfilerWorkerInitRequest, EagleProfilerWorkerInitResponse, EagleProfilerWorkerReleaseRequest, EagleProfilerWorkerReleaseResponse, EagleProfilerWorkerRequest, EagleProfilerWorkerResetRequest, EagleProfilerWorkerResetResponse, EagleProfilerWorkerResponse, EagleWorkerFailureResponse, EagleWorkerInitRequest, EagleWorkerInitResponse, EagleWorkerProcessRequest, EagleWorkerProcessResponse, EagleWorkerReleaseRequest, EagleWorkerReleaseResponse, EagleWorkerRequest, EagleWorkerResetRequest, EagleWorkerResetResponse, EagleWorkerResponse } from './types';
6
+ export { Eagle, EagleErrors, EagleModel, EagleOptions, EagleProfile, EagleProfiler, EagleProfilerOptions, EagleProfilerWorker, EagleProfilerWorkerEnrollRequest, EagleProfilerWorkerEnrollResponse, EagleProfilerWorkerExportRequest, EagleProfilerWorkerExportResponse, EagleProfilerWorkerFailureResponse, EagleProfilerWorkerInitRequest, EagleProfilerWorkerInitResponse, EagleProfilerWorkerReleaseRequest, EagleProfilerWorkerReleaseResponse, EagleProfilerWorkerRequest, EagleProfilerWorkerResetRequest, EagleProfilerWorkerResetResponse, EagleProfilerWorkerResponse, EagleWorker, EagleWorkerFailureResponse, EagleWorkerInitRequest, EagleWorkerInitResponse, EagleWorkerProcessRequest, EagleWorkerProcessResponse, EagleWorkerReleaseRequest, EagleWorkerReleaseResponse, EagleWorkerRequest, EagleWorkerResetRequest, EagleWorkerResetResponse, EagleWorkerResponse, };
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EACL,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,2BAA2B,EAC3B,yBAAyB,EACzB,oBAAoB,EACpB,gCAAgC,EAChC,iCAAiC,EACjC,gCAAgC,EAChC,iCAAiC,EACjC,kCAAkC,EAClC,8BAA8B,EAC9B,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EAClC,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,EAC3B,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,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