You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tauri-plugins-workspace/plugins/camera/dist-js/index.min.js

65 lines
1.8 KiB

var d$1 = Object.defineProperty;
var e = (c, a) => {
for (var b in a) d$1(c, b, { get: a[b], enumerable: !0 });
};
var w = {};
e(w, { convertFileSrc: () => u, invoke: () => d, transformCallback: () => s });
function l() {
return window.crypto.getRandomValues(new Uint32Array(1))[0];
}
function s(r, n = !1) {
let e = l(),
t = `_${e}`;
return (
Object.defineProperty(window, t, {
value: (o) => (n && Reflect.deleteProperty(window, t), r?.(o)),
writable: !1,
configurable: !0,
}),
e
);
}
async function d(r, n = {}) {
return new Promise((e, t) => {
let o = s((i) => {
e(i), Reflect.deleteProperty(window, `_${a}`);
}, !0),
a = s((i) => {
t(i), Reflect.deleteProperty(window, `_${o}`);
}, !0);
window.__TAURI_IPC__({ cmd: r, callback: o, error: a, ...n });
});
}
function u(r, n = "asset") {
let e = encodeURIComponent(r);
return navigator.userAgent.includes("Windows")
? `https://${n}.localhost/${e}`
: `${n}://localhost/${e}`;
}
// Copyright 2019-2022 Tauri Programme within The Commons Conservancy
var Source;
(function (Source) {
Source["Prompt"] = "PROMPT";
Source["Camera"] = "CAMERA";
Source["Photos"] = "PHOTOS";
})(Source || (Source = {}));
var ResultType;
(function (ResultType) {
ResultType["Uri"] = "uri";
ResultType["Base64"] = "base64";
ResultType["DataUrl"] = "dataUrl";
})(ResultType || (ResultType = {}));
var CameraDirection;
(function (CameraDirection) {
CameraDirection["Rear"] = "REAR";
CameraDirection["Front"] = "FRONT";
})(CameraDirection || (CameraDirection = {}));
async function getPhoto(options) {
return await d("plugin:camera|getPhoto", { ...options });
}
export { CameraDirection, ResultType, Source, getPhoto };
//# sourceMappingURL=index.min.js.map