import type { NobjcObject } from "objc-js";
import type { _NSResponder } from "../AppKit/NSResponder.js";
import type { _IMKServer } from "./IMKServer.js";
import type { _NSArray } from "../Foundation/NSArray.js";
import type { _NSAttributedString } from "../Foundation/NSAttributedString.js";
import type { _NSDictionary } from "../Foundation/NSDictionary.js";
import type { CGPoint } from "../structs/CGPoint.js";
import type { CGRect } from "../structs/CGRect.js";
export declare class _IMKCandidates extends _NSResponder {
    static alloc(): _IMKCandidates;
    static new(): _IMKCandidates;
    init(): _IMKCandidates;
    /**
     * @method @abstract Default initializer for the class. @discussion When an input method allocates an IMKCandidate object it should initialize that object by calling this method passing the IMKServer that will manage the candidates and the initial panel type.
     */
    initWithServer$panelType$(server: _IMKServer, panelType: number): NobjcObject;
    initWithServer$panelType$styleType$(server: _IMKServer, panelType: number, style: number): NobjcObject;
    /** @method @abstract Return the panel type. */
    panelType(): number;
    /** @method @abstract Change the panel type. */
    setPanelType$(panelType: number): void;
    /**
     * @method @abstract If a candidate window type has been provided, show the candidate window. The caller provides a location hint that is used to position the window. Input methods call this method when it is appropriate, during text conversion, to display a list of candidates.
     */
    show$(locationHint: number): void;
    /** @method @abstract If the candidate window is visible, hide it. */
    hide(): void;
    /** @method @abstract Utility method returns YES if a candidate display is visible. */
    isVisible(): boolean;
    /**
     * @method @abstract Call this method to update the candidates displayed in the candidate window. @discussion Calling this method will result in a call being made to the IMKInputController's candidates method. Note that the candidate list will be updated, but the window's visible state will not change; that is to say, if the window is hidden it will remain hidden, and vice versa.
     */
    updateCandidates(): void;
    /**
     * @method @abstract Displays an annotation window whose contents are the annotationString. @discussion An annotation is additional text that explains or somehow adds to the candidate string in a candidate window. Annotations are displayed in a small borderless window that is aligned with the current candidate panel. An input method calls showAnnotation: when the method [IMKInputController candidateSelectionChanged:] is called, and the candidateString has annotations.
     */
    showAnnotation$(annotationString: _NSAttributedString): void;
    showSublist$subListDelegate$(candidates: _NSArray, delegate: NobjcObject): void;
    candidateFrame(): CGRect;
    /**
     * @method @abstract Set the selection keys for the candidates. @discussion Selection keys are an array of NSNumbers where each NSNumber is a virtual key code that the controller will map to characters that are displayed either across the top of the candidates, if the candidates are laid out horizontally, or along the left edge of the candidates, if they are aligned vertically. The number of selection keys determines how many candidates are displayed per page. For example, if you passed an array of 4 key codes, then 4 candidates are displayed per page. If you passed 11 key codes, then 11 candidates would be displayed. By default the key codes are mapped using the keyboard layout whose source id is com.apple.keylayout.US. The default layout can be replaced by calling setSelectionKeysKeylayout (see below). The default selection keys are the digits 1 through 9, or in terms of key codes: 18-21,23,22, 26, 28, 25.
     */
    setSelectionKeys$(keyCodes: _NSArray): void;
    /**
     * @method @abstract Returns an NSArray of NSNumbers where each NSNumber is a virtual key code. The NSArray is an autoreleased object. Do not release unless it is first retained.
     */
    selectionKeys(): _NSArray;
    /**
     * @method @abstract Sets the key layout that is used to map virtual key codes to characters.
     */
    setSelectionKeysKeylayout$(layout: NobjcObject): void;
    /**
     * @method @abstract Returns the key layout that is used to map virtual key codes for the selection keys. By default this is the key layout whose source id is com.apple.keylayout.US. This is an autoreleased object. Retain it if you need to keep it.
     */
    selectionKeysKeylayout(): NobjcObject;
    /**
     * @method @abstract Sets the "style" attributes for the candidates window. The keys for the attributes dictionary and the values are: NSFontAttributeName (value = NSFont) Setting the font attribute sets the font that is used to draw Candidates. It does not effect the selection keys which are always drawn in the same font. Note that to set the font size you should use this key/value pair. IMKCandidatesOpacityAttributeName (value = NSNumber with a float value between 0 and 1). Sets the opacity level to transparent (0.0) to completely opaque (1.0). The default opacity is 1.0. This constant is declared above. NSForegroundColorAttributeName (value = NSColor) Sets the text color used for the candidate text. By default it is black. NSBackgroundColorDocumentAttribute (value = NSColor). Set the background color that is drawn behind the candidate text. IMKCandidatesSendServerKeyEventFirst (value = NSNumber). NO (default) gives the candidate window first chance at key events. YES causes events to first be routed to the current IMKInputController. In that case, if the event is not handled, it will then be sent to the candidate window.
     */
    setAttributes$(attributes: _NSDictionary): void;
    /** @method @abstract Returns the attributes dictionary. */
    attributes(): _NSDictionary;
    /**
     * @method @abstract Setting the dismissesAutomatically flag determines what happens to displayed candidates when the return key or enter key is typed. @discussion By default, if a return or enter key is typed, the candidates are dismissed and a candidateSelected: message is sent to the input controller. However if setDismissesAutomatically is passed a NO flag the candidate display will not be dismissed when a return or enter key is typed. The input controller will still be sent the candidatesSelected: message, but, as stated, the candidates display will not be dismissed. Setting this flag to NO lets an input method process text input while keeping a dynamically changing candidates display in view throughout the text input process. When you set this to NO the candidate display will still be hidden when when a session deactivates.
     */
    setDismissesAutomatically$(flag: boolean): void;
    /** @method @abstract Returns the dismissesAutomatically flag. */
    dismissesAutomatically(): boolean;
    /**
     * @method @abstract Returns the currently selected candidate identifer. @discussion Attempts to determine the identifier for the selected candidate. If there is no selection the return value will be NSNotFound.
     */
    selectedCandidate(): number;
    /**
     * @method @abstract Positions the top-left corner of the candidate window’s frame rectangle at a given point in screen coordinates.
     */
    setCandidateFrameTopLeft$(point: CGPoint): void;
    /**
     * @method @abstract If the current selection has a child IMKCandidates object that will be shown. @discussion If there is a failure in showing the child this method will throw an exception.
     */
    showChild(): void;
    /**
     * @method @abstract If the current selection has a child IMKCandidates that is being shown hide it. @discussion Typically a client will not need to call this as IMKCandidates automatically hides and shows children.
     */
    hideChild(): void;
    /**
     * @method @abstract Attach an IMKCandidates object to the specified selection. @discussion The IMKCandidate can be a sublist or an annotation.
     */
    attachChild$toCandidate$type$(child: _IMKCandidates, candidateIdentifier: number, theType: number): void;
    /** @method @abstract Detach the IMKCandidates object attached to candidate */
    detachChild$(candidateIdentifier: number): void;
    /**
     * @method @abstract Set the candidates data directly rather than supplying data via [IMKInputContoller candidates:]. @discussion The elements of the array can be strings or attributed strings.
     */
    setCandidateData$(candidatesArray: _NSArray): void;
    /**
     * @method @abstract Select the candidate whose identifier matches the identifier parameter. @result YES if the candidateIdentifier is valid an the selection was made. NO if canidateIdentifier is invalid or it was not possible make the selection. @param An identifier for a candidate. You can obtain an identifier by mapping a candidate to an identifier via the [IMKCandidates candidateStringIdentifier:].
     */
    selectCandidateWithIdentifier$(candidateIdentifier: number): boolean;
    /**
     * temporary use this until all the clients have moved to selectCandidateWithIdentifier
     */
    selectCandidate$(candidateIdentifier: number): void;
    /**
     * @method @abstract Show the candidate window. @discussion This simply shows the candidates. No effort is made to position the candidate. The caller should move the candidate window to an appropriate location prior to showing.
     */
    showCandidates(): void;
    /**
     * @method @abstract Map a candidateString to an identifier. @discussion Beginning with MacOS 10.7, candidate strings are mapped internally to an unique identifier of type NSInteger. Using identifiers to identify a particular candidate is the first stage of enabling data types other than NSString and NSAttributedString for containing the contents of a candidate.
     */
    candidateStringIdentifier$(candidateString: NobjcObject): number;
    /**
     * @method @abstract Returns the currently selected candidate string. @discussion Attempts to determine the string for the selected candidate. If there is no selection the return value can be nil. The attributed string is an autoreleased object.
     */
    selectedCandidateString(): _NSAttributedString;
    /**
     * @method @abstract Returns the candidate identifier for a given line in the candidate window display. @discussion Maps the lineNumber to a candidate identifier. Line number 0 corresponds to the candidate in the cell currently in the first (top for vertical) line of the candidate window. This is convienient for input methods that support selecting a candidate by a number key. Line Number values depend on the column arrangement of your candidate. If you are displaying a single column candidate window, lines that have been scrolled out of view will have negative values. For a single row grid line, numbers will correspond to the cell's position in the row (i.e. the first cell will be 0, the second 1, etc). Finally, for a grid, the line numbers correspond to the grid row. If the line number is invalid, NSNotFound is returned. @param lineNumber a number representing a cells position in the candidate window.
     */
    candidateIdentifierAtLineNumber$(lineNumber: number): number;
    /**
     * @method @abstract Returns the line number for a given CandidateID. @result The line number. NSNotFound if the candidateID is invalid. @param candidateIdentifier - A valid identifier for a candidate. @discussion If the cell that contains the candidate is at the top line of the candidate window, the return value will be 0.
     */
    lineNumberForCandidateWithIdentifier$(candidateIdentifier: number): number;
    /** @method @abstract Clears the current selection. */
    clearSelection(): void;
}
