Skip to content

Commit 9209111

Browse files
committed
chore: export library code
1 parent 9370d03 commit 9209111

20 files changed

+231
-185
lines changed

lib/1llest-waveform-vue.mjs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
var L = Object.defineProperty;
2-
var M = (a, e, t) => e in a ? L(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3-
var s = (a, e, t) => (M(a, typeof e != "symbol" ? e + "" : e, t), t);
4-
import { defineComponent as O, ref as h, onMounted as G, watchEffect as g, onUnmounted as $, openBlock as V, createElementBlock as P, normalizeStyle as y, createVNode as U, Transition as X, withCtx as H, withDirectives as w, createElementVNode as m, vShow as A } from "vue";
1+
var E = Object.defineProperty;
2+
var L = (a, e, t) => e in a ? E(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3+
var s = (a, e, t) => (L(a, typeof e != "symbol" ? e + "" : e, t), t);
4+
import { defineComponent as M, ref as h, onMounted as G, watchEffect as g, onUnmounted as $, openBlock as V, createElementBlock as P, normalizeStyle as y, createVNode as U, Transition as X, withCtx as H, withDirectives as w, createElementVNode as m, vShow as A } from "vue";
55
class q {
66
constructor(e, t, i) {
77
s(this, "canvasCtx");
@@ -78,7 +78,7 @@ class Y {
7878
}
7979
async fetchAudioFile() {
8080
try {
81-
const e = await fetch(this.props.url);
81+
const e = await fetch(this.props.url, this.props.requestOptions);
8282
this.arrayBuffer = await e.arrayBuffer();
8383
} catch (e) {
8484
console.error(e);
@@ -194,10 +194,11 @@ function Q(a, e) {
194194
function Z() {
195195
D.unobserve();
196196
}
197-
const tt = /* @__PURE__ */ O({
197+
const tt = /* @__PURE__ */ M({
198198
__name: "IllestWaveform",
199199
props: {
200200
url: null,
201+
requestOptions: { default: () => ({}) },
201202
lineWidth: { default: 0.5 },
202203
lineCap: { default: "round" },
203204
lineColor: { default: "#5e5e5e" },
@@ -280,19 +281,19 @@ const tt = /* @__PURE__ */ O({
280281
p.value <= o._audioDuration || F();
281282
});
282283
}
283-
function z() {
284+
function O() {
284285
return x(p.value);
285286
}
286-
function E() {
287+
function z() {
287288
const u = o._audioDuration;
288289
return x(u);
289290
}
290291
return e({
291292
play: b,
292293
pause: R,
293294
replay: W,
294-
getCurrentTime: z,
295-
getDuration: E
295+
getCurrentTime: O,
296+
getDuration: z
296297
}), (u, at) => (V(), P("section", {
297298
id: "illest-waveform",
298299
ref_key: "__illestWaveformRef__",
@@ -338,7 +339,7 @@ const et = (a, e) => {
338339
for (const [i, n] of e)
339340
t[i] = n;
340341
return t;
341-
}, it = /* @__PURE__ */ et(tt, [["__scopeId", "data-v-6d613eae"]]), ot = {
342+
}, it = /* @__PURE__ */ et(tt, [["__scopeId", "data-v-59075811"]]), ot = {
342343
install: (a) => {
343344
a.component("IllestWaveform", it);
344345
}

lib/1llest-waveform-vue.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.d.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

lib/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/types/IllestWaveform.vue.d.ts

Lines changed: 0 additions & 141 deletions
This file was deleted.

lib/types/IllestWaveformProps.d.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
import type { Ref } from 'vue';
2+
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3+
url: string;
4+
requestOptions?: RequestInit | undefined;
5+
lineWidth?: number | undefined;
6+
lineCap?: ("butt" | "round" | "square") | undefined;
7+
lineColor?: string | undefined;
8+
samplingRate?: number | undefined;
9+
cursorWidth?: number | undefined;
10+
cursorColor?: string | undefined;
11+
maskColor?: string | undefined;
12+
lazy?: boolean | Ref<boolean> | undefined;
13+
skeleton?: boolean | Ref<boolean> | undefined;
14+
skeletonColor?: string | undefined;
15+
interact?: boolean | Ref<boolean> | undefined;
16+
fade?: boolean | Ref<boolean> | undefined;
17+
}>, {
18+
requestOptions: () => {};
19+
lineWidth: number;
20+
lineCap: string;
21+
lineColor: string;
22+
cursorWidth: number;
23+
cursorColor: string;
24+
samplingRate: number;
25+
maskColor: string;
26+
lazy: boolean;
27+
skeleton: boolean;
28+
skeletonColor: string;
29+
interact: boolean;
30+
fade: boolean;
31+
}>, {
32+
play: () => void;
33+
pause: () => void;
34+
replay: () => void;
35+
getCurrentTime: () => string;
36+
getDuration: () => string;
37+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onInit" | "onFetched" | "onReady" | "onPlay" | "onPause" | "onFinish" | "onClick")[], "onInit" | "onFetched" | "onReady" | "onPlay" | "onPause" | "onFinish" | "onClick", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
38+
url: string;
39+
requestOptions?: RequestInit | undefined;
40+
lineWidth?: number | undefined;
41+
lineCap?: ("butt" | "round" | "square") | undefined;
42+
lineColor?: string | undefined;
43+
samplingRate?: number | undefined;
44+
cursorWidth?: number | undefined;
45+
cursorColor?: string | undefined;
46+
maskColor?: string | undefined;
47+
lazy?: boolean | Ref<boolean> | undefined;
48+
skeleton?: boolean | Ref<boolean> | undefined;
49+
skeletonColor?: string | undefined;
50+
interact?: boolean | Ref<boolean> | undefined;
51+
fade?: boolean | Ref<boolean> | undefined;
52+
}>, {
53+
requestOptions: () => {};
54+
lineWidth: number;
55+
lineCap: string;
56+
lineColor: string;
57+
cursorWidth: number;
58+
cursorColor: string;
59+
samplingRate: number;
60+
maskColor: string;
61+
lazy: boolean;
62+
skeleton: boolean;
63+
skeletonColor: string;
64+
interact: boolean;
65+
fade: boolean;
66+
}>>> & {
67+
onOnInit?: ((...args: any[]) => any) | undefined;
68+
onOnFetched?: ((...args: any[]) => any) | undefined;
69+
onOnReady?: ((...args: any[]) => any) | undefined;
70+
onOnPlay?: ((...args: any[]) => any) | undefined;
71+
onOnPause?: ((...args: any[]) => any) | undefined;
72+
onOnFinish?: ((...args: any[]) => any) | undefined;
73+
onOnClick?: ((...args: any[]) => any) | undefined;
74+
}, {
75+
requestOptions: RequestInit;
76+
lineWidth: number;
77+
lineCap: "butt" | "round" | "square";
78+
lineColor: string;
79+
samplingRate: number;
80+
cursorWidth: number;
81+
cursorColor: string;
82+
maskColor: string;
83+
lazy: boolean | Ref<boolean>;
84+
skeleton: boolean | Ref<boolean>;
85+
skeletonColor: string;
86+
interact: boolean | Ref<boolean>;
87+
fade: boolean | Ref<boolean>;
88+
}>;
89+
export default _default;
90+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
91+
type __VLS_TypePropsToRuntimeProps<T> = {
92+
[K in keyof T]-?: {} extends Pick<T, K> ? {
93+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
94+
} : {
95+
type: import('vue').PropType<T[K]>;
96+
required: true;
97+
};
98+
};
99+
type __VLS_WithDefaults<P, D> = {
100+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? P[K] & {
101+
default: D[K];
102+
} : P[K];
103+
};

lib/types/index.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { App } from 'vue';
2+
import IllestWaveform from './components/IllestWaveform.vue';
3+
declare const _default: {
4+
install: (app: App) => void;
5+
};
6+
export default _default;
7+
export type { IllestWaveformProps } from './types/waveform';
8+
export { IllestWaveform };

lib/types/modules/Audio.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { IllestWaveformProps } from '../types/waveform';
2+
/**
3+
* The WebAudio class creates a playable audio instance
4+
* and converts the audio into an array for visual processing
5+
*
6+
*/
7+
export default class WebAudio {
8+
protected props: IllestWaveformProps;
9+
protected audioCtx: AudioContext;
10+
protected audioBuffer: AudioBuffer;
11+
protected gainNode: GainNode;
12+
private filteredData;
13+
private arrayBuffer;
14+
constructor(props: IllestWaveformProps);
15+
get _filteredData(): number[];
16+
get _audioDuration(): number;
17+
setupAudio(): Promise<void>;
18+
fetchAudioFile(): Promise<void>;
19+
private createAudioBuffer;
20+
private createGainNode;
21+
private createFilterData;
22+
}

0 commit comments

Comments
 (0)