Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mebjas authored Jun 14, 2021
1 parent 79f580a commit 5b72520
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,16 +339,33 @@ enum Html5QrcodeSupportedFormats {
UPC_EAN_EXTENSION,
}

/**
* Type for a callback for a successful code scan.
*/
export type QrcodeSuccessCallback
/** Format of detected code. */
class QrcodeResultFormat {
public readonly format: Html5QrcodeSupportedFormats;
public readonly formatName: string;
}

/** Detailed scan result. */
interface QrcodeResult {
/** Decoded text. */
text: string;

/** Format that was successfully scanned. */
format?: QrcodeResultFormat,
}

/** QrCode result object. */
interface Html5QrcodeResult {
decodedText: string;
result: QrcodeResult;
}

/** Type for a callback for a successful code scan. */
type QrcodeSuccessCallback
= (decodedText: string, result: Html5QrcodeResult) => void;

/**
* Type for a callback for failure during code scan.
*/
export type QrcodeErrorCallback
/** Type for a callback for failure during code scan. */
type QrcodeErrorCallback
= (errorMessage: string, error: Html5QrcodeError) => void;

/**
Expand Down

0 comments on commit 5b72520

Please sign in to comment.