ng-cw-v12
Version:
Angular UI component library
26 lines (25 loc) • 1.12 kB
TypeScript
import * as i0 from "@angular/core";
export interface NcHtml2canvasOptions {
type?: 'canvas' | 'base64' | 'blob';
scale?: number;
backgroundColor?: string;
}
export declare class NcHtml2canvasService {
constructor();
/**
* 截图
* @param dom 要截图的DOM元素
* @param options 截图配置
* @param options.type 输出图片的类型,可选值:'canvas' | 'base64' | 'blob',默认值:'canvas'
* @param options.scale 输出图片的缩放比例,值越大清晰度越高,默认值:1
* @param options.backgroundColor 输出图片的背景颜色,默认值:'white'
* @returns 根据type返回不同类型:
* - 'canvas': 返回 HTMLCanvasElement
* - 'base64': 返回 base64 字符串
* - 'blob': 返回 Blob 对象
*/
html2canvas(dom: HTMLElement, options?: NcHtml2canvasOptions): Promise<any>;
private getScreenScale;
static ɵfac: i0.ɵɵFactoryDeclaration<NcHtml2canvasService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<NcHtml2canvasService>;
}