feat: add options to the getValue api

pr675
Hufe921 2 years ago
parent 53701fc46c
commit 65acd580d6

@ -17,13 +17,9 @@ Usage:
```javascript
const {
version: string;
width: number;
height: number;
margins: IMargin;
header?: IHeader;
watermark?: IWatermark;
data: IEditorData;
version: string
data: IEditorData
options: IEditorOption
} = instance.command.getValue(options?: IGetValueOption)
```

@ -17,13 +17,9 @@ const value = instance.command.commandName()
```javascript
const {
version: string;
width: number;
height: number;
margins: IMargin;
header?: IHeader;
watermark?: IWatermark;
data: IEditorData;
version: string
data: IEditorData
options: IEditorOption
} = instance.command.getValue(options?: IGetValueOption)
```

@ -998,9 +998,6 @@ export class Draw {
}
public getValue(options: IGetValueOption = {}): IEditorResult {
// 配置
const { width, height, margins, watermark } = this.options
// 数据
const { pageNo } = options
let mainElementList = this.elementList
if (
@ -1019,11 +1016,8 @@ export class Draw {
}
return {
version,
width,
height,
margins,
watermark: watermark.data ? watermark : undefined,
data
data,
options: deepClone(this.options)
}
}

@ -91,11 +91,8 @@ export interface IEditorOption {
export interface IEditorResult {
version: string
width: number
height: number
margins: IMargin
watermark?: IWatermark
data: IEditorData
options: IEditorOption
}
export interface IEditorHTML {

Loading…
Cancel
Save