Skip to content

Commit

Permalink
Update TypeScript definitions because NDEFReader/NDEFWriter merge
Browse files Browse the repository at this point in the history
Signed-off-by: Zoltan Kis <[email protected]>
  • Loading branch information
zolkis committed Sep 24, 2020
1 parent 12764f2 commit dbb9a52
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions web-nfc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,18 @@ declare interface NDEFRecordInit {

declare type NDEFMessageSource = string | BufferSource | NDEFMessageInit

interface Window {
NDEFWriter: NDEFWriter
}
declare class NDEFWriter {
constructor()
write: (
message: NDEFMessageSource,
options?: NDEFWriteOptions
) => Promise<void>
}

interface Window {
NDEFReader: NDEFReader
}
declare class NDEFReader extends EventTarget {
constructor()
onerror: (error: any) => void
onreading: (event: NDEFReadingEvent) => void
onreadingerror: (error: any) => void
scan: (options?: NDEFScanOptions) => Promise<void>
write: (
message: NDEFMessageSource,
options?: NDEFWriteOptions
) => Promise<void>
}

interface Window {
Expand All @@ -78,13 +71,9 @@ interface NDEFReadingEventInit extends EventInit {
}

interface NDEFWriteOptions {
ignoreRead?: boolean
overwrite?: boolean
signal?: AbortSignal
}
interface NDEFScanOptions {
id?: string
recordType?: string
mediaType?: string
signal?: AbortSignal
signal: AbortSignal
}

0 comments on commit dbb9a52

Please sign in to comment.