@speechos/client 0.2.1 → 0.2.3
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/dist/config.d.ts +68 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/form-detector.d.cts +25 -0
- package/dist/form-detector.d.ts +16 -1
- package/dist/form-detector.d.ts.map +1 -1
- package/dist/index.cjs +5584 -1525
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +19 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.iife.js +6761 -1713
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +2126 -392
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.js +5528 -1520
- package/dist/index.js.map +1 -1
- package/dist/speechos.d.cts +74 -0
- package/dist/speechos.d.ts +47 -5
- package/dist/speechos.d.ts.map +1 -1
- package/dist/speechos.test.d.ts +5 -0
- package/dist/speechos.test.d.ts.map +1 -0
- package/dist/stores/audio-settings.d.ts +45 -0
- package/dist/stores/audio-settings.d.ts.map +1 -0
- package/dist/stores/index.d.ts +15 -0
- package/dist/stores/index.d.ts.map +1 -0
- package/dist/stores/language-settings.d.ts +106 -0
- package/dist/stores/language-settings.d.ts.map +1 -0
- package/dist/stores/snippets-store.d.ts +72 -0
- package/dist/stores/snippets-store.d.ts.map +1 -0
- package/dist/stores/snippets-store.test.d.ts +5 -0
- package/dist/stores/snippets-store.test.d.ts.map +1 -0
- package/dist/stores/transcript-store.d.ts +54 -0
- package/dist/stores/transcript-store.d.ts.map +1 -0
- package/dist/stores/transcript-store.test.d.ts +5 -0
- package/dist/stores/transcript-store.test.d.ts.map +1 -0
- package/dist/stores/vocabulary-store.d.ts +63 -0
- package/dist/stores/vocabulary-store.d.ts.map +1 -0
- package/dist/stores/vocabulary-store.test.d.ts +5 -0
- package/dist/stores/vocabulary-store.test.d.ts.map +1 -0
- package/dist/text-input-handler.d.ts +73 -0
- package/dist/text-input-handler.d.ts.map +1 -0
- package/dist/text-input-handler.test.d.ts +5 -0
- package/dist/text-input-handler.test.d.ts.map +1 -0
- package/dist/ui/action-bubbles.d.cts +17 -0
- package/dist/ui/action-bubbles.d.ts +5 -1
- package/dist/ui/action-bubbles.d.ts.map +1 -1
- package/dist/ui/audio-level-meter.d.ts +31 -0
- package/dist/ui/audio-level-meter.d.ts.map +1 -0
- package/dist/ui/audio-visualizer.d.ts +29 -0
- package/dist/ui/audio-visualizer.d.ts.map +1 -0
- package/dist/ui/icons.d.cts +88 -0
- package/dist/ui/icons.d.ts +30 -0
- package/dist/ui/icons.d.ts.map +1 -1
- package/dist/ui/index.d.cts +20 -0
- package/dist/ui/index.d.ts +4 -0
- package/dist/ui/index.d.ts.map +1 -1
- package/dist/ui/mic-button.d.cts +34 -0
- package/dist/ui/mic-button.d.ts +2 -0
- package/dist/ui/mic-button.d.ts.map +1 -1
- package/dist/ui/settings-button.d.cts +16 -0
- package/dist/ui/settings-button.d.ts.map +1 -1
- package/dist/ui/settings-modal.d.cts +34 -0
- package/dist/ui/settings-modal.d.ts +13 -14
- package/dist/ui/settings-modal.d.ts.map +1 -1
- package/dist/ui/styles/modal-styles.d.ts +10 -0
- package/dist/ui/styles/modal-styles.d.ts.map +1 -0
- package/dist/ui/styles/theme.d.cts +17 -0
- package/dist/ui/tabs/about-tab.d.ts +14 -0
- package/dist/ui/tabs/about-tab.d.ts.map +1 -0
- package/dist/ui/tabs/help-tab.d.ts +14 -0
- package/dist/ui/tabs/help-tab.d.ts.map +1 -0
- package/dist/ui/tabs/history-tab.d.ts +26 -0
- package/dist/ui/tabs/history-tab.d.ts.map +1 -0
- package/dist/ui/tabs/index.d.ts +10 -0
- package/dist/ui/tabs/index.d.ts.map +1 -0
- package/dist/ui/tabs/settings-tab.d.ts +42 -0
- package/dist/ui/tabs/settings-tab.d.ts.map +1 -0
- package/dist/ui/tabs/snippets-tab.d.ts +34 -0
- package/dist/ui/tabs/snippets-tab.d.ts.map +1 -0
- package/dist/ui/tabs/vocabulary-tab.d.ts +30 -0
- package/dist/ui/tabs/vocabulary-tab.d.ts.map +1 -0
- package/dist/ui/widget.d.cts +64 -0
- package/dist/ui/widget.d.ts +22 -0
- package/dist/ui/widget.d.ts.map +1 -1
- package/dist/ui/widget.test.d.ts +6 -0
- package/dist/ui/widget.test.d.ts.map +1 -0
- package/package.json +5 -4
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main SpeechOS Client SDK class
|
|
3
|
+
* Composes core logic with UI components
|
|
4
|
+
*/
|
|
5
|
+
import type { SpeechOSConfig, SpeechOSState } from "@speechos/core";
|
|
6
|
+
import { SpeechOSEventEmitter } from "@speechos/core";
|
|
7
|
+
import "./ui/index.js";
|
|
8
|
+
/**
|
|
9
|
+
* Main SpeechOS class for initializing and managing the SDK with UI
|
|
10
|
+
*/
|
|
11
|
+
export declare class SpeechOS {
|
|
12
|
+
private static instance;
|
|
13
|
+
private static widgetElement;
|
|
14
|
+
private static isInitialized;
|
|
15
|
+
/**
|
|
16
|
+
* Initialize the SpeechOS SDK
|
|
17
|
+
* @param config - Configuration options
|
|
18
|
+
* @returns Promise that resolves when initialization is complete
|
|
19
|
+
* @throws Error if configuration is invalid (e.g., missing apiKey)
|
|
20
|
+
*/
|
|
21
|
+
static init(config?: SpeechOSConfig): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Destroy the SpeechOS SDK and clean up resources
|
|
24
|
+
*/
|
|
25
|
+
static destroy(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Check if SpeechOS is initialized
|
|
28
|
+
*/
|
|
29
|
+
static get initialized(): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Get the current state
|
|
32
|
+
*/
|
|
33
|
+
static getState(): SpeechOSState;
|
|
34
|
+
/**
|
|
35
|
+
* Get the event emitter for external listeners
|
|
36
|
+
*/
|
|
37
|
+
static get events(): SpeechOSEventEmitter;
|
|
38
|
+
/**
|
|
39
|
+
* Mount the widget to the DOM
|
|
40
|
+
*/
|
|
41
|
+
private static mountWidget;
|
|
42
|
+
/**
|
|
43
|
+
* Unmount the widget from the DOM
|
|
44
|
+
*/
|
|
45
|
+
private static unmountWidget;
|
|
46
|
+
/**
|
|
47
|
+
* Show the widget programmatically
|
|
48
|
+
*/
|
|
49
|
+
static show(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Hide the widget programmatically
|
|
52
|
+
*/
|
|
53
|
+
static hide(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Identify the current user
|
|
56
|
+
* Can be called after init() to associate sessions with a user identifier.
|
|
57
|
+
* Clears the cached token so the next voice session uses the new userId.
|
|
58
|
+
*
|
|
59
|
+
* @param userId - User identifier from your system (e.g., user ID, email)
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // Initialize SDK early
|
|
63
|
+
* SpeechOS.init({ apiKey: 'xxx' });
|
|
64
|
+
*
|
|
65
|
+
* // Later, after user logs in
|
|
66
|
+
* SpeechOS.identify('user_123');
|
|
67
|
+
*/
|
|
68
|
+
static identify(userId: string): void;
|
|
69
|
+
/**
|
|
70
|
+
* Private constructor to prevent direct instantiation
|
|
71
|
+
*/
|
|
72
|
+
private constructor();
|
|
73
|
+
}
|
|
74
|
+
export default SpeechOS;
|
package/dist/speechos.d.ts
CHANGED
|
@@ -2,9 +2,16 @@
|
|
|
2
2
|
* Main SpeechOS Client SDK class
|
|
3
3
|
* Composes core logic with UI components
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
5
|
+
import type { SpeechOSState, SessionSettings } from "@speechos/core";
|
|
6
6
|
import { SpeechOSEventEmitter } from "@speechos/core";
|
|
7
|
+
import { getClientConfig } from "./config.js";
|
|
8
|
+
import type { SpeechOSClientConfig } from "./config.js";
|
|
7
9
|
import "./ui/index.js";
|
|
10
|
+
/**
|
|
11
|
+
* Gather current user settings from stores into SessionSettings
|
|
12
|
+
* Used when starting voice sessions to pass settings to core
|
|
13
|
+
*/
|
|
14
|
+
export declare function getSessionSettings(): SessionSettings;
|
|
8
15
|
/**
|
|
9
16
|
* Main SpeechOS class for initializing and managing the SDK with UI
|
|
10
17
|
*/
|
|
@@ -12,13 +19,13 @@ export declare class SpeechOS {
|
|
|
12
19
|
private static instance;
|
|
13
20
|
private static widgetElement;
|
|
14
21
|
private static isInitialized;
|
|
22
|
+
private static activeFormDetector;
|
|
15
23
|
/**
|
|
16
24
|
* Initialize the SpeechOS SDK
|
|
17
25
|
* @param config - Configuration options
|
|
18
|
-
* @returns Promise that resolves when initialization is complete
|
|
19
26
|
* @throws Error if configuration is invalid (e.g., missing apiKey)
|
|
20
27
|
*/
|
|
21
|
-
static init(config
|
|
28
|
+
static init(config: SpeechOSClientConfig): void;
|
|
22
29
|
/**
|
|
23
30
|
* Destroy the SpeechOS SDK and clean up resources
|
|
24
31
|
*/
|
|
@@ -35,6 +42,10 @@ export declare class SpeechOS {
|
|
|
35
42
|
* Get the event emitter for external listeners
|
|
36
43
|
*/
|
|
37
44
|
static get events(): SpeechOSEventEmitter;
|
|
45
|
+
/**
|
|
46
|
+
* Get the current client configuration
|
|
47
|
+
*/
|
|
48
|
+
static getClientConfig(): ReturnType<typeof getClientConfig>;
|
|
38
49
|
/**
|
|
39
50
|
* Mount the widget to the DOM
|
|
40
51
|
*/
|
|
@@ -51,15 +62,46 @@ export declare class SpeechOS {
|
|
|
51
62
|
* Hide the widget programmatically
|
|
52
63
|
*/
|
|
53
64
|
static hide(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Show the widget positioned for a specific element.
|
|
67
|
+
* On mobile, the widget will anchor below the element.
|
|
68
|
+
* On desktop, the widget stays at center bottom but tracks the element for dictation/edit.
|
|
69
|
+
*
|
|
70
|
+
* @param element - The element to show the widget for
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* const textarea = document.querySelector('textarea');
|
|
74
|
+
* SpeechOS.showFor(textarea);
|
|
75
|
+
*/
|
|
76
|
+
static showFor(element: HTMLElement): void;
|
|
77
|
+
/**
|
|
78
|
+
* Attach the widget to persistently track a specific element.
|
|
79
|
+
* The widget will show and position relative to this element.
|
|
80
|
+
* Equivalent to showFor() - the widget tracks the element until detach() is called.
|
|
81
|
+
*
|
|
82
|
+
* @param element - The element to attach to
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* const input = document.querySelector('input');
|
|
86
|
+
* SpeechOS.attachTo(input);
|
|
87
|
+
*/
|
|
88
|
+
static attachTo(element: HTMLElement): void;
|
|
89
|
+
/**
|
|
90
|
+
* Detach the widget from any attached element.
|
|
91
|
+
* Returns the widget to default positioning (center bottom of screen).
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* SpeechOS.detach();
|
|
95
|
+
*/
|
|
96
|
+
static detach(): void;
|
|
54
97
|
/**
|
|
55
98
|
* Identify the current user
|
|
56
99
|
* Can be called after init() to associate sessions with a user identifier.
|
|
57
|
-
* Clears the cached token so the next voice session uses the new userId.
|
|
58
100
|
*
|
|
59
101
|
* @param userId - User identifier from your system (e.g., user ID, email)
|
|
60
102
|
*
|
|
61
103
|
* @example
|
|
62
|
-
* // Initialize SDK
|
|
104
|
+
* // Initialize SDK
|
|
63
105
|
* SpeechOS.init({ apiKey: 'xxx' });
|
|
64
106
|
*
|
|
65
107
|
* // Later, after user logs in
|
package/dist/speechos.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"speechos.d.ts","sourceRoot":"","sources":["../src/speechos.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"speechos.d.ts","sourceRoot":"","sources":["../src/speechos.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAOL,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAmB,eAAe,EAAqB,MAAM,aAAa,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAUxD,OAAO,eAAe,CAAC;AAEvB;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CASpD;AAED;;GAEG;AACH,qBAAa,QAAQ;IACnB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAyB;IAChD,OAAO,CAAC,MAAM,CAAC,aAAa,CAA4B;IACxD,OAAO,CAAC,MAAM,CAAC,aAAa,CAAS;IACrC,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAsC;IAEvE;;;;OAIG;IACH,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI;IA6D/C;;OAEG;WACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAwCrC;;OAEG;IACH,MAAM,KAAK,WAAW,IAAI,OAAO,CAEhC;IAED;;OAEG;IACH,MAAM,CAAC,QAAQ,IAAI,aAAa;IAIhC;;OAEG;IACH,MAAM,KAAK,MAAM,IAAI,oBAAoB,CAExC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,IAAI,UAAU,CAAC,OAAO,eAAe,CAAC;IAI5D;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAc1B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAO5B;;OAEG;IACH,MAAM,CAAC,IAAI,IAAI,IAAI;IAInB;;OAEG;IACH,MAAM,CAAC,IAAI,IAAI,IAAI;IAInB;;;;;;;;;;OAUG;IACH,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAS1C;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAS3C;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,IAAI,IAAI;IAQrB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAkBrC;;OAEG;IACH,OAAO;CAGR;AAGD,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"speechos.test.d.ts","sourceRoot":"","sources":["../src/speechos.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audio settings store
|
|
3
|
+
* Persists audio device preferences to localStorage
|
|
4
|
+
*/
|
|
5
|
+
export interface AudioSettings {
|
|
6
|
+
/** Selected audio input device ID (empty string = system default) */
|
|
7
|
+
deviceId: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get current audio settings from localStorage
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAudioSettings(): AudioSettings;
|
|
13
|
+
/**
|
|
14
|
+
* Get the selected audio device ID
|
|
15
|
+
* Returns empty string for system default
|
|
16
|
+
*/
|
|
17
|
+
export declare function getAudioDeviceId(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Set the selected audio device ID
|
|
20
|
+
* Pass empty string to use system default
|
|
21
|
+
*/
|
|
22
|
+
export declare function setAudioDeviceId(deviceId: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Get list of available audio input devices
|
|
25
|
+
* Requires microphone permission to get device labels
|
|
26
|
+
*/
|
|
27
|
+
export declare function getAudioInputDevices(): Promise<MediaDeviceInfo[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Check if the selected device is still available
|
|
30
|
+
* Returns true if the device exists or if using system default
|
|
31
|
+
*/
|
|
32
|
+
export declare function isSelectedDeviceAvailable(): Promise<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* Reset audio settings to defaults
|
|
35
|
+
*/
|
|
36
|
+
export declare function resetAudioSettings(): void;
|
|
37
|
+
export declare const audioSettings: {
|
|
38
|
+
getAudioSettings: typeof getAudioSettings;
|
|
39
|
+
getAudioDeviceId: typeof getAudioDeviceId;
|
|
40
|
+
setAudioDeviceId: typeof setAudioDeviceId;
|
|
41
|
+
getAudioInputDevices: typeof getAudioInputDevices;
|
|
42
|
+
isSelectedDeviceAvailable: typeof isSelectedDeviceAvailable;
|
|
43
|
+
resetAudioSettings: typeof resetAudioSettings;
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=audio-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-settings.d.ts","sourceRoot":"","sources":["../../src/stores/audio-settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,aAAa;IAC5B,qEAAqE;IACrE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAMD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAQhD;AAaD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAIvD;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAOvE;AAED;;;GAGG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,OAAO,CAAC,CAMlE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAMzC;AAED,eAAO,MAAM,aAAa,EAAE;IAC1B,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,yBAAyB,EAAE,OAAO,yBAAyB,CAAC;IAC5D,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;CAQ/C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client-side stores for SpeechOS settings and data persistence
|
|
3
|
+
* All stores use localStorage for browser-based persistence
|
|
4
|
+
*/
|
|
5
|
+
export { snippetsStore, getSnippets, addSnippet, updateSnippet, deleteSnippet, clearSnippets, getSnippetCount, isAtSnippetLimit, } from "./snippets-store.js";
|
|
6
|
+
export type { Snippet, SnippetValidationError, AddSnippetResult, } from "./snippets-store.js";
|
|
7
|
+
export { vocabularyStore, getVocabulary, addTerm, deleteTerm, clearVocabulary, getVocabularyCount, isAtVocabularyLimit, } from "./vocabulary-store.js";
|
|
8
|
+
export type { VocabularyTerm, VocabularyValidationError, AddTermResult, } from "./vocabulary-store.js";
|
|
9
|
+
export { audioSettings, getAudioSettings, getAudioDeviceId, setAudioDeviceId, getAudioInputDevices, isSelectedDeviceAvailable, resetAudioSettings, } from "./audio-settings.js";
|
|
10
|
+
export type { AudioSettings } from "./audio-settings.js";
|
|
11
|
+
export { languageSettings, getLanguageSettings, getInputLanguageCode, setInputLanguageCode, getOutputLanguageCode, setOutputLanguageCode, getLanguageByCode, getInputLanguageName, getOutputLanguageName, getSmartFormatEnabled, setSmartFormatEnabled, resetLanguageSettings, SUPPORTED_LANGUAGES, getLanguageCode, setLanguageCode, getLanguageName, } from "./language-settings.js";
|
|
12
|
+
export type { LanguageSettings, LanguageOption } from "./language-settings.js";
|
|
13
|
+
export { transcriptStore } from "./transcript-store.js";
|
|
14
|
+
export type { TranscriptEntry, TranscriptAction, SaveCommandOptions } from "./transcript-store.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stores/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACb,eAAe,EACf,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,OAAO,EACP,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,eAAe,EACf,aAAa,EACb,OAAO,EACP,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,cAAc,EACd,yBAAyB,EACzB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EAEnB,eAAe,EACf,eAAe,EACf,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Language settings store
|
|
3
|
+
* Persists input language preferences to localStorage
|
|
4
|
+
*/
|
|
5
|
+
export interface LanguageOption {
|
|
6
|
+
/** Display name of the language */
|
|
7
|
+
name: string;
|
|
8
|
+
/** Primary language code */
|
|
9
|
+
code: string;
|
|
10
|
+
/** All available locale variants */
|
|
11
|
+
variants: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Supported input languages for speech recognition
|
|
15
|
+
* Each language has a name, primary code, and available variants
|
|
16
|
+
* Sorted alphabetically by name for dropdown display
|
|
17
|
+
*/
|
|
18
|
+
export declare const SUPPORTED_LANGUAGES: LanguageOption[];
|
|
19
|
+
export interface LanguageSettings {
|
|
20
|
+
/** Selected input language code for speech recognition (e.g., "en-US", "es", "fr") */
|
|
21
|
+
inputLanguageCode: string;
|
|
22
|
+
/** Selected output language code for transcription formatting (e.g., "en-US", "es", "fr") */
|
|
23
|
+
outputLanguageCode: string;
|
|
24
|
+
/** Whether to apply AI formatting to transcripts (removes filler words, adds punctuation) */
|
|
25
|
+
smartFormat: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get current language settings from localStorage
|
|
29
|
+
*/
|
|
30
|
+
export declare function getLanguageSettings(): LanguageSettings;
|
|
31
|
+
/**
|
|
32
|
+
* Get the selected input language code for speech recognition
|
|
33
|
+
* Returns "en-US" (American English) by default
|
|
34
|
+
*/
|
|
35
|
+
export declare function getInputLanguageCode(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Set the selected input language code for speech recognition
|
|
38
|
+
*/
|
|
39
|
+
export declare function setInputLanguageCode(languageCode: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Get the selected output language code for transcription formatting
|
|
42
|
+
* Returns "en-US" (American English) by default
|
|
43
|
+
*/
|
|
44
|
+
export declare function getOutputLanguageCode(): string;
|
|
45
|
+
/**
|
|
46
|
+
* Set the selected output language code for transcription formatting
|
|
47
|
+
*/
|
|
48
|
+
export declare function setOutputLanguageCode(languageCode: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Get the language option for a given code
|
|
51
|
+
*/
|
|
52
|
+
export declare function getLanguageByCode(code: string): LanguageOption | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Get the display name for the input language
|
|
55
|
+
*/
|
|
56
|
+
export declare function getInputLanguageName(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Get the display name for the output language
|
|
59
|
+
*/
|
|
60
|
+
export declare function getOutputLanguageName(): string;
|
|
61
|
+
/**
|
|
62
|
+
* Get whether smart formatting is enabled
|
|
63
|
+
* Returns true by default (AI formatting removes filler words, adds punctuation)
|
|
64
|
+
*/
|
|
65
|
+
export declare function getSmartFormatEnabled(): boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Set whether smart formatting is enabled
|
|
68
|
+
*/
|
|
69
|
+
export declare function setSmartFormatEnabled(enabled: boolean): void;
|
|
70
|
+
/**
|
|
71
|
+
* Legacy alias for getInputLanguageCode
|
|
72
|
+
* @deprecated Use getInputLanguageCode instead
|
|
73
|
+
*/
|
|
74
|
+
export declare function getLanguageCode(): string;
|
|
75
|
+
/**
|
|
76
|
+
* Legacy alias for setInputLanguageCode
|
|
77
|
+
* @deprecated Use setInputLanguageCode instead
|
|
78
|
+
*/
|
|
79
|
+
export declare function setLanguageCode(languageCode: string): void;
|
|
80
|
+
/**
|
|
81
|
+
* Legacy alias for getInputLanguageName
|
|
82
|
+
* @deprecated Use getInputLanguageName instead
|
|
83
|
+
*/
|
|
84
|
+
export declare function getLanguageName(): string;
|
|
85
|
+
/**
|
|
86
|
+
* Reset language settings to defaults
|
|
87
|
+
*/
|
|
88
|
+
export declare function resetLanguageSettings(): void;
|
|
89
|
+
export declare const languageSettings: {
|
|
90
|
+
getLanguageSettings: typeof getLanguageSettings;
|
|
91
|
+
getInputLanguageCode: typeof getInputLanguageCode;
|
|
92
|
+
setInputLanguageCode: typeof setInputLanguageCode;
|
|
93
|
+
getOutputLanguageCode: typeof getOutputLanguageCode;
|
|
94
|
+
setOutputLanguageCode: typeof setOutputLanguageCode;
|
|
95
|
+
getLanguageByCode: typeof getLanguageByCode;
|
|
96
|
+
getInputLanguageName: typeof getInputLanguageName;
|
|
97
|
+
getOutputLanguageName: typeof getOutputLanguageName;
|
|
98
|
+
getSmartFormatEnabled: typeof getSmartFormatEnabled;
|
|
99
|
+
setSmartFormatEnabled: typeof setSmartFormatEnabled;
|
|
100
|
+
resetLanguageSettings: typeof resetLanguageSettings;
|
|
101
|
+
SUPPORTED_LANGUAGES: typeof SUPPORTED_LANGUAGES;
|
|
102
|
+
getLanguageCode: typeof getLanguageCode;
|
|
103
|
+
setLanguageCode: typeof setLanguageCode;
|
|
104
|
+
getLanguageName: typeof getLanguageName;
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=language-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"language-settings.d.ts","sourceRoot":"","sources":["../../src/stores/language-settings.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,cAAc;IAC7B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,cAAc,EAuC/C,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,sFAAsF;IACtF,iBAAiB,EAAE,MAAM,CAAC;IAC1B,6FAA6F;IAC7F,kBAAkB,EAAE,MAAM,CAAC;IAC3B,6FAA6F;IAC7F,WAAW,EAAE,OAAO,CAAC;CACtB;AAQD;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,gBAAgB,CAQtD;AAaD;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAE7C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAO/D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAOhE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAI1E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAI7C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAI9C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAO5D;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAE1D;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAM5C;AAED,eAAO,MAAM,gBAAgB,EAAE;IAC7B,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;IAChD,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IACpD,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IACpD,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;IAC5C,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;IAClD,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IACpD,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IACpD,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IACpD,qBAAqB,EAAE,OAAO,qBAAqB,CAAC;IACpD,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;IAEhD,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,eAAe,EAAE,OAAO,eAAe,CAAC;CAkBzC,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snippets store
|
|
3
|
+
* Persists text snippets to localStorage for voice-triggered text expansion
|
|
4
|
+
*/
|
|
5
|
+
declare const MAX_SNIPPETS = 25;
|
|
6
|
+
declare const MAX_TRIGGER_LENGTH = 30;
|
|
7
|
+
declare const MAX_EXPANSION_LENGTH = 300;
|
|
8
|
+
export interface Snippet {
|
|
9
|
+
id: string;
|
|
10
|
+
/** Trigger phrase spoken to activate the snippet (max 30 chars) */
|
|
11
|
+
trigger: string;
|
|
12
|
+
/** Text that replaces the trigger phrase (max 300 chars) */
|
|
13
|
+
expansion: string;
|
|
14
|
+
/** Timestamp when snippet was created */
|
|
15
|
+
createdAt: number;
|
|
16
|
+
}
|
|
17
|
+
export interface SnippetValidationError {
|
|
18
|
+
field: "trigger" | "expansion" | "limit";
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
export type AddSnippetResult = {
|
|
22
|
+
success: true;
|
|
23
|
+
snippet: Snippet;
|
|
24
|
+
} | {
|
|
25
|
+
success: false;
|
|
26
|
+
error: SnippetValidationError;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Get all snippets from localStorage
|
|
30
|
+
*/
|
|
31
|
+
export declare function getSnippets(): Snippet[];
|
|
32
|
+
/**
|
|
33
|
+
* Add a new snippet
|
|
34
|
+
*/
|
|
35
|
+
export declare function addSnippet(trigger: string, expansion: string): AddSnippetResult;
|
|
36
|
+
/**
|
|
37
|
+
* Update an existing snippet
|
|
38
|
+
*/
|
|
39
|
+
export declare function updateSnippet(id: string, trigger: string, expansion: string): AddSnippetResult;
|
|
40
|
+
/**
|
|
41
|
+
* Delete a snippet by ID
|
|
42
|
+
*/
|
|
43
|
+
export declare function deleteSnippet(id: string): void;
|
|
44
|
+
/**
|
|
45
|
+
* Clear all snippets
|
|
46
|
+
*/
|
|
47
|
+
export declare function clearSnippets(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Get snippet count info
|
|
50
|
+
*/
|
|
51
|
+
export declare function getSnippetCount(): {
|
|
52
|
+
current: number;
|
|
53
|
+
max: number;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Check if at snippet limit
|
|
57
|
+
*/
|
|
58
|
+
export declare function isAtSnippetLimit(): boolean;
|
|
59
|
+
export declare const snippetsStore: {
|
|
60
|
+
getSnippets: typeof getSnippets;
|
|
61
|
+
addSnippet: typeof addSnippet;
|
|
62
|
+
updateSnippet: typeof updateSnippet;
|
|
63
|
+
deleteSnippet: typeof deleteSnippet;
|
|
64
|
+
clearSnippets: typeof clearSnippets;
|
|
65
|
+
getSnippetCount: typeof getSnippetCount;
|
|
66
|
+
isAtSnippetLimit: typeof isAtSnippetLimit;
|
|
67
|
+
MAX_SNIPPETS: typeof MAX_SNIPPETS;
|
|
68
|
+
MAX_TRIGGER_LENGTH: typeof MAX_TRIGGER_LENGTH;
|
|
69
|
+
MAX_EXPANSION_LENGTH: typeof MAX_EXPANSION_LENGTH;
|
|
70
|
+
};
|
|
71
|
+
export {};
|
|
72
|
+
//# sourceMappingURL=snippets-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippets-store.d.ts","sourceRoot":"","sources":["../../src/stores/snippets-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,QAAA,MAAM,YAAY,KAAK,CAAC;AACxB,QAAA,MAAM,kBAAkB,KAAK,CAAC;AAC9B,QAAA,MAAM,oBAAoB,MAAM,CAAC;AAEjC,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,gBAAgB,GACxB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GACnC;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,sBAAsB,CAAA;CAAE,CAAC;AAStD;;GAEG;AACH,wBAAgB,WAAW,IAAI,OAAO,EAAE,CAUvC;AAiED;;GAEG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,gBAAgB,CAsClB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,gBAAgB,CAiClB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAI9C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAOpC;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAElE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED,eAAO,MAAM,aAAa,EAAE;IAC1B,WAAW,EAAE,OAAO,WAAW,CAAC;IAChC,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,oBAAoB,EAAE,OAAO,oBAAoB,CAAC;CAYnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippets-store.test.d.ts","sourceRoot":"","sources":["../../src/stores/snippets-store.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transcript history store
|
|
3
|
+
* Persists transcripts to localStorage for viewing in the settings modal
|
|
4
|
+
*/
|
|
5
|
+
import type { CommandDefinition, CommandResult } from "@speechos/core";
|
|
6
|
+
export type TranscriptAction = "dictate" | "edit" | "command";
|
|
7
|
+
export interface TranscriptEntry {
|
|
8
|
+
id: string;
|
|
9
|
+
text: string;
|
|
10
|
+
timestamp: number;
|
|
11
|
+
action: TranscriptAction;
|
|
12
|
+
/** Original text before edit (only for edit actions) */
|
|
13
|
+
originalText?: string;
|
|
14
|
+
/** The raw transcript of what the user said (for command actions) */
|
|
15
|
+
inputText?: string;
|
|
16
|
+
/** The matched command result (for command actions) */
|
|
17
|
+
commandResult?: CommandResult | null;
|
|
18
|
+
/** The command definitions that were available (for command actions) */
|
|
19
|
+
commandConfig?: CommandDefinition[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get all transcripts from localStorage
|
|
23
|
+
*/
|
|
24
|
+
export declare function getTranscripts(): TranscriptEntry[];
|
|
25
|
+
/**
|
|
26
|
+
* Options for saving a command transcript
|
|
27
|
+
*/
|
|
28
|
+
export interface SaveCommandOptions {
|
|
29
|
+
/** The raw transcript of what the user said */
|
|
30
|
+
inputText?: string;
|
|
31
|
+
/** The matched command result */
|
|
32
|
+
commandResult?: CommandResult | null;
|
|
33
|
+
/** The command definitions that were available */
|
|
34
|
+
commandConfig?: CommandDefinition[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Save a new transcript entry
|
|
38
|
+
*/
|
|
39
|
+
export declare function saveTranscript(text: string, action: TranscriptAction, originalTextOrOptions?: string | SaveCommandOptions): TranscriptEntry;
|
|
40
|
+
/**
|
|
41
|
+
* Clear all transcript history
|
|
42
|
+
*/
|
|
43
|
+
export declare function clearTranscripts(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Delete a single transcript by ID
|
|
46
|
+
*/
|
|
47
|
+
export declare function deleteTranscript(id: string): void;
|
|
48
|
+
export declare const transcriptStore: {
|
|
49
|
+
getTranscripts: typeof getTranscripts;
|
|
50
|
+
saveTranscript: typeof saveTranscript;
|
|
51
|
+
clearTranscripts: typeof clearTranscripts;
|
|
52
|
+
deleteTranscript: typeof deleteTranscript;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=transcript-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript-store.d.ts","sourceRoot":"","sources":["../../src/stores/transcript-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,gBAAgB,CAAC;IACzB,wDAAwD;IACxD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,wEAAwE;IACxE,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACrC;AAYD;;GAEG;AACH,wBAAgB,cAAc,IAAI,eAAe,EAAE,CAUlD;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,kDAAkD;IAClD,aAAa,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACrC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,gBAAgB,EACxB,qBAAqB,CAAC,EAAE,MAAM,GAAG,kBAAkB,GAClD,eAAe,CAkCjB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAMvC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAOjD;AAED,eAAO,MAAM,eAAe,EAAE;IAC5B,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,cAAc,EAAE,OAAO,cAAc,CAAC;IACtC,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;IAC1C,gBAAgB,EAAE,OAAO,gBAAgB,CAAC;CAM3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcript-store.test.d.ts","sourceRoot":"","sources":["../../src/stores/transcript-store.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vocabulary store
|
|
3
|
+
* Persists custom vocabulary terms to localStorage for improved transcription accuracy
|
|
4
|
+
*/
|
|
5
|
+
declare const MAX_TERMS = 50;
|
|
6
|
+
declare const MAX_TERM_LENGTH = 50;
|
|
7
|
+
export interface VocabularyTerm {
|
|
8
|
+
id: string;
|
|
9
|
+
/** The term or phrase to recognize (max 50 chars) */
|
|
10
|
+
term: string;
|
|
11
|
+
/** Timestamp when term was added */
|
|
12
|
+
createdAt: number;
|
|
13
|
+
}
|
|
14
|
+
export interface VocabularyValidationError {
|
|
15
|
+
field: "term" | "limit";
|
|
16
|
+
message: string;
|
|
17
|
+
}
|
|
18
|
+
export type AddTermResult = {
|
|
19
|
+
success: true;
|
|
20
|
+
term: VocabularyTerm;
|
|
21
|
+
} | {
|
|
22
|
+
success: false;
|
|
23
|
+
error: VocabularyValidationError;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Get all vocabulary terms from localStorage
|
|
27
|
+
*/
|
|
28
|
+
export declare function getVocabulary(): VocabularyTerm[];
|
|
29
|
+
/**
|
|
30
|
+
* Add a new vocabulary term
|
|
31
|
+
*/
|
|
32
|
+
export declare function addTerm(term: string): AddTermResult;
|
|
33
|
+
/**
|
|
34
|
+
* Delete a term by ID
|
|
35
|
+
*/
|
|
36
|
+
export declare function deleteTerm(id: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Clear all vocabulary
|
|
39
|
+
*/
|
|
40
|
+
export declare function clearVocabulary(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Get vocabulary count info
|
|
43
|
+
*/
|
|
44
|
+
export declare function getVocabularyCount(): {
|
|
45
|
+
current: number;
|
|
46
|
+
max: number;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Check if at term limit
|
|
50
|
+
*/
|
|
51
|
+
export declare function isAtVocabularyLimit(): boolean;
|
|
52
|
+
export declare const vocabularyStore: {
|
|
53
|
+
getVocabulary: typeof getVocabulary;
|
|
54
|
+
addTerm: typeof addTerm;
|
|
55
|
+
deleteTerm: typeof deleteTerm;
|
|
56
|
+
clearVocabulary: typeof clearVocabulary;
|
|
57
|
+
getVocabularyCount: typeof getVocabularyCount;
|
|
58
|
+
isAtVocabularyLimit: typeof isAtVocabularyLimit;
|
|
59
|
+
MAX_TERMS: typeof MAX_TERMS;
|
|
60
|
+
MAX_TERM_LENGTH: typeof MAX_TERM_LENGTH;
|
|
61
|
+
};
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=vocabulary-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary-store.d.ts","sourceRoot":"","sources":["../../src/stores/vocabulary-store.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,QAAA,MAAM,SAAS,KAAK,CAAC;AACrB,QAAA,MAAM,eAAe,KAAK,CAAC;AAE3B,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,GACvC;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,yBAAyB,CAAA;CAAE,CAAC;AASzD;;GAEG;AACH,wBAAgB,aAAa,IAAI,cAAc,EAAE,CAUhD;AA8CD;;GAEG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CA+BnD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAI3C;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAOtC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAErE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED,eAAO,MAAM,eAAe,EAAE;IAC5B,aAAa,EAAE,OAAO,aAAa,CAAC;IACpC,OAAO,EAAE,OAAO,OAAO,CAAC;IACxB,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,kBAAkB,EAAE,OAAO,kBAAkB,CAAC;IAC9C,mBAAmB,EAAE,OAAO,mBAAmB,CAAC;IAChD,SAAS,EAAE,OAAO,SAAS,CAAC;IAC5B,eAAe,EAAE,OAAO,eAAe,CAAC;CAUzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vocabulary-store.test.d.ts","sourceRoot":"","sources":["../../src/stores/vocabulary-store.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|