Commit d78951e4 authored by rockyl's avatar rockyl

首次发布

parent ac4c7484
{ {
"name": "html-shot", "name": "html-shot",
"version": "1.0.0", "version": "1.0.1",
"main": "dist/index.js", "main": "dist/index.js",
"types": "types/index.d.ts", "types": "types/index.d.ts",
"license": "MIT", "license": "MIT",
......
...@@ -47,6 +47,7 @@ export interface RenderOptions { ...@@ -47,6 +47,7 @@ export interface RenderOptions {
* @param data * @param data
* @param options * @param options
* @param callback * @param callback
* @return Promise<HTMLCanvasElement | string>
*/ */
export async function toCanvas(data: ICData, options: RenderOptions = {}, callback?: (canvas: HTMLCanvasElement) => void): Promise<HTMLCanvasElement | string> { export async function toCanvas(data: ICData, options: RenderOptions = {}, callback?: (canvas: HTMLCanvasElement) => void): Promise<HTMLCanvasElement | string> {
const {type: exportType = 'png', quality = 0.7} = options; const {type: exportType = 'png', quality = 0.7} = options;
......
...@@ -41,6 +41,7 @@ export interface RenderOptions { ...@@ -41,6 +41,7 @@ export interface RenderOptions {
* @param data * @param data
* @param options * @param options
* @param callback * @param callback
* @return Promise<HTMLCanvasElement | string>
*/ */
export declare function toCanvas(data: ICData, options?: RenderOptions, callback?: (canvas: HTMLCanvasElement) => void): Promise<HTMLCanvasElement | string>; export declare function toCanvas(data: ICData, options?: RenderOptions, callback?: (canvas: HTMLCanvasElement) => void): Promise<HTMLCanvasElement | string>;
export {}; export {};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment