@opentui/qrcode/solid

Every export of @opentui/qrcode/solid in the 0.6.0 release, from its type declarations. A version names the release that added an export after the module's first release.

Functions#

function createQrSvg(text: string, options?: EncodeOptions & { ecl?: ErrorCorrectionLevel; border?: number; moduleSize?: number; }): string
function encodeTextBytes(text: string, encoding?: ByteEncoding): Uint8Array
function registerQRCode(): void
QR code

Classes#

class QRCode
  • method QRCode.getModule(x: number, y: number): boolean
  • method QRCode.toMatrix(): boolean[][]
  • method QRCode.toSvgString(options?: { border?: number; moduleSize?: number; lightColor?: string; darkColor?: string; }): string
  • method QRCode.toTerminalString(options?: number | TerminalRenderOptions): string
  • readonly property QRCode.containsEci: boolean
  • readonly property QRCode.errorCorrectionLevel: ErrorCorrectionLevel
  • readonly property QRCode.fnc1: "none" | "first" | "second"
  • readonly property QRCode.mask: number
  • readonly property QRCode.size: number
  • readonly property QRCode.symbologyIdentifier: string
  • readonly property QRCode.version: number
  • static method QRCode.computeStructuredAppendParity(segments: readonly QrSegment[]): number
  • static method QRCode.encodeBytes(bytes: Uint8Array | number[], ecl?: ErrorCorrectionLevel, options?: EncodeOptions): QRCode
  • static method QRCode.encodeEciText(escapedText: string, ecl?: ErrorCorrectionLevel, options?: EncodeOptions): QRCode
  • static method QRCode.encodeGs1Text(gs1Data: string | Gs1Element[], ecl?: ErrorCorrectionLevel, options?: EncodeOptions): QRCode
  • static method QRCode.encodeSegments(segments: QrSegment[], ecl?: ErrorCorrectionLevel, options?: EncodeOptions): QRCode
  • static method QRCode.encodeStructuredAppend(parts: readonly (readonly QrSegment[])[], ecl?: ErrorCorrectionLevel, options?: EncodeOptions): QRCode[]
  • static method QRCode.encodeText(text: string, ecl?: ErrorCorrectionLevel, options?: EncodeOptions): QRCode
  • static method QRCode.maskCondition(mask: number, x: number, y: number): boolean
  • static method QRCode.validateVersionPublic(version: number): void
class QRCodeRenderable extends BaseQRCodeRenderable<ErrorCorrectionLevel, number, QRCode>constructor QRCodeRenderable(ctx: RenderContext, options?: QRCodeOptions)
  • static protected readonly property QRCodeRenderable._defaultOptions: { content: string; errorCorrectionLevel: ErrorCorrectionLevel.M; quietZone: number; scale: number; fit: QRCodeFitMode; foregroundColor: RGBA; backgroundColor: RGBA; fallbackContent: string; fallbackColor: RGBA; }
class QrSegment
  • method QrSegment.getTotalBits(version: number): number
  • readonly property QrSegment.data: BitBuffer
  • readonly property QrSegment.mode: Mode
  • readonly property QrSegment.numChars: number
  • readonly property QrSegment.parityBytes: readonly number[]
  • static method QrSegment.isAlphanumeric(text: string): boolean
  • static method QrSegment.isKanji(text: string): boolean
  • static method QrSegment.isNumeric(text: string): boolean
  • static method QrSegment.makeAlphanumeric(text: string): QrSegment
  • static method QrSegment.makeBytes(bytes: Uint8Array | number[]): QrSegment
  • static method QrSegment.makeBytesFromText(text: string, encoding?: ByteEncoding): QrSegment
  • static method QrSegment.makeEci(assignVal: number): QrSegment
  • static method QrSegment.makeEciSegmentsFromEscapedText(escapedText: string, options?: { defaultEncoding?: ByteEncoding; defaultEci?: number | null; }): QrSegment[]
  • static method QrSegment.makeFnc1FirstPosition(): QrSegment
  • static method QrSegment.makeFnc1SecondPosition(applicationIndicator: string | number): QrSegment
  • static method QrSegment.makeKanji(text: string): QrSegment
  • static method QrSegment.makeKanjiFromShiftJis(bytes: Uint8Array | number[]): QrSegment
  • static method QrSegment.makeNumeric(digits: string): QrSegment
  • static method QrSegment.makeOptimizedSegments(text: string, version: number, options?: Pick<EncodeOptions, "eciForUtf8" | "kanji" | "byteEncoding" | "eciAssignment">): QrSegment[]
  • static method QrSegment.makeSegments(text: string, options?: Pick<EncodeOptions, "eciForUtf8" | "kanji" | "byteEncoding" | "eciAssignment">): QrSegment[]
  • static method QrSegment.makeStructuredAppendHeader(position: number, total: number, parity: number): QrSegment

Interfaces#

interface EncodeOptions
  • property EncodeOptions.boostEcl?: boolean
  • property EncodeOptions.byteEncoding?: ByteEncoding
  • property EncodeOptions.eciAssignment?: number | null
  • property EncodeOptions.eciForUtf8?: boolean
  • property EncodeOptions.fnc1First?: boolean
  • property EncodeOptions.fnc1Second?: Fnc1SecondPositionInfo
  • property EncodeOptions.kanji?: boolean
  • property EncodeOptions.mask?: number
  • property EncodeOptions.maxVersion?: number
  • property EncodeOptions.minVersion?: number
  • property EncodeOptions.optimize?: boolean
  • property EncodeOptions.structuredAppend?: StructuredAppendInfo
interface Fnc1SecondPositionInfo
  • property Fnc1SecondPositionInfo.applicationIndicator: string | number
interface Gs1Element
  • property Gs1Element.ai: string
  • property Gs1Element.data: string
  • property Gs1Element.separatorAfter?: boolean
interface QRCodeOptions extends QRCodeSharedOptions<QRCodeRenderable, ErrorCorrectionLevel>
interface StructuredAppendInfo
  • property StructuredAppendInfo.parity: number
  • property StructuredAppendInfo.position: number
  • property StructuredAppendInfo.total: number
interface TerminalRenderOptions
  • property TerminalRenderOptions.ansi?: boolean
  • property TerminalRenderOptions.border?: number
  • property TerminalRenderOptions.invert?: boolean

Types#

type ByteEncoding = "utf-8" | "iso-8859-1" | "shift-jis"
type QRCodeFitMode = "contain" | "none"

Enums#

enum ErrorCorrectionLevel
  • enum-member ErrorCorrectionLevel.H = "H"
  • enum-member ErrorCorrectionLevel.L = "L"
  • enum-member ErrorCorrectionLevel.M = "M"
  • enum-member ErrorCorrectionLevel.Q = "Q"

Constants and variables#

const EciAssignment: { readonly ISO_8859_1: 3; readonly SHIFT_JIS: 20; readonly UTF_8: 26; }