R
fn

encodeSegments

tested

Returns a QR Code representing the given segments with the given encoding parameters. The smallest possible QR Code version within the given range is automatically chosen for the output. This is a mid-level API; the high-level API is encodeText() and encodeBinary().

Signature

ts
export function encodeSegments(
  segs: readonly QrSegment[],
  ecl: QrCodeEcc,
  minVersion = 1,
  maxVersion = 40,
  mask = -1,
  boostEcl = true,
): QrCode{ ... }

Parameters

ParameterTypeDescription
segsreadonly QrSegment[]
eclQrCodeEcc
minVersion?number
maxVersion?number
mask?number
boostEcl?boolean

Returns

QrCode