import type { NobjcObject } from "objc-js";
import type { _NSArray } from "./NSArray.js";
import type { _NSData } from "./NSData.js";
import type { _NSDictionary } from "./NSDictionary.js";
import type { _NSNetServiceDelegate } from "./NSNetServiceDelegate.js";
import type { _NSObject } from "./NSObject.js";
import type { _NSRunLoop } from "./NSRunLoop.js";
import type { _NSString } from "./NSString.js";
import type { NSNetServiceOptions } from "./NSNetServiceOptions.js";
export declare class _NSNetService extends _NSObject {
    static alloc(): _NSNetService;
    static new(): _NSNetService;
    init(): _NSNetService;
    /**
     * Returns an NSDictionary created from the provided NSData. The keys will be UTF8-encoded NSStrings. The values are NSDatas. The caller is responsible for interpreting these as types appropriate to the keys. If the NSData cannot be converted into an appropriate NSDictionary, this method will return nil. For applications linked on or after Mac OS X 10.5, this method will throw an NSInvalidException if it is passed nil as the argument.
     */
    static dictionaryFromTXTRecordData$(txtData: _NSData): _NSDictionary;
    /**
     * Returns an NSData created from the provided dictionary. The keys in the provided dictionary must be NSStrings, and the values must be NSDatas. If the dictionary cannot be converted into an NSData suitable for a TXT record, this method will return nil. For applications linked on or after Mac OS X 10.5, this method will throw an NSInvalidArgumentException if it is passed nil as the argument.
     */
    static dataFromTXTRecordDictionary$(txtDictionary: _NSDictionary): _NSData;
    /**
     * This is the initializer for publishing. You should use this initializer if you are going to announce the availability of a service on the network. To publish a service in all available domains, pass the empty string as the domain.
     */
    initWithDomain$type$name$port$(domain: _NSString, type: _NSString, name: _NSString, port: number): _NSNetService;
    /**
     * This is the initializer for resolution. If you know the domain, type and name of the service for which you wish to discover addresses, you should initialize an NSNetService instance using this method and call resolve: on the result. If you wish to connect to this service immediately, you should call getInputStream:getOutputStream: on the result and forego the resolution step entirely. If publish: is called on an NSNetService instance initialized with this method, an NSNetServicesBadArgumentError will be sent in the error dictionary to the delegate's netService:didNotPublish: method.
     */
    initWithDomain$type$name$(domain: _NSString, type: _NSString, name: _NSString): _NSNetService;
    /**
     * NSNetService instances may be scheduled on NSRunLoops to operate in different modes, or in other threads. It is generally not necessary to schedule NSNetServices in other threads. NSNetServices are scheduled in the current thread's NSRunLoop in the NSDefaultRunLoopMode when they are created.
     */
    scheduleInRunLoop$forMode$(aRunLoop: _NSRunLoop, mode: _NSString): void;
    removeFromRunLoop$forMode$(aRunLoop: _NSRunLoop, mode: _NSString): void;
    /**
     * Advertises a given service on the network. This method returns immediately. Success or failure is indicated by callbacks to the NSNetService instance's delegate. If the name of the service is the default name (@""), then the service will be renamed automatically. If the name of the service has been specified, then the service will not be renamed automatically. If more control over renaming is required, then -[NSNetService publishWithOptions:] is available.
     */
    publish(): void;
    /**
     * Advertises a given service on the network. This method returns immediately. Success or failure is indicated by callbacks to the NSNetService instance's delegate. See the notes above for NSNetServiceNoAutoRename for information about controlling the auto-renaming behavior using this method.
     * @deprecated Not supported
     */
    publishWithOptions$(options: NSNetServiceOptions): void;
    /**
     * Attempts to determine at least one address for the NSNetService instance. For applications linked on or after Mac OS X 10.4 "Tiger", this method calls -resolveWithTimeout: with a value of 5.0. Applications linked prior to Mac OS X 10.4 "Tiger" must call -stop on the instance after an appropriate (short) amount of time to avoid causing unnecessary network traffic.
     * @deprecated Not supported
     */
    resolve(): void;
    /** Halts a service which is either publishing or resolving. */
    stop(): void;
    /**
     * Starts a resolve for the NSNetService instance of the specified duration. If the delegate's -netServiceDidResolveAddress: method is called before the timeout expires, the resolve is successful. If the timeout is reached, the delegate's -netService:didNotResolve: method will be called. The value of the NSNetServicesErrorCode key in the error dictionary will be NSNetServicesTimeoutError.
     */
    resolveWithTimeout$(timeout: number): void;
    /**
     * Retrieves streams from the NSNetService instance. The instance's delegate methods are not called. Returns YES if the streams requested are created successfully. Returns NO if or any reason the stream could not be created. If only one stream is desired, pass NULL for the address of the other stream. The streams that are created are not open, and are not scheduled in any run loop for any mode.
     */
    getInputStream$outputStream$(inputStream: NobjcObject | null, outputStream: NobjcObject | null): boolean;
    /**
     * Sets the TXT record of the NSNetService instance that has been or will be published. Pass nil to remove the TXT record from the instance.
     */
    setTXTRecordData$(recordData: _NSData | null): boolean;
    /**
     * Returns the raw TXT record of the NSNetService instance. If the instance has not been resolved, or the delegate's -netService:didUpdateTXTRecordData: has not been called, this will return nil. It is permitted to have a zero-length TXT record.
     */
    TXTRecordData(): _NSData | null;
    /**
     * Starts monitoring the NSNetService instance for events. In Mac OS X 10.4 Tiger, monitored NSNetService instances inform their delegates of changes to the instance's TXT record by calling the delegate's -netService:didUpdateTXTRecordData: method.
     */
    startMonitoring(): void;
    /** Stops monitoring the NSNetService instance for events. */
    stopMonitoring(): void;
    /** Set a delegate to receive publish, resolve, or monitor events. */
    delegate(): _NSNetServiceDelegate | null;
    setDelegate$(value: _NSNetServiceDelegate | null): void;
    /**
     * Initially set to NO. Set to YES to also publish, resolve, or monitor this service over peer to peer Wi-Fi (if available). Must be set before operation starts.
     */
    includesPeerToPeer(): boolean;
    setIncludesPeerToPeer$(value: boolean): void;
    /** Returns the name of the discovered or published service. */
    name(): _NSString;
    /** Returns the type of the discovered or published service. */
    type(): _NSString;
    /** Returns the domain of the discovered or published service. */
    domain(): _NSString;
    /**
     * Returns the DNS host name of the computer hosting the discovered or published service. If a successful resolve has not yet occurred, this method will return nil.
     */
    hostName(): _NSString | null;
    /**
     * The addresses of the service. This is an NSArray of NSData instances, each of which contains a single struct sockaddr suitable for use with connect(2). In the event that no addresses are resolved for the service or the service has not yet been resolved, an empty NSArray is returned.
     */
    addresses(): _NSArray | null;
    /**
     * The port of a resolved service. This returns -1 if the service has not been resolved.
     */
    port(): number;
}
