parent
9a5521dfd2
commit
cfc5fc699e
@ -1 +1 @@
|
|||||||
if("__TAURI__"in window){var __TAURI_NFC__=function(_){"use strict";return _.scanNdef=async function(){},_.scanTag=async function(){},_}({});Object.defineProperty(window.__TAURI__,"nfc",{value:__TAURI_NFC__})}
|
if("__TAURI__"in window){var __TAURI_NFC__=function(n){"use strict";var _;return n.ScanKind=void 0,(_=n.ScanKind||(n.ScanKind={}))[_.Ndef=0]="Ndef",_[_.Tag=1]="Tag",n.isAvailable=async function(){return await window.__TAURI_INVOKE__("plugin:nfc|isAvailable")},n.scan=async function(_,i){return await window.__TAURI_INVOKE__("plugin:nfc|scan",{kind:_===n.ScanKind.Ndef?"ndef":"tag",...i})},n}({});Object.defineProperty(window.__TAURI__,"nfc",{value:__TAURI_NFC__})}
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
|
||||||
// SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
use serde::de::DeserializeOwned;
|
|
||||||
use tauri::{plugin::PluginApi, AppHandle, Runtime};
|
|
||||||
|
|
||||||
use crate::models::*;
|
|
||||||
|
|
||||||
pub fn init<R: Runtime, C: DeserializeOwned>(
|
|
||||||
app: &AppHandle<R>,
|
|
||||||
_api: PluginApi<R, C>,
|
|
||||||
) -> crate::Result<Nfc<R>> {
|
|
||||||
Ok(Nfc(app.clone()))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Access to the nfc APIs.
|
|
||||||
pub struct Nfc<R: Runtime>(AppHandle<R>);
|
|
||||||
|
|
||||||
impl<R: Runtime> Nfc<R> {
|
|
||||||
pub fn ping(&self, payload: PingRequest) -> crate::Result<PingResponse> {
|
|
||||||
Ok(PingResponse {
|
|
||||||
value: payload.value,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in new issue