@exode-team/react-recorder 1.0.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/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Exode
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+
package/README.md ADDED
@@ -0,0 +1,135 @@
1
+ ## @exode-team/react-recorder
2
+
3
+ Готовый компонент записи и отправки голосовых сообщений для React-приложений. Компонент инкапсулирует работу с
4
+ `MediaRecorder`, визуализацию волны и UX-паттерн «нажал — запись началась», оставляя вам полный контроль над загрузкой
5
+ файла и локализацией.
6
+
7
+ ### Возможности
8
+
9
+ - поддержка простого сценария «нажал — запись началась» без удержания и свайпов;
10
+ - встроенная визуализация уровней сигнала и предпросмотр записанного фрагмента;
11
+ - управление воспроизведением, паузой и повторным набором;
12
+ - адаптация текстов/aria-лейблов через проп `messages`;
13
+ - строгая типизация и SDK-подобный API (`uploader`, callbacks жизненного цикла).
14
+ - **[NEW]** Хук `useVoiceRecorder` для создания кастомного UI.
15
+
16
+ ### Установка
17
+
18
+ ```bash
19
+ yarn add @exode-team/react-recorder styled-components
20
+ # или
21
+ npm install @exode-team/react-recorder styled-components
22
+ ```
23
+
24
+ Компонент требует React 17+ и `styled-components` в качестве peer dependency.
25
+
26
+ ### Быстрый старт
27
+
28
+ ```tsx
29
+ import React from 'react';
30
+ import { AudioRecorder, StorageSpaceEnum } from '@exode-team/react-recorder';
31
+
32
+
33
+ const Example = () => {
34
+ const uploader = async (file: File) => {
35
+ const body = new FormData();
36
+ body.append('file', file);
37
+ const response = await fetch('/api/upload', { method: 'POST', body });
38
+ return response.json();
39
+ };
40
+
41
+ return (
42
+ <AudioRecorder uploader={uploader}
43
+ space={StorageSpaceEnum.User}
44
+ onUploaded={(file) => console.log('Uploaded', file)}
45
+ onUploadError={(error) => console.error(error)}/>
46
+ );
47
+ };
48
+ ```
49
+
50
+ ### API
51
+
52
+ #### `<AudioRecorder />`
53
+
54
+ | Проп | Тип | Обязателен | По умолчанию | Описание |
55
+ |------------------------|----------------------------|------------|-------------------------|------------------------------------------------------------------------------|
56
+ | `uploader` | `UploadStrategy<T>` | ✅ | — | Функция, которая принимает `File` и возвращает результат (DTO, URL и т. д.). |
57
+ | `onUploaded` | `(file: T) => void` | — | — | Колбэк после успешной загрузки. |
58
+ | `onUploadError` | `(error: unknown) => void` | — | — | Обработчик ошибок загрузки. |
59
+ | `space` | `StorageSpace` | — | `StorageSpaceEnum.User` | Пространство хранения при загрузке. |
60
+ | `uploadId` | `string` | — | `crypto.randomUUID()` | Идентификатор загрузки. |
61
+ | `messages` | `RecorderMessagesInput` | — | встроенные тексты | Локализация кнопок и aria-лейблов. |
62
+ | `fileName` | `string` | — | `record.webm` | Имя файла при сохранении. |
63
+ | `mimeType` | `string` | — | `audio/webm` | MIME-тип создаваемого файла. |
64
+ | `autoResetAfterUpload` | `boolean` | — | `true` | Сбрасывать UI после `onUploaded`. |
65
+ | `className` | `string` | — | — | Пользовательский класс контейнера. |
66
+ | `onRecordingStart` | `() => void` | — | — | Колбэк старта записи. |
67
+ | `onRecordingStop` | `(blob: Blob) => void` | — | — | Колбэк остановки записи. |
68
+ | `onRecordingDelete` | `() => void` | — | — | Колбэк удаления записанного файла. |
69
+ | `onRecordingError` | `(error: unknown) => void` | — | — | Ошибка при записи. |
70
+ | `onPermissionDenied` | `(error: unknown) => void` | — | — | Отказ в доступе к микрофону. |
71
+
72
+ #### `useVoiceRecorder`
73
+
74
+ Хук для создания собственного интерфейса записи, если стандартный `AudioRecorder` не подходит.
75
+
76
+ ```tsx
77
+ import { useVoiceRecorder } from '@exode-team/react-recorder';
78
+
79
+
80
+ const MyCustomRecorder = () => {
81
+ const {
82
+ isRecording,
83
+ startRecording,
84
+ stopRecording,
85
+ audioURL
86
+ } = useVoiceRecorder({
87
+ onRecordingStop: (blob) => console.log('Recorded blob:', blob),
88
+ });
89
+
90
+ return (
91
+ <div>
92
+ <button onClick={isRecording ? stopRecording : startRecording}>
93
+ {isRecording ? 'Stop' : 'Record'}
94
+ </button>
95
+ {audioURL && <audio src={audioURL} controls/>}
96
+ </div>
97
+ );
98
+ };
99
+ ```
100
+
101
+ **Параметры хука (`UseVoiceRecorderOptions`):**
102
+
103
+ - `space`, `uploadId`, `uploader`, `onUploaded`
104
+ - `fileName`, `mimeType`
105
+ - `autoResetAfterUpload`
106
+ - `onRecordingStart`, `onRecordingStop`, `onRecordingDelete`, `onRecordingError`, `onPermissionDenied`
107
+
108
+ **Возвращаемое значение (`UseVoiceRecorderResult`):**
109
+
110
+ - Состояния: `isRecording`, `isPaused`, `isPlaying`, `hasRecording`
111
+ - Данные: `audioURL`, `recordingTime`, `playbackTime`, `playbackDuration`, `audioLevels`, `previewLevels`
112
+ - Методы: `startRecording`, `stopRecording`, `cancelRecording`, `deleteRecording`, `toggleRecordingPause`,
113
+ `togglePlayback`, `stopPlayback`, `sendRecording`
114
+ - Утилиты: `formatTime`
115
+
116
+ ### Типы
117
+
118
+ #### `StorageSpaceEnum`
119
+
120
+ ```ts
121
+ export const StorageSpaceEnum = {
122
+ User: 'user',
123
+ Shared: 'shared',
124
+ System: 'system',
125
+ } as const;
126
+ ```
127
+
128
+ ### Сборка
129
+
130
+ Команда `yarn build` (или `npm run build`) запускает Rollup, который собирает ESModule, CommonJS и декларации
131
+ TypeScript. `.npmignore` настроен так, чтобы в пакет попадали только `dist`, README и LICENSE.
132
+
133
+ ### Лицензия
134
+
135
+ MIT © Exode.
@@ -0,0 +1,43 @@
1
+ /**
2
+ * AudioRecorder
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ import { type StorageFileEntity, type StorageSpace, type UploadStrategy, type UseVoiceRecorderOptions } from './types';
7
+ type RecorderOptionOverrides = Omit<UseVoiceRecorderOptions<Partial<StorageFileEntity>>, 'space' | 'uploadId' | 'onUploaded' | 'uploader'>;
8
+ interface RecorderMessages {
9
+ buttons: {
10
+ send: string;
11
+ cancel: string;
12
+ };
13
+ instruction: string;
14
+ aria: {
15
+ startRecording: string;
16
+ stopRecording: string;
17
+ pauseRecording: string;
18
+ resumeRecording: string;
19
+ playRecording: string;
20
+ pausePlayback: string;
21
+ };
22
+ errors: {
23
+ loadFileFailed: string;
24
+ };
25
+ }
26
+ type RecorderMessagesInput = Partial<{
27
+ buttons: Partial<RecorderMessages['buttons']>;
28
+ instruction: RecorderMessages['instruction'];
29
+ aria: Partial<RecorderMessages['aria']>;
30
+ errors: Partial<RecorderMessages['errors']>;
31
+ }>;
32
+ interface Props extends Partial<RecorderOptionOverrides> {
33
+ uploader: UploadStrategy<Partial<StorageFileEntity>>;
34
+ messages?: RecorderMessagesInput;
35
+ uploadId?: string;
36
+ className?: string;
37
+ space?: StorageSpace;
38
+ onUploadError?: (error: unknown) => void;
39
+ onUploaded?: (file: Partial<StorageFileEntity>) => void | Promise<void>;
40
+ }
41
+ declare const AudioRecorder: (props: Props) => any;
42
+ export { AudioRecorder };
43
+ //# sourceMappingURL=AudioRecorder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioRecorder.d.ts","sourceRoot":"","sources":["../src/AudioRecorder.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAEjB,KAAK,cAAc,EACnB,KAAK,uBAAuB,EAC/B,MAAM,SAAS,CAAC;AAGjB,KAAK,uBAAuB,GAAG,IAAI,CAC/B,uBAAuB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,EACnD,OAAO,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CACnD,CAAC;AAEF,UAAU,gBAAgB;IACtB,OAAO,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE;QACF,cAAc,EAAE,MAAM,CAAC;QACvB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,eAAe,EAAE,MAAM,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,MAAM,EAAE;QACJ,cAAc,EAAE,MAAM,CAAC;KAC1B,CAAC;CACL;AAED,KAAK,qBAAqB,GAAG,OAAO,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9C,WAAW,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAC7C,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IACxC,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;CAC/C,CAAC,CAAC;AAEH,UAAU,KAAM,SAAQ,OAAO,CAAC,uBAAuB,CAAC;IACpD,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,iBAAiB,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3E;AAoDD,QAAA,MAAM,aAAa,GAAI,OAAO,KAAK,QA6NlC,CAAC;AAGF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * IdleControlAtom
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ interface Props {
7
+ onClick: () => void;
8
+ instruction: string;
9
+ startAriaLabel: string;
10
+ }
11
+ declare const IdleControlAtom: (props: Props) => any;
12
+ export { IdleControlAtom };
13
+ //# sourceMappingURL=IdleControlAtom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdleControlAtom.d.ts","sourceRoot":"","sources":["../../src/atoms/IdleControlAtom.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,UAAU,KAAK;IACX,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CAC1B;AAGD,QAAA,MAAM,eAAe,GAAI,OAAO,KAAK,QAsBpC,CAAC;AAGF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * IdleControlAtom styles
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export declare const IdleWrapper: any;
7
+ export declare const IdleButton: any;
8
+ export declare const IdleButtonOutline: any;
9
+ export declare const IdleButtonGlow: any;
10
+ export declare const IdleInstruction: any;
11
+ //# sourceMappingURL=IdleControlAtom.styled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdleControlAtom.styled.d.ts","sourceRoot":"","sources":["../../src/atoms/IdleControlAtom.styled.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,WAAW,KAKvB,CAAC;AAEF,eAAO,MAAM,UAAU,KA0BtB,CAAC;AAEF,eAAO,MAAM,iBAAiB,KAM7B,CAAC;AAEF,eAAO,MAAM,cAAc,KAY1B,CAAC;AAEF,eAAO,MAAM,eAAe,KAI3B,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * RecordingShellAtom
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ interface Props {
7
+ isRecording: boolean;
8
+ isPaused: boolean;
9
+ hasRecording: boolean;
10
+ isPlaying: boolean;
11
+ recordingTime: number;
12
+ playbackTime: number;
13
+ playbackDuration: number;
14
+ audioLevels: number[];
15
+ previewLevels: number[];
16
+ isSending: boolean;
17
+ cancelAriaLabel: string;
18
+ stopAriaLabel: string;
19
+ startAriaLabel: string;
20
+ pauseRecordingAriaLabel: string;
21
+ resumeRecordingAriaLabel: string;
22
+ playAriaLabel: string;
23
+ pausePlaybackAriaLabel: string;
24
+ sendAriaLabel: string;
25
+ onSend: () => void;
26
+ onCancel: () => void;
27
+ onRecordToggle: () => void;
28
+ onTogglePlayback: () => void;
29
+ formatTime: (seconds: number) => string;
30
+ }
31
+ declare const RecordingShellAtom: (props: Props) => any;
32
+ export { RecordingShellAtom };
33
+ //# sourceMappingURL=RecordingShellAtom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecordingShellAtom.d.ts","sourceRoot":"","sources":["../../src/atoms/RecordingShellAtom.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AA4BH,UAAU,KAAK;IACX,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,MAAM,CAAC;IAChC,wBAAwB,EAAE,MAAM,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C;AAGD,QAAA,MAAM,kBAAkB,GAAI,OAAO,KAAK,QAwHvC,CAAC;AAGF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * RecordingShellAtom styles
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export declare const Wrapper: any;
7
+ export declare const CancelButton: any;
8
+ export declare const Track: any;
9
+ export declare const CircleButton: any;
10
+ export declare const Waveform: any;
11
+ export declare const Bars: any;
12
+ export declare const Bar: any;
13
+ export declare const Timer: any;
14
+ export declare const SendButton: any;
15
+ export declare const SpinnerSlot: any;
16
+ export declare const Spinner: any;
17
+ //# sourceMappingURL=RecordingShellAtom.styled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecordingShellAtom.styled.d.ts","sourceRoot":"","sources":["../../src/atoms/RecordingShellAtom.styled.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,eAAO,MAAM,OAAO,KAQnB,CAAC;AAEF,eAAO,MAAM,YAAY,KAqBxB,CAAC;AAEF,eAAO,MAAM,KAAK,KAQjB,CAAC;AAEF,eAAO,MAAM,YAAY,KA2CxB,CAAC;AAEF,eAAO,MAAM,QAAQ,KAOpB,CAAC;AAEF,eAAO,MAAM,IAAI,KAMhB,CAAC;AAEF,eAAO,MAAM,GAAG,KAOf,CAAC;AAEF,eAAO,MAAM,KAAK,KAKjB,CAAC;AAEF,eAAO,MAAM,UAAU,KAyBtB,CAAC;AAEF,eAAO,MAAM,WAAW,KAMvB,CAAC;AAEF,eAAO,MAAM,OAAO,KAoBnB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * WaveformBarsAtom
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ import React from 'react';
7
+ interface Props {
8
+ scale?: number;
9
+ divider?: number;
10
+ values: number[];
11
+ minHeight?: number;
12
+ styleInterpolator?: (context: {
13
+ normalized: number;
14
+ height: number;
15
+ index: number;
16
+ }) => React.CSSProperties;
17
+ }
18
+ declare const WaveformBarsAtom: (props: Props) => any;
19
+ export { WaveformBarsAtom };
20
+ //# sourceMappingURL=WaveformBarsAtom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WaveformBarsAtom.d.ts","sourceRoot":"","sources":["../../src/atoms/WaveformBarsAtom.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,UAAU,KAAK;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE;QAC1B,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACjB,KAAK,KAAK,CAAC,aAAa,CAAC;CAC7B;AAGD,QAAA,MAAM,gBAAgB,GAAI,OAAO,KAAK,QA0BrC,CAAC;AAGF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * AudioRecorder constants
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ export declare const AUDIO_LEVEL_BARS = 40;
7
+ export declare const createInitialLevels: () => number[];
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,eAAO,MAAM,mBAAmB,QAAO,MAAM,EAAuD,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * useRecorderVisualization
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ interface UseRecorderVisualizationResult {
7
+ audioLevels: number[];
8
+ previewLevels: number[];
9
+ resetAudioLevels: () => void;
10
+ resetPreviewLevels: () => void;
11
+ cleanupVisualization: () => void;
12
+ generatePreviewLevels: (blob: Blob) => Promise<void>;
13
+ initializeVisualization: (stream: MediaStream) => void;
14
+ stopVisualization: (options?: {
15
+ resetLevels?: boolean;
16
+ }) => void;
17
+ }
18
+ declare const useRecorderVisualization: () => UseRecorderVisualizationResult;
19
+ export { useRecorderVisualization };
20
+ //# sourceMappingURL=useRecorderVisualization.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRecorderVisualization.d.ts","sourceRoot":"","sources":["../../src/hooks/useRecorderVisualization.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,UAAU,8BAA8B;IACpC,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,EAAE,MAAM,IAAI,CAAC;IAC7B,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,qBAAqB,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrD,uBAAuB,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;IACvD,iBAAiB,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CACpE;AAGD,QAAA,MAAM,wBAAwB,QAAO,8BAmJpC,CAAC;AAGF,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * useRecordingTiming
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ interface UseRecordingTimingResult {
7
+ recordingTime: number;
8
+ pauseSession: () => void;
9
+ resetSession: () => void;
10
+ resumeSession: () => void;
11
+ startNewSession: () => void;
12
+ }
13
+ declare const useRecordingTiming: () => UseRecordingTimingResult;
14
+ export { useRecordingTiming };
15
+ //# sourceMappingURL=useRecordingTiming.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useRecordingTiming.d.ts","sourceRoot":"","sources":["../../src/hooks/useRecordingTiming.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,UAAU,wBAAwB;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAC;CAC/B;AAID,QAAA,MAAM,kBAAkB,QAAO,wBAgF9B,CAAC;AAGF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * useVoiceRecorder
3
+ *
4
+ * @author: exode <hello@exode.ru>
5
+ */
6
+ import type { UseVoiceRecorderOptions, UseVoiceRecorderResult } from '../types';
7
+ export declare const clampValue: (value: number, lowerBound?: number, upperBound?: number) => number;
8
+ declare function useVoiceRecorder<TFile = unknown>(props: UseVoiceRecorderOptions<TFile>): UseVoiceRecorderResult;
9
+ export { useVoiceRecorder };
10
+ //# sourceMappingURL=useVoiceRecorder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useVoiceRecorder.d.ts","sourceRoot":"","sources":["../../src/hooks/useVoiceRecorder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGhF,eAAO,MAAM,UAAU,GAAI,OAAO,MAAM,EAAE,mBAAc,EAAE,mBAAgB,KAAG,MACX,CAAC;AAGnE,iBAAS,gBAAgB,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,EAAE,uBAAuB,CAAC,KAAK,CAAC,GAAG,sBAAsB,CAubxG;AAGD,OAAO,EAAE,gBAAgB,EAAE,CAAC"}