Interface: exports

module.exports

Members

(protected) __workaround__

because javascript is dumb, and we can't call getters and setters directly we have to do this silly workaround. if your inherited options class uses magic getters and setters, add the relevant property names to this array and call _fromIterable() afterwards: constructor($options = null){ super(); this.__workaround__.push('myMagicProp'); this._fromIterable($options) } let o = new MyExtendedOptions({myMagicProp: 'foo', ...}); note; for some reason we need to add the constructor with a parent call in extended classes even without the aforementioned workaround, otherwise the additional properties will not be recognized. wtfjs???
Source:

(protected) _canvasMimeType :string

canvas image mime type for bas64/file output the value may be one of the following (depends on browser/engine): - png - jpeg - bmp - webp the "image/" is prepended internally
Type:
  • string
Source:
See:

(protected) _circleRadius :number|float

specifies the radius of the modules when $svgDrawCircularModules is set to true
Type:
  • number | float
Source:

(protected) _eccLevel :EccLevel

the current ECC level
Type:
  • EccLevel
Source:

(protected) _eccLevel :number|int

Error correct level QRCode::ECC_X where X is: - L => 7% - M => 15% - Q => 25% - H => 30%
Type:
  • number | int
Source:

(protected) _logoSpaceHeight :number|int|null

height of the logo space
Type:
  • number | int | null
Source:

(protected) _logoSpaceStartX :number|int|null

optional horizontal start position of the logo space (top left corner)
Type:
  • number | int | null
Source:

(protected) _logoSpaceStartY :number|int|null

optional vertical start position of the logo space (top left corner)
Type:
  • number | int | null
Source:

(protected) _logoSpaceWidth :number|int|null

width of the logo space
Type:
  • number | int | null
Source:

(protected) _maskPattern :MaskPattern

the used mask pattern, set via QRMatrix::mask()
Type:
  • MaskPattern
Source:

(protected) _maskPattern :number|int

Mask Pattern to use (no value in using, mostly for unit testing purposes) [0...7] or QRCode::MASK_PATTERN_AUTO
Type:
  • number | int
Source:

(protected) _matrix :Array.<Array.<number>>|Array.<Array.<int>>

the actual matrix data array
Type:
  • Array.<Array.<number>> | Array.<Array.<int>>
Source:

(protected) _quietzoneSize :number|int

Size of the quiet zone internally clamped to [0 ... $moduleCount / 2], defaults to 4 modules
Type:
  • number | int
Source:

(protected) _version :Version

a Version instance
Type:
  • Version
Source:

(protected) _version :number|int

QR Code version number [1 ... 40] or QRCode.VERSION_AUTO
Type:
  • number | int
Source:

(protected) _versionMax :number|int

Maximum QR version
Type:
  • number | int
Source:

(protected) _versionMin :number|int

Minimum QR version if $version = QRCode.VERSION_AUTO
Type:
  • number | int
Source:

addLogoSpace :boolean

Toggles logo space creation
Type:
  • boolean
Source:

addQuietzone :boolean

Add a "quiet zone" (margin) according to the QR code spec
Type:
  • boolean
Source:
See:

bgcolor :*|null

background color supported in: - OUTPUT_CANVAS
Type:
  • * | null
Source:

buffer :Array.<number>|Array.<int>

The buffer content
Type:
  • Array.<number> | Array.<int>
Source:

cachefile :string|null

/path/to/cache.file
Type:
  • string | null
Source:

(protected) canvas :HTMLCanvasElement

Type:
  • HTMLCanvasElement
Source:

canvasElement :HTMLCanvasElement

the canvas HTML element (canvas output only)
Type:
  • HTMLCanvasElement
Source:
See:

canvasImageQuality :number|float

canvas image quality "A number between 0 and 1 indicating the image quality to be used when creating images using file formats that support lossy compression (such as image/jpeg or image/webp). A user agent will use its default quality value if this option is not specified, or if the number is outside the allowed range."
Type:
  • number | float
Source:
See:

connectPaths :boolean

whether to connect the paths for the several module types to avoid weird glitches when using gradients etc.
Type:
  • boolean
Source:
See:

(protected) context :CanvasRenderingContext2D

Type:
  • CanvasRenderingContext2D
Source:

cssClass :string

a common css class
Type:
  • string
Source:

data :string

The data to write
Type:
  • string
Source:

(protected) dataSegments :Array

Type:
  • Array
Source:

datamode

Source:

datamode

Source:

datamode

Source:

(abstract) datamode :number|int

the current data mode: Num, Alphanum, Kanji, Byte
Type:
  • number | int
Source:

drawCircularModules :boolean

specify whether to draw the modules as filled circles a note for GDImage output: if QROptions::$scale is less or equal than 20, the image will be upscaled internally, then the modules will be drawn using imagefilledellipse() and then scaled back to the expected size using IMG_BICUBIC which in turn produces unexpected outcomes in combination with transparency - to avoid this, set scale to a value greater than 20.
Type:
  • boolean
Source:
See:

drawLightModules :boolean

whether to draw the light (false) modules
Type:
  • boolean
Source:

eccLevel :EccLevel

$eccLevel
Type:
  • EccLevel
Source:

eol :string

newline string [HTML, SVG, TEXT]
Type:
  • string
Source:

excludeFromConnect :Array.<number>|Array.<int>

specify which paths/patterns to exclude from connecting if $svgConnectPaths is set to true
Type:
  • Array.<number> | Array.<int>
Source:

imageTransparent :boolean

toggle background transparency if transparency is disabled, a background color should be specified to avoid unexpected outcomes
Type:
  • boolean
Source:
See:
  • QROptions.bgcolor

keepAsSquare :Array.<number>|Array.<int>

specifies which module types to exclude when $svgDrawCircularModules is set to true
Type:
  • Array.<number> | Array.<int>
Source:

length :number|int

Length of the content (bits)
Type:
  • number | int
Source:

(protected) length :number|int

the side length of the QR image (modules * scale)
Type:
  • number | int
Source:

(protected) matrix :QRMatrix

the (filled) data matrix object
Type:
  • QRMatrix
Source:

mimeType

Source:

mimeType

Source:

(protected) mimeType :string

Type:
  • string
Source:
See:
  • QROutputAbstract.toBase64DataURI()

mimeType

Source:

mimeType

Source:

(protected) moduleCount :number|int

the size (side length) of the matrix, including quiet zone (if created)
Type:
  • number | int
Source:

(protected) moduleCount :number|int

the current size of the QR matrix
Type:
  • number | int
Source:
See:
  • QRMatrix.getSize()

(protected) moduleValues :Object.<number, *>

an (optional) array of color values for the several QR matrix parts
Type:
  • Object.<number, *>
Source:

moduleValues :Object.<number, *>|null

Module values map - HTML, IMAGICK: #ABCDEF, cssname, rgb(), rgba()... - IMAGE: [63, 127, 255] // R, G, B
Type:
  • Object.<number, *> | null
Source:

(protected) options :QROptions

Type:
  • QROptions
Source:

(protected) options :QROptions

Type:
  • QROptions
Source:

outputBase64 :boolean

toggle base64 or raw image data
Type:
  • boolean
Source:

outputInterface :string|null

the FQCN of the custom QROutputInterface if $outputType is set to QRCode::OUTPUT_CUSTOM
Type:
  • string | null
Source:

returnAsDomElement :boolean

whether to return the markup as DOM element
Type:
  • boolean
Source:

(protected) scale :number|int

the current scaling for a QR pixel
Type:
  • number | int
Source:
See:
  • QROptions.$scale

scale :number|int

size of a QR code module in pixels [SVG, IMAGE_*], HTML via CSS
Type:
  • number | int
Source:

(protected) schema :string

the json schema
Type:
  • string
Source:

svgAddXmlHeader :boolean

Whether to add an XML header line or not, e.g. to embed the SVG directly in HTML ``
Type:
  • boolean
Source:

svgDefs :string

anything between
Type:
  • string
Source:
See:

svgOpacity :number|float

SVG opacity
Type:
  • number | float
Source:

svgPreserveAspectRatio :string

Type:
  • string
Source:
See:

svgUseFillAttributes :boolean

Whether to use the SVG `fill` attributes If set to `true` (default), the `fill` attribute will be set with the module value for the `` element's `$M_TYPE`. When set to `false`, the module values map will be ignored and the QR Code may be styled via CSS.
Type:
  • boolean
Source:
See:

version :Version

$version
Type:
  • Version
Source:

module.exports

Members

(protected) __workaround__

because javascript is dumb, and we can't call getters and setters directly we have to do this silly workaround. if your inherited options class uses magic getters and setters, add the relevant property names to this array and call _fromIterable() afterwards: constructor($options = null){ super(); this.__workaround__.push('myMagicProp'); this._fromIterable($options) } let o = new MyExtendedOptions({myMagicProp: 'foo', ...}); note; for some reason we need to add the constructor with a parent call in extended classes even without the aforementioned workaround, otherwise the additional properties will not be recognized. wtfjs???
Source:

(protected) _canvasMimeType :string

canvas image mime type for bas64/file output the value may be one of the following (depends on browser/engine): - png - jpeg - bmp - webp the "image/" is prepended internally
Type:
  • string
Source:
See:

(protected) _circleRadius :number|float

specifies the radius of the modules when $svgDrawCircularModules is set to true
Type:
  • number | float
Source:

(protected) _eccLevel :EccLevel

the current ECC level
Type:
  • EccLevel
Source:

(protected) _eccLevel :number|int

Error correct level QRCode::ECC_X where X is: - L => 7% - M => 15% - Q => 25% - H => 30%
Type:
  • number | int
Source:

(protected) _logoSpaceHeight :number|int|null

height of the logo space
Type:
  • number | int | null
Source:

(protected) _logoSpaceStartX :number|int|null

optional horizontal start position of the logo space (top left corner)
Type:
  • number | int | null
Source:

(protected) _logoSpaceStartY :number|int|null

optional vertical start position of the logo space (top left corner)
Type:
  • number | int | null
Source:

(protected) _logoSpaceWidth :number|int|null

width of the logo space
Type:
  • number | int | null
Source:

(protected) _maskPattern :MaskPattern

the used mask pattern, set via QRMatrix::mask()
Type:
  • MaskPattern
Source:

(protected) _maskPattern :number|int

Mask Pattern to use (no value in using, mostly for unit testing purposes) [0...7] or QRCode::MASK_PATTERN_AUTO
Type:
  • number | int
Source:

(protected) _matrix :Array.<Array.<number>>|Array.<Array.<int>>

the actual matrix data array
Type:
  • Array.<Array.<number>> | Array.<Array.<int>>
Source:

(protected) _quietzoneSize :number|int

Size of the quiet zone internally clamped to [0 ... $moduleCount / 2], defaults to 4 modules
Type:
  • number | int
Source:

(protected) _version :Version

a Version instance
Type:
  • Version
Source:

(protected) _version :number|int

QR Code version number [1 ... 40] or QRCode.VERSION_AUTO
Type:
  • number | int
Source:

(protected) _versionMax :number|int

Maximum QR version
Type:
  • number | int
Source:

(protected) _versionMin :number|int

Minimum QR version if $version = QRCode.VERSION_AUTO
Type:
  • number | int
Source:

addLogoSpace :boolean

Toggles logo space creation
Type:
  • boolean
Source:

addQuietzone :boolean

Add a "quiet zone" (margin) according to the QR code spec
Type:
  • boolean
Source:
See:

bgcolor :*|null

background color supported in: - OUTPUT_CANVAS
Type:
  • * | null
Source:

buffer :Array.<number>|Array.<int>

The buffer content
Type:
  • Array.<number> | Array.<int>
Source:

cachefile :string|null

/path/to/cache.file
Type:
  • string | null
Source:

(protected) canvas :HTMLCanvasElement

Type:
  • HTMLCanvasElement
Source:

canvasElement :HTMLCanvasElement

the canvas HTML element (canvas output only)
Type:
  • HTMLCanvasElement
Source:
See:

canvasImageQuality :number|float

canvas image quality "A number between 0 and 1 indicating the image quality to be used when creating images using file formats that support lossy compression (such as image/jpeg or image/webp). A user agent will use its default quality value if this option is not specified, or if the number is outside the allowed range."
Type:
  • number | float
Source:
See:

connectPaths :boolean

whether to connect the paths for the several module types to avoid weird glitches when using gradients etc.
Type:
  • boolean
Source:
See:

(protected) context :CanvasRenderingContext2D

Type:
  • CanvasRenderingContext2D
Source:

cssClass :string

a common css class
Type:
  • string
Source:

data :string

The data to write
Type:
  • string
Source:

(protected) dataSegments :Array

Type:
  • Array
Source:

datamode

Source:

datamode

Source:

datamode

Source:

(abstract) datamode :number|int

the current data mode: Num, Alphanum, Kanji, Byte
Type:
  • number | int
Source:

drawCircularModules :boolean

specify whether to draw the modules as filled circles a note for GDImage output: if QROptions::$scale is less or equal than 20, the image will be upscaled internally, then the modules will be drawn using imagefilledellipse() and then scaled back to the expected size using IMG_BICUBIC which in turn produces unexpected outcomes in combination with transparency - to avoid this, set scale to a value greater than 20.
Type:
  • boolean
Source:
See:

drawLightModules :boolean

whether to draw the light (false) modules
Type:
  • boolean
Source:

eccLevel :EccLevel

$eccLevel
Type:
  • EccLevel
Source:

eol :string

newline string [HTML, SVG, TEXT]
Type:
  • string
Source:

excludeFromConnect :Array.<number>|Array.<int>

specify which paths/patterns to exclude from connecting if $svgConnectPaths is set to true
Type:
  • Array.<number> | Array.<int>
Source:

imageTransparent :boolean

toggle background transparency if transparency is disabled, a background color should be specified to avoid unexpected outcomes
Type:
  • boolean
Source:
See:
  • QROptions.bgcolor

keepAsSquare :Array.<number>|Array.<int>

specifies which module types to exclude when $svgDrawCircularModules is set to true
Type:
  • Array.<number> | Array.<int>
Source:

length :number|int

Length of the content (bits)
Type:
  • number | int
Source:

(protected) length :number|int

the side length of the QR image (modules * scale)
Type:
  • number | int
Source:

(protected) matrix :QRMatrix

the (filled) data matrix object
Type:
  • QRMatrix
Source:

mimeType

Source:

mimeType

Source:

(protected) mimeType :string

Type:
  • string
Source:
See:
  • QROutputAbstract.toBase64DataURI()

mimeType

Source:

mimeType

Source:

(protected) moduleCount :number|int

the size (side length) of the matrix, including quiet zone (if created)
Type:
  • number | int
Source:

(protected) moduleCount :number|int

the current size of the QR matrix
Type:
  • number | int
Source:
See:
  • QRMatrix.getSize()

(protected) moduleValues :Object.<number, *>

an (optional) array of color values for the several QR matrix parts
Type:
  • Object.<number, *>
Source:

moduleValues :Object.<number, *>|null

Module values map - HTML, IMAGICK: #ABCDEF, cssname, rgb(), rgba()... - IMAGE: [63, 127, 255] // R, G, B
Type:
  • Object.<number, *> | null
Source:

(protected) options :QROptions

Type:
  • QROptions
Source:

(protected) options :QROptions

Type:
  • QROptions
Source:

outputBase64 :boolean

toggle base64 or raw image data
Type:
  • boolean
Source:

outputInterface :string|null

the FQCN of the custom QROutputInterface if $outputType is set to QRCode::OUTPUT_CUSTOM
Type:
  • string | null
Source:

returnAsDomElement :boolean

whether to return the markup as DOM element
Type:
  • boolean
Source:

(protected) scale :number|int

the current scaling for a QR pixel
Type:
  • number | int
Source:
See:
  • QROptions.$scale

scale :number|int

size of a QR code module in pixels [SVG, IMAGE_*], HTML via CSS
Type:
  • number | int
Source:

(protected) schema :string

the json schema
Type:
  • string
Source:

svgAddXmlHeader :boolean

Whether to add an XML header line or not, e.g. to embed the SVG directly in HTML ``
Type:
  • boolean
Source:

svgDefs :string

anything between
Type:
  • string
Source:
See:

svgOpacity :number|float

SVG opacity
Type:
  • number | float
Source:

svgPreserveAspectRatio :string

Type:
  • string
Source:
See:

svgUseFillAttributes :boolean

Whether to use the SVG `fill` attributes If set to `true` (default), the `fill` attribute will be set with the module value for the `` element's `$M_TYPE`. When set to `false`, the module values map will be ignored and the QR Code may be styled via CSS.
Type:
  • boolean
Source:
See:

version :Version

$version
Type:
  • Version
Source: