feat: add options to the getValue api
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user