@spencerls/react-native-nfc 1.0.9 → 1.0.11

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/README.md CHANGED
@@ -6,19 +6,17 @@ A clean, React-friendly, **cross-platform** NFC layer built on top of
6
6
  ## 🎯 Truly Cross-Platform
7
7
 
8
8
  Write your NFC code once and it works on **both iOS and Android**.
9
- The only platform-specific code is the optional Android reader mode configuration.
10
- Everything else—reading, writing, and all NFC operations—uses the exact same API.
9
+ All NFC operations use the exact same API across platforms.
11
10
 
12
11
  This package provides:
13
12
 
14
- - A unified NFC service (`nfcService`)
13
+ - A unified NFC service with job-based architecture (`nfcService`)
15
14
  - High-level protocol namespaces (`nfc.tag`, `nfc.v`, `nfc.ndef`)
16
15
  - Low-level tag modules (`nfcTag`, `nfcVTag`, `nfcNdefTag`)
17
- - Automatic iOS reader restarts
18
- - Safe Android reader handling
19
- - Optional React hooks and provider
16
+ - React hooks for one-shot and continuous NFC sessions
20
17
  - Technology sessions for NDEF/NfcV and raw commands
21
18
  - Builder pattern for NDEF records
19
+ - Automatic session management and cleanup
22
20
 
23
21
  The API is designed to be stable, predictable, and easy to use across iOS and Android.
24
22
 
@@ -28,15 +26,13 @@ The API is designed to be stable, predictable, and easy to use across iOS and An
28
26
 
29
27
  | Feature | iOS | Android |
30
28
  |---------|-----|---------|
31
- | Reader Mode* | | ✅ |
29
+ | Technology Sessions | | ✅ |
30
+ | Tag Event Handling | ✅ | ✅ |
32
31
  | NDEF Read/Write | ✅ | ✅ |
33
32
  | NFC-V (ISO15693) | ✅ | ✅ |
34
- | Technology Sessions | ✅ | ✅ |
35
33
  | React Hooks | ✅ | ✅ |
36
34
 
37
- **\*Reader Mode** is Android's background NFC scanning API. iOS uses Technology Sessions instead.
38
- **Platform-specific code:** Only `enableReaderMode_ANDROID()` is Android-specific (no-op on iOS).
39
- All other APIs work identically on both platforms.
35
+ **100% Cross-Platform** - All APIs work identically on both platforms.
40
36
 
41
37
  ---
42
38
 
@@ -56,32 +52,46 @@ Works with:
56
52
 
57
53
  ---
58
54
 
59
- ## Basic Usage (Reader Mode)
55
+ ## Quick Start
60
56
 
61
- ```tsx
62
- import { useNfc, useNfcState, nfcService } from "@spencerls/react-native-nfc";
63
- import { NfcAdapter } from "react-native-nfc-manager";
57
+ ### One-Shot Tag Read
64
58
 
65
- export default function ScannerScreen() {
66
- const { mode } = useNfcState();
59
+ ```tsx
60
+ import { useNfcTech, nfcTag } from "@spencerls/react-native-nfc";
61
+ import { NfcTech } from "react-native-nfc-manager";
67
62
 
68
- // Platform-specific: Configure Android reader mode (no-op on iOS)
69
- // Call once, typically at app startup or in useEffect
70
- nfcService.enableReaderMode_ANDROID(
71
- NfcAdapter.FLAG_READER_NFC_V |
72
- NfcAdapter.FLAG_READER_NO_PLATFORM_SOUNDS
63
+ export default function ScanButton() {
64
+ const { startTech } = useNfcTech(
65
+ [NfcTech.Ndef, NfcTech.NfcV],
66
+ async () => {
67
+ const tag = await nfcTag.getTag();
68
+ console.log("Tag ID:", tag.id);
69
+ }
73
70
  );
74
71
 
75
- // Cross-platform: Works identically on iOS and Android
76
- useNfc((tagId) => {
77
- console.log("Scanned:", tagId);
78
- }, {
79
- cooldownMs: 800
80
- });
72
+ return <Button title="Scan NFC" onPress={startTech} />;
73
+ }
74
+ ```
75
+
76
+ ### Continuous Tag Scanning
77
+
78
+ ```tsx
79
+ import { useNfcTechLoop, nfcTag } from "@spencerls/react-native-nfc";
80
+ import { NfcTech } from "react-native-nfc-manager";
81
+
82
+ export default function ContinuousScanScreen() {
83
+ const { start, stop, isRunning } = useNfcTechLoop(
84
+ [NfcTech.Ndef, NfcTech.NfcV],
85
+ async () => {
86
+ const tag = await nfcTag.getTag();
87
+ console.log("Tag detected:", tag.id);
88
+ }
89
+ );
81
90
 
82
91
  return (
83
92
  <View>
84
- <Text>NFC Mode: {mode}</Text>
93
+ <Button title={isRunning ? "Stop" : "Start"} onPress={isRunning ? stop : start} />
94
+ <Text>Status: {isRunning ? "Scanning..." : "Idle"}</Text>
85
95
  </View>
86
96
  );
87
97
  }
@@ -89,185 +99,177 @@ export default function ScannerScreen() {
89
99
 
90
100
  ---
91
101
 
92
- ## Manual Reader Control
102
+ ## High-Level Operations
103
+
104
+ ### Get Basic Tag Information
105
+
106
+ **Cross-platform:** Works identically on iOS and Android.
93
107
 
94
108
  ```tsx
95
- import { useNfcReader, nfcService } from "@spencerls/react-native-nfc";
96
- import { NfcAdapter } from "react-native-nfc-manager";
97
-
98
- export default function Screen() {
99
- const { start, stop } = useNfcReader();
100
-
101
- // Platform-specific: Configure Android reader mode (no-op on iOS)
102
- nfcService.enableReaderMode_ANDROID(NfcAdapter.FLAG_READER_NFC_V);
103
-
104
- const begin = () => {
105
- // Cross-platform: Works identically on iOS and Android
106
- start(
107
- (tag) => {
108
- console.log("Tag:", tag.id);
109
- },
110
- { cooldownMs: 1200 }
111
- );
112
- };
113
-
114
- return <Button title="Start" onPress={begin} />;
115
- }
109
+ import { nfc } from "@spencerls/react-native-nfc";
110
+ import { NfcTech } from "react-native-nfc-manager";
111
+
112
+ const tag = await nfc.tag.getTag([NfcTech.NfcA, NfcTech.NfcV, NfcTech.Ndef]);
113
+ console.log("Tag ID:", tag.id);
114
+ console.log("Tag Type:", tag.type);
116
115
  ```
117
116
 
118
117
  ---
119
118
 
120
- ## Get Basic Tag Information
119
+ ### NDEF Write with Builder
121
120
 
122
121
  **Cross-platform:** Works identically on iOS and Android.
123
122
 
124
123
  ```tsx
125
124
  import { nfc } from "@spencerls/react-native-nfc";
126
- import { NfcTech } from "react-native-nfc-manager";
127
125
 
128
- export default function ScanTagButton() {
129
- const scanTag = async () => {
130
- const tag = await nfc.tag.getTag([
131
- NfcTech.NfcA,
132
- NfcTech.NfcV,
133
- NfcTech.Ndef,
134
- ]);
135
- console.log("Tag ID:", tag.id);
136
- console.log("Tag Type:", tag.type);
137
- };
138
-
139
- return <Button title="Scan Tag" onPress={scanTag} />;
140
- }
126
+ await nfc.ndef.write(
127
+ nfc.ndef.Builder.records((B) => [
128
+ B.textRecord("Hello, world!"),
129
+ B.uriRecord("https://www.google.com"),
130
+ B.jsonRecord(
131
+ JSON.stringify({
132
+ name: "John Doe",
133
+ age: 30,
134
+ email: "john.doe@example.com",
135
+ })
136
+ ),
137
+ ])
138
+ );
141
139
  ```
142
140
 
143
141
  ---
144
142
 
145
- ## NDEF Write with Builder
143
+ ### NDEF Read
146
144
 
147
145
  **Cross-platform:** Works identically on iOS and Android.
148
146
 
149
147
  ```tsx
150
148
  import { nfc } from "@spencerls/react-native-nfc";
151
149
 
152
- export default function WriteNdefButton() {
153
- const writeNdef = async () => {
154
- await nfc.ndef.write(
155
- nfc.ndef.Builder.records((B) => [
156
- B.textRecord("Hello, world!"),
157
- B.uriRecord("https://www.google.com"),
158
- B.jsonRecord(
159
- JSON.stringify({
160
- name: "John Doe",
161
- age: 30,
162
- email: "john.doe@example.com",
163
- })
164
- ),
165
- ])
166
- );
167
- };
168
-
169
- return <Button title="Write NDEF" onPress={writeNdef} />;
170
- }
150
+ const { message, tag } = await nfc.ndef.readFull();
151
+ console.log("Tag ID:", tag.id);
152
+ console.log("Records:", message.ndefMessage);
171
153
  ```
172
154
 
173
155
  ---
174
156
 
175
- ## NDEF Read
157
+ ### High-Level NFC-V Operations
176
158
 
177
159
  **Cross-platform:** Works identically on iOS and Android.
178
160
 
179
161
  ```tsx
180
162
  import { nfc } from "@spencerls/react-native-nfc";
181
163
 
182
- export default function ReadNdefButton() {
183
- const readNdef = async () => {
184
- const { message, tag } = await nfc.ndef.readFull();
185
- console.log("Tag ID:", tag.id);
186
- console.log("Records:", message.ndefMessage);
187
- };
164
+ // Read a single block
165
+ const data = await nfc.v.readBlock(0);
166
+ console.log("Block 0:", data);
188
167
 
189
- return <Button title="Read NDEF" onPress={readNdef} />;
190
- }
168
+ // Write a single block
169
+ const writeData = new Uint8Array([0x01, 0x02, 0x03, 0x04]);
170
+ await nfc.v.writeBlock(0, writeData);
171
+
172
+ // Get system info
173
+ const info = await nfc.v.getSystemInfo();
174
+ console.log("Blocks:", info.numberOfBlocks);
175
+ console.log("Block size:", info.blockSize);
191
176
  ```
192
177
 
193
178
  ---
194
179
 
195
- ## Custom NFC-V Operations
180
+ ## Advanced: Custom NFC-V Operations
196
181
 
197
182
  **Cross-platform:** Works identically on iOS and Android.
198
183
 
199
184
  ```tsx
200
185
  import { nfc, nfcTag, nfcVTag } from "@spencerls/react-native-nfc";
201
186
 
202
- export default function ReadNfcVButton() {
203
- const readCustom = async () => {
204
- const data = await nfc.service.withTechnology(nfcVTag.tech, async () => {
205
- const tag = await nfcTag.getTag();
206
- if (!tag?.id) throw new Error("No NFC-V tag detected");
207
-
208
- const buffer = new Uint8Array();
209
- let offset = 0;
210
-
211
- // Read blocks 0, 2, 4, 6
212
- for (let i = 0; i < 8; i += 2) {
213
- const block = await nfcVTag.readBlock(tag.id, i);
214
- buffer.set(block, offset);
215
- offset += block.length;
216
- }
217
-
218
- return buffer;
219
- });
220
-
221
- console.log("Data:", data);
222
- };
187
+ await nfc.service.startTech(
188
+ nfcVTag.tech,
189
+ async () => {
190
+ const tag = await nfcTag.getTag();
191
+ if (!tag?.id) throw new Error("No NFC-V tag detected");
223
192
 
224
- return <Button title="Read NFC-V" onPress={readCustom} />;
225
- }
193
+ const buffer = new Uint8Array();
194
+ let offset = 0;
195
+
196
+ // Read blocks 0, 2, 4, 6
197
+ for (let i = 0; i < 8; i += 2) {
198
+ const block = await nfcVTag.readBlock(tag.id, i);
199
+ buffer.set(block, offset);
200
+ offset += block.length;
201
+ }
202
+
203
+ console.log("Data:", buffer);
204
+ }
205
+ );
226
206
  ```
227
207
 
228
208
  ---
229
209
 
230
- ## High-Level NFC-V Operations
210
+ ## React Hooks Reference
231
211
 
232
- **Cross-platform:** Works identically on iOS and Android.
212
+ ### useNfcTech
213
+
214
+ One-shot technology session. Executes once when triggered.
233
215
 
234
216
  ```tsx
235
- import { nfc } from "@spencerls/react-native-nfc";
217
+ const { startTech } = useNfcTech(
218
+ tech: NfcTech[],
219
+ withTechnology: () => Promise<void>,
220
+ afterTechnology?: () => Promise<void>,
221
+ options?: RegisterTagEventOpts
222
+ );
223
+ ```
236
224
 
237
- export default function NfcVScreen() {
238
- const readBlock = async () => {
239
- const data = await nfc.v.readBlock(0);
240
- console.log("Block 0:", data);
241
- };
225
+ ### useNfcTechLoop
242
226
 
243
- const writeBlock = async () => {
244
- const data = new Uint8Array([0x01, 0x02, 0x03, 0x04]);
245
- await nfc.v.writeBlock(0, data);
246
- };
227
+ Continuous technology session loop. Automatically restarts after each tag.
247
228
 
248
- const getInfo = async () => {
249
- const info = await nfc.v.getSystemInfo();
250
- console.log("System Info:", info);
251
- };
229
+ ```tsx
230
+ const { start, stop, isRunning } = useNfcTechLoop(
231
+ tech: NfcTech[],
232
+ withTechnology: () => Promise<void>,
233
+ afterTechnology?: () => Promise<void>,
234
+ options?: RegisterTagEventOpts
235
+ );
236
+ ```
252
237
 
253
- return (
254
- <View>
255
- <Button title="Read Block" onPress={readBlock} />
256
- <Button title="Write Block" onPress={writeBlock} />
257
- <Button title="Get Info" onPress={getInfo} />
258
- </View>
259
- );
260
- }
238
+ ### useNfcTagEvent
239
+
240
+ One-shot tag event. Executes once when a tag is detected.
241
+
242
+ ```tsx
243
+ const { startTech } = useNfcTagEvent(
244
+ onTag: (tag: TagEvent) => Promise<void>
245
+ );
246
+ ```
247
+
248
+ ### useNfcTagEventLoop
249
+
250
+ Continuous tag event loop. Automatically restarts after each tag.
251
+
252
+ ```tsx
253
+ const { start, stop, isRunning } = useNfcTagEventLoop(
254
+ onTag: (tag: TagEvent) => Promise<void>,
255
+ options?: RegisterTagEventOpts
256
+ );
261
257
  ```
262
258
 
263
259
  ---
264
260
 
265
261
  ## API Overview
266
262
 
267
- **Cross-platform:** All APIs below work identically on iOS and Android.
263
+ **Cross-platform:** All APIs work identically on iOS and Android.
268
264
 
269
265
  ```ts
270
- import { nfc, nfcTag, nfcVTag, nfcNdefTag } from "@spencerls/react-native-nfc";
266
+ import {
267
+ nfc,
268
+ nfcService,
269
+ nfcTag,
270
+ nfcVTag,
271
+ nfcNdefTag
272
+ } from "@spencerls/react-native-nfc";
271
273
 
272
274
  // High-level namespace operations (auto-manages technology sessions)
273
275
  await nfc.tag.getTag([NfcTech.NfcV]);
@@ -278,10 +280,11 @@ await nfc.ndef.write(records);
278
280
  await nfc.ndef.readMessage();
279
281
  await nfc.ndef.readFull();
280
282
 
281
- // Low-level tag modules (use inside withTechnology)
282
- await nfc.service.withTechnology(nfcVTag.tech, async () => {
283
+ // Custom operations using service
284
+ await nfc.service.startTech(nfcVTag.tech, async () => {
283
285
  const tag = await nfcTag.getTag();
284
286
  const block = await nfcVTag.readBlock(tag.id, 0);
287
+ console.log(block);
285
288
  });
286
289
 
287
290
  // NDEF Builder
@@ -294,25 +297,11 @@ const records = nfc.ndef.Builder.records((B) => [
294
297
  ]);
295
298
 
296
299
  // Service control
297
- nfc.service.enableReaderMode_ANDROID(flags); // Android-only (no-op on iOS)
298
- await nfc.service.startReader(onTag, options); // Cross-platform
299
- await nfc.service.stopReader(); // Cross-platform
300
- ```
301
-
302
- ---
303
-
304
- ## Global Provider (Optional)
305
-
306
- ```tsx
307
- import { NfcProvider } from "@spencerls/react-native-nfc";
308
-
309
- export default function App() {
310
- return (
311
- <NfcProvider>
312
- <RootApp />
313
- </NfcProvider>
314
- );
315
- }
300
+ await nfcService.startTech(tech, withTech);
301
+ await nfcService.startTechLoop(tech, withTech);
302
+ await nfcService.startTagEvent(onTag);
303
+ await nfcService.startTagEventLoop(onTag);
304
+ await nfcService.stop();
316
305
  ```
317
306
 
318
307
  ---
package/dist/index.d.mts CHANGED
@@ -1,19 +1,22 @@
1
1
  import * as react_native_nfc_manager from 'react-native-nfc-manager';
2
- import { NdefRecord, ISOLangCode, TNF, TagEvent, NfcTech, NdefStatus } from 'react-native-nfc-manager';
3
- import * as react_jsx_runtime from 'react/jsx-runtime';
4
- import { PropsWithChildren } from 'react';
2
+ import { NfcTech, RegisterTagEventOpts, TagEvent, NdefRecord, TNF, ISOLangCode, NdefStatus } from 'react-native-nfc-manager';
5
3
 
6
- declare class Builder {
7
- static records(b: NdefBuilder): NdefRecord[];
8
- static message(b: NdefBuilder): number[];
9
- static record(init: BuildRecordInit): NdefRecord;
10
- static textRecord(text: string, lang?: ISOLangCode, encoding?: "utf8" | "utf16", id?: string): NdefRecord;
11
- static uriRecord(uri: string, id?: string): NdefRecord;
12
- static jsonRecord(payload: string | Uint8Array | number[], id?: string): NdefRecord;
13
- static mimeRecord(mimeType: string, payload: string | Uint8Array | number[], id?: string): NdefRecord;
14
- static externalRecord(domain: string, type: string, payload: string | Uint8Array | number[], id?: string): NdefRecord;
15
- static createEmpty(): NdefRecord;
4
+ declare class NfcService {
5
+ private static instance;
6
+ private strategies;
7
+ private stateMachine;
8
+ private jobRetry;
9
+ private isExecutingJobs;
10
+ static getInstance(): NfcService;
11
+ startTech(tech: NfcTech[], withTechnology: () => Promise<void>, afterTechnology?: () => Promise<void>, options?: RegisterTagEventOpts): Promise<void>;
12
+ startTechLoop(tech: NfcTech[], withTechnology: () => Promise<void>, afterTechnology?: () => Promise<void>, options?: RegisterTagEventOpts): Promise<void>;
13
+ startTagEvent(onTag: (tag: TagEvent) => Promise<void>): Promise<void>;
14
+ startTagEventLoop(onTag: (tag: TagEvent) => Promise<void>, options?: RegisterTagEventOpts): Promise<void>;
15
+ stop(): Promise<void>;
16
+ private executeOrQueue;
17
+ private executeJob;
16
18
  }
19
+ declare const nfcService: NfcService;
17
20
 
18
21
  type NdefBuilder = (r: typeof Builder) => NdefRecord[];
19
22
  interface BuildRecordInit {
@@ -30,45 +33,17 @@ interface NdefMessageResult {
30
33
  canMakeReadOnly: boolean;
31
34
  }
32
35
 
33
- type SystemInfo = {
34
- uid?: string;
35
- dsfid?: number;
36
- afi?: number;
37
- numberOfBlocks?: number;
38
- blockSize?: number;
39
- icReference?: number;
40
- manufacturer?: string;
41
- };
42
-
43
- type NfcMode = "idle" | "starting" | "active" | "stopping" | "technology";
44
- interface NfcState {
45
- mode: NfcMode;
46
- tag: TagEvent | null;
47
- }
48
-
49
- type NfcListener = (state: NfcState) => void;
50
- declare class NfcService {
51
- private state;
52
- private listeners;
53
- private isProcessingTag;
54
- private currentOnTag?;
55
- private currentCooldownMs;
56
- private cooldownTimer?;
57
- private readerModeFlags_ANDROID;
58
- constructor();
59
- enableReaderMode_ANDROID(flags: number): void;
60
- private setState;
61
- getState(): NfcState;
62
- subscribe(fn: NfcListener): () => void;
63
- startReader(onTag?: (tag: TagEvent) => Promise<void> | void, options?: {
64
- cooldownMs?: number;
65
- }): Promise<void>;
66
- stopReader(): Promise<void>;
67
- private _resetReaderState;
68
- withTechnology<T>(tech: NfcTech | NfcTech[], handler: () => Promise<T>): Promise<T>;
69
- private withTechnologyReaderMode_ANDROID;
36
+ declare class Builder {
37
+ static records(b: NdefBuilder): NdefRecord[];
38
+ static message(b: NdefBuilder): number[];
39
+ static record(init: BuildRecordInit): NdefRecord;
40
+ static textRecord(text: string, lang?: ISOLangCode, encoding?: "utf8" | "utf16", id?: string): NdefRecord;
41
+ static uriRecord(uri: string, id?: string): NdefRecord;
42
+ static jsonRecord(payload: string | Uint8Array | number[], id?: string): NdefRecord;
43
+ static mimeRecord(mimeType: string, payload: string | Uint8Array | number[], id?: string): NdefRecord;
44
+ static externalRecord(domain: string, type: string, payload: string | Uint8Array | number[], id?: string): NdefRecord;
45
+ static createEmpty(): NdefRecord;
70
46
  }
71
- declare const nfcService: NfcService;
72
47
 
73
48
  declare function readMessage$1(): Promise<NdefMessageResult>;
74
49
  declare function write$1(records: NdefRecord[]): Promise<void>;
@@ -102,7 +77,17 @@ declare const nfcTag: {
102
77
  readonly getTag: typeof getTag$1;
103
78
  };
104
79
 
105
- declare function getTag(tech: NfcTech | NfcTech[]): Promise<TagEvent>;
80
+ declare function getTag(tech: NfcTech[]): Promise<TagEvent>;
81
+
82
+ type SystemInfo = {
83
+ uid?: string;
84
+ dsfid?: number;
85
+ afi?: number;
86
+ numberOfBlocks?: number;
87
+ blockSize?: number;
88
+ icReference?: number;
89
+ manufacturer?: string;
90
+ };
106
91
 
107
92
  declare function transceive(bytes: number[]): Promise<number[]>;
108
93
  declare function readBlock$1(tagId: string, blockNumber: number): Promise<Uint8Array>;
@@ -180,7 +165,7 @@ declare namespace utils {
180
165
  }
181
166
 
182
167
  declare const nfcVTag: {
183
- readonly tech: react_native_nfc_manager.NfcTech.NfcV | react_native_nfc_manager.NfcTech[];
168
+ readonly tech: react_native_nfc_manager.NfcTech[];
184
169
  readonly utils: typeof utils;
185
170
  readonly transceive: typeof transceive;
186
171
  readonly readBlock: typeof readBlock$1;
@@ -229,27 +214,24 @@ declare const nfc: {
229
214
  };
230
215
  };
231
216
 
232
- interface NfcContextValue {
233
- state: NfcState;
234
- service: typeof nfcService;
235
- }
236
- declare function NfcProvider({ children }: PropsWithChildren): react_jsx_runtime.JSX.Element;
237
- declare function useNfcContext(): NfcContextValue;
238
-
239
- declare function useNfc(onTag: (tagId: string) => void, options: {
240
- cooldownMs?: number;
241
- }): void;
217
+ declare function useNfcTech(tech: NfcTech[], withTechnology: () => Promise<void>, afterTechnology?: () => Promise<void>, options?: RegisterTagEventOpts): {
218
+ startTech: () => void;
219
+ };
242
220
 
243
- declare function useNfcReader(): {
244
- start: (onTag?: (tag: TagEvent) => Promise<void> | void, cooldownMs?: number) => void;
245
- stop: () => void;
221
+ declare function useNfcTechLoop(tech: NfcTech[], withTechnology: () => Promise<void>, afterTechnology?: () => Promise<void>, options?: RegisterTagEventOpts): {
222
+ start: () => Promise<void>;
223
+ stop: () => Promise<void>;
224
+ isRunning: boolean;
246
225
  };
247
226
 
248
- declare function useNfcState(): NfcState;
227
+ declare function useNfcTagEvent(onTag: (tag: TagEvent) => Promise<void>): {
228
+ startTech: () => void;
229
+ };
249
230
 
250
- declare function useNfcTechnology(): {
251
- writeNdef: (records: NdefRecord[]) => Promise<void>;
252
- runWithTech: (tech: NfcTech | NfcTech[], fn: () => Promise<void>) => Promise<void>;
231
+ declare function useNfcTagEventLoop(onTag: (tag: TagEvent) => Promise<void>, options?: RegisterTagEventOpts): {
232
+ start: () => Promise<void>;
233
+ stop: () => Promise<void>;
234
+ isRunning: boolean;
253
235
  };
254
236
 
255
- export { type BuildRecordInit, type NdefBuilder, type NdefMessageResult, type NfcMode, NfcProvider, type NfcState, type SystemInfo, nfc, nfcNdefTag, nfcService, nfcTag, nfcVTag, useNfc, useNfcContext, useNfcReader, useNfcState, useNfcTechnology };
237
+ export { type BuildRecordInit, type NdefBuilder, type NdefMessageResult, type SystemInfo, nfc, nfcNdefTag, nfcService, nfcTag, nfcVTag, useNfcTagEvent, useNfcTagEventLoop, useNfcTech, useNfcTechLoop };