@tma.js/sdk 2.6.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1965,7 +1965,7 @@ class Be extends q {
|
|
|
1965
1965
|
}), this.postEvent = n;
|
|
1966
1966
|
}
|
|
1967
1967
|
/**
|
|
1968
|
-
* Closes scanner.
|
|
1968
|
+
* Closes the scanner.
|
|
1969
1969
|
*/
|
|
1970
1970
|
close() {
|
|
1971
1971
|
this.postEvent("web_app_close_scan_qr_popup"), this.isOpened = !1;
|
|
@@ -1974,14 +1974,14 @@ class Be extends q {
|
|
|
1974
1974
|
this.set("isOpened", t);
|
|
1975
1975
|
}
|
|
1976
1976
|
/**
|
|
1977
|
-
* Returns true
|
|
1977
|
+
* Returns true if the scanner is currently opened.
|
|
1978
1978
|
*/
|
|
1979
1979
|
get isOpened() {
|
|
1980
1980
|
return this.get("isOpened");
|
|
1981
1981
|
}
|
|
1982
1982
|
async open(t) {
|
|
1983
1983
|
if (this.isOpened)
|
|
1984
|
-
throw new Error("
|
|
1984
|
+
throw new Error("The scanner is already opened");
|
|
1985
1985
|
const { text: s, capture: n } = (typeof t == "string" ? { text: t } : t) || {};
|
|
1986
1986
|
this.isOpened = !0;
|
|
1987
1987
|
try {
|
|
@@ -1995,10 +1995,11 @@ class Be extends q {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
}) || {}).data || null;
|
|
1997
1997
|
return i && this.close(), i;
|
|
1998
|
-
}
|
|
1999
|
-
|
|
1998
|
+
} finally {
|
|
1999
|
+
this.isOpened = !1;
|
|
2000
2000
|
}
|
|
2001
2001
|
}
|
|
2002
|
+
// TODO: Streaming mode, allowing to scan several QRs until closed.
|
|
2002
2003
|
}
|
|
2003
2004
|
const ls = l(
|
|
2004
2005
|
({ version: e, postEvent: t }) => new Be(!1, e, t)
|