@waveform-playlist/browser 6.0.0 → 6.0.2
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.d.ts +68 -41
- package/dist/index.js +80 -80
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2008 -1982
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { Analyser } from 'tone';
|
|
1
2
|
import { BaseContext } from 'tone';
|
|
2
3
|
import { default as default_2 } from 'react';
|
|
3
4
|
import { default as default_3 } from 'waveform-data';
|
|
4
5
|
import { DragEndEvent } from '@dnd-kit/core';
|
|
6
|
+
import { DragMoveEvent } from '@dnd-kit/core';
|
|
7
|
+
import { DragStartEvent } from '@dnd-kit/core';
|
|
5
8
|
import { Fade as Fade_2 } from '@waveform-playlist/core';
|
|
6
9
|
import { Gain } from 'tone';
|
|
10
|
+
import { InputNode } from 'tone';
|
|
7
11
|
import { MediaElementPlayout } from '@waveform-playlist/media-element-playout';
|
|
12
|
+
import { Modifier } from '@dnd-kit/core';
|
|
8
13
|
import { MutableRefObject } from 'react';
|
|
9
14
|
import { Provider } from 'react';
|
|
10
15
|
import react__default from 'react';
|
|
@@ -48,6 +53,32 @@ declare interface AnnotationActionOptions {
|
|
|
48
53
|
[key: string]: unknown;
|
|
49
54
|
}
|
|
50
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Props the browser package passes to the AnnotationBoxesWrapper component.
|
|
58
|
+
* Mirrors what PlaylistVisualization and MediaElementPlaylist actually use.
|
|
59
|
+
*/
|
|
60
|
+
declare interface AnnotationBoxesWrapperIntegrationProps {
|
|
61
|
+
children?: React.ReactNode;
|
|
62
|
+
height?: number;
|
|
63
|
+
width?: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Props the browser package passes to the AnnotationBox component.
|
|
68
|
+
* Mirrors what PlaylistVisualization and MediaElementPlaylist actually use.
|
|
69
|
+
*/
|
|
70
|
+
declare interface AnnotationBoxIntegrationProps {
|
|
71
|
+
annotationId: string;
|
|
72
|
+
annotationIndex: number;
|
|
73
|
+
startPosition: number;
|
|
74
|
+
endPosition: number;
|
|
75
|
+
label?: string;
|
|
76
|
+
color?: string;
|
|
77
|
+
isActive?: boolean;
|
|
78
|
+
onClick?: () => void;
|
|
79
|
+
editable?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
51
82
|
/**
|
|
52
83
|
* Shared annotation types used across waveform-playlist packages
|
|
53
84
|
*/
|
|
@@ -71,9 +102,9 @@ export declare interface AnnotationData {
|
|
|
71
102
|
export declare interface AnnotationIntegration {
|
|
72
103
|
parseAeneas: (data: unknown) => AnnotationData;
|
|
73
104
|
serializeAeneas: (annotation: AnnotationData) => unknown;
|
|
74
|
-
AnnotationText: React.ComponentType<
|
|
75
|
-
AnnotationBox: React.ComponentType<
|
|
76
|
-
AnnotationBoxesWrapper: React.ComponentType<
|
|
105
|
+
AnnotationText: React.ComponentType<AnnotationTextIntegrationProps>;
|
|
106
|
+
AnnotationBox: React.ComponentType<AnnotationBoxIntegrationProps>;
|
|
107
|
+
AnnotationBoxesWrapper: React.ComponentType<AnnotationBoxesWrapperIntegrationProps>;
|
|
77
108
|
ContinuousPlayCheckbox: React.ComponentType<{
|
|
78
109
|
checked: boolean;
|
|
79
110
|
onChange: (checked: boolean) => void;
|
|
@@ -98,6 +129,24 @@ export declare interface AnnotationIntegration {
|
|
|
98
129
|
|
|
99
130
|
export declare const AnnotationIntegrationProvider: Provider<AnnotationIntegration | null>;
|
|
100
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Props the browser package passes to the AnnotationText component.
|
|
134
|
+
* Mirrors what PlaylistAnnotationList and MediaElementAnnotationList actually use.
|
|
135
|
+
*/
|
|
136
|
+
declare interface AnnotationTextIntegrationProps {
|
|
137
|
+
annotations: AnnotationData[];
|
|
138
|
+
activeAnnotationId?: string;
|
|
139
|
+
shouldScrollToActive?: boolean;
|
|
140
|
+
scrollActivePosition?: ScrollLogicalPosition;
|
|
141
|
+
scrollActiveContainer?: 'nearest' | 'all';
|
|
142
|
+
editable?: boolean;
|
|
143
|
+
controls?: AnnotationAction[];
|
|
144
|
+
annotationListConfig?: AnnotationActionOptions;
|
|
145
|
+
height?: number;
|
|
146
|
+
onAnnotationUpdate?: (updatedAnnotations: AnnotationData[]) => void;
|
|
147
|
+
renderAnnotationItem?: (props: RenderAnnotationItemProps) => React.ReactNode;
|
|
148
|
+
}
|
|
149
|
+
|
|
101
150
|
/**
|
|
102
151
|
* Represents a single audio clip on the timeline
|
|
103
152
|
*
|
|
@@ -286,8 +335,8 @@ export declare const ContinuousPlayCheckbox: default_2.FC<{
|
|
|
286
335
|
* Create a chain of effects connected in series
|
|
287
336
|
*/
|
|
288
337
|
export declare function createEffectChain(effects: EffectInstance[]): {
|
|
289
|
-
input:
|
|
290
|
-
output:
|
|
338
|
+
input: ToneAudioNode;
|
|
339
|
+
output: ToneAudioNode;
|
|
291
340
|
dispose: () => void;
|
|
292
341
|
};
|
|
293
342
|
|
|
@@ -360,13 +409,13 @@ export declare interface EffectDefinition {
|
|
|
360
409
|
export declare const effectDefinitions: EffectDefinition[];
|
|
361
410
|
|
|
362
411
|
export declare interface EffectInstance {
|
|
363
|
-
effect:
|
|
412
|
+
effect: ToneAudioNode;
|
|
364
413
|
id: string;
|
|
365
414
|
instanceId: string;
|
|
366
415
|
dispose: () => void;
|
|
367
416
|
setParameter: (name: string, value: number | string | boolean) => void;
|
|
368
417
|
getParameter: (name: string) => number | string | boolean | undefined;
|
|
369
|
-
connect: (destination:
|
|
418
|
+
connect: (destination: InputNode) => void;
|
|
370
419
|
disconnect: () => void;
|
|
371
420
|
}
|
|
372
421
|
|
|
@@ -728,7 +777,7 @@ declare interface MediaElementPlaylistProviderProps {
|
|
|
728
777
|
};
|
|
729
778
|
/** Annotations */
|
|
730
779
|
annotationList?: {
|
|
731
|
-
annotations?:
|
|
780
|
+
annotations?: AnnotationData[];
|
|
732
781
|
isContinuousPlay?: boolean;
|
|
733
782
|
};
|
|
734
783
|
/** Width of waveform bars */
|
|
@@ -957,7 +1006,7 @@ declare interface PlaylistDataContextValue {
|
|
|
957
1006
|
};
|
|
958
1007
|
playoutRef: default_2.RefObject<TonePlayout | null>;
|
|
959
1008
|
samplesPerPixel: number;
|
|
960
|
-
timeFormat:
|
|
1009
|
+
timeFormat: TimeFormat;
|
|
961
1010
|
masterVolume: number;
|
|
962
1011
|
canZoomIn: boolean;
|
|
963
1012
|
canZoomOut: boolean;
|
|
@@ -1383,16 +1432,8 @@ declare interface TrackState_2 {
|
|
|
1383
1432
|
* ```
|
|
1384
1433
|
*/
|
|
1385
1434
|
export declare function useAnnotationDragHandlers({ annotations, onAnnotationsChange, samplesPerPixel, sampleRate, duration, linkEndpoints, }: UseAnnotationDragHandlersOptions): {
|
|
1386
|
-
onDragStart: (event:
|
|
1387
|
-
|
|
1388
|
-
}) => void;
|
|
1389
|
-
onDragMove: (event: {
|
|
1390
|
-
active: any;
|
|
1391
|
-
delta: {
|
|
1392
|
-
x: number;
|
|
1393
|
-
y: number;
|
|
1394
|
-
};
|
|
1395
|
-
}) => void;
|
|
1435
|
+
onDragStart: (event: DragStartEvent) => void;
|
|
1436
|
+
onDragMove: (event: DragMoveEvent) => void;
|
|
1396
1437
|
onDragEnd: () => void;
|
|
1397
1438
|
};
|
|
1398
1439
|
|
|
@@ -1568,24 +1609,10 @@ declare interface UseAudioTracksOptions {
|
|
|
1568
1609
|
* ```
|
|
1569
1610
|
*/
|
|
1570
1611
|
export declare function useClipDragHandlers({ tracks, onTracksChange, samplesPerPixel, sampleRate, }: UseClipDragHandlersOptions): {
|
|
1571
|
-
onDragStart: (event:
|
|
1572
|
-
|
|
1573
|
-
}) => void;
|
|
1574
|
-
onDragMove: (event: {
|
|
1575
|
-
active: any;
|
|
1576
|
-
delta: {
|
|
1577
|
-
x: number;
|
|
1578
|
-
y: number;
|
|
1579
|
-
};
|
|
1580
|
-
}) => void;
|
|
1612
|
+
onDragStart: (event: DragStartEvent) => void;
|
|
1613
|
+
onDragMove: (event: DragMoveEvent) => void;
|
|
1581
1614
|
onDragEnd: (event: DragEndEvent) => void;
|
|
1582
|
-
collisionModifier: (args: {
|
|
1583
|
-
transform: {
|
|
1584
|
-
x: number;
|
|
1585
|
-
y: number;
|
|
1586
|
-
};
|
|
1587
|
-
active: any;
|
|
1588
|
-
}) => {
|
|
1615
|
+
collisionModifier: (args: Parameters<Modifier>[0]) => {
|
|
1589
1616
|
scaleX: number;
|
|
1590
1617
|
scaleY: number;
|
|
1591
1618
|
x: number;
|
|
@@ -1680,7 +1707,7 @@ export declare interface UseDynamicEffectsReturn {
|
|
|
1680
1707
|
* This creates new effect instances that work in the offline AudioContext.
|
|
1681
1708
|
*/
|
|
1682
1709
|
createOfflineEffectsFunction: () => EffectsFunction | undefined;
|
|
1683
|
-
analyserRef: React.RefObject<
|
|
1710
|
+
analyserRef: React.RefObject<Analyser | null>;
|
|
1684
1711
|
}
|
|
1685
1712
|
|
|
1686
1713
|
/**
|
|
@@ -1742,7 +1769,7 @@ declare interface UseKeyboardShortcutsOptions {
|
|
|
1742
1769
|
* For more advanced effects (reverb, delay, filters, etc.), use useDynamicEffects instead.
|
|
1743
1770
|
*/
|
|
1744
1771
|
export declare const useMasterAnalyser: (fftSize?: number) => {
|
|
1745
|
-
analyserRef: MutableRefObject<
|
|
1772
|
+
analyserRef: MutableRefObject<Analyser | null>;
|
|
1746
1773
|
masterEffects: EffectsFunction;
|
|
1747
1774
|
};
|
|
1748
1775
|
|
|
@@ -2018,7 +2045,7 @@ export declare interface WaveformPlaylistContextValue {
|
|
|
2018
2045
|
setTrackVolume: (trackIndex: number, volume: number) => void;
|
|
2019
2046
|
setTrackPan: (trackIndex: number, pan: number) => void;
|
|
2020
2047
|
setSelection: (start: number, end: number) => void;
|
|
2021
|
-
timeFormat:
|
|
2048
|
+
timeFormat: TimeFormat;
|
|
2022
2049
|
setTimeFormat: (format: TimeFormat) => void;
|
|
2023
2050
|
formatTime: (seconds: number) => string;
|
|
2024
2051
|
samplesPerPixel: number;
|
|
@@ -2063,11 +2090,11 @@ declare interface WaveformPlaylistProviderProps {
|
|
|
2063
2090
|
width: number;
|
|
2064
2091
|
};
|
|
2065
2092
|
annotationList?: {
|
|
2066
|
-
annotations?:
|
|
2093
|
+
annotations?: AnnotationData[];
|
|
2067
2094
|
editable?: boolean;
|
|
2068
2095
|
isContinuousPlay?: boolean;
|
|
2069
2096
|
linkEndpoints?: boolean;
|
|
2070
|
-
controls?:
|
|
2097
|
+
controls?: AnnotationAction[];
|
|
2071
2098
|
};
|
|
2072
2099
|
effects?: EffectsFunction;
|
|
2073
2100
|
onReady?: () => void;
|