formanitor 0.0.28 → 0.0.30
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/index.cjs +362 -223
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.mjs +202 -63
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -63,6 +63,12 @@ interface BaseFieldDef {
|
|
|
63
63
|
*/
|
|
64
64
|
theme?: string;
|
|
65
65
|
meta?: Record<string, unknown>;
|
|
66
|
+
/**
|
|
67
|
+
* When true, a microphone button is rendered alongside this field so the
|
|
68
|
+
* user can dictate its value via speech. Requires `StoreConfig.voice` to
|
|
69
|
+
* be wired up with an `onTranscribe` callback.
|
|
70
|
+
*/
|
|
71
|
+
voice?: boolean;
|
|
66
72
|
}
|
|
67
73
|
interface TextFieldDef extends BaseFieldDef {
|
|
68
74
|
type: 'text' | 'textarea';
|
|
@@ -448,6 +454,17 @@ interface StoreConfig {
|
|
|
448
454
|
onEvent?: EventListener;
|
|
449
455
|
onUpload?: UploadHandler;
|
|
450
456
|
onDraftChange?: DraftChangeHandler;
|
|
457
|
+
/**
|
|
458
|
+
* Voice dictation support. When provided, fields marked with `voice: true`
|
|
459
|
+
* in the schema will display a microphone button.
|
|
460
|
+
* The host app owns all recording logic and supplies two callbacks:
|
|
461
|
+
* - `startRecording` — begin capturing audio
|
|
462
|
+
* - `stopRecording` — stop capturing, transcribe, and return the transcript
|
|
463
|
+
*/
|
|
464
|
+
voice?: {
|
|
465
|
+
startRecording: () => Promise<void>;
|
|
466
|
+
stopRecording: () => Promise<string>;
|
|
467
|
+
};
|
|
451
468
|
}
|
|
452
469
|
declare class FormStore {
|
|
453
470
|
private state;
|
|
@@ -471,6 +488,7 @@ declare class FormStore {
|
|
|
471
488
|
};
|
|
472
489
|
getSchema(): FormDef;
|
|
473
490
|
getFieldDef(fieldId: string): FieldDef | undefined;
|
|
491
|
+
getVoice(): StoreConfig['voice'];
|
|
474
492
|
hasPersistence(): boolean;
|
|
475
493
|
setValue(fieldId: string, value: any): void;
|
|
476
494
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -63,6 +63,12 @@ interface BaseFieldDef {
|
|
|
63
63
|
*/
|
|
64
64
|
theme?: string;
|
|
65
65
|
meta?: Record<string, unknown>;
|
|
66
|
+
/**
|
|
67
|
+
* When true, a microphone button is rendered alongside this field so the
|
|
68
|
+
* user can dictate its value via speech. Requires `StoreConfig.voice` to
|
|
69
|
+
* be wired up with an `onTranscribe` callback.
|
|
70
|
+
*/
|
|
71
|
+
voice?: boolean;
|
|
66
72
|
}
|
|
67
73
|
interface TextFieldDef extends BaseFieldDef {
|
|
68
74
|
type: 'text' | 'textarea';
|
|
@@ -448,6 +454,17 @@ interface StoreConfig {
|
|
|
448
454
|
onEvent?: EventListener;
|
|
449
455
|
onUpload?: UploadHandler;
|
|
450
456
|
onDraftChange?: DraftChangeHandler;
|
|
457
|
+
/**
|
|
458
|
+
* Voice dictation support. When provided, fields marked with `voice: true`
|
|
459
|
+
* in the schema will display a microphone button.
|
|
460
|
+
* The host app owns all recording logic and supplies two callbacks:
|
|
461
|
+
* - `startRecording` — begin capturing audio
|
|
462
|
+
* - `stopRecording` — stop capturing, transcribe, and return the transcript
|
|
463
|
+
*/
|
|
464
|
+
voice?: {
|
|
465
|
+
startRecording: () => Promise<void>;
|
|
466
|
+
stopRecording: () => Promise<string>;
|
|
467
|
+
};
|
|
451
468
|
}
|
|
452
469
|
declare class FormStore {
|
|
453
470
|
private state;
|
|
@@ -471,6 +488,7 @@ declare class FormStore {
|
|
|
471
488
|
};
|
|
472
489
|
getSchema(): FormDef;
|
|
473
490
|
getFieldDef(fieldId: string): FieldDef | undefined;
|
|
491
|
+
getVoice(): StoreConfig['voice'];
|
|
474
492
|
hasPersistence(): boolean;
|
|
475
493
|
setValue(fieldId: string, value: any): void;
|
|
476
494
|
/**
|