@twilio/player
Advanced tools
Comparing version 1.0.0-beta.17 to 1.0.0-beta.18
@@ -0,10 +1,63 @@ | ||
/// <reference types="wavesurfer.js" /> | ||
/// <reference types="react" /> | ||
/// <reference path="./declarations.d.ts" /> | ||
import * as React from "react"; | ||
import WaveSurfer from "wavesurfer.js"; | ||
import { WaveRenderer, PluginDefinition } from "wavesurfer.js"; | ||
import { WaveSurferParams as WaveSurferParams$0 } from "wavesurfer.js"; | ||
import * as EE from "eventemitter3"; | ||
import CanvasEntry from "wavesurfer.js/src/drawer.canvasentry.js"; | ||
import MultiCanvas from "wavesurfer.js/src/drawer.multicanvas.js"; | ||
import { EventEmitter } from "eventemitter3"; | ||
declare class TimelinePlugin { | ||
static create(params: TimelinePluginParams): any; | ||
constructor(params: TimelinePluginParams, ws: object); | ||
_onScroll: () => void; | ||
_onRedraw: () => void; | ||
_onReady: () => void; | ||
drawer: any; | ||
pixelRatio: any; | ||
maxCanvasWidth: any; | ||
maxCanvasElementWidth: any; | ||
_onWrapperClick: (e: object) => void; | ||
container: any; | ||
wavesurfer: object; | ||
util: any; | ||
params: { | ||
height: number; | ||
notchPercentHeight: number; | ||
labelPadding: number; | ||
unlabeledNotchColor: string; | ||
primaryColor: string; | ||
secondaryColor: string; | ||
primaryFontColor: string; | ||
secondaryFontColor: string; | ||
fontFamily: string; | ||
fontSize: number; | ||
duration: null; | ||
zoomDebounce: boolean; | ||
formatTimeCallback: (seconds: number, pxPerSec: number) => number; | ||
timeInterval: (pxPerSec: number) => number; | ||
primaryLabelInterval: (pxPerSec: number) => number; | ||
secondaryLabelInterval: (pxPerSec: number) => number; | ||
offset: number; | ||
} & Object; | ||
canvases: any[]; | ||
wrapper: any; | ||
_onZoom: any; | ||
init(): void; | ||
destroy(): void; | ||
createWrapper(): void; | ||
render(): void; | ||
addCanvas(): void; | ||
removeCanvas(): void; | ||
updateCanvases(): void; | ||
updateCanvasesPositioning(): void; | ||
renderCanvases(): void; | ||
setFillStyles(fillStyle: any | CanvasGradient | CanvasPattern): void; | ||
setFonts(font: any): void; | ||
fillRect(x: number, y: number, width: number, height: number): void; | ||
fillText(text: string, x: number, y: number): void; | ||
defaultFormatTimeCallback(seconds: number, pxPerSec: number): number; | ||
defaultTimeInterval(pxPerSec: number): number; | ||
defaultPrimaryLabelInterval(pxPerSec: number): number; | ||
defaultSecondaryLabelInterval(pxPerSec: number): number; | ||
} | ||
type TimelinePluginParams = Object; | ||
declare module TimelinePluginWrapper { | ||
export { TimelinePlugin }; | ||
} | ||
declare function defaultTimeFormatter(seconds: number): string; | ||
@@ -23,3 +76,3 @@ interface Segment { | ||
type PlaybackRate = number | "very_fast" | "fast" | "normal" | "slow" | "very_slow"; | ||
type PlayerOptions = Pick<WaveSurferParams, "audioRate" | "backgroundColor" | "barGap" | "barHeight" | "barWidth" | "cursorColor" | "cursorWidth" | "height" | "hideScrollbar" | "progressColor" | "waveColor"> & { | ||
type PlayerOptions = Pick<WaveSurfer.WaveSurferParams, "audioRate" | "backgroundColor" | "barGap" | "barHeight" | "barWidth" | "cursorColor" | "cursorWidth" | "height" | "hideScrollbar" | "progressColor" | "waveColor"> & { | ||
progressBackgroundColor?: string | null; | ||
@@ -29,3 +82,3 @@ timeline?: TimelineOptions; | ||
}; | ||
type PlayerParams = WaveSurferParams & PlayerOptions; | ||
type PlayerParams = WaveSurfer.WaveSurferParams & PlayerOptions; | ||
type TimelineOptions = Partial<{ | ||
@@ -44,64 +97,2 @@ notchPercentHeight: number; | ||
}>; | ||
interface WaveSurferParams { | ||
audioContext?: AudioContext; | ||
audioRate?: number; | ||
audioScriptProcessor?: ScriptProcessorNode; | ||
autoCenter?: boolean; | ||
backend?: string; | ||
backgroundColor?: string; | ||
barHeight?: number; | ||
barMinHeight?: number | null; | ||
barWidth?: number; | ||
barGap?: number; | ||
barRadius?: number; | ||
closeAudioContext?: boolean; | ||
container: string | HTMLElement; | ||
cursorColor?: string; | ||
cursorWidth?: number; | ||
fillParent?: boolean; | ||
forceDecode?: boolean; | ||
height?: number; | ||
hideScrollbar?: boolean; | ||
interact?: boolean; | ||
loopSelection?: boolean; | ||
maxCanvasWidth?: number; | ||
mediaControls?: boolean; | ||
mediaType?: string; | ||
minPxPerSec?: number; | ||
normalize?: boolean; | ||
partialRender?: boolean; | ||
pixelRatio?: number; | ||
plugins?: PluginDefinition[]; | ||
progressColor?: string; | ||
removeMediaElementOnDestroy?: boolean; | ||
renderer?: { | ||
new (container: HTMLElement, params: WaveSurferParams): WaveRenderer; | ||
}; | ||
responsive?: boolean | number; | ||
scrollParent?: boolean; | ||
skipLength?: number; | ||
splitChannels?: boolean; | ||
waveColor?: string; | ||
} | ||
declare class Drawer extends MultiCanvas { | ||
container: HTMLElement; | ||
channels: Channel[]; | ||
params: Required<PlayerParams>; | ||
cursorCanvas?: HTMLCanvasElement; | ||
currentPosition: number; | ||
constructor(container: HTMLElement, params: WaveSurferParams$0); | ||
init(): void; | ||
private handleWindowResize; | ||
destroy: () => void; | ||
createElements(): void; | ||
drawBars(peaks: number[][] | number[], channelIndex: number, start?: number, end?: number): void; | ||
prepareForDraw(peaks: number[][] | number[], start: number, end: number): void; | ||
fillRect(channelIndex: number, x: number, y: number, width: number, height: number, radius?: number): void; | ||
setFillStyles(entry: CanvasEntry, channelIndex: number): void; | ||
getPeakAverageValue(peaks: number[], index: number, radius: number): number; | ||
private weightDistributionFunction; | ||
updateCursor(): void; | ||
updateProgress(position: number): void; | ||
drawCursor(position: number): void; | ||
} | ||
type PlayerEvents = { | ||
@@ -118,3 +109,3 @@ error: [Error]; | ||
}; | ||
declare class PlayerCore extends EE<PlayerEvents> { | ||
declare class PlayerCore extends EventEmitter<PlayerEvents> { | ||
container: HTMLDivElement; | ||
@@ -131,3 +122,3 @@ isHotLoading: boolean; | ||
waveform?: HTMLElement | null; | ||
ws?: WaveSurfer<Drawer>; | ||
ws?: WaveSurfer; | ||
wsParams: PlayerParams; | ||
@@ -151,7 +142,7 @@ private currentSegmentDuration?; | ||
hotLoad: (url: string) => Promise<unknown>; | ||
play: (start?: number | undefined, end?: number | undefined) => Promise<void>; | ||
play: (start?: number | undefined, end?: number | undefined) => Promise<void> | undefined; | ||
pause: () => Promise<void>; | ||
getCurrentTime: () => number; | ||
isPlaying: () => boolean; | ||
isReady: () => boolean; | ||
isReady: () => false | (() => boolean); | ||
seekToSecond: (seconds: number, offsetFromSegment?: boolean) => void; | ||
@@ -188,4 +179,4 @@ setCurrentSegment: (duration?: number | undefined, offset?: number | undefined) => void; | ||
isPlaying: () => boolean; | ||
isReady: () => boolean; | ||
play: (start?: number | undefined, end?: number | undefined) => Promise<void>; | ||
isReady: () => false | (() => boolean); | ||
play: (start?: number | undefined, end?: number | undefined) => Promise<void> | undefined; | ||
pause: () => Promise<void>; | ||
@@ -192,0 +183,0 @@ seekToSecond: (seconds: number, offsetFromSegment?: boolean) => void; |
{ | ||
"name": "@twilio/player", | ||
"version": "1.0.0-beta.17", | ||
"version": "1.0.0-beta.18", | ||
"main": "dist/index.js", | ||
@@ -15,9 +15,10 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@types/wavesurfer.js": "^3.3.1", | ||
"debounce": "^1.2.0", | ||
"eventemitter3": "^4.0.4", | ||
"eventemitter3": "^4.0.7", | ||
"wavesurfer.js": "^4.0.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1" | ||
"react": "^16.5.2", | ||
"react-dom": "^16.5.2" | ||
}, | ||
@@ -24,0 +25,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
492135
2714
6
32
+ Added@types/wavesurfer.js@^3.3.1
+ Added@types/wavesurfer.js@3.3.2(transitive)
Updatedeventemitter3@^4.0.7