Constructor Summary
Public Constructor | ||
public |
Create a new component. |
Method Summary
Public Methods | ||
public |
addComponent(component: Component): Component Add a component to the component. |
|
public |
Add a property to the component. |
|
public |
componentNames(): string[] Get a frozen array of the component's components' names. |
|
public |
components(): Component[] Get a frozen array of the component's components. |
|
public |
Get a frozen array of the component's properties' names. |
|
public |
Get a frozen array of the component's properties. |
|
public |
reset() Reset the components components and properties to the default empty state. |
|
public |
Get a Base64 encoded string representation of the component. |
|
public |
toBlob(): Blob Get a Blob representation of the component. |
|
public |
Get a string representation of the component. |
|
public |
Validate if all required properties have been added. |
Public Constructors
Public Methods
public addComponent(component: Component): Component source
Add a component to the component.
Params:
Name | Type | Attribute | Description |
component | Component | Configured component to add to the component. |
Throw:
Provided component type is not in the component's list of valid component types. |
public addProp(name: string, value: *, props: Object, skipTransformer: boolean): Property source
Add a property to the component.
Params:
Name | Type | Attribute | Description |
name | string | Name of the property (e.g. DTSTAMP). |
|
value | * |
|
Value of the property. |
props | Object |
|
Object of properties for the property. Object keys and values are directly injected. |
skipTransformer | boolean |
|
Explicitly determine if the property's value is transformed. |
Throw:
Provided property type is not in the component's list of valid property types. |
public toBlob(): Blob source
Get a Blob representation of the component. Uses MIME_TYPE as the MIME type.
Note: This is a browser-only function unless a Blob polyfill is provided.
Return:
Blob | Blob representation of the component. |
Throw:
Blob is undefined. Usually due to running in Node without a polyfill. |