@visactor/vrender-kits
Version:
```typescript import { xxx } from '@visactor/vrender-kits'; ```
59 lines (58 loc) • 2.56 kB
TypeScript
import { BaseEnvContribution } from '@visactor/vrender-core';
import type { ICanvasLike, EnvType, ICreateCanvasParams, IEnvContribution, IGlobal, ITTCanvas } from '@visactor/vrender-core';
interface ITaro {
createCanvasContext: (id: string) => any;
canvasGetImageData: (data: {
canvasId: string;
x: number;
y: number;
width: number;
height: number;
success: (res: any) => void;
}) => any;
}
interface IConfigureParams {
domref: any;
canvasIdLists: string[];
freeCanvasIdx: number;
taro: ITaro;
pixelRatio: number;
}
export declare class TaroEnvContribution extends BaseEnvContribution implements IEnvContribution {
type: EnvType;
supportEvent: boolean;
canvasMap: Map<string, ITTCanvas>;
freeCanvasList: ITTCanvas[];
canvasIdx: number;
taro: ITaro;
pixelRatio: number;
constructor();
getDynamicCanvasCount(): number;
getStaticCanvasCount(): number;
mapToCanvasPoint(event: any): any;
configure(service: IGlobal, params: IConfigureParams): void;
loadImage(url: string): Promise<{
loadState: 'success' | 'fail';
data: HTMLImageElement | ImageData | null;
}>;
loadSvg(svgStr: string): Promise<{
loadState: 'success' | 'fail';
data: HTMLImageElement | ImageData | null;
}>;
createCanvas(params: ICreateCanvasParams): ITTCanvas;
createOffscreenCanvas(params: ICreateCanvasParams): void;
releaseCanvas(canvas: ICanvasLike | string): void;
getDevicePixelRatio(): number;
getRequestAnimationFrame(): (callback: FrameRequestCallback) => number;
getCancelAnimationFrame(): (h: number) => void;
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions | undefined): void;
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
dispatchEvent(event: any): boolean;
getElementById(str: string): any | null;
getRootElement(): HTMLElement | null;
getDocument(): Document | null;
release(...params: any): void;
}
export {};