import type { NobjcObject } from "objc-js";
import type { _NSData } from "../Foundation/NSData.js";
import type { _NSError } from "../Foundation/NSError.js";
import type { _NSNumber } from "../Foundation/NSNumber.js";
import type { _NSObject } from "../Foundation/NSObject.js";
import type { _TKSmartCardPINFormat } from "./TKSmartCardPINFormat.js";
import type { _TKSmartCardSlot } from "./TKSmartCardSlot.js";
import type { _TKSmartCardUserInteractionForSecurePINChange } from "./TKSmartCardUserInteractionForSecurePINChange.js";
import type { _TKSmartCardUserInteractionForSecurePINVerification } from "./TKSmartCardUserInteractionForSecurePINVerification.js";
import type { TKSmartCardProtocol } from "./TKSmartCardProtocol.js";
export declare class _TKSmartCard extends _NSObject {
    static alloc(): _TKSmartCard;
    static new(): _TKSmartCard;
    init(): _TKSmartCard;
    /**
     * Begins session with the card. @discussion When session exists, other requests for sessions from other card objects to the same card are blocked. Session is reference-counted, the same amount of 'end' calls must be done to really terminate the session. Note that finishing session does not automatically mean that the card is disconnected; it only happens when another session from different card object is requested. @param success Signals whether session was successfully started. @param error More information about error preventing the transaction to start
     */
    beginSessionWithReply$(reply: ((success: boolean, error: _NSError) => void) | null): void;
    /**
     * Transmits raw command to the card. This call is allowed only inside session. @param request Request part of APDU @param reponse Response part of APDU, or nil if communication with the card failed @param error Error details when communication with the card failed
     */
    transmitRequest$reply$(request: _NSData, reply: ((response: _NSData, error: _NSError) => void) | null): void;
    /**
     * Terminates the transaction. If no transaction is pending any more, the connection will be closed if there is another session in the system waiting for the transaction.
     */
    endSession(): void;
    /**
     * Creates a new user interaction object for secure PIN verification using the SmartCard reader facilities (typically a HW keypad). @note This interaction is only allowed within a session. @param PINFormat PIN format descriptor. @param APDU Predefined APDU in which the SmartCard reader fills in the PIN. @param PINByteOffset Offset in bytes within APDU data field to mark a location of a PIN block for filling in the entered PIN (currently unused, must be 0). @return A new user interaction object, or nil if this feature is not supported by the SmartCard reader. After the interaction has been successfully completed the operation result is available in the result properites.
     */
    userInteractionForSecurePINVerificationWithPINFormat$APDU$PINByteOffset$(PINFormat: _TKSmartCardPINFormat, APDU: _NSData, PINByteOffset: number): _TKSmartCardUserInteractionForSecurePINVerification | null;
    /**
     * Creates a new user interaction object for secure PIN change using the SmartCard reader facilities (typically a HW keypad). @note This interaction is only allowed within a session. @param PINFormat PIN format descriptor. @param APDU Predefined APDU in which the SmartCard reader fills in the PIN(s). @param currentPINByteOffset Offset in bytes within APDU data field to mark a location of a PIN block for filling in the current PIN. @param newPINByteOffset Offset in bytes within APDU data field to mark a location of a PIN block for filling in the new PIN. @return A new user interaction object, or nil if this feature is not supported by the SmartCard reader. After the interaction has been successfully completed the operation result is available in the result properites.
     */
    userInteractionForSecurePINChangeWithPINFormat$APDU$currentPINByteOffset$newPINByteOffset$(PINFormat: _TKSmartCardPINFormat, APDU: _NSData, currentPINByteOffset: number, newPINByteOffset: number): _TKSmartCardUserInteractionForSecurePINChange | null;
    /**
     * Transmits APDU to the card and returns response. @discussion Asynchronous high level variant of command for transmitting APDU to the card. Handles all ISO7816-4 APDU cases translation to proper sequences according to used protocol. Consults useExtendedAPDU and useCommandChaining properties and uses these modes whenever appropriate and beneficial for sending requested APDU request. @param ins INS code of the APDU @param p1 P1 code of the APDU @param p2 P2 code of the APDU @param requestData Data field of the APDU, or nil if no input data field should be present (i.e case1 or case2 APDUs). Length of the data serves as Lc field of the APDU. @param le Expected number of bytes to be returned, or nil if no output data are expected (i.e. case1 or case3 APDUs). To get as much bytes as card provides, pass @0. @param replyData Block of returned data without SW1SW2 bytes, or nil if an error occured. @param sw SW1SW2 result code, first two bytes of returned card's reply. @param error Contains error details when nil is returned. Specific error is also filled in if there was no communication error, but card returned other SW code than 0x9000.
     */
    sendIns$p1$p2$data$le$reply$(ins: NobjcObject, p1: NobjcObject, p2: NobjcObject, requestData: _NSData | null, le: _NSNumber | null, reply: ((replyData: _NSData, sw: number, error: _NSError) => void) | null): void;
    /**
     * Synchronous variant of session creation. Begins the session, executes given block and ends session. @param error Error receiving more information when transaction failed to start or block failed for some reason. @param block Block to be executed when the session was successfully begun. @return Returns YES if the session was successfully begun and block returned YES, otherwise NO.
     */
    inSessionWithError$executeBlock$(error: NobjcObject | null, block: ((error: NobjcObject) => boolean) | null): boolean;
    /**
     * Transmits APDU to the card and returns response. @discussion Synchronous high level variant of command for transmitting APDU to the card. Handles all ISO7816-4 APDU cases translation to proper sequences according to used protocol. Should be used in block passed to -[TKSmartCard inSessionWithError:executeBlock:] method. @param ins INS code of the APDU @param p1 P1 code of the APDU @param p2 P2 code of the APDU @param data Data field of the APDU. Length of the data serves as Lc field of the APDU @param le Expected number of bytes to be returned, or nil if no output data are expected (i.e. case1 or case3 APDUs). To get as much bytes as card provides, pass @0. @param sw On output, filled with SW1SW2 result code @param error Contains error details when nil is returned. Specific error is also filled in if there was no communication error, but card returned other SW code than 0x9000. @return Returned data field, excluding SW status bytes. If an error occured, returns nil.
     */
    sendIns$p1$p2$data$le$sw$error$(ins: NobjcObject, p1: NobjcObject, p2: NobjcObject, requestData: _NSData | null, le: _NSNumber | null, sw: NobjcObject, error: NobjcObject | null): _NSData | null;
    /** Slot in which is this card inserted. */
    slot(): _TKSmartCardSlot;
    /**
     * Flag indicating whether card is valid, i.e. it was not removed from the reader. Use Key-Value-Observing to be notified about card removal.
     */
    valid(): boolean;
    /**
     * Bitmask containing allowed protocols to be used when communicating with the card. This property is consulted only during connection to the card, changes are not propagated to already connected session. By default, any protocol can be used.
     */
    allowedProtocols(): TKSmartCardProtocol;
    setAllowedProtocols$(value: TKSmartCardProtocol): void;
    /**
     * Protocol used for communication with the SmartCard. If no card session is established, TKSmartCardProtocolNone is set.
     */
    currentProtocol(): TKSmartCardProtocol;
    /**
     * Flag indicating whether card session should be considered as sensitive. Sensitive session always gets card after reset before communicating with it and never leaves card without reset to be used by another SmartCard object. This might be important in case that card session contain some important state which should not leak to another SmartCard object (possibly running in another, foreign application). Default is NO.
     */
    sensitive(): boolean;
    setSensitive$(value: boolean): void;
    /**
     * User-specified context kept as long as the card is powered. Once the card is removed or another TKSmartCard object opens session, this property is automatically set to nil.
     */
    context(): NobjcObject | null;
    setContext$(value: NobjcObject | null): void;
    /** CLA byte which will be used for sendIns: APDU transmits. Default value is 0x00. */
    cla(): NobjcObject;
    setCla$(value: NobjcObject): void;
    /**
     * Flag indicating whether extended length APDUs should be used. It is automatically enabled only when used slot supports transmitting extended length commands and card announces that extended length APDU are supported in its ATR. However, caller can explicitly override this decision.
     */
    useExtendedLength(): boolean;
    setUseExtendedLength$(value: boolean): void;
    /**
     * Flag indicating whether command chaining of APDU with data field longer than 255 bytes can be used. It is automatically enabled when card announces that command chaining is supported in its ATR. However, caller can explicitly override this decision.
     */
    useCommandChaining(): boolean;
    setUseCommandChaining$(value: boolean): void;
}
