@meersagor/wavesurfer-vue 1.0.0 → 2.0.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/README.md +253 -80
- package/dist/@meersagor-wavesurfer-vue.cjs +75 -1
- package/dist/@meersagor-wavesurfer-vue.js +2920 -207
- package/dist/src/core/index.d.ts +5 -0
- package/dist/src/{composables → core}/useWaveSurferInstance.d.ts +8 -2
- package/dist/src/core/useWaveSurferPlugin.d.ts +1019 -0
- package/dist/src/index.d.ts +3 -3
- package/dist/src/plugins/index.d.ts +23 -0
- package/dist/src/plugins/useWaveSurferEnvelope.d.ts +1084 -0
- package/dist/src/plugins/useWaveSurferHover.d.ts +1060 -0
- package/dist/src/plugins/useWaveSurferMinimap.d.ts +1060 -0
- package/dist/src/plugins/useWaveSurferRecorder.d.ts +1126 -0
- package/dist/src/plugins/useWaveSurferRegions.d.ts +1075 -0
- package/dist/src/plugins/useWaveSurferSpectrogram.d.ts +1072 -0
- package/dist/src/plugins/useWaveSurferTimeline.d.ts +1060 -0
- package/dist/src/{composables/useWaveSurferRecorder.d.ts → plugins/useWaveSurferZoom.d.ts} +69 -56
- package/dist/src/types/index.d.ts +2 -2
- package/package.json +25 -7
- /package/dist/src/{composables → core}/useWaveSurfer.d.ts +0 -0
- /package/dist/src/{composables → core}/useWaveSurferState.d.ts +0 -0
|
@@ -1,7 +1,44 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { default as ZoomPlugin } from 'wavesurfer.js/dist/plugins/zoom.js';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
import { default as WaveSurfer } from 'wavesurfer.js';
|
|
4
|
+
import { ZoomPluginOptions } from 'wavesurfer.js/dist/plugins/zoom';
|
|
5
|
+
export interface UseWaveSurferZoomOptions {
|
|
6
|
+
waveSurfer: Ref<WaveSurfer | null>;
|
|
7
|
+
zoomOptions?: ZoomPluginOptions;
|
|
8
|
+
}
|
|
9
|
+
export interface UseWaveSurferZoomStandaloneOptions {
|
|
10
|
+
containerRef: Ref<HTMLElement | null>;
|
|
11
|
+
options: any;
|
|
12
|
+
zoomOptions?: ZoomPluginOptions;
|
|
13
|
+
}
|
|
14
|
+
export declare const useWaveSurferZoom: ({ waveSurfer, zoomOptions }: UseWaveSurferZoomOptions) => {
|
|
15
|
+
zoomPlugin: Ref<{
|
|
16
|
+
onInit: () => void;
|
|
17
|
+
destroy: () => void;
|
|
18
|
+
_init: (wavesurfer: WaveSurfer) => void;
|
|
19
|
+
on: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void, options?: {
|
|
20
|
+
once?: boolean;
|
|
21
|
+
}) => () => void;
|
|
22
|
+
un: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void) => void;
|
|
23
|
+
once: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void) => () => void;
|
|
24
|
+
unAll: () => void;
|
|
25
|
+
} | null, ZoomPlugin | {
|
|
26
|
+
onInit: () => void;
|
|
27
|
+
destroy: () => void;
|
|
28
|
+
_init: (wavesurfer: WaveSurfer) => void;
|
|
29
|
+
on: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void, options?: {
|
|
30
|
+
once?: boolean;
|
|
31
|
+
}) => () => void;
|
|
32
|
+
un: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void) => void;
|
|
33
|
+
once: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void) => () => void;
|
|
34
|
+
unAll: () => void;
|
|
35
|
+
} | null>;
|
|
36
|
+
zoomIn: () => void;
|
|
37
|
+
zoomOut: () => void;
|
|
38
|
+
setZoom: (minPxPerSec: number) => void;
|
|
39
|
+
};
|
|
40
|
+
export declare const useWaveSurferZoomStandalone: ({ containerRef, options, zoomOptions }: UseWaveSurferZoomStandaloneOptions) => {
|
|
41
|
+
waveSurfer: Ref<{
|
|
5
42
|
options: {
|
|
6
43
|
container: HTMLElement | string;
|
|
7
44
|
height?: (number | "auto") | undefined;
|
|
@@ -183,7 +220,7 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
183
220
|
splitChannels?: any[] | undefined;
|
|
184
221
|
normalize?: boolean | undefined;
|
|
185
222
|
plugins?: {
|
|
186
|
-
_init: (wavesurfer:
|
|
223
|
+
_init: (wavesurfer: WaveSurfer) => void;
|
|
187
224
|
destroy: () => void;
|
|
188
225
|
on: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void, options?: {
|
|
189
226
|
once?: boolean;
|
|
@@ -313,11 +350,12 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
313
350
|
} | undefined;
|
|
314
351
|
backend?: ("WebAudio" | "MediaElement") | undefined;
|
|
315
352
|
cspNonce?: string | undefined;
|
|
353
|
+
blobMimeType?: string | undefined;
|
|
316
354
|
overlay?: boolean | undefined;
|
|
317
355
|
}[] | undefined;
|
|
318
356
|
normalize?: boolean | undefined;
|
|
319
357
|
plugins?: {
|
|
320
|
-
_init: (wavesurfer:
|
|
358
|
+
_init: (wavesurfer: WaveSurfer) => void;
|
|
321
359
|
destroy: () => void;
|
|
322
360
|
on: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void, options?: {
|
|
323
361
|
once?: boolean;
|
|
@@ -447,9 +485,11 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
447
485
|
} | undefined;
|
|
448
486
|
backend?: ("WebAudio" | "MediaElement") | undefined;
|
|
449
487
|
cspNonce?: string | undefined;
|
|
488
|
+
blobMimeType?: string | undefined;
|
|
450
489
|
};
|
|
451
490
|
setOptions: (options: Partial<import('wavesurfer.js').WaveSurferOptions>) => void;
|
|
452
491
|
registerPlugin: <T extends import('wavesurfer.js/dist/base-plugin').GenericPlugin>(plugin: T) => T;
|
|
492
|
+
unregisterPlugin: (plugin: import('wavesurfer.js/dist/base-plugin').GenericPlugin) => void;
|
|
453
493
|
getWrapper: () => HTMLElement;
|
|
454
494
|
getWidth: () => number;
|
|
455
495
|
getScroll: () => number;
|
|
@@ -469,6 +509,7 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
469
509
|
toggleInteraction: (isInteractive: boolean) => void;
|
|
470
510
|
setTime: (time: number) => void;
|
|
471
511
|
seekTo: (progress: number) => void;
|
|
512
|
+
play: (start?: number, end?: number) => Promise<void>;
|
|
472
513
|
playPause: () => Promise<void>;
|
|
473
514
|
stop: () => void;
|
|
474
515
|
skip: (seconds: number) => void;
|
|
@@ -479,7 +520,6 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
479
520
|
(format: string, quality: number, type: "blob"): Promise<Blob[]>;
|
|
480
521
|
};
|
|
481
522
|
destroy: () => void;
|
|
482
|
-
play: () => Promise<void>;
|
|
483
523
|
pause: () => void;
|
|
484
524
|
isPlaying: () => boolean;
|
|
485
525
|
getCurrentTime: () => number;
|
|
@@ -498,7 +538,7 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
498
538
|
un: <EventName extends keyof import('wavesurfer.js').WaveSurferEvents>(event: EventName, listener: (...args: import('wavesurfer.js').WaveSurferEvents[EventName]) => void) => void;
|
|
499
539
|
once: <EventName extends keyof import('wavesurfer.js').WaveSurferEvents>(event: EventName, listener: (...args: import('wavesurfer.js').WaveSurferEvents[EventName]) => void) => () => void;
|
|
500
540
|
unAll: () => void;
|
|
501
|
-
} | null,
|
|
541
|
+
} | null, WaveSurfer | {
|
|
502
542
|
options: {
|
|
503
543
|
container: HTMLElement | string;
|
|
504
544
|
height?: (number | "auto") | undefined;
|
|
@@ -680,7 +720,7 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
680
720
|
splitChannels?: any[] | undefined;
|
|
681
721
|
normalize?: boolean | undefined;
|
|
682
722
|
plugins?: {
|
|
683
|
-
_init: (wavesurfer:
|
|
723
|
+
_init: (wavesurfer: WaveSurfer) => void;
|
|
684
724
|
destroy: () => void;
|
|
685
725
|
on: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void, options?: {
|
|
686
726
|
once?: boolean;
|
|
@@ -810,11 +850,12 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
810
850
|
} | undefined;
|
|
811
851
|
backend?: ("WebAudio" | "MediaElement") | undefined;
|
|
812
852
|
cspNonce?: string | undefined;
|
|
853
|
+
blobMimeType?: string | undefined;
|
|
813
854
|
overlay?: boolean | undefined;
|
|
814
855
|
}[] | undefined;
|
|
815
856
|
normalize?: boolean | undefined;
|
|
816
857
|
plugins?: {
|
|
817
|
-
_init: (wavesurfer:
|
|
858
|
+
_init: (wavesurfer: WaveSurfer) => void;
|
|
818
859
|
destroy: () => void;
|
|
819
860
|
on: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void, options?: {
|
|
820
861
|
once?: boolean;
|
|
@@ -944,9 +985,11 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
944
985
|
} | undefined;
|
|
945
986
|
backend?: ("WebAudio" | "MediaElement") | undefined;
|
|
946
987
|
cspNonce?: string | undefined;
|
|
988
|
+
blobMimeType?: string | undefined;
|
|
947
989
|
};
|
|
948
990
|
setOptions: (options: Partial<import('wavesurfer.js').WaveSurferOptions>) => void;
|
|
949
991
|
registerPlugin: <T extends import('wavesurfer.js/dist/base-plugin').GenericPlugin>(plugin: T) => T;
|
|
992
|
+
unregisterPlugin: (plugin: import('wavesurfer.js/dist/base-plugin').GenericPlugin) => void;
|
|
950
993
|
getWrapper: () => HTMLElement;
|
|
951
994
|
getWidth: () => number;
|
|
952
995
|
getScroll: () => number;
|
|
@@ -966,6 +1009,7 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
966
1009
|
toggleInteraction: (isInteractive: boolean) => void;
|
|
967
1010
|
setTime: (time: number) => void;
|
|
968
1011
|
seekTo: (progress: number) => void;
|
|
1012
|
+
play: (start?: number, end?: number) => Promise<void>;
|
|
969
1013
|
playPause: () => Promise<void>;
|
|
970
1014
|
stop: () => void;
|
|
971
1015
|
skip: (seconds: number) => void;
|
|
@@ -976,7 +1020,6 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
976
1020
|
(format: string, quality: number, type: "blob"): Promise<Blob[]>;
|
|
977
1021
|
};
|
|
978
1022
|
destroy: () => void;
|
|
979
|
-
play: () => Promise<void>;
|
|
980
1023
|
pause: () => void;
|
|
981
1024
|
isPlaying: () => boolean;
|
|
982
1025
|
getCurrentTime: () => number;
|
|
@@ -996,58 +1039,28 @@ export declare const useWaveSurferRecorder: ({ containerRef, options, recordPlug
|
|
|
996
1039
|
once: <EventName extends keyof import('wavesurfer.js').WaveSurferEvents>(event: EventName, listener: (...args: import('wavesurfer.js').WaveSurferEvents[EventName]) => void) => () => void;
|
|
997
1040
|
unAll: () => void;
|
|
998
1041
|
} | null>;
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
onDestroy: () => void;
|
|
1002
|
-
onEnd: () => void;
|
|
1003
|
-
};
|
|
1004
|
-
startMic: (options?: import('wavesurfer.js/dist/plugins/record.js').RecordPluginDeviceOptions) => Promise<MediaStream>;
|
|
1005
|
-
stopMic: () => void;
|
|
1006
|
-
startRecording: (options?: import('wavesurfer.js/dist/plugins/record.js').RecordPluginDeviceOptions) => Promise<void>;
|
|
1007
|
-
getDuration: () => number;
|
|
1008
|
-
isRecording: () => boolean;
|
|
1009
|
-
isPaused: () => boolean;
|
|
1010
|
-
isActive: () => boolean;
|
|
1011
|
-
stopRecording: () => void;
|
|
1012
|
-
pauseRecording: () => void;
|
|
1013
|
-
resumeRecording: () => void;
|
|
1042
|
+
zoomPlugin: Ref<{
|
|
1043
|
+
onInit: () => void;
|
|
1014
1044
|
destroy: () => void;
|
|
1015
|
-
_init: (wavesurfer:
|
|
1016
|
-
on: <EventName extends "destroy"
|
|
1045
|
+
_init: (wavesurfer: WaveSurfer) => void;
|
|
1046
|
+
on: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void, options?: {
|
|
1017
1047
|
once?: boolean;
|
|
1018
1048
|
}) => () => void;
|
|
1019
|
-
un: <EventName extends "destroy"
|
|
1020
|
-
once: <EventName extends "destroy"
|
|
1049
|
+
un: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void) => void;
|
|
1050
|
+
once: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void) => () => void;
|
|
1021
1051
|
unAll: () => void;
|
|
1022
|
-
} | null,
|
|
1023
|
-
|
|
1024
|
-
onDestroy: () => void;
|
|
1025
|
-
onEnd: () => void;
|
|
1026
|
-
};
|
|
1027
|
-
startMic: (options?: import('wavesurfer.js/dist/plugins/record.js').RecordPluginDeviceOptions) => Promise<MediaStream>;
|
|
1028
|
-
stopMic: () => void;
|
|
1029
|
-
startRecording: (options?: import('wavesurfer.js/dist/plugins/record.js').RecordPluginDeviceOptions) => Promise<void>;
|
|
1030
|
-
getDuration: () => number;
|
|
1031
|
-
isRecording: () => boolean;
|
|
1032
|
-
isPaused: () => boolean;
|
|
1033
|
-
isActive: () => boolean;
|
|
1034
|
-
stopRecording: () => void;
|
|
1035
|
-
pauseRecording: () => void;
|
|
1036
|
-
resumeRecording: () => void;
|
|
1052
|
+
} | null, ZoomPlugin | {
|
|
1053
|
+
onInit: () => void;
|
|
1037
1054
|
destroy: () => void;
|
|
1038
|
-
_init: (wavesurfer:
|
|
1039
|
-
on: <EventName extends "destroy"
|
|
1055
|
+
_init: (wavesurfer: WaveSurfer) => void;
|
|
1056
|
+
on: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void, options?: {
|
|
1040
1057
|
once?: boolean;
|
|
1041
1058
|
}) => () => void;
|
|
1042
|
-
un: <EventName extends "destroy"
|
|
1043
|
-
once: <EventName extends "destroy"
|
|
1059
|
+
un: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void) => void;
|
|
1060
|
+
once: <EventName extends "destroy">(event: EventName, listener: (...args: import('wavesurfer.js/dist/base-plugin').BasePluginEvents[EventName]) => void) => () => void;
|
|
1044
1061
|
unAll: () => void;
|
|
1045
1062
|
} | null>;
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
pauseRecording: () => void;
|
|
1050
|
-
isRecording: import('vue').Ref<boolean, boolean>;
|
|
1051
|
-
isPaused: import('vue').Ref<boolean, boolean>;
|
|
1052
|
-
isPauseResume: import('vue').ComputedRef<boolean>;
|
|
1063
|
+
zoomIn: () => void;
|
|
1064
|
+
zoomOut: () => void;
|
|
1065
|
+
setZoom: (minPxPerSec: number) => void;
|
|
1053
1066
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WaveSurferOptions } from 'wavesurfer.js';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
|
-
import { useWaveSurferInstance } from '../
|
|
4
|
-
import { useWaveSurferState } from '../
|
|
3
|
+
import { useWaveSurferInstance } from '../core/useWaveSurferInstance';
|
|
4
|
+
import { useWaveSurferState } from '../core/useWaveSurferState';
|
|
5
5
|
import { RecordPluginOptions } from 'wavesurfer.js/dist/plugins/record';
|
|
6
6
|
import { ZoomPluginOptions } from 'wavesurfer.js/dist/plugins/zoom';
|
|
7
7
|
import { TimelinePluginOptions } from 'wavesurfer.js/dist/plugins/timeline';
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"author": "Meer Sagor",
|
|
3
3
|
"name": "@meersagor/wavesurfer-vue",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "2.0.1",
|
|
5
|
+
"description": "Vue 3 composables and components for WaveSurfer.js with modular plugin architecture",
|
|
6
6
|
"private": false,
|
|
7
7
|
"type": "module",
|
|
8
8
|
"license": "MIT",
|
|
@@ -24,6 +24,16 @@
|
|
|
24
24
|
"types": "./dist/src/index.d.ts",
|
|
25
25
|
"import": "./dist/@meersagor-wavesurfer-vue.js",
|
|
26
26
|
"require": "./dist/@meersagor-wavesurfer-vue.cjs"
|
|
27
|
+
},
|
|
28
|
+
"./core": {
|
|
29
|
+
"types": "./dist/src/core/index.d.ts",
|
|
30
|
+
"import": "./dist/@meersagor-wavesurfer-vue.js",
|
|
31
|
+
"require": "./dist/@meersagor-wavesurfer-vue.cjs"
|
|
32
|
+
},
|
|
33
|
+
"./plugins": {
|
|
34
|
+
"types": "./dist/src/plugins/index.d.ts",
|
|
35
|
+
"import": "./dist/@meersagor-wavesurfer-vue.js",
|
|
36
|
+
"require": "./dist/@meersagor-wavesurfer-vue.cjs"
|
|
27
37
|
}
|
|
28
38
|
},
|
|
29
39
|
"types": "./dist/src/index.d.ts",
|
|
@@ -34,23 +44,31 @@
|
|
|
34
44
|
"wavesurfer",
|
|
35
45
|
"vue",
|
|
36
46
|
"vue3",
|
|
47
|
+
"composable",
|
|
48
|
+
"plugins",
|
|
49
|
+
"modular",
|
|
37
50
|
"audio",
|
|
38
51
|
"waveform",
|
|
39
|
-
"player"
|
|
52
|
+
"player",
|
|
53
|
+
"recorder",
|
|
54
|
+
"timeline",
|
|
55
|
+
"zoom",
|
|
56
|
+
"minimap"
|
|
40
57
|
],
|
|
41
58
|
"scripts": {
|
|
42
59
|
"build": "vite build",
|
|
43
60
|
"type-check": "vue-tsc --build --force",
|
|
44
61
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
|
45
62
|
"format": "prettier --write src/",
|
|
46
|
-
"link-pack": "(yarn --global unlink '@meersagor/wavesurfer-vue' || true) && yarn --global link"
|
|
63
|
+
"link-pack": "(yarn --global unlink '@meersagor/wavesurfer-vue' || true) && yarn --global link",
|
|
64
|
+
"dev": "vite",
|
|
65
|
+
"preview": "vite preview"
|
|
47
66
|
},
|
|
48
67
|
"dependencies": {
|
|
49
68
|
"vue": "^3.5.12",
|
|
50
|
-
"wavesurfer.js": "^7.
|
|
69
|
+
"wavesurfer.js": "^7.10.1"
|
|
51
70
|
},
|
|
52
71
|
"devDependencies": {
|
|
53
|
-
"@changesets/cli": "^2.27.9",
|
|
54
72
|
"@rushstack/eslint-patch": "^1.10.4",
|
|
55
73
|
"@tsconfig/node18": "^18.2.4",
|
|
56
74
|
"@types/node": "^22.9.0",
|
|
@@ -67,4 +85,4 @@
|
|
|
67
85
|
"vite-plugin-dts": "^4.3.0",
|
|
68
86
|
"vue-tsc": "^2.1.10"
|
|
69
87
|
}
|
|
70
|
-
}
|
|
88
|
+
}
|
|
File without changes
|
|
File without changes
|