@oiij/use
Version:
Som Composable Functions for Vue 3
62 lines (61 loc) • 1.8 kB
text/typescript
import * as vue60 from "vue";
import { TemplateRef } from "vue";
import * as _vueuse_core28 from "@vueuse/core";
//#region src/composables/use-spectrum.d.ts
type SpectrumBarOptions = {
width?: number;
minHeight?: number;
spacing?: number;
radius?: number;
color?: [string, string] | string;
shadow?: boolean;
};
type SpectrumLineOptions = {
width?: number;
spacing?: number;
color?: [string, string] | string;
smoothness?: number;
fill?: boolean;
shadow?: boolean;
};
type SpectrumCircleBarOptions = {
width?: number;
minHeight?: number;
spacing?: number;
radius?: number;
barRadius?: number;
color?: [string, string] | string;
startAngle?: number;
endAngle?: number;
shadow?: boolean;
};
type SpectrumCircleLineOptions = {
width?: number;
spacing?: number;
radius?: number;
color?: [string, string] | string;
smoothness?: number;
fill?: boolean;
startAngle?: number;
endAngle?: number;
shadow?: boolean;
};
type SpectrumOptions = {
type?: 'bar' | 'line' | 'circle-bar' | 'circle-line';
color?: [string, string] | string;
shadow?: boolean;
barOptions?: SpectrumBarOptions;
lineOptions?: SpectrumLineOptions;
circleBarOptions?: SpectrumCircleBarOptions;
circleLineOptions?: SpectrumCircleLineOptions;
animationSpeed?: number;
manual?: boolean;
};
declare function useSpectrum(canvasRef: TemplateRef<HTMLCanvasElement>, frequencyDataGetter: () => Uint8Array<ArrayBuffer>, options?: SpectrumOptions): {
canvasRef: Readonly<vue60.ShallowRef<HTMLCanvasElement | null>>;
pause: _vueuse_core28.Fn;
resume: _vueuse_core28.Fn;
isActive: Readonly<vue60.ShallowRef<boolean>>;
};
//#endregion
export { SpectrumBarOptions, SpectrumCircleBarOptions, SpectrumCircleLineOptions, SpectrumLineOptions, SpectrumOptions, useSpectrum };