Methods
addBoard
- addBoard(docName: string, pageCount: number): string
-
Parameters
-
docName: string
-
pageCount: number
Returns string
返回文档的boardName
addDoc
-
Parameters
Returns string
返回文档的boardName
addImage
- addImage(opt: { boardName?: string; height: number; pageIndex?: number; url: string; width: number }): void
-
Parameters
-
opt: { boardName?: string; height: number; pageIndex?: number; url: string; width: number }
-
Optional boardName?: string
-
height: number
-
Optional pageIndex?: number
-
url: string
-
width: number
Returns void
addPage
- addPage(opt: { insertAfter?: number; payload: any }): void
-
Parameters
-
opt: { insertAfter?: number; payload: any }
-
Optional insertAfter?: number
-
payload: any
Returns void
addTransDoc
- addTransDoc(opt: { docName: string; height: number; pageCount: number; url: string; width: number }): string
-
Parameters
-
opt: { docName: string; height: number; pageCount: number; url: string; width: number }
-
docName: string
-
height: number
-
pageCount: number
-
url: string
-
width: number
Returns string
返回文档的boardName
addVideo
- addVideo(opt: { boardName?: string; pageIndex?: number; sourceType: string; title?: string; url: string; width?: number }): void
-
Parameters
-
opt: { boardName?: string; pageIndex?: number; sourceType: string; title?: string; url: string; width?: number }
-
Optional boardName?: string
-
Optional pageIndex?: number
-
sourceType: string
-
Optional title?: string
-
url: string
-
Optional width?: number
Returns void
deleteBoard
- deleteBoard(boardName: string): void
deletePage
- deletePage(index: number): void
enableDraw
- enableDraw(enable: boolean): void
exportAsBase64String
- exportAsBase64String(opt?: { content?: "clip" | "fitToDoc" | "fitToContent"; customBg?: boolean; omitSelection?: boolean; quality?: number; type?: "jpeg" | "png" }): null | { content: string; height: number; width: number }
-
Parameters
-
Optional opt: { content?: "clip" | "fitToDoc" | "fitToContent"; customBg?: boolean; omitSelection?: boolean; quality?: number; type?: "jpeg" | "png" }
-
Optional content?: "clip" | "fitToDoc" | "fitToContent"
-
Optional customBg?: boolean
-
Optional omitSelection?: boolean
-
Optional quality?: number
-
Optional type?: "jpeg" | "png"
Returns null | { content: string; height: number; width: number }
exportAsImage
- exportAsImage(opt?: { content?: "clip" | "fitToDoc" | "fitToContent"; customBg?: boolean; omitSelection?: boolean; quality?: number; type?: "jpeg" | "png" }): void
-
Parameters
-
Optional opt: { content?: "clip" | "fitToDoc" | "fitToContent"; customBg?: boolean; omitSelection?: boolean; quality?: number; type?: "jpeg" | "png" }
-
Optional content?: "clip" | "fitToDoc" | "fitToContent"
-
Optional customBg?: boolean
-
Optional omitSelection?: boolean
-
Optional quality?: number
-
Optional type?: "jpeg" | "png"
Returns void
exportBoardAsStr
- exportBoardAsStr(opt: { boardName?: string; content?: "clip" | "fitToDoc" | "fitToContent"; customBg?: boolean; omitSelection?: boolean; quality?: number; resWait?: number; type?: "jpeg" | "png" }, callbacks: { onComplete: any; onError?: any; onImgProgress?: any; onResourceProgress?: any }): void
-
Parameters
-
opt: { boardName?: string; content?: "clip" | "fitToDoc" | "fitToContent"; customBg?: boolean; omitSelection?: boolean; quality?: number; resWait?: number; type?: "jpeg" | "png" }
-
Optional boardName?: string
-
Optional content?: "clip" | "fitToDoc" | "fitToContent"
-
Optional customBg?: boolean
-
Optional omitSelection?: boolean
-
Optional quality?: number
-
Optional resWait?: number
-
Optional type?: "jpeg" | "png"
-
callbacks: { onComplete: any; onError?: any; onImgProgress?: any; onResourceProgress?: any }
-
onComplete: function
- onComplete(res: { contents: string[]; maxH: number; maxW: number; nullPages: number[]; sizes: { h: number; w: number }[] }): void
-
Parameters
-
res: { contents: string[]; maxH: number; maxW: number; nullPages: number[]; sizes: { h: number; w: number }[] }
-
contents: string[]
-
maxH: number
-
maxW: number
-
nullPages: number[]
-
sizes: { h: number; w: number }[]
Returns void
-
onError: function
-
onImgProgress: function
- onImgProgress(progress: number): void
-
onResourceProgress: function
- onResourceProgress(progress: number): void
Returns void
fitToContent
- fitToContent(animate: boolean): void
fitToDoc
- fitToDoc(animate: boolean): void
getAnimInfos
- getAnimInfos(): null | { animIndex: number; animState: "start" | "end"; pageIndex: number }
-
Returns null | { animIndex: number; animState: "start" | "end"; pageIndex: number }
getBgRendererName
- getBgRendererName(): string
getPageInfos
-
Parameters
-
Optional boardName: string
getSelectedIds
- getSelectedIds(): string[]
getStream
- getStream(opt?: { keepDPI?: boolean; width?: number }): MediaStream
-
Parameters
-
Optional opt: { keepDPI?: boolean; width?: number }
-
Optional keepDPI?: boolean
-
Optional width?: number
Returns MediaStream
getVisibleElementInfos
- getVisibleElementInfos(): { id: string; type: string }[]
-
Returns { id: string; type: string }[]
getVisionState
- getVisionState(): { broadcaster: undefined | string; broadcasterName: undefined | string; mode: "broadcaster" | "follower" | "freeObserver" }
-
Returns { broadcaster: undefined | string; broadcasterName: undefined | string; mode: "broadcaster" | "follower" | "freeObserver" }
-
broadcaster: undefined | string
-
broadcasterName: undefined | string
-
mode: "broadcaster" | "follower" | "freeObserver"
gotoAnim
- gotoAnim(opt: { animIndex: number; animState: "start" | "end"; pageIndex: number }): void
-
Parameters
-
opt: { animIndex: number; animState: "start" | "end"; pageIndex: number }
-
animIndex: number
-
animState: "start" | "end"
-
pageIndex: number
Returns void
gotoBoard
- gotoBoard(boardName: string): void
gotoPage
- gotoPage(index: number): void
isClearAvailable
- isClearAvailable(): boolean
isTextAreaFocus
- isTextAreaFocus(): boolean
lockCameraWithContent
- lockCameraWithContent(opt: { height: number; width: number }): void
-
Parameters
-
opt: { height: number; width: number }
-
height: number
-
width: number
Returns void
on
- on(eventName: "event:appState:change", callback: (stateName: "renderColor", color: string) => void): void
- on(eventName: "event:appState:change", callback: (stateName: "renderWidth", width: number) => void): void
- on(eventName: "event:appState:change", callback: (stateName: "zoomFactor", scale: number) => void): void
- on(eventName: "event:appState:change", callback: (stateName: "currTool", tool: string) => void): void
- on(eventName: "event:appState:change", callback: (stateName: "clearAvailable", available: boolean) => void): void
- on(eventName: "event:appState:change", callback: (stateName: "redoCount", count: number) => void): void
- on(eventName: "event:appState:change", callback: (stateName: "undoCount", count: number) => void): void
- on(eventName: "event:appState:change", callback: (stateName: "selectChange", oldSelectedOpIds: string[], currSelectedOpIds: string[], nonMediaSelectedOpIds: string[]) => void): void
- on(eventName: "event:appState:change", callback: (stateName: "board", infos: IBoardInfos) => void): void
- on(eventName: "event:appState:change", callback: (stateName: "page", infos: IPageInfos) => void): void
- on(eventName: "event:appState:change", callback: (stateName: "vision", infos: { broadcaster: undefined | string; broadcasterName: undefined | string; mode: "broadcaster" | "follower" | "freeObserver" }) => void): void
-
Parameters
-
eventName: "event:appState:change"
-
callback: (stateName: "renderColor", color: string) => void
-
- (stateName: "renderColor", color: string): void
-
Parameters
-
stateName: "renderColor"
-
color: string
Returns void
Returns void
-
Parameters
-
eventName: "event:appState:change"
-
callback: (stateName: "renderWidth", width: number) => void
-
- (stateName: "renderWidth", width: number): void
-
Parameters
-
stateName: "renderWidth"
-
width: number
Returns void
Returns void
-
Parameters
-
eventName: "event:appState:change"
-
callback: (stateName: "zoomFactor", scale: number) => void
-
- (stateName: "zoomFactor", scale: number): void
-
Parameters
-
stateName: "zoomFactor"
-
scale: number
Returns void
Returns void
-
Parameters
-
eventName: "event:appState:change"
-
callback: (stateName: "currTool", tool: string) => void
-
- (stateName: "currTool", tool: string): void
-
Parameters
-
stateName: "currTool"
-
tool: string
Returns void
Returns void
-
Parameters
-
eventName: "event:appState:change"
-
callback: (stateName: "clearAvailable", available: boolean) => void
-
- (stateName: "clearAvailable", available: boolean): void
-
Parameters
-
stateName: "clearAvailable"
-
available: boolean
Returns void
Returns void
-
Parameters
-
eventName: "event:appState:change"
-
callback: (stateName: "redoCount", count: number) => void
-
- (stateName: "redoCount", count: number): void
-
Parameters
-
stateName: "redoCount"
-
count: number
Returns void
Returns void
-
Parameters
-
eventName: "event:appState:change"
-
callback: (stateName: "undoCount", count: number) => void
-
- (stateName: "undoCount", count: number): void
-
Parameters
-
stateName: "undoCount"
-
count: number
Returns void
Returns void
-
Parameters
-
eventName: "event:appState:change"
-
callback: (stateName: "selectChange", oldSelectedOpIds: string[], currSelectedOpIds: string[], nonMediaSelectedOpIds: string[]) => void
-
- (stateName: "selectChange", oldSelectedOpIds: string[], currSelectedOpIds: string[], nonMediaSelectedOpIds: string[]): void
-
Parameters
-
stateName: "selectChange"
-
oldSelectedOpIds: string[]
-
currSelectedOpIds: string[]
-
nonMediaSelectedOpIds: string[]
Returns void
Returns void
-
Parameters
-
eventName: "event:appState:change"
-
callback: (stateName: "board", infos: IBoardInfos) => void
Returns void
-
Parameters
-
eventName: "event:appState:change"
-
callback: (stateName: "page", infos: IPageInfos) => void
Returns void
-
Parameters
-
eventName: "event:appState:change"
-
callback: (stateName: "vision", infos: { broadcaster: undefined | string; broadcasterName: undefined | string; mode: "broadcaster" | "follower" | "freeObserver" }) => void
-
- (stateName: "vision", infos: { broadcaster: undefined | string; broadcasterName: undefined | string; mode: "broadcaster" | "follower" | "freeObserver" }): void
-
Parameters
-
stateName: "vision"
-
infos: { broadcaster: undefined | string; broadcasterName: undefined | string; mode: "broadcaster" | "follower" | "freeObserver" }
-
broadcaster: undefined | string
-
broadcasterName: undefined | string
-
mode: "broadcaster" | "follower" | "freeObserver"
Returns void
Returns void
resetCamera
- resetCamera(animate: boolean): void
rotateElement
- rotateElement(opt: { angle: number; id: string }): void
-
Parameters
-
opt: { angle: number; id: string }
Returns void
setColor
- setColor(color: string): void
setCustomBackground
- setCustomBackground(coodinate: "world", customFn: (opt: { DPI: number; ctx: CanvasRenderingContext2D; height: number; rect: { centerX: number; centerY: number; height: number; width: number }; width: number; zoom: number }) => string | void, bgName: string): void
- setCustomBackground(coodinate: "container", customFn: (opt: { DPI: number; ctx: CanvasRenderingContext2D; height: number; width: number; zoom: number }) => string | void, bgName: string): void
-
Parameters
-
coodinate: "world"
-
customFn: (opt: { DPI: number; ctx: CanvasRenderingContext2D; height: number; rect: { centerX: number; centerY: number; height: number; width: number }; width: number; zoom: number }) => string | void
-
- (opt: { DPI: number; ctx: CanvasRenderingContext2D; height: number; rect: { centerX: number; centerY: number; height: number; width: number }; width: number; zoom: number }): string | void
-
Parameters
-
opt: { DPI: number; ctx: CanvasRenderingContext2D; height: number; rect: { centerX: number; centerY: number; height: number; width: number }; width: number; zoom: number }
-
DPI: number
-
ctx: CanvasRenderingContext2D
-
height: number
-
rect: { centerX: number; centerY: number; height: number; width: number }
-
centerX: number
-
centerY: number
-
height: number
-
width: number
-
width: number
-
zoom: number
Returns string | void
-
bgName: string
Returns void
-
Parameters
-
coodinate: "container"
-
customFn: (opt: { DPI: number; ctx: CanvasRenderingContext2D; height: number; width: number; zoom: number }) => string | void
-
- (opt: { DPI: number; ctx: CanvasRenderingContext2D; height: number; width: number; zoom: number }): string | void
-
Parameters
-
opt: { DPI: number; ctx: CanvasRenderingContext2D; height: number; width: number; zoom: number }
-
DPI: number
-
ctx: CanvasRenderingContext2D
-
height: number
-
width: number
-
zoom: number
Returns string | void
-
bgName: string
Returns void
setFontFamily
- setFontFamily(opt: { fontFace?: { format?: string; url: string }[] | { format?: string; url: string }; fontFamily?: string }): void
-
Parameters
-
opt: { fontFace?: { format?: string; url: string }[] | { format?: string; url: string }; fontFamily?: string }
-
Optional fontFace?: { format?: string; url: string }[] | { format?: string; url: string }
-
Optional fontFamily?: string
Returns void
setOpacity
- setOpacity(opacity: number): void
setPageBackground
- setPageBackground(opt: { height: number; url: string; width: number }): void
-
Parameters
-
opt: { height: number; url: string; width: number }
-
height: number
-
url: string
-
width: number
Returns void
setSelfAsBroadcaster
- setSelfAsBroadcaster(): void
setSelfAsFollower
- setSelfAsFollower(): void
setSelfAsFreeObserver
- setSelfAsFreeObserver(): void
setShowCursor
- setShowCursor(value: boolean): void
setStrokeWidth
- setStrokeWidth(width: number): void
setTool
- setTool(toolName: string): void
unlockCameraWithContent
- unlockCameraWithContent(): void
unsetCustomBackground
- unsetCustomBackground(): void
unsetSelfAsBroadcaster
- unsetSelfAsBroadcaster(): void
updateContainerAfterResize
- updateContainerAfterResize(): void
updateStream
- updateStream(opt?: { keepDPI?: boolean; width?: number }): MediaStream
-
Parameters
-
Optional opt: { keepDPI?: boolean; width?: number }
-
Optional keepDPI?: boolean
-
Optional width?: number
Returns MediaStream
zoomTo
- zoomTo(scale: number, animate: boolean): void
-
Parameters
-
scale: number
-
animate: boolean
Returns void
绘制模块