Home Reference Source Test

Function

Static Public Summary
public

loadFZP(src: String, url: String): Promise

Load a FZP file from the given URL.

public

Load a FZP and all linked SVGs

public

Create a xml string of a FZP instance.

public
public

parse a fzp xml string

public

Get the parsed xml object and map to a proper structure

Static Public

public loadFZP(src: String, url: String): Promise source

Load a FZP file from the given URL.

Params:

NameTypeAttributeDescription
src String
url String

URL to the FZP file.

Return:

Promise

Example:

const {FZPUtils} = require('fzp-js')

FZPUtils.loadFZP('core/Arduino Nano3(fix).fzp')
.then((fzz) => {
  console.log(fzz.fz)
})
.catch((err) => {
  console.error(err)
})

public loadFZPandSVGs(src: String, url: String): FZP source

Load a FZP and all linked SVGs

Params:

NameTypeAttributeDescription
src String
url String

URL to the FZP file.

Return:

FZP

Example:

const {FZPUtils} = require('fzp-js')

FZPUtils.loadFZPandSVGs('core/Arduino Nano3(fix).fzp')
.then((fzz) => {
  console.log(fzz)
})
.catch((err) => {
  console.error(err)
})

public marshalToXML(fzp: FZP): String source

Create a xml string of a FZP instance.

Params:

NameTypeAttributeDescription
fzp FZP

Return:

String

Example:

const {marshalToXML} = require('fzp-js')

const xmlData = FZPUtils.marshalToXML(fzp)
console.log(xmlData)

public parseConnectorView(xml: Object): FZPConnectorView source

Params:

NameTypeAttributeDescription
xml Object

public parseFZP(data: String): Promise source

parse a fzp xml string

Params:

NameTypeAttributeDescription
data String

Return:

Promise

public parseProperties(xml: String): Object source

Get the parsed xml object and map to a proper structure

Params:

NameTypeAttributeDescription
xml String

Return:

Object