From a0fb9034bfadcea9db51d9a15423f01065d07f99 Mon Sep 17 00:00:00 2001 From: semdy <501859275@qq.com> Date: Tue, 25 Jul 2023 16:07:51 +0800 Subject: [PATCH] chore: update ts decoration --- index.d.ts | 7 ++++--- package.json | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index.d.ts b/index.d.ts index 165d464..da88490 100644 --- a/index.d.ts +++ b/index.d.ts @@ -11,7 +11,6 @@ export interface IPoint { export type IMouseEvent = MouseEvent & { stageX: number; stageY: number } export interface IOptions { - root: HTMLElement | null width?: number | 'auto' height?: number | 'auto' openSmooth?: boolean @@ -33,14 +32,16 @@ export interface IOptions { onDrawUp?: (evt: IMouseEvent, img: HTMLImageElement) => void } +export type ConstructorOptions = IOptions & { root: HTMLElement | null } + export default class Signature { static defaultOptions: IOptions - constructor(options?: IOptions) + constructor(options?: ConstructorOptions) setLineWidth: (width: number) => void setColor: (color: string) => void - setOptions: (options: Omit) => void + setOptions: (options: IOptions) => void clear: () => void undo: () => void redo: () => void diff --git a/package.json b/package.json index 1406f3a..9d823c6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "h5-signature", - "version": "0.2.7", + "version": "0.2.8", "description": "h5 signature", "main": "lib/index.js", "module": "es/index.js",