Barcode Types
BarcodeFormat
The list of possible barcode formats.
A BarcodeFormat can be one of the following values:
"code128""code39""ean13""ean8""upc""itf14""msi""pharmacode""codabar"
GenerateQRCodeAction
An event that is used to generate a QR Code as a data URL image.
Members
code string
The code to generate.
options? GenerateQRCodeOptions
The options for generating the QR code.
playerId? string
The ID of the player that created this task. Set by remote action handlers when a task is recieved from a remote player.
taskId (string | number)
The ID of the async task.
type "generate_qr_code"
The type of the event. This helps determine how the event should be applied to the state.
uncopiable? boolean
Whether the action can be structure cloned. If true, then the action should not be passed across message ports without special handling.
GenerateQRCodeOptions
The options that can be used when generating a QR code.
Members
color? QRCodeColorOptions
The color options for the QR Code.
errorCorrectionLevel? ("low" | "medium" | "quartile" | "high")
The error correction level to use for the QR code.
Defaults to 'medium'.
'low' - 7% of codewords can be restored. 'medium' - 15% of codewords can be restored. 'quartile' - 25% of codewords can be restored. 'high' - 30% of codewords can be restored.
imageFormat? ("image/jpeg" | "image/webp" | "image/png")
The image format that should be used for the generated QR code.
margin? number
Defines how wide the quiet zone should be around the QR code.
Defaults to
4.maskPattern? (0 | 1 | 2 | 3 | 7 | 5 | 4 | 6)
The mask pattern to use for the QR Code.
Must be between 0 and 7.
If not specified, then the best mask pattern will be chosen automatically.
scale? number
The scale factor that the QR code should have. That is, how many pixels each module (black or white dot) should be. A value of
1means1pxper modules (black dots).Defaults to 4
version? number
The QR Code version to use. Must be between 1 and 40.
Higher values store more data, lower values store less data.
Defaults to automatic selection based on the length of the code.
width? number
The width of the generated QR code in pixels. Defaults to generating the smallest code that can fit the data.
If both width and scale are specified, then width takes precedence. If the code is too small to fit the code with the given width, then the width will be increased to fit.
Defaults to
256.