22 * @see https://wicg.github.io/web-smart-card
33 */
44
5- export interface SmartCardResourceManager {
6- establishContext ( ) : Promise < SmartCardContext > ;
5+ declare global {
6+ interface SmartCardResourceManager {
7+ establishContext ( ) : Promise < SmartCardContext > ;
8+ }
79}
810
911export type SmartCardResponseCode =
@@ -28,9 +30,11 @@ export interface SmartCardErrorOptions {
2830 responseCode : SmartCardResponseCode ;
2931}
3032
31- export class SmartCardError extends DOMException {
32- constructor ( message : string , options : SmartCardErrorOptions ) ;
33- readonly responseCode : SmartCardResponseCode ;
33+ declare global {
34+ class SmartCardError extends DOMException {
35+ constructor ( message : string , options : SmartCardErrorOptions ) ;
36+ readonly responseCode : SmartCardResponseCode ;
37+ }
3438}
3539
3640export interface SmartCardReaderStateIn {
@@ -101,17 +105,19 @@ export interface SmartCardConnectOptions {
101105 preferredProtocols ?: SmartCardProtocol [ ] ;
102106}
103107
104- export interface SmartCardContext {
105- listReaders ( ) : Promise < string [ ] > ;
106- getStatusChange (
107- readerStates : SmartCardReaderStateIn [ ] ,
108- options ?: SmartCardGetStatusChangeOptions ,
109- ) : Promise < SmartCardReaderStateOut [ ] > ;
110- connect (
111- readerName : string ,
112- accessMode : SmartCardAccessMode ,
113- options ?: SmartCardConnectOptions ,
114- ) : Promise < SmartCardConnectResult > ;
108+ declare global {
109+ interface SmartCardContext {
110+ listReaders ( ) : Promise < string [ ] > ;
111+ getStatusChange (
112+ readerStates : SmartCardReaderStateIn [ ] ,
113+ options ?: SmartCardGetStatusChangeOptions ,
114+ ) : Promise < SmartCardReaderStateOut [ ] > ;
115+ connect (
116+ readerName : string ,
117+ accessMode : SmartCardAccessMode ,
118+ options ?: SmartCardConnectOptions ,
119+ ) : Promise < SmartCardConnectResult > ;
120+ }
115121}
116122
117123export type SmartCardConnectionState =
@@ -146,17 +152,19 @@ export interface SmartCardTransmitOptions {
146152
147153export type SmartCardTransactionCallback = ( ) => Promise < SmartCardDisposition | null > ;
148154
149- export interface SmartCardConnection {
150- disconnect ( disposition ?: SmartCardDisposition ) : Promise < undefined > ;
151- transmit ( sendBuffer : BufferSource , options ?: SmartCardTransmitOptions ) : Promise < ArrayBuffer > ;
152- status ( ) : Promise < SmartCardConnectionStatus > ;
153- control ( controlCode : number , data : BufferSource ) : Promise < ArrayBuffer > ;
154- getAttribute ( tag : number ) : Promise < ArrayBuffer > ;
155- setAttribute ( tag : number , value : BufferSource ) : Promise < undefined > ;
156- startTransaction (
157- transaction : SmartCardTransactionCallback ,
158- options ?: SmartCardTransactionOptions ,
159- ) : Promise < undefined > ;
155+ declare global {
156+ interface SmartCardConnection {
157+ disconnect ( disposition ?: SmartCardDisposition ) : Promise < void > ;
158+ transmit ( sendBuffer : BufferSource , options ?: SmartCardTransmitOptions ) : Promise < ArrayBuffer > ;
159+ status ( ) : Promise < SmartCardConnectionStatus > ;
160+ control ( controlCode : number , data : BufferSource ) : Promise < ArrayBuffer > ;
161+ getAttribute ( tag : number ) : Promise < ArrayBuffer > ;
162+ setAttribute ( tag : number , value : BufferSource ) : Promise < void > ;
163+ startTransaction (
164+ transaction : SmartCardTransactionCallback ,
165+ options ?: SmartCardTransactionOptions ,
166+ ) : Promise < void > ;
167+ }
160168}
161169
162170declare global {
0 commit comments