visual-song 0.13.0 → 0.13.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.
Files changed (3) hide show
  1. package/dist/index.d.ts +15 -10
  2. package/dist/index.js +281 -228
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import * as react from 'react';
2
+ import { PropsWithChildren } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
4
 
3
5
  declare enum EasingType {
4
6
  Linear = 0,
@@ -27,20 +29,24 @@ declare enum EasingType {
27
29
  OutBounce = 23,
28
30
  InOutBounce = 24
29
31
  }
30
- type VisualSongRef = {
31
- IsInitialized(): boolean;
32
- loadAudioFile(file: File): void;
33
- resumeMainLoop(): void;
34
- pauseMainLoop(): void;
32
+ declare function VisualSongProvider({ children }: PropsWithChildren<{}>): react_jsx_runtime.JSX.Element;
33
+ type VisualSongAudioRef = {
35
34
  play(): void;
36
35
  pause(): void;
37
36
  stop(): void;
38
- setCurrentTime(time: number): void;
39
37
  getCurrentTime(): number;
40
- getAudioDuration(): number;
38
+ setCurrentTime(time: number): void;
41
39
  getIsPlay(): boolean;
40
+ getAudioDuration(): number;
41
+ loadAudioFile(file: File): void;
42
42
  getLoop(): boolean;
43
43
  setLoop(loop: boolean): void;
44
+ };
45
+ declare function useVisualSongAudio(file?: File): VisualSongAudioRef;
46
+ type VisualSongRef = {
47
+ IsInitialized(): boolean;
48
+ resumeMainLoop(): void;
49
+ pauseMainLoop(): void;
44
50
  getBackgroundColor(): Float32Array;
45
51
  setBackgroundColor(color: Float32Array): void;
46
52
  setVertexShader(shader: string): boolean;
@@ -63,10 +69,9 @@ type Props = {
63
69
  vertexShader?: string;
64
70
  primitiveMode?: number;
65
71
  vertexCount?: number;
66
- audioFile?: File | null;
67
72
  initializedCallback?: () => void;
68
73
  };
69
74
  declare const VisualSong: react.ForwardRefExoticComponent<Props & react.RefAttributes<VisualSongRef>>;
70
75
 
71
- export { EasingType, VisualSong, VisualSong as default };
72
- export type { VisualSongRef };
76
+ export { EasingType, VisualSong, VisualSongProvider, useVisualSongAudio };
77
+ export type { VisualSongAudioRef, VisualSongRef };