import type { _NSData } from "../Foundation/NSData.js";
import type { _NSError } from "../Foundation/NSError.js";
import type { _NSObject } from "../Foundation/NSObject.js";
import type { _NWEndpoint } from "./NWEndpoint.js";
import type { _NWPath } from "./NWPath.js";
import type { NWTCPConnectionState } from "./NWTCPConnectionState.js";
export declare class _NWTCPConnection extends _NSObject {
    static alloc(): _NWTCPConnection;
    static new(): _NWTCPConnection;
    init(): _NWTCPConnection;
    /**
     * This convenience initializer can be used to create a new connection that would only be connected if there exists a better path (as determined by the system) to the destination endpoint of the original connection. It will be initialized using the same destination endpoint and set of parameters from the original connection. If the original connection becomes disconnected or cancelled, the new "upgrade" connection would automatically be considered better. The caller should create an NWTCPConnection and watch for the hasBetterPath property. When this property is YES, the caller should attempt to create a new upgrade connection, with the goal to start transferring data on the new better path as soon as possible to reduce power and potentially monetary cost. When the new upgrade connection becomes connected and when the caller wraps up the previous caller session on the original connection, the caller can start using the new upgrade connection and tear down the original one. The original connection from which the caller will upgrade An initialized NWTCPConnection
     * @deprecated Use `nw_connection_create` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    initWithUpgradeForConnection$(connection: _NWTCPConnection): _NWTCPConnection;
    /**
     * Cancel the connection. This will clean up the resources associated with this object and transition this object to NWTCPConnectionStateCancelled state.
     * @deprecated Use `nw_connection_cancel` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    cancel(): void;
    /**
     * Read "length" number of bytes. See readMinimumLength:maximumLength:completionHandler: for a complete discussion of the callback behavior. The exact number of bytes the application wants to read The completion handler to be invoked when there is data to read or an error occurred
     * @deprecated Use `nw_connection_receive` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    readLength$completionHandler$(length: number, completion: ((data: _NSData, error: _NSError) => void) | null): void;
    /**
     * Read the requested range of bytes. The completion handler will be invoked when: - Exactly "length" number of bytes have been read. 'data' will be non-nil. - Fewer than "length" number of bytes, including 0 bytes, have been read, and the connection's read side has been closed. 'data' might be nil, depending on whether there was any data to be read when the connection's read side was closed. - Some fatal error has occurred, and 'data' will be nil. To know when to schedule a read again, check for the condition whether an error has occurred. For better performance, the caller should pick the effective minimum and maximum lengths. For example, if the caller absolutely needs a specific number of bytes before it can make any progress, use that value as the minimum. The maximum bytes can be the upperbound that the caller wants to read. Typically, the minimum length can be the caller protocol fixed-size header and the maximum length can be the maximum size of the payload or the size of the current read buffer. The minimum number of bytes the caller wants to read The maximum number of bytes the caller wants to read The completion handler to be invoked when there is data to read or an error occurred
     * @deprecated Use `nw_connection_receive` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    readMinimumLength$maximumLength$completionHandler$(minimum: number, maximum: number, completion: ((data: _NSData, error: _NSError) => void) | null): void;
    /**
     * Write the given data object content. Callers should wait until the completionHandler is executed before issuing another write. The data object whose content will be written The completion handler to be invoked when the data content has been written or an error has occurred. If the error is nil, the write succeeded and the caller can write more data.
     * @deprecated Use `nw_connection_send` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    write$completionHandler$(data: _NSData, completion: ((error: _NSError) => void) | null): void;
    /**
     * Close this connection's write side such that further write requests won't succeed. Note that this has the effect of closing the read side of the peer connection. When the connection's read side and write side are closed, the connection is considered disconnected and will transition to the appropriate state.
     * @deprecated Use `nw_connection_send` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    writeClose(): void;
    /**
     * The status of the connection. Use KVO to watch this property to get updates.
     * @deprecated Use `nw_connection_set_state_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    state(): NWTCPConnectionState;
    /**
     * YES if the connection can read and write data, NO otherwise. Use KVO to watch this property.
     * @deprecated Use `nw_connection_set_viability_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    viable(): boolean;
    /**
     * YES if the system determines there is a better path the destination can be reached if the caller creates a new connection using the same endpoint and parameters. This can be done using the convenience upgrade initializer method. Use KVO to watch this property to get updates.
     * @deprecated Use `nw_connection_set_better_path_available_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    hasBetterPath(): boolean;
    /**
     * The destination endpoint with which this connection was created.
     * @deprecated Use `nw_connection_copy_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    endpoint(): _NWEndpoint;
    /**
     * The network path over which the connection was established. The caller can query additional properties from the NWPath object for more information. Note that this contains a snapshot of information at the time of connection establishment for this connection only. As a result, some underlying properties might change in time and might not reflect the path for other connections that might be established at different times.
     * @deprecated Use `nw_connection_copy_current_path` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    connectedPath(): _NWPath;
    /**
     * The IP address endpoint from which the connection was connected.
     * @deprecated Use `nw_path_copy_effective_local_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    localAddress(): _NWEndpoint;
    /**
     * The IP address endpoint to which the connection was connected.
     * @deprecated Use `nw_path_copy_effective_remote_endpoint` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    remoteAddress(): _NWEndpoint;
    /**
     * When the connection is connected to a Bonjour service endpoint, the TXT record associated with the Bonjour service is available via this property. Beware that the value comes from the network. Care must be taken when parsing this potentially malicious value.
     * @deprecated Use `nw_endpoint_copy_txt_record` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    txtRecord(): _NSData;
    /**
     * The connection-wide error property indicates any fatal error that occurred while processing the connection or performing data reading or writing.
     * @deprecated Use `nw_connection_set_state_changed_handler` in Network framework instead, see deprecation notice in <NetworkExtension/NWTCPConnection.h>
     */
    error(): _NSError;
}
