react-native-waveform-player 0.0.1 → 1.0.0

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 (46) hide show
  1. package/AudioWaveform.podspec +29 -0
  2. package/LICENSE +20 -0
  3. package/README.md +296 -0
  4. package/android/build.gradle +67 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/java/com/audiowaveform/AudioPlayerEngine.kt +353 -0
  7. package/android/src/main/java/com/audiowaveform/AudioWaveformEvent.kt +22 -0
  8. package/android/src/main/java/com/audiowaveform/AudioWaveformPackage.kt +17 -0
  9. package/android/src/main/java/com/audiowaveform/AudioWaveformView.kt +715 -0
  10. package/android/src/main/java/com/audiowaveform/AudioWaveformViewManager.kt +234 -0
  11. package/android/src/main/java/com/audiowaveform/PlayPauseButton.kt +106 -0
  12. package/android/src/main/java/com/audiowaveform/SpeedPillView.kt +70 -0
  13. package/android/src/main/java/com/audiowaveform/WaveformBarsView.kt +358 -0
  14. package/android/src/main/java/com/audiowaveform/WaveformDecoder.kt +240 -0
  15. package/android/src/main/res/drawable/pause_fill.xml +15 -0
  16. package/android/src/main/res/drawable/play_fill.xml +15 -0
  17. package/ios/AudioPlayerEngine.swift +281 -0
  18. package/ios/AudioWaveformView.h +14 -0
  19. package/ios/AudioWaveformView.mm +307 -0
  20. package/ios/AudioWaveformViewImpl.swift +835 -0
  21. package/ios/PlayPauseButton.swift +118 -0
  22. package/ios/SpeedPillView.swift +70 -0
  23. package/ios/WaveformBarsView.swift +327 -0
  24. package/ios/WaveformDecoder.swift +332 -0
  25. package/lib/module/AudioWaveformView.js +8 -0
  26. package/lib/module/AudioWaveformView.js.map +1 -0
  27. package/lib/module/AudioWaveformView.native.js +79 -0
  28. package/lib/module/AudioWaveformView.native.js.map +1 -0
  29. package/lib/module/AudioWaveformViewNativeComponent.ts +95 -0
  30. package/lib/module/index.js +4 -0
  31. package/lib/module/index.js.map +1 -0
  32. package/lib/module/package.json +1 -0
  33. package/lib/typescript/package.json +1 -0
  34. package/lib/typescript/src/AudioWaveformView.d.ts +233 -0
  35. package/lib/typescript/src/AudioWaveformView.d.ts.map +1 -0
  36. package/lib/typescript/src/AudioWaveformView.native.d.ts +335 -0
  37. package/lib/typescript/src/AudioWaveformView.native.d.ts.map +1 -0
  38. package/lib/typescript/src/AudioWaveformViewNativeComponent.d.ts +71 -0
  39. package/lib/typescript/src/AudioWaveformViewNativeComponent.d.ts.map +1 -0
  40. package/lib/typescript/src/index.d.ts +3 -0
  41. package/lib/typescript/src/index.d.ts.map +1 -0
  42. package/package.json +138 -7
  43. package/src/AudioWaveformView.native.tsx +281 -0
  44. package/src/AudioWaveformView.tsx +96 -0
  45. package/src/AudioWaveformViewNativeComponent.ts +95 -0
  46. package/src/index.tsx +13 -0
@@ -0,0 +1,335 @@
1
+ import { type ColorValue, type ViewProps } from 'react-native';
2
+ export type AudioWaveformPlayerState = 'idle' | 'loading' | 'ready' | 'ended' | 'error';
3
+ export type AudioWaveformTimeMode = 'count-up' | 'count-down';
4
+ export type AudioWaveformSource = {
5
+ uri: string;
6
+ };
7
+ export type AudioWaveformPlayerStateEvent = {
8
+ state: AudioWaveformPlayerState;
9
+ isPlaying: boolean;
10
+ speed: number;
11
+ error?: string;
12
+ };
13
+ export type AudioWaveformTimeUpdateEvent = {
14
+ currentTimeMs: number;
15
+ durationMs: number;
16
+ };
17
+ export type AudioWaveformSeekEvent = {
18
+ positionMs: number;
19
+ };
20
+ export type AudioWaveformLoadEvent = {
21
+ durationMs: number;
22
+ };
23
+ export type AudioWaveformLoadErrorEvent = {
24
+ message: string;
25
+ };
26
+ export type AudioWaveformViewProps = Omit<ViewProps, 'children'> & {
27
+ source: AudioWaveformSource;
28
+ /** Pre-computed amplitudes in [0, 1]. When provided, native decode is skipped. */
29
+ samples?: ReadonlyArray<number>;
30
+ /** Highlighted bar color (the "played" portion). */
31
+ playedBarColor?: ColorValue;
32
+ /** Bar color for the not-yet-played portion. */
33
+ unplayedBarColor?: ColorValue;
34
+ /** Bar thickness (default 3). */
35
+ barWidth?: number;
36
+ /** Gap between bars (default 2). */
37
+ barGap?: number;
38
+ /** Bar corner radius (default = barWidth / 2). */
39
+ barRadius?: number;
40
+ /** Force a specific number of bars; default auto from view width. */
41
+ barCount?: number;
42
+ /** Background of the rounded container (default light blue). Has no effect when showBackground={false}. */
43
+ containerBackgroundColor?: ColorValue;
44
+ /** Container corner radius (default 16). Has no effect when showBackground={false}. */
45
+ containerBorderRadius?: number;
46
+ /** Whether to draw the rounded container background. Default true. */
47
+ showBackground?: boolean;
48
+ /** Show the play/pause button. Default true. */
49
+ showPlayButton?: boolean;
50
+ playButtonColor?: ColorValue;
51
+ /** Show the time label. Default true. */
52
+ showTime?: boolean;
53
+ timeColor?: ColorValue;
54
+ /** count-up: 0:00 -> duration. count-down: duration -> 0:00. Default count-up. */
55
+ timeMode?: AudioWaveformTimeMode;
56
+ /** Show the playback-speed pill. Default true. */
57
+ showSpeedControl?: boolean;
58
+ speedColor?: ColorValue;
59
+ speedBackgroundColor?: ColorValue;
60
+ /** Available speeds the pill cycles through (default [0.5, 1, 1.5, 2]). */
61
+ speeds?: ReadonlyArray<number>;
62
+ /** Initial speed when the component mounts. Default 1. */
63
+ defaultSpeed?: number;
64
+ /** Begin playback as soon as the source is ready. Default false. */
65
+ autoPlay?: boolean;
66
+ /** Seek to this position immediately on load (milliseconds). Default 0. */
67
+ initialPositionMs?: number;
68
+ /** Restart from the beginning when playback ends. Default false. */
69
+ loop?: boolean;
70
+ /**
71
+ * Allow audio to keep playing when the host app is backgrounded.
72
+ * Default `false` — playback is paused on `didEnterBackground` (iOS) /
73
+ * `onHostPause` (Android).
74
+ *
75
+ * When `true`:
76
+ * - **iOS**: the host app must enable the "Audio, AirPlay, and Picture in
77
+ * Picture" Background Mode (Xcode → Signing & Capabilities → +Capability
78
+ * → Background Modes, or add `UIBackgroundModes: [audio]` to
79
+ * `Info.plist`). The library will configure `AVAudioSession` to
80
+ * `.playback` and activate it when the source is set.
81
+ * - **Android**: no host configuration is required for typical use.
82
+ * `MediaPlayer` keeps playing through `Activity.onPause` already.
83
+ * Optionally add `<uses-permission android:name="android.permission.WAKE_LOCK"/>`
84
+ * to your app manifest if you need playback to survive device sleep —
85
+ * the library will then call `MediaPlayer.setWakeMode` automatically.
86
+ */
87
+ playInBackground?: boolean;
88
+ /**
89
+ * When the app is backgrounded, skip the cheap-but-pointless waveform /
90
+ * time-label refreshes that would otherwise piggy-back on every 30 Hz
91
+ * progress tick (the OS already skips the actual GPU painting).
92
+ *
93
+ * Default `true` — there is no visible effect since the view is
94
+ * offscreen, and we save a small amount of CPU per tick. The
95
+ * `onTimeUpdate` JS event keeps firing regardless so you can still
96
+ * drive Now Playing / Lock Screen / analytics from background.
97
+ *
98
+ * Set to `false` if you want the bars + time label to stay refreshed in
99
+ * background for some reason (rare).
100
+ */
101
+ pauseUiUpdatesInBackground?: boolean;
102
+ /** When defined, the component is fully controlled — internal taps fire onPlayerStateChange but do not toggle play state. */
103
+ playing?: boolean;
104
+ /** When defined, the component is fully controlled — speed pill taps fire onPlayerStateChange but do not change speed. */
105
+ speed?: number;
106
+ onLoad?: (event: AudioWaveformLoadEvent) => void;
107
+ onLoadError?: (event: AudioWaveformLoadErrorEvent) => void;
108
+ onPlayerStateChange?: (event: AudioWaveformPlayerStateEvent) => void;
109
+ onTimeUpdate?: (event: AudioWaveformTimeUpdateEvent) => void;
110
+ onSeek?: (event: AudioWaveformSeekEvent) => void;
111
+ onEnd?: () => void;
112
+ };
113
+ export type AudioWaveformViewRef = {
114
+ play: () => void;
115
+ pause: () => void;
116
+ toggle: () => void;
117
+ seekTo: (positionMs: number) => void;
118
+ setSpeed: (speed: number) => void;
119
+ };
120
+ export declare const AudioWaveformView: import("react").ForwardRefExoticComponent<Omit<Readonly<Omit<Readonly<{
121
+ onAccessibilityAction?: ((event: import("react-native").AccessibilityActionEvent) => unknown) | undefined;
122
+ onAccessibilityTap?: (() => unknown) | undefined;
123
+ onLayout?: ((event: import("react-native").LayoutChangeEvent) => unknown) | undefined;
124
+ onMagicTap?: (() => unknown) | undefined;
125
+ onAccessibilityEscape?: (() => unknown) | undefined;
126
+ }>, "onMoveShouldSetResponder" | "onMoveShouldSetResponderCapture" | "onResponderGrant" | "onResponderMove" | "onResponderReject" | "onResponderRelease" | "onResponderStart" | "onResponderEnd" | "onResponderTerminate" | "onResponderTerminationRequest" | "onStartShouldSetResponder" | "onStartShouldSetResponderCapture" | "onMouseEnter" | "onMouseLeave" | "onClick" | "onClickCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onBlur" | "onBlurCapture" | "onFocus" | "onFocusCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyUp" | "onKeyUpCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
127
+ onMoveShouldSetResponder?: ((e: import("react-native").GestureResponderEvent) => boolean) | undefined;
128
+ onMoveShouldSetResponderCapture?: ((e: import("react-native").GestureResponderEvent) => boolean) | undefined;
129
+ onResponderGrant?: ((e: import("react-native").GestureResponderEvent) => void | boolean) | undefined;
130
+ onResponderMove?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
131
+ onResponderReject?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
132
+ onResponderRelease?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
133
+ onResponderStart?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
134
+ onResponderEnd?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
135
+ onResponderTerminate?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
136
+ onResponderTerminationRequest?: ((e: import("react-native").GestureResponderEvent) => boolean) | undefined;
137
+ onStartShouldSetResponder?: ((e: import("react-native").GestureResponderEvent) => boolean) | undefined;
138
+ onStartShouldSetResponderCapture?: ((e: import("react-native").GestureResponderEvent) => boolean) | undefined;
139
+ }>, "onMouseEnter" | "onMouseLeave" | "onClick" | "onClickCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onBlur" | "onBlurCapture" | "onFocus" | "onFocusCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyUp" | "onKeyUpCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
140
+ onMouseEnter?: ((event: import("react-native").MouseEvent) => void) | undefined;
141
+ onMouseLeave?: ((event: import("react-native").MouseEvent) => void) | undefined;
142
+ }>, "onClick" | "onClickCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onBlur" | "onBlurCapture" | "onFocus" | "onFocusCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyUp" | "onKeyUpCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
143
+ onClick?: ((event: import("react-native").PointerEvent) => void) | undefined;
144
+ onClickCapture?: ((event: import("react-native").PointerEvent) => void) | undefined;
145
+ onPointerEnter?: ((event: import("react-native").PointerEvent) => void) | undefined;
146
+ onPointerEnterCapture?: ((event: import("react-native").PointerEvent) => void) | undefined;
147
+ onPointerLeave?: ((event: import("react-native").PointerEvent) => void) | undefined;
148
+ onPointerLeaveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined;
149
+ onPointerMove?: ((event: import("react-native").PointerEvent) => void) | undefined;
150
+ onPointerMoveCapture?: ((event: import("react-native").PointerEvent) => void) | undefined;
151
+ onPointerCancel?: ((e: import("react-native").PointerEvent) => void) | undefined;
152
+ onPointerCancelCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
153
+ onPointerDown?: ((e: import("react-native").PointerEvent) => void) | undefined;
154
+ onPointerDownCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
155
+ onPointerUp?: ((e: import("react-native").PointerEvent) => void) | undefined;
156
+ onPointerUpCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
157
+ onPointerOver?: ((e: import("react-native").PointerEvent) => void) | undefined;
158
+ onPointerOverCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
159
+ onPointerOut?: ((e: import("react-native").PointerEvent) => void) | undefined;
160
+ onPointerOutCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
161
+ onGotPointerCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
162
+ onGotPointerCaptureCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
163
+ onLostPointerCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
164
+ onLostPointerCaptureCapture?: ((e: import("react-native").PointerEvent) => void) | undefined;
165
+ }>, "onClick" | "onBlur" | "onBlurCapture" | "onFocus" | "onFocusCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyUp" | "onKeyUpCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
166
+ onBlur?: ((event: import("react-native").BlurEvent) => void) | undefined;
167
+ onBlurCapture?: ((event: import("react-native").BlurEvent) => void) | undefined;
168
+ onFocus?: ((event: import("react-native").FocusEvent) => void) | undefined;
169
+ onFocusCapture?: ((event: import("react-native").FocusEvent) => void) | undefined;
170
+ }>, "onClick" | "onKeyDown" | "onKeyDownCapture" | "onKeyUp" | "onKeyUpCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
171
+ onKeyDown?: ((event: import("react-native").KeyDownEvent) => void) | undefined;
172
+ onKeyDownCapture?: ((event: import("react-native").KeyDownEvent) => void) | undefined;
173
+ onKeyUp?: ((event: import("react-native").KeyUpEvent) => void) | undefined;
174
+ onKeyUpCapture?: ((event: import("react-native").KeyUpEvent) => void) | undefined;
175
+ }>, "onClick" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
176
+ onTouchCancel?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
177
+ onTouchCancelCapture?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
178
+ onTouchEnd?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
179
+ onTouchEndCapture?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
180
+ onTouchMove?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
181
+ onTouchMoveCapture?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
182
+ onTouchStart?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
183
+ onTouchStartCapture?: ((e: import("react-native").GestureResponderEvent) => void) | undefined;
184
+ }>, "onClick" | "nativeBackgroundAndroid" | "nativeForegroundAndroid" | "renderToHardwareTextureAndroid" | "hasTVPreferredFocus" | "nextFocusDown" | "nextFocusForward" | "nextFocusLeft" | "nextFocusRight" | "nextFocusUp" | "focusable" | "tabIndex" | "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
185
+ nativeBackgroundAndroid?: import("react-native/types_generated/Libraries/Components/View/ViewPropTypes").AndroidDrawable | undefined;
186
+ nativeForegroundAndroid?: import("react-native/types_generated/Libraries/Components/View/ViewPropTypes").AndroidDrawable | undefined;
187
+ renderToHardwareTextureAndroid?: boolean | undefined;
188
+ hasTVPreferredFocus?: boolean | undefined;
189
+ nextFocusDown?: number | undefined;
190
+ nextFocusForward?: number | undefined;
191
+ nextFocusLeft?: number | undefined;
192
+ nextFocusRight?: number | undefined;
193
+ nextFocusUp?: number | undefined;
194
+ focusable?: boolean | undefined;
195
+ tabIndex?: 0 | -1;
196
+ onClick?: ((event: import("react-native").GestureResponderEvent) => unknown) | undefined;
197
+ }>, "shouldRasterizeIOS" | "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
198
+ shouldRasterizeIOS?: boolean | undefined;
199
+ }>, "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden" | "accessibilityLabelledBy" | "aria-labelledby" | "accessibilityLiveRegion" | "aria-live" | "importantForAccessibility" | "screenReaderFocusable" | "children" | "style" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<Omit<Readonly<{
200
+ accessibilityLabelledBy?: (string | undefined) | (Array<string> | undefined);
201
+ "aria-labelledby"?: string | undefined;
202
+ accessibilityLiveRegion?: ("none" | "polite" | "assertive") | undefined;
203
+ "aria-live"?: ("polite" | "assertive" | "off") | undefined;
204
+ importantForAccessibility?: ("auto" | "yes" | "no" | "no-hide-descendants") | undefined;
205
+ screenReaderFocusable?: boolean;
206
+ }>, "accessibilityIgnoresInvertColors" | "accessibilityViewIsModal" | "accessibilityShowsLargeContentViewer" | "accessibilityLargeContentTitle" | "aria-modal" | "accessibilityElementsHidden" | "accessibilityLanguage" | "accessibilityRespondsToUserInteraction" | "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden"> & Omit<Readonly<{
207
+ accessibilityIgnoresInvertColors?: boolean | undefined;
208
+ accessibilityViewIsModal?: boolean | undefined;
209
+ accessibilityShowsLargeContentViewer?: boolean | undefined;
210
+ accessibilityLargeContentTitle?: string | undefined;
211
+ "aria-modal"?: boolean | undefined;
212
+ accessibilityElementsHidden?: boolean | undefined;
213
+ accessibilityLanguage?: string | undefined;
214
+ accessibilityRespondsToUserInteraction?: boolean | undefined;
215
+ }>, "accessible" | "accessibilityLabel" | "accessibilityHint" | "aria-label" | "accessibilityRole" | "role" | "accessibilityState" | "accessibilityValue" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "accessibilityActions" | "aria-busy" | "aria-checked" | "aria-disabled" | "aria-expanded" | "aria-selected" | "aria-hidden"> & {
216
+ accessible?: boolean | undefined;
217
+ accessibilityLabel?: string | undefined;
218
+ accessibilityHint?: string | undefined;
219
+ "aria-label"?: string | undefined;
220
+ accessibilityRole?: import("react-native").AccessibilityRole | undefined;
221
+ role?: import("react-native").Role | undefined;
222
+ accessibilityState?: import("react-native").AccessibilityState | undefined;
223
+ accessibilityValue?: import("react-native").AccessibilityValue | undefined;
224
+ "aria-valuemax"?: import("react-native").AccessibilityValue["max"] | undefined;
225
+ "aria-valuemin"?: import("react-native").AccessibilityValue["min"] | undefined;
226
+ "aria-valuenow"?: import("react-native").AccessibilityValue["now"] | undefined;
227
+ "aria-valuetext"?: import("react-native").AccessibilityValue["text"] | undefined;
228
+ accessibilityActions?: ReadonlyArray<import("react-native/types_generated/Libraries/Components/View/ViewAccessibility").AccessibilityActionInfo> | undefined;
229
+ "aria-busy"?: boolean | undefined;
230
+ "aria-checked"?: (boolean | undefined) | "mixed";
231
+ "aria-disabled"?: boolean | undefined;
232
+ "aria-expanded"?: boolean | undefined;
233
+ "aria-selected"?: boolean | undefined;
234
+ "aria-hidden"?: boolean | undefined;
235
+ }>, "children" | "style" | "collapsable" | "collapsableChildren" | "id" | "testID" | "nativeID" | "needsOffscreenAlphaCompositing" | "hitSlop" | "pointerEvents" | "removeClippedSubviews" | "experimental_accessibilityOrder"> & Omit<Readonly<{
236
+ children?: React.ReactNode;
237
+ style?: import("react-native/types_generated/Libraries/StyleSheet/StyleSheet").ViewStyleProp | undefined;
238
+ collapsable?: boolean | undefined;
239
+ collapsableChildren?: boolean | undefined;
240
+ id?: string;
241
+ testID?: string | undefined;
242
+ nativeID?: string | undefined;
243
+ needsOffscreenAlphaCompositing?: boolean | undefined;
244
+ hitSlop?: import("react-native/types_generated/Libraries/StyleSheet/EdgeInsetsPropType").EdgeInsetsOrSizeProp | undefined;
245
+ pointerEvents?: ("auto" | "box-none" | "box-only" | "none") | undefined;
246
+ removeClippedSubviews?: boolean | undefined;
247
+ experimental_accessibilityOrder?: Array<string> | undefined;
248
+ }>, never>>, "children"> & {
249
+ source: AudioWaveformSource;
250
+ /** Pre-computed amplitudes in [0, 1]. When provided, native decode is skipped. */
251
+ samples?: ReadonlyArray<number>;
252
+ /** Highlighted bar color (the "played" portion). */
253
+ playedBarColor?: ColorValue;
254
+ /** Bar color for the not-yet-played portion. */
255
+ unplayedBarColor?: ColorValue;
256
+ /** Bar thickness (default 3). */
257
+ barWidth?: number;
258
+ /** Gap between bars (default 2). */
259
+ barGap?: number;
260
+ /** Bar corner radius (default = barWidth / 2). */
261
+ barRadius?: number;
262
+ /** Force a specific number of bars; default auto from view width. */
263
+ barCount?: number;
264
+ /** Background of the rounded container (default light blue). Has no effect when showBackground={false}. */
265
+ containerBackgroundColor?: ColorValue;
266
+ /** Container corner radius (default 16). Has no effect when showBackground={false}. */
267
+ containerBorderRadius?: number;
268
+ /** Whether to draw the rounded container background. Default true. */
269
+ showBackground?: boolean;
270
+ /** Show the play/pause button. Default true. */
271
+ showPlayButton?: boolean;
272
+ playButtonColor?: ColorValue;
273
+ /** Show the time label. Default true. */
274
+ showTime?: boolean;
275
+ timeColor?: ColorValue;
276
+ /** count-up: 0:00 -> duration. count-down: duration -> 0:00. Default count-up. */
277
+ timeMode?: AudioWaveformTimeMode;
278
+ /** Show the playback-speed pill. Default true. */
279
+ showSpeedControl?: boolean;
280
+ speedColor?: ColorValue;
281
+ speedBackgroundColor?: ColorValue;
282
+ /** Available speeds the pill cycles through (default [0.5, 1, 1.5, 2]). */
283
+ speeds?: ReadonlyArray<number>;
284
+ /** Initial speed when the component mounts. Default 1. */
285
+ defaultSpeed?: number;
286
+ /** Begin playback as soon as the source is ready. Default false. */
287
+ autoPlay?: boolean;
288
+ /** Seek to this position immediately on load (milliseconds). Default 0. */
289
+ initialPositionMs?: number;
290
+ /** Restart from the beginning when playback ends. Default false. */
291
+ loop?: boolean;
292
+ /**
293
+ * Allow audio to keep playing when the host app is backgrounded.
294
+ * Default `false` — playback is paused on `didEnterBackground` (iOS) /
295
+ * `onHostPause` (Android).
296
+ *
297
+ * When `true`:
298
+ * - **iOS**: the host app must enable the "Audio, AirPlay, and Picture in
299
+ * Picture" Background Mode (Xcode → Signing & Capabilities → +Capability
300
+ * → Background Modes, or add `UIBackgroundModes: [audio]` to
301
+ * `Info.plist`). The library will configure `AVAudioSession` to
302
+ * `.playback` and activate it when the source is set.
303
+ * - **Android**: no host configuration is required for typical use.
304
+ * `MediaPlayer` keeps playing through `Activity.onPause` already.
305
+ * Optionally add `<uses-permission android:name="android.permission.WAKE_LOCK"/>`
306
+ * to your app manifest if you need playback to survive device sleep —
307
+ * the library will then call `MediaPlayer.setWakeMode` automatically.
308
+ */
309
+ playInBackground?: boolean;
310
+ /**
311
+ * When the app is backgrounded, skip the cheap-but-pointless waveform /
312
+ * time-label refreshes that would otherwise piggy-back on every 30 Hz
313
+ * progress tick (the OS already skips the actual GPU painting).
314
+ *
315
+ * Default `true` — there is no visible effect since the view is
316
+ * offscreen, and we save a small amount of CPU per tick. The
317
+ * `onTimeUpdate` JS event keeps firing regardless so you can still
318
+ * drive Now Playing / Lock Screen / analytics from background.
319
+ *
320
+ * Set to `false` if you want the bars + time label to stay refreshed in
321
+ * background for some reason (rare).
322
+ */
323
+ pauseUiUpdatesInBackground?: boolean;
324
+ /** When defined, the component is fully controlled — internal taps fire onPlayerStateChange but do not toggle play state. */
325
+ playing?: boolean;
326
+ /** When defined, the component is fully controlled — speed pill taps fire onPlayerStateChange but do not change speed. */
327
+ speed?: number;
328
+ onLoad?: (event: AudioWaveformLoadEvent) => void;
329
+ onLoadError?: (event: AudioWaveformLoadErrorEvent) => void;
330
+ onPlayerStateChange?: (event: AudioWaveformPlayerStateEvent) => void;
331
+ onTimeUpdate?: (event: AudioWaveformTimeUpdateEvent) => void;
332
+ onSeek?: (event: AudioWaveformSeekEvent) => void;
333
+ onEnd?: () => void;
334
+ } & import("react").RefAttributes<AudioWaveformViewRef>>;
335
+ //# sourceMappingURL=AudioWaveformView.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioWaveformView.native.d.ts","sourceRoot":"","sources":["../../../src/AudioWaveformView.native.tsx"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAKtB,MAAM,MAAM,wBAAwB,GAChC,MAAM,GACN,SAAS,GACT,OAAO,GACP,OAAO,GACP,OAAO,CAAC;AAEZ,MAAM,MAAM,qBAAqB,GAAG,UAAU,GAAG,YAAY,CAAC;AAE9D,MAAM,MAAM,mBAAmB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAElD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,KAAK,EAAE,wBAAwB,CAAC;IAChC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,MA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA/NpB,mBAAmB;IAE3B,kFAAkF;cACxE,aAAa,CAAC,MAAM,CAAC;IAE/B,oDAAoD;qBACnC,UAAU;IAC3B,gDAAgD;uBAC7B,UAAU;IAE7B,iCAAiC;eACtB,MAAM;IACjB,oCAAoC;aAC3B,MAAM;IACf,kDAAkD;gBACtC,MAAM;IAClB,qEAAqE;eAC1D,MAAM;IAEjB,2GAA2G;+BAChF,UAAU;IACrC,uFAAuF;4BAC/D,MAAM;IAC9B,sEAAsE;qBACrD,OAAO;IAExB,gDAAgD;qBAC/B,OAAO;sBACN,UAAU;IAE5B,yCAAyC;eAC9B,OAAO;gBACN,UAAU;IACtB,kFAAkF;eACvE,qBAAqB;IAEhC,kDAAkD;uBAC/B,OAAO;iBACb,UAAU;2BACA,UAAU;IACjC,2EAA2E;aAClE,aAAa,CAAC,MAAM,CAAC;IAC9B,0DAA0D;mBAC3C,MAAM;IAErB,oEAAoE;eACzD,OAAO;IAClB,2EAA2E;wBACvD,MAAM;IAC1B,oEAAoE;WAC7D,OAAO;IAEd;;;;;;;;;;;;;;;;OAgBG;uBACgB,OAAO;IAE1B;;;;;;;;;;;;OAYG;iCAC0B,OAAO;IAEpC,6HAA6H;cACnH,OAAO;IACjB,0HAA0H;YAClH,MAAM;aAEL,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI;kBAClC,CAAC,KAAK,EAAE,2BAA2B,KAAK,IAAI;0BACpC,CAAC,KAAK,EAAE,6BAA6B,KAAK,IAAI;mBACrD,CAAC,KAAK,EAAE,4BAA4B,KAAK,IAAI;aACnD,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI;YACxC,MAAM,IAAI;wDAkIK,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { type CodegenTypes, type ColorValue, type HostComponent, type ViewProps } from 'react-native';
2
+ type Source = Readonly<{
3
+ uri: string;
4
+ }>;
5
+ type OnLoadEvent = Readonly<{
6
+ durationMs: CodegenTypes.Int32;
7
+ }>;
8
+ type OnLoadErrorEvent = Readonly<{
9
+ message: string;
10
+ }>;
11
+ type OnPlayerStateChangeEvent = Readonly<{
12
+ state: string;
13
+ isPlaying: boolean;
14
+ speed: CodegenTypes.Float;
15
+ error: string;
16
+ }>;
17
+ type OnTimeUpdateEvent = Readonly<{
18
+ currentTimeMs: CodegenTypes.Int32;
19
+ durationMs: CodegenTypes.Int32;
20
+ }>;
21
+ type OnSeekEvent = Readonly<{
22
+ positionMs: CodegenTypes.Int32;
23
+ }>;
24
+ type OnEndEvent = Readonly<{}>;
25
+ export interface NativeProps extends ViewProps {
26
+ source: Source;
27
+ samples?: ReadonlyArray<CodegenTypes.Float>;
28
+ playedBarColor?: ColorValue;
29
+ unplayedBarColor?: ColorValue;
30
+ barWidth?: CodegenTypes.WithDefault<CodegenTypes.Float, 3.0>;
31
+ barGap?: CodegenTypes.WithDefault<CodegenTypes.Float, 2.0>;
32
+ barRadius?: CodegenTypes.WithDefault<CodegenTypes.Float, -1.0>;
33
+ barCount?: CodegenTypes.WithDefault<CodegenTypes.Int32, 0>;
34
+ containerBackgroundColor?: ColorValue;
35
+ containerBorderRadius?: CodegenTypes.WithDefault<CodegenTypes.Float, 16.0>;
36
+ showBackground?: CodegenTypes.WithDefault<boolean, true>;
37
+ showPlayButton?: CodegenTypes.WithDefault<boolean, true>;
38
+ playButtonColor?: ColorValue;
39
+ showTime?: CodegenTypes.WithDefault<boolean, true>;
40
+ timeColor?: ColorValue;
41
+ timeMode?: CodegenTypes.WithDefault<'count-up' | 'count-down', 'count-up'>;
42
+ showSpeedControl?: CodegenTypes.WithDefault<boolean, true>;
43
+ speedColor?: ColorValue;
44
+ speedBackgroundColor?: ColorValue;
45
+ speeds?: ReadonlyArray<CodegenTypes.Float>;
46
+ defaultSpeed?: CodegenTypes.WithDefault<CodegenTypes.Float, 1.0>;
47
+ autoPlay?: CodegenTypes.WithDefault<boolean, false>;
48
+ initialPositionMs?: CodegenTypes.WithDefault<CodegenTypes.Int32, 0>;
49
+ loop?: CodegenTypes.WithDefault<boolean, false>;
50
+ playInBackground?: CodegenTypes.WithDefault<boolean, false>;
51
+ pauseUiUpdatesInBackground?: CodegenTypes.WithDefault<boolean, true>;
52
+ controlledPlaying?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
53
+ controlledSpeed?: CodegenTypes.WithDefault<CodegenTypes.Float, -1.0>;
54
+ onLoad?: CodegenTypes.DirectEventHandler<OnLoadEvent>;
55
+ onLoadError?: CodegenTypes.DirectEventHandler<OnLoadErrorEvent>;
56
+ onPlayerStateChange?: CodegenTypes.DirectEventHandler<OnPlayerStateChangeEvent>;
57
+ onTimeUpdate?: CodegenTypes.DirectEventHandler<OnTimeUpdateEvent>;
58
+ onSeek?: CodegenTypes.DirectEventHandler<OnSeekEvent>;
59
+ onEnd?: CodegenTypes.DirectEventHandler<OnEndEvent>;
60
+ }
61
+ interface NativeCommands {
62
+ play: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
63
+ pause: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
64
+ toggle: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
65
+ seekTo: (viewRef: React.ElementRef<HostComponent<NativeProps>>, positionMs: CodegenTypes.Int32) => void;
66
+ setSpeed: (viewRef: React.ElementRef<HostComponent<NativeProps>>, speed: CodegenTypes.Float) => void;
67
+ }
68
+ export declare const Commands: NativeCommands;
69
+ declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
70
+ export default _default;
71
+ //# sourceMappingURL=AudioWaveformViewNativeComponent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioWaveformViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/AudioWaveformViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf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AW,CAAC,CAAC,EACrD,UAAU,EAAE,YAAY,CAAC,KAAK,KAC3B,IAAI,CAAC;IACV,QAAQ,EAAE,CACR,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,EACrD,KAAK,EAAE,YAAY,CAAC,KAAK,KACtB,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,EAAE,cAErB,CAAC;;AAEH,wBAAwE"}
@@ -0,0 +1,3 @@
1
+ export { AudioWaveformView } from './AudioWaveformView';
2
+ export type { AudioWaveformViewProps, AudioWaveformViewRef, AudioWaveformPlayerState, AudioWaveformPlayerStateEvent, AudioWaveformTimeUpdateEvent, AudioWaveformSeekEvent, AudioWaveformLoadEvent, AudioWaveformLoadErrorEvent, AudioWaveformTimeMode, AudioWaveformSource, } from './AudioWaveformView';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EACV,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,sBAAsB,EACtB,2BAA2B,EAC3B,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,143 @@
1
1
  {
2
2
  "name": "react-native-waveform-player",
3
- "version": "0.0.1",
4
- "description": "",
5
- "main": "index.js",
3
+ "version": "1.0.0",
4
+ "description": "audio waveform",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src",
17
+ "lib",
18
+ "android",
19
+ "ios",
20
+ "cpp",
21
+ "*.podspec",
22
+ "react-native.config.js",
23
+ "!ios/build",
24
+ "!android/build",
25
+ "!android/gradle",
26
+ "!android/gradlew",
27
+ "!android/gradlew.bat",
28
+ "!android/local.properties",
29
+ "!**/__tests__",
30
+ "!**/__fixtures__",
31
+ "!**/__mocks__",
32
+ "!**/.*"
33
+ ],
6
34
  "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
35
+ "example": "yarn workspace react-native-waveform-player-example",
36
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
37
+ "prepare": "bob build",
38
+ "typecheck": "tsc",
39
+ "lint": "eslint \"**/*.{js,ts,tsx}\""
40
+ },
41
+ "keywords": [
42
+ "react-native",
43
+ "ios",
44
+ "android"
45
+ ],
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/maitrungduc1410/react-native-audio-waveform.git"
49
+ },
50
+ "author": "Duc Trung Mai <maitrungduc1410@gmail.com> (https://github.com/maitrungduc1410)",
51
+ "license": "MIT",
52
+ "bugs": {
53
+ "url": "https://github.com/maitrungduc1410/react-native-audio-waveform/issues"
54
+ },
55
+ "homepage": "https://github.com/maitrungduc1410/react-native-audio-waveform#readme",
56
+ "publishConfig": {
57
+ "registry": "https://registry.npmjs.org/"
58
+ },
59
+ "devDependencies": {
60
+ "@commitlint/config-conventional": "^20.5.0",
61
+ "@eslint/compat": "^2.0.3",
62
+ "@eslint/eslintrc": "^3.3.5",
63
+ "@eslint/js": "^10.0.1",
64
+ "@react-native/babel-preset": "0.85.0",
65
+ "@react-native/eslint-config": "0.85.0",
66
+ "@types/react": "^19.2.0",
67
+ "commitlint": "^20.5.0",
68
+ "del-cli": "^7.0.0",
69
+ "eslint": "^9.39.4",
70
+ "eslint-config-prettier": "^10.1.8",
71
+ "eslint-plugin-ft-flow": "^3.0.11",
72
+ "eslint-plugin-prettier": "^5.5.5",
73
+ "lefthook": "^2.1.4",
74
+ "prettier": "^3.8.1",
75
+ "react": "19.2.3",
76
+ "react-native": "0.85.0",
77
+ "react-native-builder-bob": "^0.41.0",
78
+ "turbo": "^2.8.21",
79
+ "typescript": "^6.0.2"
80
+ },
81
+ "peerDependencies": {
82
+ "react": "*",
83
+ "react-native": "*"
84
+ },
85
+ "workspaces": [
86
+ "example"
87
+ ],
88
+ "packageManager": "yarn@4.11.0",
89
+ "react-native-builder-bob": {
90
+ "source": "src",
91
+ "output": "lib",
92
+ "targets": [
93
+ [
94
+ "module",
95
+ {
96
+ "esm": true
97
+ }
98
+ ],
99
+ [
100
+ "typescript",
101
+ {
102
+ "project": "tsconfig.build.json"
103
+ }
104
+ ]
105
+ ]
106
+ },
107
+ "codegenConfig": {
108
+ "name": "AudioWaveformViewSpec",
109
+ "type": "all",
110
+ "jsSrcsDir": "src",
111
+ "android": {
112
+ "javaPackageName": "com.audiowaveform"
113
+ },
114
+ "ios": {
115
+ "components": {
116
+ "AudioWaveformView": {
117
+ "className": "AudioWaveformView"
118
+ }
119
+ }
120
+ }
121
+ },
122
+ "prettier": {
123
+ "quoteProps": "consistent",
124
+ "singleQuote": true,
125
+ "tabWidth": 2,
126
+ "trailingComma": "es5",
127
+ "useTabs": false
128
+ },
129
+ "commitlint": {
130
+ "extends": [
131
+ "@commitlint/config-conventional"
132
+ ]
8
133
  },
9
- "keywords": [],
10
- "author": "",
11
- "license": "ISC"
134
+ "create-react-native-library": {
135
+ "type": "fabric-view",
136
+ "languages": "kotlin-objc",
137
+ "tools": [
138
+ "eslint",
139
+ "lefthook"
140
+ ],
141
+ "version": "0.62.0"
142
+ }
12
143
  }