import type { NobjcObject } from "objc-js";
import type { _NSData } from "./NSData.js";
import type { _NSError } from "./NSError.js";
import type { _NSObject } from "./NSObject.js";
import type { _NSOperationQueue } from "./NSOperationQueue.js";
import type { _NSRunLoop } from "./NSRunLoop.js";
import type { _NSString } from "./NSString.js";
import type { _NSURLRequest } from "./NSURLRequest.js";
import type { _NSURLResponse } from "./NSURLResponse.js";
export declare class _NSURLConnection extends _NSObject {
    static alloc(): _NSURLConnection;
    static new(): _NSURLConnection;
    init(): _NSURLConnection;
    /** @deprecated Use NSURLSession (see NSURLSession.h) */
    static connectionWithRequest$delegate$(request: _NSURLRequest, delegate: NobjcObject | null): _NSURLConnection | null;
    /**
     * @method canHandleRequest: @abstract Performs a "preflight" operation that performs some speculative checks to see if a connection can be initialized, and the associated I/O that is started in the initializer methods can begin. @discussion The result of this method is valid only as long as no protocols are registered or unregistered, and as long as the request is not mutated (if the request is mutable). Hence, clients should be prepared to handle failures even if they have performed request preflighting by calling this method. @param request The request to preflight. @result YES if it is likely that the given request can be used to initialize a connection and the associated I/O can be started, NO otherwise.
     */
    static canHandleRequest$(request: _NSURLRequest): boolean;
    /**
     * @method sendSynchronousRequest:returningResponse:error: @abstract Performs a synchronous load of the given request, returning an NSURLResponse in the given out parameter. @discussion A synchronous load for the given request is built on top of the asynchronous loading code made available by the class. The calling thread is blocked while the asynchronous loading system performs the URL load on a thread spawned specifically for this load request. No special threading or run loop configuration is necessary in the calling thread in order to perform a synchronous load. For instance, the calling thread need not be running its run loop. @param request The request to load. Note that the request is deep-copied as part of the initialization process. Changes made to the request argument after this method returns do not affect the request that is used for the loading process. @param response An out parameter which is filled in with the response generated by performing the load. @param error Out parameter (may be NULL) used if an error occurs while processing the request. Will not be modified if the load succeeds. @result The content of the URL resulting from performing the load, or nil if the load failed.
     * @deprecated Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h
     */
    static sendSynchronousRequest$returningResponse$error$(request: _NSURLRequest, response: NobjcObject | null, error: NobjcObject | null): _NSData | null;
    /**
     * @method sendAsynchronousRequest:queue:completionHandler: @abstract Performs an asynchronous load of the given request. When the request has completed or failed, the block will be executed from the context of the specified NSOperationQueue. @discussion This is a convenience routine that allows for asynchronous loading of a url-based resource. If the resource load is successful, the data parameter to the callback will contain the resource data and the error parameter will be nil. If the resource load fails, the data parameter will be nil and the error will contain information about the failure. @param request The request to load. Note that the request is deep-copied as part of the initialization process. Changes made to the request argument after this method returns do not affect the request that is used for the loading process. @param queue An NSOperationQueue upon which the handler block will be dispatched. @param handler A block which receives the results of the resource load.
     * @deprecated Use [NSURLSession dataTaskWithRequest:completionHandler:] (see NSURLSession.h
     */
    static sendAsynchronousRequest$queue$completionHandler$(request: _NSURLRequest, queue: _NSOperationQueue, handler: ((response: _NSURLResponse, data: _NSData, connectionError: _NSError) => void) | null): void;
    /**
     * Designated initializer
     * @deprecated Use NSURLSession (see NSURLSession.h)
     */
    initWithRequest$delegate$startImmediately$(request: _NSURLRequest, delegate: NobjcObject | null, startImmediately: boolean): _NSURLConnection | null;
    /** @deprecated Use NSURLSession (see NSURLSession.h) */
    initWithRequest$delegate$(request: _NSURLRequest, delegate: NobjcObject | null): _NSURLConnection | null;
    start(): void;
    cancel(): void;
    scheduleInRunLoop$forMode$(aRunLoop: _NSRunLoop, mode: _NSString): void;
    unscheduleFromRunLoop$forMode$(aRunLoop: _NSRunLoop, mode: _NSString): void;
    setDelegateQueue$(queue: _NSOperationQueue | null): void;
    originalRequest(): _NSURLRequest;
    currentRequest(): _NSURLRequest;
}
