@types/wavesurfer.js
Advanced tools
Comparing version 5.0.3 to 5.0.4
{ | ||
"name": "@types/wavesurfer.js", | ||
"version": "5.0.3", | ||
"version": "5.0.4", | ||
"description": "TypeScript definitions for wavesurfer.js", | ||
@@ -40,4 +40,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/wavesurfer.js", | ||
}, | ||
"typesPublisherContentHash": "e131b16599c37982b64767043d20d9697c607ca82d870347d85e0ad9943596bf", | ||
"typesPublisherContentHash": "b734f80cf99c9e322f60e373b8fe8215952b42d1f508a23d1e4fd57196bf0920", | ||
"typeScriptVersion": "3.6" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 18 Jun 2021 15:31:22 GMT | ||
* Last updated: Fri, 02 Jul 2021 18:05:17 GMT | ||
* Dependencies: [@types/debounce](https://npmjs.com/package/@types/debounce) | ||
@@ -14,0 +14,0 @@ * Global values: `WaveSurfer` |
@@ -21,9 +21,9 @@ import { WaveSurferParams } from "../types/params"; | ||
/** The default wavesurfer initialisation parameters (default: { backend: 'MediaElement', mediaControls: true }). */ | ||
defaults?: WaveSurferParams; | ||
defaults?: WaveSurferParams | undefined; | ||
/** Selector or NodeList of elements to attach instances to. */ | ||
containers?: string | NodeList; | ||
containers?: string | NodeList | undefined; | ||
/** URL template for the dynamic loading of plugins (default: '//localhost:8080/dist/plugin/wavesurfer.[name].js'). */ | ||
pluginCdnTemplate?: string; | ||
pluginCdnTemplate?: string | undefined; | ||
/** If set overwrites the default request function, can be used to inject plugins differently. */ | ||
loadPlugin?: (pluginName: string, callback: (plugin: WaveSurferPlugin) => void) => void; | ||
loadPlugin?: ((pluginName: string, callback: (plugin: WaveSurferPlugin) => void) => void) | undefined; | ||
} |
@@ -32,19 +32,19 @@ import { PluginDefinition, PluginParams, WaveSurferPlugin } from "../../types/plugin"; | ||
/** Hide the cursor when the mouse leaves the waveform (default: true). */ | ||
hideOnBlur?: boolean; | ||
hideOnBlur?: boolean | undefined; | ||
/** The width of the cursor (default: '1px'). */ | ||
width?: string; | ||
width?: string | undefined; | ||
/** The color of the cursor (default: 'black'). */ | ||
color?: string; | ||
color?: string | undefined; | ||
/** The opacity of the cursor (default 0.25). */ | ||
opacity?: string; | ||
opacity?: string | undefined; | ||
/** The border style of the cursor (default: 'solid'). */ | ||
style?: string; | ||
style?: string | undefined; | ||
/** The z-index of the cursor element (default: 3). */ | ||
zIndex?: number; | ||
zIndex?: number | undefined; | ||
/** An object with custom styles which are applied to the cursor element. */ | ||
customStyle?: Styles; | ||
customStyle?: Styles | undefined; | ||
/** Show the time on the cursor (default: false). */ | ||
showTime?: boolean; | ||
showTime?: boolean | undefined; | ||
/** An object with custom styles which are applied to the cursor time element. */ | ||
customShowTimeStyle?: Styles; | ||
customShowTimeStyle?: Styles | undefined; | ||
/** | ||
@@ -56,5 +56,5 @@ * Whether to follow both the x- and the y-position of the mouse (default: false). | ||
*/ | ||
followCursorY?: string | false; | ||
followCursorY?: string | false | undefined; | ||
/** Formats the timestamp on the cursor. */ | ||
formatTimeCallback?: ((cursorTime: number) => string) | null; | ||
formatTimeCallback?: ((cursorTime: number) => string) | null | undefined; | ||
} |
@@ -14,7 +14,7 @@ import { PluginDefinition, PluginParams, WaveSurferPlugin } from "../../types/plugin"; | ||
/** CSS selector or HTML element where the ELAN information should be rendered. */ | ||
container?: string | HTMLElement; | ||
container?: string | HTMLElement | undefined; | ||
/** The location of ELAN XML data. */ | ||
url?: string; | ||
url?: string | undefined; | ||
/** If set only shows the data tiers with the TIER_ID in this map. */ | ||
tiers?: unknown; | ||
tiers?: unknown | undefined; | ||
} |
@@ -37,3 +37,3 @@ import { PluginDefinition, PluginParams, WaveSurferPlugin } from "../../types/plugin"; | ||
time: number; | ||
label?: string; | ||
label?: string | undefined; | ||
color: string; | ||
@@ -45,3 +45,3 @@ position: "top" | "bottom"; | ||
/** Initial set of markers. */ | ||
markers?: MarkerParams[]; | ||
markers?: MarkerParams[] | undefined; | ||
} | ||
@@ -53,6 +53,6 @@ | ||
/** An optional marker label. */ | ||
label?: string; | ||
label?: string | undefined; | ||
/** Background color for marker. */ | ||
color?: string; | ||
position?: "top" | "bottom"; | ||
color?: string | undefined; | ||
position?: "top" | "bottom" | undefined; | ||
} |
@@ -32,4 +32,4 @@ import { PluginDefinition, PluginParams, WaveSurferPlugin } from "../../types/plugin"; | ||
src: string; | ||
sizes?: string; | ||
type?: string; | ||
sizes?: string | undefined; | ||
type?: string | undefined; | ||
} |
@@ -62,11 +62,11 @@ import { PluginDefinition, PluginParams, WaveSurferPlugin } from "../../types/plugin"; | ||
/** Constraints describing the media types requested. */ | ||
constraints?: MediaStreamConstraints; | ||
constraints?: MediaStreamConstraints | undefined; | ||
/** The buffer size in units of sample-frames (default: 4096). */ | ||
bufferSize?: BufferSize; | ||
bufferSize?: BufferSize | undefined; | ||
/** Integer specifying the number of channels for this node's input (default: 1). Values of up to 32 are supported. */ | ||
numberOfInputChannels?: number; | ||
numberOfInputChannels?: number | undefined; | ||
/** Integer specifying the number of channels for this node's output. */ | ||
numberOfOutputChannels?: number; | ||
numberOfOutputChannels?: number | undefined; | ||
} | ||
export type BufferSize = 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384; |
@@ -39,3 +39,3 @@ import { PluginDefinition, PluginParams, WaveSurferPlugin } from "../../types/plugin"; | ||
/** CSS selector or HTML element where the map should be rendered. By default it is simply appended after the waveform. */ | ||
container?: string | HTMLElement | false; | ||
container?: string | HTMLElement | false | undefined; | ||
} |
@@ -29,7 +29,7 @@ import { PluginDefinition, PluginParams, WaveSurferPlugin } from "../../types/plugin"; | ||
/** Draw the playhead as a triangle/line. */ | ||
draw?: boolean; | ||
draw?: boolean | undefined; | ||
/** Seeking (via clicking) while playing moves the playhead. */ | ||
moveOnSeek?: boolean; | ||
moveOnSeek?: boolean | undefined; | ||
/** Pausing the track returns the seek position to the playhead. */ | ||
returnOnPause?: boolean; | ||
returnOnPause?: boolean | undefined; | ||
} |
@@ -38,17 +38,17 @@ import { Styles } from "../../types/util"; | ||
/** Enable creating regions by dragging with the mouse. */ | ||
dragSelection?: boolean; | ||
dragSelection?: boolean | undefined; | ||
/** Regions that should be added upon initialisation. */ | ||
regions?: RegionParams[]; | ||
regions?: RegionParams[] | undefined; | ||
/** The sensitivity of the mouse dragging (default: 2). */ | ||
slop?: number; | ||
slop?: number | undefined; | ||
/** Snap the regions to a grid of the specified multiples in seconds? */ | ||
snapToGridInterval?: number; | ||
snapToGridInterval?: number | undefined; | ||
/** Shift the snap-to-grid by the specified seconds. May also be negative. */ | ||
snapToGridOffset?: number; | ||
snapToGridOffset?: number | undefined; | ||
/** Maximum number of regions that may be created by the user at one time. */ | ||
maxRegions?: number[]; | ||
maxRegions?: number[] | undefined; | ||
/** Allows custom formating for region tooltip. */ | ||
formatTimeCallback?: () => string; | ||
formatTimeCallback?: (() => string) | undefined; | ||
/** from container edges' Optional width for edgeScroll to start (default: 5% of viewport width). */ | ||
edgeScrollWidth?: number; | ||
edgeScrollWidth?: number | undefined; | ||
} | ||
@@ -79,3 +79,3 @@ | ||
readonly drag: boolean; | ||
readonly edgeScrollWidth?: number; | ||
readonly edgeScrollWidth?: number | undefined; | ||
readonly element: HTMLElement; | ||
@@ -85,3 +85,3 @@ readonly end: number; | ||
readonly firedOut: boolean; | ||
readonly formatTimeCallback?: (start: number, end: number) => string; | ||
readonly formatTimeCallback?: ((start: number, end: number) => string) | undefined; | ||
readonly handleLeftEl: HTMLElement | null; | ||
@@ -113,12 +113,12 @@ readonly handleRightEl: HTMLElement | null; | ||
id: string; | ||
start?: number; | ||
end?: number; | ||
loop?: boolean; | ||
drag?: boolean; | ||
resize?: boolean; | ||
color?: string; | ||
channelIdx?: number; | ||
handleStyle?: HandleStyle; | ||
preventContextMenu?: boolean; | ||
showTooltip?: boolean; | ||
start?: number | undefined; | ||
end?: number | undefined; | ||
loop?: boolean | undefined; | ||
drag?: boolean | undefined; | ||
resize?: boolean | undefined; | ||
color?: string | undefined; | ||
channelIdx?: number | undefined; | ||
handleStyle?: HandleStyle | undefined; | ||
preventContextMenu?: boolean | undefined; | ||
showTooltip?: boolean | undefined; | ||
} | ||
@@ -125,0 +125,0 @@ |
@@ -40,15 +40,15 @@ import { PluginDefinition, PluginParams, WaveSurferPlugin } from "../../types/plugin"; | ||
/** Number of samples to fetch to FFT. Must be a power of 2. */ | ||
fftSamples?: number; | ||
fftSamples?: number | undefined; | ||
/** Set to true to display frequency labels. */ | ||
labels?: boolean; | ||
labels?: boolean | undefined; | ||
/** Size of the overlapping window. Must be < fftSamples. Auto deduced from canvas size by default. */ | ||
noverlap?: number; | ||
noverlap?: number | undefined; | ||
/** The window function to be used. */ | ||
windowFunc?: WindowFunction; | ||
windowFunc?: WindowFunction | undefined; | ||
/** Some window functions have this extra value (between 0 and 1). */ | ||
alpha?: number; | ||
alpha?: number | undefined; | ||
/** Controls the size of the spectrogram in relation with its canvas (1 = Draw on the whole canvas. 2 = Draw on a quarter, i.e. 1/2 the length and 1/2 the width). */ | ||
pixelRatio?: number; | ||
pixelRatio?: number | undefined; | ||
/** A 256 long array of 4-element arrays. Each entry should contain a float between 0 and 1 and specify r, g, b, and alpha. */ | ||
colorMap?: RGBA[] & { length: 256 }; | ||
colorMap?: RGBA[] & { length: 256 } | undefined; | ||
} | ||
@@ -55,0 +55,0 @@ |
@@ -54,30 +54,30 @@ import { PluginDefinition, PluginParams, WaveSurferPlugin } from "../../types/plugin"; | ||
/** Height of notches in percent (default: 90). */ | ||
notchPercentHeight?: number; | ||
notchPercentHeight?: number | undefined; | ||
/** The colour of the notches that do not have labels (default: '#c0c0c0'). */ | ||
unlabeledNotchColor?: string; | ||
unlabeledNotchColor?: string | undefined; | ||
/** The colour of the main notches (default: '#000'). */ | ||
primaryColor?: string; | ||
primaryColor?: string | undefined; | ||
/** The colour of the secondary notches (default: '#c0c0c0'). */ | ||
secondaryColor?: string; | ||
secondaryColor?: string | undefined; | ||
/** The colour of the labels next to the main notches (default: '#000'). */ | ||
primaryFontColor?: string; | ||
primaryFontColor?: string | undefined; | ||
/** The colour of the labels next to the secondary notches (default: '#000'). */ | ||
secondaryFontColor?: string; | ||
secondaryFontColor?: string | undefined; | ||
/** The padding between the label and the notch (default: 5). */ | ||
labelPadding?: number; | ||
labelPadding?: number | undefined; | ||
/** A debounce timeout to increase rendering performance for large files. */ | ||
zoomDebounce?: number | false; | ||
fontFamily?: string; | ||
zoomDebounce?: number | false | undefined; | ||
fontFamily?: string | undefined; | ||
/** Font size of labels in pixels (default: 10). */ | ||
fontSize?: number; | ||
fontSize?: number | undefined; | ||
/** Length of the track in seconds. Overrides getDuration() for setting length of timeline. */ | ||
duration?: number | null; | ||
formatTimecallback?: (sec: number, pxPerSec: number) => string; | ||
timeInterval?: (pxPerSec: number) => number; | ||
duration?: number | null | undefined; | ||
formatTimecallback?: ((sec: number, pxPerSec: number) => string) | undefined; | ||
timeInterval?: ((pxPerSec: number) => number) | undefined; | ||
/** Cadence between labels in primary color. */ | ||
primaryLabelInterval?: (pxPerSec: number) => number; | ||
primaryLabelInterval?: ((pxPerSec: number) => number) | undefined; | ||
/** Cadence between labels in secondary color. */ | ||
secondaryLabelInterval?: (pxPerSec: number) => number; | ||
secondaryLabelInterval?: ((pxPerSec: number) => number) | undefined; | ||
/** Offset for the timeline start in seconds. May also be negative. */ | ||
offset?: number; | ||
offset?: number | undefined; | ||
} |
@@ -8,13 +8,13 @@ import MultiCanvas from "../src/drawer.multicanvas"; | ||
/** Use your own previously initialized AudioContext or leave blank (default: null). */ | ||
audioContext?: AudioContext; | ||
audioContext?: AudioContext | undefined; | ||
/** Speed at which to play audio. Lower number is slower (default: 1). */ | ||
audioRate?: number; | ||
audioRate?: number | undefined; | ||
/** Use your own previously initialized ScriptProcessorNode or leave blank (default: null). */ | ||
audioScriptProcessor?: ScriptProcessorNode; | ||
audioScriptProcessor?: ScriptProcessorNode | undefined; | ||
/** If a scrollbar is present, center the waveform on current progress (default: true). */ | ||
autoCenter?: boolean; | ||
autoCenter?: boolean | undefined; | ||
/** If autoCenter is active, rate at which the waveform is centered (default: 5). */ | ||
autoCenterRate?: number; | ||
autoCenterRate?: number | undefined; | ||
/** If autoCenter is active, immediately center waveform on current progress (default: false). */ | ||
autoCenterImmediately?: boolean; | ||
autoCenterImmediately?: boolean | undefined; | ||
/** | ||
@@ -26,60 +26,60 @@ * Backend to use (default: 'WebAudio'). | ||
*/ | ||
backend?: "WebAudio" | "MediaElement" | "MediaElementWebAudio"; | ||
backend?: "WebAudio" | "MediaElement" | "MediaElementWebAudio" | undefined; | ||
/** Change background color of the waveform container (default: null). */ | ||
backgroundColor?: string; | ||
backgroundColor?: string | undefined; | ||
/** The height of the wave bars (default: 1). */ | ||
barHeight?: number; | ||
barHeight?: number | undefined; | ||
/** The radius of the wave bars (default: 0). Makes bars rounded. */ | ||
barRadius?: number; | ||
barRadius?: number | undefined; | ||
/** The optional spacing between bars of the wave, if not provided will be calculated in legacy format (default: null). */ | ||
barGap?: number; | ||
barGap?: number | undefined; | ||
/** Draw the waveform using bars (default: null). */ | ||
barWidth?: number; | ||
barWidth?: number | undefined; | ||
/** If specified, draw at least a bar of this height, eliminating waveform gaps (default: null). */ | ||
barMinHeight?: number; | ||
barMinHeight?: number | undefined; | ||
/** Close and nullify all audio contexts when the destroy method is called (default: false). */ | ||
closeAudioContext?: boolean; | ||
closeAudioContext?: boolean | undefined; | ||
/** CSS selector or HTML element where the waveform should be drawn. This is the only required parameter. */ | ||
container: string | HTMLElement; | ||
/** The fill color of the cursor indicating the playhead position (default: '#333'). */ | ||
cursorColor?: string; | ||
cursorColor?: string | undefined; | ||
/** Measured in pixels (default: 1). */ | ||
cursorWidth?: number; | ||
drawingContextAttributes?: DrawingContextAttributes; | ||
cursorWidth?: number | undefined; | ||
drawingContextAttributes?: DrawingContextAttributes | undefined; | ||
/** Optional audio length so pre-rendered peaks can be display immediately for example (default: null). */ | ||
duration?: number; | ||
duration?: number | undefined; | ||
/** Whether to fill the entire container or draw only according to minPxPerSec (default: true). */ | ||
fillParent?: boolean; | ||
fillParent?: boolean | undefined; | ||
/** Force decoding of audio using web audio when zooming to get a more detailed waveform (default: false). */ | ||
forceDecode?: boolean; | ||
forceDecode?: boolean | undefined; | ||
/** The height of the waveform. Measured in pixels (default: 128). */ | ||
height?: number; | ||
height?: number | undefined; | ||
/** Whether to hide the horizontal scrollbar when one would normally be shown (default: false). */ | ||
hideScrollbar?: boolean; | ||
hideScrollbar?: boolean | undefined; | ||
/** Whether the mouse interaction will be enabled at initialization. You can switch this parameter at any time later on (default: true). */ | ||
interact?: boolean; | ||
interact?: boolean | undefined; | ||
/** (Use with regions plugin) Enable looping of selected regions (default: false). */ | ||
loopSelection?: boolean; | ||
loopSelection?: boolean | undefined; | ||
/** Maximum width of a single canvas in pixels (default: 4000). */ | ||
maxCanvasWidth?: number; | ||
maxCanvasWidth?: number | undefined; | ||
/** (Use with backend MediaElement or MediaElementWebAudio) Enable the native controls for the media element (default: false). */ | ||
mediaControls?: boolean; | ||
mediaControls?: boolean | undefined; | ||
/** (Use with backend MediaElement or MediaElementWebAudio) 'audio'|'video' ('video' only for MediaElement) */ | ||
mediaType?: "audio" | "video"; | ||
mediaType?: "audio" | "video" | undefined; | ||
/** Minimum number of pixels per second of audio (default: 20). */ | ||
minPxPerSec?: number; | ||
minPxPerSec?: number | undefined; | ||
/** If true, normalize by the maximum peak instead of 1.0 (default: false). */ | ||
normalize?: boolean; | ||
normalize?: boolean | undefined; | ||
/** Use the PeakCache to improve rendering speed of large waveforms (default: false). */ | ||
partialRender?: boolean; | ||
partialRender?: boolean | undefined; | ||
/** The pixel ratio used to calculate display (default: window.deviceDixelRatio). */ | ||
pixelRatio?: number; | ||
pixelRatio?: number | undefined; | ||
/** An array of plugin definitions to register during instantiation. */ | ||
plugins?: PluginDefinition[]; | ||
plugins?: PluginDefinition[] | undefined; | ||
/** The fill color of the part of the waveform behind the cursor (default: '#555'). */ | ||
progressColor?: string; | ||
progressColor?: string | undefined; | ||
/** Set to false to keep the media element in the DOM when the player is destroyed (default: true). */ | ||
removeMediaElementOnDestroy?: boolean; | ||
removeMediaElementOnDestroy?: boolean | undefined; | ||
/** Can be used to inject a custom renderer (default: MultiCanvas). */ | ||
renderer?: MultiCanvas; | ||
renderer?: MultiCanvas | undefined; | ||
/** | ||
@@ -90,19 +90,19 @@ * If set to true resize the waveform, when the window is resized (default: false). | ||
*/ | ||
responsive?: boolean | number; | ||
responsive?: boolean | number | undefined; | ||
/** If set to true, renders waveform from right-to-left (default: false). */ | ||
rtl?: boolean; | ||
rtl?: boolean | undefined; | ||
/** Whether to scroll the container with a lengthy waveform. Otherwise the waveform is shrunk to the container width (see fillParent) (default: false). */ | ||
scrollParent?: boolean; | ||
scrollParent?: boolean | undefined; | ||
/** Number of seconds to skip with the skipForward() and skipBackward() methods (default: 2). */ | ||
skipLength?: number; | ||
skipLength?: number | undefined; | ||
/** Render with separate waveforms for the channels of the audio (default: false). */ | ||
splitChannels?: boolean; | ||
splitChannels?: boolean | undefined; | ||
/** Options for splitChannel rendering. */ | ||
splitChannelsOptions?: SplitChannelOptions; | ||
splitChannelsOptions?: SplitChannelOptions | undefined; | ||
/** Render the waveform vertically instead of horizontally. */ | ||
vertical?: boolean; | ||
vertical?: boolean | undefined; | ||
/** The fill color of the waveform after the cursor. */ | ||
waveColor?: string | CanvasGradient; | ||
waveColor?: string | CanvasGradient | undefined; | ||
/** XHR options. */ | ||
xhr?: XHROptions; | ||
xhr?: XHROptions | undefined; | ||
} | ||
@@ -112,9 +112,9 @@ | ||
/** Determines whether channels are rendered on top of each other or on separate tracks. */ | ||
overlay?: boolean; | ||
overlay?: boolean | undefined; | ||
/** Object describing color for each channel. */ | ||
channelColors?: { [channel: number]: ChannelColor }; | ||
channelColors?: { [channel: number]: ChannelColor } | undefined; | ||
/** Indexes of channels to be hidden from rendering. */ | ||
filterChannels?: number[]; | ||
filterChannels?: number[] | undefined; | ||
/** Determines whether normalization is done per channel or maintains proportionality between channels. */ | ||
relativeNormalization?: boolean; | ||
relativeNormalization?: boolean | undefined; | ||
} | ||
@@ -121,0 +121,0 @@ |
@@ -14,5 +14,5 @@ import WaveSurfer from "../src/wavesurfer"; | ||
/** The properties that should be added to the wavesurfer instance as static properties. */ | ||
staticProps?: { [staticPropName: string]: unknown }; | ||
staticProps?: { [staticPropName: string]: unknown } | undefined; | ||
/** Don't initialise plugin automatically. */ | ||
deferInit?: boolean; | ||
deferInit?: boolean | undefined; | ||
/** The plugin parameters, they are the first parameter passed to the plugin class constructor function. */ | ||
@@ -27,3 +27,3 @@ params: PluginParams; | ||
/** Set to true to manually call (default: false). */ | ||
deferInit?: boolean; | ||
deferInit?: boolean | undefined; | ||
} |
export interface XHROptions { | ||
url?: string; | ||
method?: string; | ||
mode?: string; | ||
credentials?: string; | ||
cache?: string; | ||
responseType?: "arraybuffer" | "blob" | "json" | "text"; | ||
requestHeaders?: XHRRequestHeader[]; | ||
redirect?: string; | ||
referrer?: string; | ||
withCredentials?: boolean; | ||
url?: string | undefined; | ||
method?: string | undefined; | ||
mode?: string | undefined; | ||
credentials?: string | undefined; | ||
cache?: string | undefined; | ||
responseType?: "arraybuffer" | "blob" | "json" | "text" | undefined; | ||
requestHeaders?: XHRRequestHeader[] | undefined; | ||
redirect?: string | undefined; | ||
referrer?: string | undefined; | ||
withCredentials?: boolean | undefined; | ||
} | ||
@@ -13,0 +13,0 @@ |
56786