@contrail/documents
Advanced tools
Comparing version 1.0.8 to 1.0.9
import { DocumentElement } from './types/document-element'; | ||
export declare class DocumentElementFactory { | ||
private static initNewElement; | ||
static createTextElement(text: string): DocumentElement; | ||
static createShapeElement(type: string): DocumentElement; | ||
static createTextElement(text: string, options?: DocumentElement): DocumentElement; | ||
static createShapeElement(type: string, options?: DocumentElement): DocumentElement; | ||
static createImageElement(options: DocumentElement): DocumentElement; | ||
static createComponent(componentType: string, model: any, modelBindings: any, options?: DocumentElement): DocumentElement; | ||
} |
@@ -13,25 +13,7 @@ "use strict"; | ||
type, | ||
size: { | ||
width: 0, | ||
height: 0, | ||
}, | ||
style: { | ||
font: { | ||
size: 0, | ||
family: '', | ||
weight: '', | ||
style: '', | ||
}, | ||
text: { | ||
decoration: '', | ||
}, | ||
color: '', | ||
}, | ||
text: '', | ||
url: '', | ||
}; | ||
return element; | ||
} | ||
static createTextElement(text) { | ||
const element = this.initNewElement('text'); | ||
static createTextElement(text, options = {}) { | ||
let element = this.initNewElement('text'); | ||
element.text = text; | ||
@@ -42,7 +24,8 @@ element.size = { width: 65, height: 20 }; | ||
}; | ||
element = Object.assign(element, options); | ||
return element; | ||
} | ||
static createShapeElement(type) { | ||
const element = this.initNewElement('shape'); | ||
element.type = type; | ||
static createShapeElement(type, options = {}) { | ||
let element = this.initNewElement('shape'); | ||
element = Object.assign(element, options); | ||
return element; | ||
@@ -49,0 +32,0 @@ } |
{ | ||
"name": "@contrail/documents", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Documents library for contrail platform", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15649
407