@hussmartinez/audio-sdk 0.6.0 → 0.7.1

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/element.d.ts CHANGED
@@ -4,9 +4,1018 @@
4
4
  * @remarks
5
5
  * Importing this entry registers nothing: applications call
6
6
  * `defineAudioEditorElement()` themselves, and importing it on a server does
7
- * nothing (ADR 0004, ADR 0007). The element arrives in a later release.
7
+ * nothing (sdk-core ADR 0004, ADR 0007). The element renders
8
+ * `<AudioEditor>` into its light DOM, so React and React DOM, the package's
9
+ * optional peer dependencies, are needed here. Hosts import
10
+ * `@hussmartinez/ui/styles.css` once, then this package's `styles.css`
11
+ * (sdk-core ADR 0036).
8
12
  *
9
13
  * @packageDocumentation
10
14
  */
11
15
 
16
+ import { EditorElementDefine } from '@hussmartinez/sdk-core/element';
17
+ import { FilePolicyOverrides } from '@hussmartinez/sdk-core';
18
+ import { MessageOverrides } from '@hussmartinez/sdk-core';
19
+
20
+ /**
21
+ * Options every port call accepts.
22
+ *
23
+ * @public
24
+ */
25
+ declare interface AudioCallOptions {
26
+ /**
27
+ * Cancels the call. It then rejects with an `AudioError` whose code is
28
+ * `ABORTED`, `TIMEOUT`, or the code of an `SdkError` given as the abort
29
+ * reason, such as `PROCESSING_TIME_EXCEEDED`.
30
+ */
31
+ readonly signal?: AbortSignal;
32
+ }
33
+
34
+ /**
35
+ * A clip on a track (docs/adr/0006): a range of a source, starting on the
36
+ * timeline frame `at`. A clip's position is stored, so an edit on one track
37
+ * leaves every other clip where it is.
38
+ *
39
+ * @public
40
+ */
41
+ declare interface AudioClip extends AudioClipBody {
42
+ /** The timeline frame the clip starts on. */
43
+ readonly at: number;
44
+ }
45
+
46
+ /**
47
+ * A range of a source with its gain and fades: a clip without its place on
48
+ * the timeline, which is what version 1 of the plan called a clip.
49
+ *
50
+ * @public
51
+ */
52
+ declare interface AudioClipBody {
53
+ /** Stable across edits, so selection and waveform tiles follow a clip that moves. */
54
+ readonly key: string;
55
+ /** The id of the source the clip plays. */
56
+ readonly source: string;
57
+ /** The first source frame the clip plays, inclusive. */
58
+ readonly start: number;
59
+ /** The source frame the clip stops before, exclusive. */
60
+ readonly end: number;
61
+ /** The clip's gain in decibels. 0 leaves it unchanged. */
62
+ readonly gainDb: number;
63
+ readonly fadeIn: AudioFade;
64
+ readonly fadeOut: AudioFade;
65
+ }
66
+
67
+ /**
68
+ * The codecs the probe recognises (ADR 0001). `pcm` covers integer and
69
+ * floating-point samples in WAV and AIFF.
70
+ *
71
+ * @public
72
+ */
73
+ declare type AudioCodec = "pcm" | "mp3" | "aac" | "alac" | "opus" | "vorbis" | "flac";
74
+
75
+ /**
76
+ * The containers the probe recognises (ADR 0001).
77
+ *
78
+ * @public
79
+ */
80
+ declare type AudioContainer = "wav" | "aiff" | "flac" | "ogg" | "mp3" | "adts" | "mp4" | "webm";
81
+
82
+ /**
83
+ * Options for `AudioEngine.decode`.
84
+ *
85
+ * @public
86
+ */
87
+ declare interface AudioDecodeOptions extends AudioProgressOptions {
88
+ /**
89
+ * The sample rate to return the audio at, in hertz, when it isn't the
90
+ * probe's: the engine converts it, as the session asks for a recording
91
+ * inserted at another rate than its own (docs/adr/0006). The result then
92
+ * has `Math.ceil(frames × sampleRate / probe.sampleRate)` frames, which
93
+ * cover the same time.
94
+ */
95
+ readonly sampleRate?: number;
96
+ }
97
+
98
+ /**
99
+ * The element's events, fired as `hm-audio-editor-<name>`. None carries a
100
+ * file name or contents (sdk-core ADR 0012):
101
+ *
102
+ * - `change`: the plan, after each committed edit, open, undo or redo.
103
+ * - `event`: the session's anonymous usage event.
104
+ * - `export`: an {@link AudioExportReport} after the export dialog finishes.
105
+ * - `error`: `{ code, details }` of a failure the editor shows.
106
+ *
107
+ * @public
108
+ */
109
+ export declare type AudioEditorElementEvent = "change" | "event" | "export" | "error";
110
+
111
+ /**
112
+ * The `<hm-audio-editor>` element's methods: the React editor's ref handle.
113
+ * `open()`, `insert()` and `export()` wait for the editor's first render;
114
+ * the others act on the editor there is, and do nothing before it.
115
+ *
116
+ * @public
117
+ */
118
+ export declare type AudioEditorElementMethods = Pick<AudioEditorHandle, "open" | "insert" | "export" | "undo" | "redo" | "play" | "pause" | "seek">;
119
+
120
+ /**
121
+ * The `<hm-audio-editor>` element's props: its attributes, `theme`, `locale`
122
+ * and `tools`, and its properties (docs/adr/0005). They're writable, since a
123
+ * host sets them on the element, such as `editor.file = file`.
124
+ *
125
+ * @public
126
+ */
127
+ export declare interface AudioEditorElementProps {
128
+ /** `light`, `dark` or `system`: ui's colour mode, on the element. Inherited when unset. */
129
+ theme?: string;
130
+ /** The locale for numbers and plurals. Defaults to `"en"`. */
131
+ locale?: string;
132
+ /** Which tools are present, by id, in order: the attribute is space-separated. */
133
+ tools?: readonly string[];
134
+ /** A recording to open. Setting another opens it, replacing the current one. */
135
+ file?: Blob;
136
+ /** The name an export is downloaded under, without its extension. */
137
+ fileName?: string;
138
+ /** The level of the editor's headings, from 2 to 6. Defaults to 2. */
139
+ headingLevel?: AudioHeadingLevel;
140
+ filePolicy?: AudioFilePolicyOverrides;
141
+ /** Where the application serves the package's `dist/assets/` directory. */
142
+ assetsUrl?: string | URL;
143
+ /** Text overrides, typed against the English catalogue. */
144
+ messages?: AudioEditorMessageOverrides;
145
+ engine?: AudioEngine;
146
+ processor?: AudioProcessor;
147
+ output?: AudioOutput;
148
+ }
149
+
150
+ /**
151
+ * What a host can do with the editor through its ref.
152
+ *
153
+ * @public
154
+ */
155
+ declare interface AudioEditorHandle {
156
+ /** Opens a recording, replacing the current one once it has opened. */
157
+ open(file: Blob): Promise<void>;
158
+ /** Adds a recording on a new track, or on `options.track`. */
159
+ insert(file: Blob, options?: AudioInsertOptions): Promise<void>;
160
+ undo(): void;
161
+ redo(): void;
162
+ play(): Promise<void>;
163
+ pause(): void;
164
+ /** Moves the playhead to a timeline frame. */
165
+ seek(frame: number): void;
166
+ /**
167
+ * Exports the plan as it is now, for a host's own export button, without
168
+ * the editor's dialog: through the editor's processor, or the host's
169
+ * `processor`. It resolves with the file, the mix's peak and how many
170
+ * frames were clamped, and never downloads anything or calls `onExport`.
171
+ * It fails as `session.export` does, and throws `TypeError` when there's
172
+ * no processor.
173
+ */
174
+ export(options?: AudioSessionExportOptions): Promise<AudioRenderResult>;
175
+ }
176
+
177
+ /**
178
+ * The type of {@link audioEditorMessages}.
179
+ *
180
+ * @public
181
+ */
182
+ declare type AudioEditorMessageCatalogue = typeof audioEditorMessages;
183
+
184
+ /**
185
+ * A host's overrides of the editor's text, keyed as in
186
+ * {@link audioEditorMessages}.
187
+ *
188
+ * @public
189
+ */
190
+ declare type AudioEditorMessageOverrides = MessageOverrides<AudioEditorMessageCatalogue>;
191
+
192
+ /**
193
+ * The editor's English catalogue: the SDK's messages, `ui`'s for its own
194
+ * components, and the editor's text, as one catalogue for one `Messages`
195
+ * object (sdk-core ADR 0046). A host overrides any of it, such as `ui`'s
196
+ * `fileDropZone.choose`, through the editor's `messages` prop.
197
+ *
198
+ * @public
199
+ */
200
+ declare const audioEditorMessages: {
201
+ readonly "editor.label": "Audio editor";
202
+ readonly "editor.empty": "Drop an audio file here, or choose one. It stays on your device.";
203
+ readonly "editor.opening": "Opening the recording";
204
+ readonly "editor.inserting": "Adding the recording";
205
+ readonly "editor.cancel": "Cancel";
206
+ readonly "editor.opened": "Recording opened.";
207
+ readonly "editor.inserted": "Recording added.";
208
+ readonly "editor.notices": "Notices";
209
+ readonly "editor.dismiss": "Dismiss";
210
+ readonly "editor.historyTrimmed": "The earliest edits can no longer be undone, to make room for the recordings.";
211
+ readonly "timeline.label": "Timeline";
212
+ readonly "timeline.summary": {
213
+ readonly $plural: "count";
214
+ } & {
215
+ readonly one: "{count} track, {duration} long.";
216
+ readonly other: "{count} tracks, {duration} long.";
217
+ };
218
+ readonly "timeline.playhead": "Playhead";
219
+ readonly "timeline.track": "Track {index}";
220
+ readonly "timeline.track.named": "Track {index}, {name}";
221
+ readonly "timeline.lane": "{track}";
222
+ readonly "timeline.lane.muted": "{track}, muted";
223
+ readonly "timeline.lane.silenced": "{track}, silenced by solo";
224
+ readonly "timeline.lane.ripple": "{lane}, later clips move when the selection is deleted";
225
+ readonly "timeline.selection": "Selected {start} to {end} on {tracks}";
226
+ readonly "track.ripple": "Ripple";
227
+ readonly "tracks.every": "every track";
228
+ readonly "tracks.count": {
229
+ readonly $plural: "count";
230
+ } & {
231
+ readonly one: "{count} track";
232
+ readonly other: "{count} tracks";
233
+ };
234
+ readonly "timeline.clips": "Clips on {track}";
235
+ readonly "timeline.clip": "Clip {index} of {count} on {track}, {start} to {end}";
236
+ readonly "timeline.clip.named": "{name}, clip {index} of {count} on {track}, {start} to {end}";
237
+ readonly "timeline.clip.gain": "Clip {index} of {count} on {track}, {start} to {end}, {gain, number} dB";
238
+ readonly "timeline.clip.named.gain": "{name}, clip {index} of {count} on {track}, {start} to {end}, {gain, number} dB";
239
+ readonly "toolbar.label": "Tools";
240
+ readonly "toolbar.file": "File";
241
+ readonly "toolbar.history": "History";
242
+ readonly "toolbar.tracks": "Tracks";
243
+ readonly "toolbar.clips": "Clip";
244
+ readonly "toolbar.range": "Selection";
245
+ readonly "toolbar.view": "Zoom";
246
+ readonly "toolbar.withKeys": "{label} ({keys})";
247
+ readonly "tools.open": "Open";
248
+ readonly "tools.insert": "Add recording";
249
+ readonly "tools.export": "Export";
250
+ readonly "tools.undo": "Undo";
251
+ readonly "tools.redo": "Redo";
252
+ readonly "tools.addTrack": "Add track";
253
+ readonly "tools.removeTrack": "Remove track";
254
+ readonly "tools.moveTrackUp": "Move track up";
255
+ readonly "tools.moveTrackDown": "Move track down";
256
+ readonly "tools.mute": "Mute track";
257
+ readonly "tools.split": "Split at the playhead";
258
+ readonly "tools.delete": "Delete";
259
+ readonly "tools.trimStart": "Trim the start to the playhead";
260
+ readonly "tools.trimEnd": "Trim the end to the playhead";
261
+ readonly "tools.moveEarlier": "Move the clip earlier";
262
+ readonly "tools.moveLater": "Move the clip later";
263
+ readonly "tools.moveToTrackAbove": "Move the clip to the track above";
264
+ readonly "tools.moveToTrackBelow": "Move the clip to the track below";
265
+ readonly "tools.setStart": "Start the selection at the playhead";
266
+ readonly "tools.setEnd": "End the selection at the playhead";
267
+ readonly "tools.clearSelection": "Clear the selection";
268
+ readonly "tools.ripple": "Ripple";
269
+ readonly "tools.fadeIn": "Fade in";
270
+ readonly "tools.fadeOut": "Fade out";
271
+ readonly "tools.zoomIn": "Zoom in";
272
+ readonly "tools.zoomOut": "Zoom out";
273
+ readonly "tools.zoomFit": "Fit to width";
274
+ readonly "tools.playPause": "Play or pause";
275
+ readonly "tools.start": "Go to the start";
276
+ readonly "tools.end": "Go to the end";
277
+ readonly "track.rename": "{track}, rename";
278
+ readonly "track.mute": "Mute";
279
+ readonly "track.solo": "Solo";
280
+ readonly "track.gain": "Gain";
281
+ readonly "track.gainValue": "{gain, number} dB";
282
+ readonly "rename.title": "Rename the track";
283
+ readonly "rename.name": "Name";
284
+ readonly "rename.description": "Leave it empty for no name.";
285
+ readonly "rename.save": "Rename";
286
+ readonly "announce.undone": "Undone.";
287
+ readonly "announce.redone": "Redone.";
288
+ readonly "announce.trackAdded": "Track added.";
289
+ readonly "announce.trackRemoved": "{track} removed.";
290
+ readonly "announce.trackMoved": "{track} moved.";
291
+ readonly "announce.muted": "{track} muted.";
292
+ readonly "announce.unmuted": "{track} unmuted.";
293
+ readonly "announce.soloed": "{track} soloed.";
294
+ readonly "announce.unsoloed": "{track} no longer soloed.";
295
+ readonly "announce.split": "Split at {time}.";
296
+ readonly "announce.noClipToSplit": "There's no clip on {track} at the playhead to split.";
297
+ readonly "announce.clipDeleted": "Clip deleted.";
298
+ readonly "announce.clipMovedTo": "Clip moved to {track}.";
299
+ readonly "announce.trimmed": "The clip is now {time} to {end}.";
300
+ readonly "announce.noRoom": "There's no room for the clip there.";
301
+ readonly "announce.refused": "That edit isn't possible.";
302
+ readonly "announce.selected": "Selected {time} to {end} on {tracks}.";
303
+ readonly "announce.selectionCleared": "Selection cleared.";
304
+ readonly "announce.rangeDeleted": "Deleted {time} to {end} from {tracks}.";
305
+ readonly "announce.rangeDeleted.ripple": "Deleted {time} to {end} from {tracks}. Later clips there moved earlier.";
306
+ readonly "announce.rippleOn": "Ripple on: deleting a range closes the gap.";
307
+ readonly "announce.rippleOff": "Ripple off: deleting a range leaves silence.";
308
+ readonly "announce.nothingInRange": "There's no audio in the selection to change.";
309
+ readonly "announce.rangeGain": "{time} to {end} on {tracks} set to {gain, number} dB.";
310
+ readonly "announce.fadedIn": "Fade in from {time} to {end} on {tracks}.";
311
+ readonly "announce.fadedOut": "Fade out from {time} to {end} on {tracks}.";
312
+ readonly "announce.noRoomForFade": "The clip has no room for that fade: shorten its other fade first.";
313
+ readonly "announce.clipFadedIn": "The clip fades in over {time}. Set its length in the inspector.";
314
+ readonly "announce.clipFadedOut": "The clip fades out over {time}. Set its length in the inspector.";
315
+ readonly "inspector.clip": "Clip on {track}";
316
+ readonly "inspector.recording": "Recording";
317
+ readonly "inspector.selection": "Selection";
318
+ readonly "inspector.selectionGain": "Gain of the selection, in decibels";
319
+ readonly "inspector.start": "Start";
320
+ readonly "inspector.gain": "Gain";
321
+ readonly "inspector.gainExact": "Gain, in decibels";
322
+ readonly "inspector.fadeIn": "Fade in, in seconds";
323
+ readonly "inspector.fadeOut": "Fade out, in seconds";
324
+ readonly "inspector.fadeInCurve": "Fade in curve";
325
+ readonly "inspector.fadeOutCurve": "Fade out curve";
326
+ readonly "inspector.curve.linear": "Linear";
327
+ readonly "inspector.curve.equalPower": "Equal power";
328
+ readonly "inspector.length": "Length";
329
+ readonly "inspector.sampleRate": "Sample rate";
330
+ readonly "inspector.sampleRateValue": "{rate, number} Hz";
331
+ readonly "inspector.tracks": "Tracks";
332
+ readonly "inspector.masterGain": "Master gain";
333
+ readonly "inspector.masterGainExact": "Master gain, in decibels";
334
+ readonly "inspector.channels": "Channels";
335
+ readonly "inspector.mono": "Mono";
336
+ readonly "inspector.stereo": "Stereo";
337
+ readonly "inspector.channelCount": "{count} channels";
338
+ readonly "metadata.title": "Title";
339
+ readonly "metadata.artist": "Artist";
340
+ readonly "metadata.album": "Album";
341
+ readonly "metadata.year": "Year";
342
+ readonly "metadata.comment": "Comment";
343
+ readonly "export.title": "Export";
344
+ readonly "export.description": "Write the recording to a WAV file on your device.";
345
+ readonly "export.summary": "What will be written";
346
+ readonly "export.audio": "{length} long, at {rate, number} Hz, {channels}.";
347
+ readonly "export.muted": "{track} is muted, so it won't be in the file.";
348
+ readonly "export.silenced": "{track} isn't soloed, so it won't be in the file.";
349
+ readonly "export.silent": "{track} won't be heard in the file.";
350
+ readonly "export.nothingHeard": "Every track with audio is muted or silenced by a solo, so there's nothing to export.";
351
+ readonly "export.metadata": "Written to the file: {fields}.";
352
+ readonly "export.noMetadata": "No metadata is written to the file.";
353
+ readonly "export.private": "Only the mix and this metadata are written. Nothing leaves your device.";
354
+ readonly "export.format": "Format";
355
+ readonly "export.formats.pcm16": "16-bit, {size, fileSize}";
356
+ readonly "export.formats.pcm24": "24-bit, {size, fileSize}";
357
+ readonly "export.formats.float32": "32-bit float, {size, fileSize}";
358
+ readonly "export.cancel": "Cancel";
359
+ readonly "export.confirm": "Export";
360
+ readonly "export.progress": "Exporting";
361
+ readonly "export.stop": "Stop";
362
+ readonly "export.done": "Done";
363
+ readonly "export.download": "Download";
364
+ readonly "export.ready": "The WAV file is ready: {size, fileSize}.";
365
+ readonly "export.cancelled": "Export stopped.";
366
+ readonly "export.clipped": "The mix went {db, number} dB over full scale, so {frames, number} frames were clipped.";
367
+ readonly "export.lower": "Lower the master gain by {db, number} dB and export again";
368
+ readonly "export.unavailable": "This editor has nothing to export with.";
369
+ readonly "transport.label": "Playback";
370
+ readonly "transport.play": "Play";
371
+ readonly "transport.pause": "Pause";
372
+ readonly "transport.start": "Back to the start";
373
+ readonly "transport.time": "{position} / {duration}";
374
+ readonly "colorField.swatches": "swatches";
375
+ readonly "dialog.close": "Close";
376
+ readonly "fileDropZone.choose": "Choose a file";
377
+ readonly "fileDropZone.chooseMultiple": "Choose files";
378
+ readonly "fileDropZone.hint": "or drop it here";
379
+ readonly "fileDropZone.hintMultiple": "or drop them here";
380
+ readonly "progress.label": "Progress";
381
+ readonly "reorderableList.moved": "{label} moved to position {position} of {count}";
382
+ readonly "spinner.label": "Loading";
383
+ readonly "errors.INVALID_THEME_TOKEN": "The theme setting {token} has a value that can't be used.";
384
+ readonly "errors.INVALID_THEME_SELECTOR": "The theme can't be applied to the selector {selector}.";
385
+ readonly "errors.INVALID_AUDIO": "This file isn't valid audio, or it's too damaged to open.";
386
+ readonly "errors.UNSUPPORTED_FORMAT": "This audio format isn't supported. Try converting the file to WAV, then open it again.";
387
+ readonly "errors.DECODE_FAILED": "This browser can't play this kind of audio. Try another browser, or convert the file to WAV.";
388
+ readonly "errors.INVALID_COMMAND": "This edit couldn't be made. Please try again.";
389
+ readonly "errors.INVALID_DOCUMENT": "This project is damaged, or it isn't an audio project.";
390
+ readonly "errors.DURATION_TOO_LONG": "This recording is {actual, duration} long, which is over the {maximum, duration} limit.";
391
+ readonly "errors.TOO_MANY_CHANNELS": "This recording has {actual, number} channels, which is over the {maximum, number}-channel limit.";
392
+ readonly "errors.SAMPLE_RATE_TOO_HIGH": "This recording's sample rate is {actual, number} Hz, which is over the {maximum, number} Hz limit.";
393
+ readonly "errors.SESSION_TOO_LARGE": "The open recordings would use {actual, fileSize} of memory, which is over the {maximum, fileSize} limit. Remove a recording, or clear the undo history, and try again.";
394
+ readonly "errors.TOO_MANY_CLIPS": {
395
+ readonly $plural: "maximum";
396
+ } & {
397
+ readonly one: "A recording can have {maximum} clip. Join or delete clips, and try again.";
398
+ readonly other: "A recording can have up to {maximum} clips. Join or delete clips, and try again.";
399
+ };
400
+ readonly "errors.TOO_MANY_TRACKS": {
401
+ readonly $plural: "maximum";
402
+ } & {
403
+ readonly one: "A recording can have {maximum} track. Remove a track, and try again.";
404
+ readonly other: "A recording can have up to {maximum} tracks. Remove a track, and try again.";
405
+ };
406
+ readonly "warnings.maxDuration": "This recording is {actual, duration} long, and may be slow to open and edit.";
407
+ readonly "warnings.maxChannels": "This recording has {actual, number} channels, and may be slow to edit.";
408
+ readonly "warnings.maxSampleRate": "This recording's sample rate is {actual, number} Hz, and it may be slow to edit.";
409
+ readonly "warnings.maxSessionSize": "The open recordings use {actual, fileSize} of memory. Clearing the undo history frees memory.";
410
+ readonly "warnings.maxClips": {
411
+ readonly $plural: "actual";
412
+ } & {
413
+ readonly one: "This recording has {actual} clip. Many clips may be slow to play and export.";
414
+ readonly other: "This recording has {actual} clips. Many clips may be slow to play and export.";
415
+ };
416
+ readonly "warnings.maxTracks": {
417
+ readonly $plural: "actual";
418
+ } & {
419
+ readonly one: "This recording has {actual} track. Many tracks may be slow to play and export.";
420
+ readonly other: "This recording has {actual} tracks. Many tracks may be slow to play and export.";
421
+ };
422
+ readonly "errors.UNSUPPORTED_ENVIRONMENT.autoplay-blocked": "The browser didn't let sound start. Press Play to start it.";
423
+ readonly "errors.DURATION_TOO_LONG.plan-too-long": "This would make the recording {actual, duration} long, which is over the {maximum, duration} limit.";
424
+ readonly "warnings.truncated": "This recording looks incomplete, perhaps from an interrupted recording or download. It opened with the audio it holds.";
425
+ readonly "errors.UNKNOWN": "Something went wrong. Please try again.";
426
+ readonly "errors.ABORTED": "The operation was cancelled.";
427
+ readonly "errors.TIMEOUT": "The operation took too long and was stopped.";
428
+ readonly "errors.WORKER_START_FAILED": "The file processor couldn't start. Reload the page and try again.";
429
+ readonly "errors.WORKER_PROTOCOL_MISMATCH": "The file processor is out of date. Reload the page to update it.";
430
+ readonly "errors.WORKER_CRASHED": "The file processor stopped unexpectedly. Please try again.";
431
+ readonly "errors.WORKER_TERMINATED": "The operation was stopped before it finished. Please try again.";
432
+ readonly "errors.WORKER_METHOD_NOT_FOUND": "This operation isn't available. Reload the page and try again.";
433
+ readonly "errors.WORKER_DATA_NOT_CLONEABLE": "Something went wrong while processing the file. Please try again.";
434
+ readonly "errors.UNSUPPORTED_ENVIRONMENT": "This browser doesn't support a feature this tool needs. Update your browser, or try another one.";
435
+ readonly "errors.FILE_TOO_LARGE": "This file is {actual, fileSize}, which is over the {maximum, fileSize} limit.";
436
+ readonly "errors.TOO_MANY_FILES": {
437
+ readonly $plural: "maximum";
438
+ } & {
439
+ readonly one: "You can add {maximum} file at a time.";
440
+ readonly other: "You can add up to {maximum} files at a time.";
441
+ };
442
+ readonly "errors.DECODED_SIZE_TOO_LARGE": "This file expands to more than {maximum, fileSize} when opened, which is over the limit.";
443
+ readonly "errors.PROCESSING_TIME_EXCEEDED": "Processing this file took too long and was stopped.";
444
+ readonly "warnings.maxFileSize": "This file is {actual, fileSize}. Large files may be slow to process.";
445
+ readonly "warnings.maxFiles": "Adding {actual} files at once may be slow.";
446
+ readonly "warnings.maxDecodedSize": "This file is very large once opened and may be slow to process.";
447
+ readonly "warnings.maxProcessingTime": "This is taking longer than usual.";
448
+ readonly "keys.control": "Ctrl";
449
+ readonly "keys.alt": "Alt";
450
+ readonly "keys.shift": "Shift";
451
+ readonly "keys.meta": "Meta";
452
+ readonly "keys.apple.control": "\u2303";
453
+ readonly "keys.apple.alt": "\u2325";
454
+ readonly "keys.apple.shift": "\u21E7";
455
+ readonly "keys.apple.meta": "\u2318";
456
+ readonly "keys.space": "Space";
457
+ readonly "keys.enter": "Enter";
458
+ readonly "keys.escape": "Esc";
459
+ readonly "keys.tab": "Tab";
460
+ readonly "keys.delete": "Delete";
461
+ readonly "keys.backspace": "Backspace";
462
+ readonly "keys.arrowUp": "\u2191";
463
+ readonly "keys.arrowDown": "\u2193";
464
+ readonly "keys.arrowLeft": "\u2190";
465
+ readonly "keys.arrowRight": "\u2192";
466
+ readonly "keys.home": "Home";
467
+ readonly "keys.end": "End";
468
+ readonly "keys.pageUp": "Page Up";
469
+ readonly "keys.pageDown": "Page Down";
470
+ };
471
+
472
+ /**
473
+ * The port for reading audio files: probe a file's headers, decode it, and
474
+ * build its waveform overview (ADR 0001, ADR 0003, ADR 0008). The SDK's own
475
+ * adapter probes and parses in its worker and decodes compressed formats
476
+ * with Web Audio; hosts can pass their own to the editor's `engine` prop, and
477
+ * every implementation must pass the engine's contract tests.
478
+ *
479
+ * The engine doesn't apply the file policy: the session checks the probe
480
+ * against it between `probe` and `decode` (ADR 0004).
481
+ *
482
+ * Failures reject with `AudioError`: `INVALID_AUDIO` for a malformed file,
483
+ * `UNSUPPORTED_FORMAT` for one the probe can't bound, `DECODE_FAILED` when
484
+ * the browser can't decode it, and sdk-core's codes for cancellation and
485
+ * worker failures.
486
+ *
487
+ * @public
488
+ */
489
+ declare interface AudioEngine {
490
+ /**
491
+ * Reads a file's headers and walks its packets, without decoding it. It
492
+ * reads the file through the `Blob`, never all at once.
493
+ */
494
+ probe(file: Blob, options?: AudioCallOptions): Promise<AudioProbe>;
495
+ /**
496
+ * Decodes a probed file at the probe's channel count, and at the probe's
497
+ * sample rate unless `options.sampleRate` asks for another, which the
498
+ * engine converts the audio to. A result longer than the probe's bound
499
+ * plus its tolerance rejects with `INVALID_AUDIO`; a shorter one is
500
+ * returned as it is.
501
+ */
502
+ decode(file: Blob, probe: AudioProbe, options?: AudioDecodeOptions): Promise<DecodedAudio>;
503
+ /**
504
+ * Builds a waveform overview of decoded audio. The audio isn't modified or
505
+ * kept.
506
+ */
507
+ peaks(audio: DecodedAudio, options?: AudioCallOptions): Promise<AudioPeaks>;
508
+ /** Releases the engine and its worker. Pending calls reject, and later calls throw. */
509
+ destroy(): Promise<void>;
510
+ }
511
+
512
+ /**
513
+ * The file an export produces. WAV is the only container so far (ADR 0001).
514
+ *
515
+ * @public
516
+ */
517
+ declare interface AudioExportFormat {
518
+ readonly container: "wav";
519
+ /** Defaults to `pcm16`. */
520
+ readonly sampleFormat?: AudioSampleFormat_2;
521
+ }
522
+
523
+ /**
524
+ * What the export dialog reports when an export finishes: the format, the
525
+ * file's size and what clamping did, with no file name or contents
526
+ * (sdk-core ADR 0012). The element fires it as its `export` event.
527
+ *
528
+ * @public
529
+ */
530
+ export declare interface AudioExportReport {
531
+ readonly sampleFormat: AudioSampleFormat_2;
532
+ /** The file's size in bytes. */
533
+ readonly size: number;
534
+ /** The mix's peak before clamping, in dB relative to full scale. */
535
+ readonly peakDb: number;
536
+ /** How many frames were clamped to full scale. */
537
+ readonly clippedFrames: number;
538
+ }
539
+
540
+ /**
541
+ * A fade at one end of a clip. `frames: 0` is no fade.
542
+ *
543
+ * @public
544
+ */
545
+ declare interface AudioFade {
546
+ readonly frames: number;
547
+ readonly curve: AudioFadeCurve;
548
+ }
549
+
550
+ /**
551
+ * The shape of a fade: `linear` changes the gain at a constant rate, and
552
+ * `equalPower` keeps the perceived loudness steadier, which suits crossfades.
553
+ *
554
+ * @public
555
+ */
556
+ declare type AudioFadeCurve = "linear" | "equalPower";
557
+
558
+ /**
559
+ * A host's `filePolicy`: a new maximum, or `{ maximum, warning }`, for any of
560
+ * the audio SDK's limits. `Infinity` disables a maximum, which removes a
561
+ * protection against hostile files, or disables a warning. Unknown limit
562
+ * names throw `TypeError` when the policy is resolved.
563
+ *
564
+ * @example
565
+ * ```ts
566
+ * // Long recordings: raise the decoded and session sizes together.
567
+ * const filePolicy: AudioFilePolicyOverrides = {
568
+ * maxDecodedSize: 2e9,
569
+ * maxSessionSize: { maximum: 3e9, warning: 1.5e9 },
570
+ * };
571
+ * ```
572
+ *
573
+ * @public
574
+ */
575
+ declare type AudioFilePolicyOverrides = FilePolicyOverrides<AudioLimitDefinitions>;
576
+
577
+ /**
578
+ * A heading level for the editor's headings, below the page's own `h1`.
579
+ *
580
+ * @public
581
+ */
582
+ declare type AudioHeadingLevel = 2 | 3 | 4 | 5 | 6;
583
+
584
+ /**
585
+ * Options for {@link AudioSession.insert}.
586
+ *
587
+ * @public
588
+ */
589
+ declare interface AudioInsertOptions extends AudioOpenOptions {
590
+ /**
591
+ * The key of the track the recording goes on, where it needs free space.
592
+ * Without it, the recording gets a new track of its own, below the
593
+ * others: laying one recording under another is the common case.
594
+ */
595
+ readonly track?: string;
596
+ /** The timeline frame the recording starts on. Defaults to 0. */
597
+ readonly at?: number;
598
+ }
599
+
600
+ /**
601
+ * The type of {@link audioLimitDefinitions}.
602
+ *
603
+ * @public
604
+ */
605
+ declare type AudioLimitDefinitions = typeof audioLimitDefinitions;
606
+
607
+ /**
608
+ * The audio SDK's limit definitions: sdk-core's core limits with audio
609
+ * defaults, plus six for audio (ADR 0004, docs/adr/0006).
610
+ *
611
+ * | Limit | Code | Default maximum | Default warning |
612
+ * |---|---|---|---|
613
+ * | `maxFileSize` | `FILE_TOO_LARGE` | 1 GB | 250 MB |
614
+ * | `maxFiles` | `TOO_MANY_FILES` | 20 | none |
615
+ * | `maxDecodedSize` | `DECODED_SIZE_TOO_LARGE` | 1 GB | 400 MB |
616
+ * | `maxProcessingTime` | `PROCESSING_TIME_EXCEEDED` | 120 s | none |
617
+ * | `maxDuration` | `DURATION_TOO_LONG` | 3 hours | 1 hour |
618
+ * | `maxChannels` | `TOO_MANY_CHANNELS` | 8 | none |
619
+ * | `maxSampleRate` | `SAMPLE_RATE_TOO_HIGH` | 192 kHz | none |
620
+ * | `maxSessionSize` | `SESSION_TOO_LARGE` | 1.5 GB | 750 MB |
621
+ * | `maxClips` | `TOO_MANY_CLIPS` | 2,000 | none |
622
+ * | `maxTracks` | `TOO_MANY_TRACKS` | 16 | none |
623
+ *
624
+ * Sizes are decimal: 1 MB is 1,000,000 bytes. Decoded sizes count 32-bit
625
+ * floats: frames × channels × 4 bytes. `maxDuration` is in milliseconds, and
626
+ * `maxSampleRate` is in hertz. `maxDuration` bounds each file, and the plan's
627
+ * length too: positions are free, so no file's limit keeps a clip from being
628
+ * placed hours in. `maxClips` counts the clips of every track together.
629
+ *
630
+ * @public
631
+ */
632
+ declare const audioLimitDefinitions: {
633
+ readonly maxFileSize: {
634
+ readonly default: 1000000000;
635
+ readonly warning: 250000000;
636
+ readonly code: "FILE_TOO_LARGE";
637
+ readonly unit: "bytes";
638
+ };
639
+ readonly maxDecodedSize: {
640
+ readonly default: 1000000000;
641
+ readonly warning: 400000000;
642
+ readonly code: "DECODED_SIZE_TOO_LARGE";
643
+ readonly unit: "bytes";
644
+ };
645
+ readonly maxDuration: {
646
+ readonly code: "DURATION_TOO_LONG";
647
+ readonly unit: "milliseconds";
648
+ readonly default: number;
649
+ readonly warning: number;
650
+ };
651
+ readonly maxChannels: {
652
+ readonly code: "TOO_MANY_CHANNELS";
653
+ readonly unit: "count";
654
+ readonly default: 8;
655
+ };
656
+ readonly maxSampleRate: {
657
+ readonly code: "SAMPLE_RATE_TOO_HIGH";
658
+ readonly unit: "hertz";
659
+ readonly default: 192000;
660
+ };
661
+ readonly maxSessionSize: {
662
+ readonly code: "SESSION_TOO_LARGE";
663
+ readonly unit: "bytes";
664
+ readonly default: 1500000000;
665
+ readonly warning: 750000000;
666
+ };
667
+ readonly maxClips: {
668
+ readonly code: "TOO_MANY_CLIPS";
669
+ readonly unit: "count";
670
+ readonly default: 2000;
671
+ };
672
+ readonly maxTracks: {
673
+ readonly code: "TOO_MANY_TRACKS";
674
+ readonly unit: "count";
675
+ readonly default: 16;
676
+ };
677
+ readonly maxFiles: {
678
+ readonly code: "TOO_MANY_FILES";
679
+ readonly unit: "count";
680
+ readonly default: 20;
681
+ };
682
+ readonly maxProcessingTime: {
683
+ readonly code: "PROCESSING_TIME_EXCEEDED";
684
+ readonly unit: "milliseconds";
685
+ readonly default: 120000;
686
+ };
687
+ };
688
+
689
+ /**
690
+ * Metadata that export writes into the file (ADR 0001).
691
+ *
692
+ * @public
693
+ */
694
+ declare interface AudioMetadata {
695
+ readonly title: string;
696
+ readonly artist: string;
697
+ readonly album: string;
698
+ readonly year: string;
699
+ readonly comment: string;
700
+ }
701
+
702
+ /**
703
+ * Options for {@link AudioSession.insert}.
704
+ *
705
+ * @public
706
+ */
707
+ declare interface AudioOpenOptions extends AudioProgressOptions {
708
+ /**
709
+ * A name for the recording, to show people, such as its file's. It wins
710
+ * over a `File`'s own name, which is used without it. It's cleaned as
711
+ * pdf-sdk ADR 0009 decides, and kept on the source in `snapshot.sources`,
712
+ * never in events, the plan or a document.
713
+ */
714
+ readonly name?: string;
715
+ }
716
+
717
+ /**
718
+ * The port for playback (ADR 0002, ADR 0003, ADR 0008). Playback is a
719
+ * function of the plan and the playhead: loading a changed plan or seeking
720
+ * while playing reschedules from the current position. The SDK's own
721
+ * adapter plays through Web Audio; tests use a fake with a manual clock.
722
+ *
723
+ * Positions are frames on the plan's timeline, from 0 to the plan's length.
724
+ *
725
+ * @public
726
+ */
727
+ declare interface AudioOutput {
728
+ getSnapshot(): AudioOutputSnapshot;
729
+ /**
730
+ * Calls the listener after every change of state, and whenever the
731
+ * playhead jumps, but not as it moves while playing. Returns a function
732
+ * that unsubscribes. Like every method here, it works detached from the
733
+ * object.
734
+ */
735
+ subscribe(listener: () => void): () => void;
736
+ /** The playhead, a whole number of frames, read from the audio clock while playing. */
737
+ position(): number;
738
+ /**
739
+ * Sets what plays: the plan and the decoded sources its clips refer to.
740
+ * While playing, playback continues from the current position with the
741
+ * new plan. A playhead past the new plan's end moves to its end.
742
+ */
743
+ load(plan: AudioPlan, sources: ReadonlyMap<string, DecodedAudio>): void;
744
+ /**
745
+ * Plays from the playhead, or from the start when the playhead is at the
746
+ * end. The first call may need a user gesture, as browsers' autoplay rules
747
+ * require. When playback reaches the end, the state becomes `stopped` and
748
+ * the playhead stays at the end.
749
+ */
750
+ play(): Promise<void>;
751
+ /** Pauses, keeping the playhead. */
752
+ pause(): void;
753
+ /** Stops, and moves the playhead to the start. */
754
+ stop(): void;
755
+ /** Moves the playhead, clamped to the plan. While playing, playback continues from there. */
756
+ seek(frame: number): void;
757
+ /** Stops playback and releases the audio device. Later calls throw. */
758
+ destroy(): Promise<void>;
759
+ }
760
+
761
+ /**
762
+ * The output's state, for `useSyncExternalStore`. A new object on every
763
+ * change of state, and whenever the playhead jumps: a seek, a stop, or a
764
+ * plan that moves it. The playhead isn't in it, because it changes on every
765
+ * audio frame (ADR 0003); read it with {@link AudioOutput.position}, or
766
+ * follow it with `watchPlayhead`.
767
+ *
768
+ * @public
769
+ */
770
+ declare interface AudioOutputSnapshot {
771
+ readonly state: AudioOutputState;
772
+ }
773
+
774
+ /**
775
+ * Whether the output is playing.
776
+ *
777
+ * @public
778
+ */
779
+ declare type AudioOutputState = "stopped" | "playing" | "paused";
780
+
781
+ /**
782
+ * One level of a waveform overview: the lowest and highest sample of each
783
+ * bucket of frames, per channel.
784
+ *
785
+ * @public
786
+ */
787
+ declare interface AudioPeakLevel {
788
+ /** How many frames each bucket covers. */
789
+ readonly framesPerBucket: number;
790
+ /** For each channel, the minimum and maximum sample of each bucket. */
791
+ readonly channels: readonly {
792
+ readonly min: Float32Array;
793
+ readonly max: Float32Array;
794
+ }[];
795
+ }
796
+
797
+ /**
798
+ * A source's waveform overview, a min/max pyramid at several zoom levels,
799
+ * computed once so that drawing the waveform never scans samples (ADR 0002).
800
+ * Levels are ordered from the finest to the coarsest.
801
+ *
802
+ * @public
803
+ */
804
+ declare interface AudioPeaks {
805
+ readonly levels: readonly AudioPeakLevel[];
806
+ }
807
+
808
+ /**
809
+ * The session's document (docs/adr/0003, docs/adr/0006): tracks of clips
810
+ * positioned in time, over immutable sources, mixed on playback and export,
811
+ * with the metadata. Every position and length is a whole number of frames
812
+ * at `sampleRate`.
813
+ *
814
+ * @public
815
+ */
816
+ declare interface AudioPlan {
817
+ /** The session's sample rate, from its first source. */
818
+ readonly sampleRate: number;
819
+ /** The session's channel count: its first source's, raised by a wider one. */
820
+ readonly channels: number;
821
+ /** The master gain in decibels, applied to the mix. */
822
+ readonly gainDb: number;
823
+ /** From top to bottom. A plan always has at least one. */
824
+ readonly tracks: readonly AudioTrack[];
825
+ readonly metadata: AudioMetadata;
826
+ }
827
+
828
+ /**
829
+ * What the probe learned about a file before anything decodes it (ADR 0001,
830
+ * ADR 0004). Limits are checked against it.
831
+ *
832
+ * @public
833
+ */
834
+ declare interface AudioProbe {
835
+ readonly container: AudioContainer;
836
+ readonly codec: AudioCodec;
837
+ /** The sample rate the decoder will output, which can differ from the header's, as for Opus. */
838
+ readonly sampleRate: number;
839
+ /** The channel count the decoder will output, which can differ from the header's. */
840
+ readonly channels: number;
841
+ /**
842
+ * The most frames the decoder can output, at {@link AudioProbe.sampleRate}
843
+ * and {@link AudioProbe.channels}: the exact length of an uncompressed
844
+ * file, or the sum over every packet of a compressed one, never a count
845
+ * declared in a header. A packet that could decode to more channels, or
846
+ * at a lower rate that's then resampled, counts as the frames that cover
847
+ * it, so `frameBound × channels × 4` bounds the decoded bytes.
848
+ */
849
+ readonly frameBound: number;
850
+ /**
851
+ * The expected length in frames: a header's count when it's within
852
+ * {@link AudioProbe.frameBound}, otherwise the bound itself.
853
+ */
854
+ readonly expectedFrames: number;
855
+ /**
856
+ * For a truncated uncompressed file, as from an interrupted recording or
857
+ * download, the frames its header declares. The file opens with the
858
+ * frames it holds, which are fewer; hosts can say that it's incomplete.
859
+ * Compressed files whose headers claim more than their packets carry fail
860
+ * instead (docs/adr/0001).
861
+ */
862
+ readonly declaredFrames?: number;
863
+ /**
864
+ * How many frames beyond {@link AudioProbe.frameBound} a decoder may
865
+ * legitimately return, such as one or two codec frames for encoder delay,
866
+ * priming or pre-skip. A longer result fails with `INVALID_AUDIO`.
867
+ */
868
+ readonly frameTolerance: number;
869
+ }
870
+
871
+ /**
872
+ * The port for exporting: mix a plan's audible tracks, with their clips'
873
+ * gain and fades, and encode the result (ADR 0001, ADR 0003, ADR 0008). The SDK's own
874
+ * adapter renders and encodes in its worker, block by block; hosts can pass
875
+ * their own to the editor's `processor` prop, and every implementation must
876
+ * pass the processor's contract tests.
877
+ *
878
+ * Failures reject with `AudioError` for cancellation and worker failures,
879
+ * `TypeError` for a clip whose source isn't in the job, and `RangeError` for
880
+ * a clip outside its source.
881
+ *
882
+ * @public
883
+ */
884
+ declare interface AudioProcessor {
885
+ /**
886
+ * Mixes and encodes a plan, up to where its last audible clip ends. Every
887
+ * sample is clamped to full scale before it's quantised, so a mix above
888
+ * full scale clips rather than wrapping around, and the result says how
889
+ * far over it went. The sources aren't modified.
890
+ */
891
+ render(job: AudioRenderJob, options?: AudioProgressOptions): Promise<AudioRenderResult>;
892
+ /** Releases the processor and its worker. Pending calls reject, and later calls throw. */
893
+ destroy(): Promise<void>;
894
+ }
895
+
896
+ /**
897
+ * Options for long calls, which report how far they've got.
898
+ *
899
+ * @public
900
+ */
901
+ declare interface AudioProgressOptions extends AudioCallOptions {
902
+ /**
903
+ * Called with the fraction done, from 0 to 1. It only moves forward, and
904
+ * it's called with 1 before the call resolves.
905
+ */
906
+ readonly onProgress?: (fraction: number) => void;
907
+ }
908
+
909
+ /**
910
+ * One export: a plan, the decoded sources its clips refer to, and the
911
+ * output format. The plan's metadata goes into the file.
912
+ *
913
+ * @public
914
+ */
915
+ declare interface AudioRenderJob {
916
+ readonly plan: AudioPlan;
917
+ /** The decoded sources, by id. Every clip's source must be here. */
918
+ readonly sources: ReadonlyMap<string, DecodedAudio>;
919
+ readonly format: AudioExportFormat;
920
+ }
921
+
922
+ /**
923
+ * What an export gives: the file, and what clamping did to the mix
924
+ * (docs/adr/0006). A mix of full-scale tracks goes over full scale; export
925
+ * clamps it rather than changing levels nobody asked to change, and says so
926
+ * here, so an editor can offer to lower the master gain.
927
+ *
928
+ * @public
929
+ */
930
+ declare interface AudioRenderResult {
931
+ /** The encoded file. */
932
+ readonly blob: Blob;
933
+ /**
934
+ * The mix's peak before clamping, in decibels relative to full scale:
935
+ * above 0 means it clipped, by that much. `-Infinity` for silence.
936
+ */
937
+ readonly peakDb: number;
938
+ /** How many frames had a sample over full scale, which was clamped. */
939
+ readonly clippedFrames: number;
940
+ }
941
+
942
+ /**
943
+ * How samples are stored in an exported WAV file (ADR 0001).
944
+ *
945
+ * @public
946
+ */
947
+ declare type AudioSampleFormat_2 = "pcm16" | "pcm24" | "float32";
948
+
949
+ /**
950
+ * Options for {@link AudioSession.export}.
951
+ *
952
+ * @public
953
+ */
954
+ declare interface AudioSessionExportOptions extends AudioProgressOptions {
955
+ /** The file to write. Defaults to 16-bit PCM WAV. */
956
+ readonly format?: AudioExportFormat;
957
+ }
958
+
959
+ /**
960
+ * One track: clips in time order that never overlap, with the track's
961
+ * name, gain, mute and solo (docs/adr/0006).
962
+ *
963
+ * @public
964
+ */
965
+ declare interface AudioTrack {
966
+ /** Stable across edits. Tracks and clips share one namespace of keys. */
967
+ readonly key: string;
968
+ /**
969
+ * The name people gave it, at most {@link MAX_TRACK_NAME_LENGTH} code
970
+ * points. Empty means none, and an editor shows "Track 2". It's
971
+ * untrusted text: render it as text, never as HTML.
972
+ */
973
+ readonly name: string;
974
+ /** The track's gain in decibels. */
975
+ readonly gainDb: number;
976
+ readonly muted: boolean;
977
+ readonly soloed: boolean;
978
+ /** Sorted by `at`, each ending at or before the next one starts. */
979
+ readonly clips: readonly AudioClip[];
980
+ }
981
+
982
+ /**
983
+ * Decoded audio, as 32-bit float samples per channel. A Web Audio
984
+ * `AudioBuffer` is one, and tests can supply their own.
985
+ *
986
+ * @public
987
+ */
988
+ declare interface DecodedAudio {
989
+ readonly sampleRate: number;
990
+ /** The length in frames. */
991
+ readonly length: number;
992
+ readonly numberOfChannels: number;
993
+ /** The samples of one channel. The caller must not modify them. */
994
+ getChannelData(channel: number): Float32Array;
995
+ }
996
+
997
+ /**
998
+ * Registers `<hm-audio-editor>`, or the tag you name, and returns its class
999
+ * (docs/adr/0005, sdk-core ADR 0040), as image-sdk's element does: the
1000
+ * attributes `theme`, `locale` and `tools`; the properties `file`,
1001
+ * `fileName`, `headingLevel`, `filePolicy`, `assetsUrl`, `messages`,
1002
+ * `engine`, `processor` and `output`; the methods `open`, `insert`,
1003
+ * `export`, `undo`, `redo`, `play`, `pause` and `seek`; and the events
1004
+ * `hm-audio-editor-change`, `-event`, `-export` and `-error`. Calling it
1005
+ * again returns the same class.
1006
+ *
1007
+ * @example
1008
+ * ```ts
1009
+ * import { defineAudioEditorElement } from "@hussmartinez/audio-sdk/element";
1010
+ *
1011
+ * defineAudioEditorElement();
1012
+ * const editor = document.querySelector("hm-audio-editor");
1013
+ * editor.file = file;
1014
+ * editor.addEventListener("hm-audio-editor-change", (event) => save(event.detail));
1015
+ * ```
1016
+ *
1017
+ * @public
1018
+ */
1019
+ export declare const defineAudioEditorElement: EditorElementDefine<Partial<AudioEditorElementProps>, AudioEditorElementMethods>;
1020
+
12
1021
  export { }