UNPKG

fcr-core

Version:

Core APIs for building online scenes

54 lines (53 loc) 2.89 kB
import { ApplianceNames, FcrBoardShape, FcrBoardToolType, ShapeType } from './enum'; import { EStrokeType } from '@netless/appliance-plugin'; import { BaseImageSize, FetchImageResult } from './type'; export declare const heightPerTool = 36; export declare const heightPerColor = 18; export declare const defaultToolsRetain: number; export declare const verticalPadding = 10; export declare const sceneNavHeight: number; export declare const widgetContainerClassName = "netless-whiteboard-wrapper"; export declare const layoutContentClassName = "fcr-layout-content-main-view"; export declare const videoRowClassName = "fcr-layout-content-video-list-row"; export declare const toolbarClassName = "fcr-board-toolbar"; export declare const windowClassName = "netless-whiteboard-wrapper"; export declare const WINDOW_TITLE_HEIGHT = 28; export declare const WINDOW_ASPECT_RATIO: number; export declare const WINDOW_MIN_SIZE: { width: number; height: number; }; export declare const WINDOW_REMAIN_SIZE: { width: number; height: number; }; export declare const WINDOW_REMAIN_POSITION: { x: number; y: number; }; /** * 根据 * @param imageInnerSize * @returns */ export declare const getImageSize: (imageInnerSize: BaseImageSize, containerSize: BaseImageSize) => BaseImageSize; /** * * @param url * @returns */ export declare const fetchImageInfoByUrl: (url: string, containerSize: BaseImageSize) => Promise<FetchImageResult>; export declare const mergeCanvasImage: (scenes: (() => Promise<HTMLCanvasElement | null>)[]) => Promise<HTMLCanvasElement>; export declare const textColors: string[]; export declare const defaultStrokeColor: { r: number; g: number; b: number; }; export declare const defaultTextSize = 24; export declare const mediaMimeTypes: Record<string, string>; export declare const convertToNetlessBoardTool: (tool: FcrBoardToolType) => never[] | readonly [ApplianceNames.selector] | readonly [ApplianceNames.pencilEraser] | readonly [ApplianceNames.laserPointer] | readonly [ApplianceNames.hand] | readonly [ApplianceNames.text] | readonly [ApplianceNames.arrow] | readonly [ApplianceNames.rectangle] | readonly [ApplianceNames.ellipse] | readonly [ApplianceNames.straight] | readonly [ApplianceNames.pencil] | readonly [ApplianceNames.shape, ShapeType.Triangle] | readonly [ApplianceNames.shape, ShapeType.Pentagram] | readonly [ApplianceNames.shape, ShapeType.Rhombus] | readonly [ApplianceNames.clicker]; export declare const convertToNetlessStorkeType: (type: FcrBoardToolType) => EStrokeType.Normal | EStrokeType.Dotted | EStrokeType.LongDotted; export declare const convertToFcrBoardToolShape: (tool?: ApplianceNames, shape?: ShapeType) => FcrBoardToolType[] | (FcrBoardShape | undefined)[]; export declare const hexColorToWhiteboardColor: (val: string) => number[]; export declare const src2DataURL: (src: string) => Promise<string>;