import type { NobjcObject } from "objc-js";
import type { _NSArray } from "../Foundation/NSArray.js";
import type { _NSCoder } from "../Foundation/NSCoder.js";
import type { _NSCopying } from "../Foundation/NSCopying.js";
import type { _NSObject } from "../Foundation/NSObject.js";
import type { _NSString } from "../Foundation/NSString.js";
import type { _NSAccessibility } from "./NSAccessibility.js";
import type { _NSAppearanceCustomization } from "./NSAppearanceCustomization.js";
import type { _NSEvent } from "./NSEvent.js";
import type { _NSFont } from "./NSFont.js";
import type { _NSImage } from "./NSImage.js";
import type { _NSMenuDelegate } from "./NSMenuDelegate.js";
import type { _NSMenuItem } from "./NSMenuItem.js";
import type { _NSUserInterfaceItemIdentification } from "./NSUserInterfaceItemIdentification.js";
import type { _NSView } from "./NSView.js";
import type { _PDFView } from "../PDFKit/PDFView.js";
import type { CGPoint } from "../structs/CGPoint.js";
import type { CGSize } from "../structs/CGSize.js";
import type { NSMenuPresentationStyle } from "./NSMenuPresentationStyle.js";
import type { NSMenuProperties } from "./NSMenuProperties.js";
import type { NSMenuSelectionMode } from "./NSMenuSelectionMode.js";
import type { NSUserInterfaceLayoutDirection } from "./NSUserInterfaceLayoutDirection.js";
export declare class _NSMenu extends _NSObject {
    static alloc(): _NSMenu;
    static new(): _NSMenu;
    init(): _NSMenu;
    /**
     * Pops up the receiver as a context menu. The menu is positioned such that the top left corner lies at the given event's location, interpreted in the coordinate system of the given view. If this would cause the menu to scroll offscreen, it will be moved up to be onscreen. The event must not be nil. If a font is specified, then it will be applied to the menu. In 10.6, the setFont: API below should be preferred.
     */
    static popUpContextMenu$withEvent$forView$(menu: _NSMenu, event: _NSEvent, view: _NSView): void;
    static popUpContextMenu$withEvent$forView$withFont$(menu: _NSMenu, event: _NSEvent, view: _NSView, font: _NSFont | null): void;
    /**
     * Determines whether the menu bar is visible for this application. Users cannot access the menu bar unless it is visible. It is visible by default.
     */
    static setMenuBarVisible$(visible: boolean): void;
    static menuBarVisible(): boolean;
    /**
     * Creates a palette menu displaying user-selectable color tags using the provided array of colors and optional titles. Note that the palette menu is configured for display as an inline menu; you must set it as the submenu of another menu item, contained in a standard menu. The palette menu cannot be used to invoke the `popUpMenuPositioningItem` method, or attached directly to a popup button or toolbar item. @return An autoconfigured palette menu.
     */
    static paletteMenuWithColors$titles$selectionHandler$(colors: _NSArray, itemTitles: _NSArray, onSelectionChange: ((arg0: _NSMenu) => void) | null): _NSMenu;
    /**
     * Creates a palette menu displaying user-selectable color tags using the provided template image, tinted using the specified array of colors. Optionally allows observing changes to the selection state in the compact menu. The block is invoked after the selection has been updated. Currently selected items can be retrieved from the `selectedItems` property. Note that the palette menu is configured for display as an inline menu; you must set it as the submenu of another menu item, contained in a standard menu. The palette menu cannot be used to invoke the `popUpMenuPositioningItem` method, or attached directly to a popup button or toolbar item. @return An autoconfigured palette menu.
     */
    static paletteMenuWithColors$titles$templateImage$selectionHandler$(colors: _NSArray, itemTitles: _NSArray, image: _NSImage, onSelectionChange: ((arg0: _NSMenu) => void) | null): _NSMenu;
    /**
     * Returns the zone used to allocate NSMenu objects. This is left in for compatibility and has returned NSDefaultMallocZone() since OS X 10.2. It is not necessary to use this - menus can be allocated the usual way.
     * @deprecated
     */
    static menuZone(): NobjcObject;
    /** @deprecated */
    static setMenuZone$(zone: NobjcObject): void;
    /**
     * Designated initializer. If this menu is used as a submenu of an item in the application's main menu, then the title is what appears in the menu bar. Otherwise, the title is ignored. Do not pass nil (an exception will result), but you may pass an empty string.
     */
    initWithTitle$(title: _NSString): _NSMenu;
    initWithCoder$(coder: _NSCoder): _NSMenu;
    /**
     * Pops up the receiver as a popup menu. The top left or right corner of the given item (which must be present in the receiver) is positioned at the given location in the given view, interpreted in the view's own coordinate system. If item is nil, the menu is positioned such that the top left or right of the menu content frame is at the given location. If view is nil, the location is interpreted in the screen coordinate system. This allows you to pop up a menu disconnected from any window. The method returns YES if menu tracking ended because an item was selected, and NO if menu tracking was cancelled for any reason. This method determines whether to use the top left or right corner by calling userInterfaceLayoutDirection on the view or its cell (if implemented). If not implemented, or if the view is nil, it inspects the userInterfaceLayoutDirection of the NSApplication.
     */
    popUpMenuPositioningItem$atLocation$inView$(item: _NSMenuItem | null, location: CGPoint, view: _NSView | null): boolean;
    /**
     * Inserts a menu item at the given index, which must be at least zero and no more than the receiver's item count. If newItem is nil, this raises an exception.
     */
    insertItem$atIndex$(newItem: _NSMenuItem, index: number): void;
    /** Appends an item to the end of the menu. A nil item will raise an exception. */
    addItem$(newItem: _NSMenuItem): void;
    /**
     * Inserts a new menu item with the given title, action, and key equivalent, at the given index. The index must be at least zero and no more than the receiver's item count. The title and key equivalent must not be nil (pass the empty string to indicate no key equivalent). This returns the new item.
     */
    insertItemWithTitle$action$keyEquivalent$atIndex$(string_: _NSString, selector: string | null, charCode: _NSString, index: number): _NSMenuItem;
    /** Appends a new menu item with the given properties to the end of the menu. */
    addItemWithTitle$action$keyEquivalent$(string_: _NSString, selector: string | null, charCode: _NSString): _NSMenuItem;
    /**
     * Removes the item at the given index, which must be at least zero and less than the number of items. All subsequent items will shift down one index.
     */
    removeItemAtIndex$(index: number): void;
    /**
     * Removes the item from the menu. If the item is nil, or is not present in the receiver, an exception will be raised.
     */
    removeItem$(item: _NSMenuItem): void;
    /** Same as [item setSubmenu:menu]. item may not be nil. */
    setSubmenu$forItem$(menu: _NSMenu | null, item: _NSMenuItem): void;
    /**
     * Removes all items. This is more efficient than removing items one by one. This does not post NSMenuDidRemoveItemNotification, for efficiency.
     */
    removeAllItems(): void;
    /**
     * Returns the item at the given index, which must be at least zero and less than the number of items.
     */
    itemAtIndex$(index: number): _NSMenuItem | null;
    /**
     * Returns the index of the item in the menu, or -1 if the item is not present in the menu
     */
    indexOfItem$(item: _NSMenuItem): number;
    /**
     * Returns the first item in the menu that matches the given property, or -1 if no item in the menu matches.
     */
    indexOfItemWithTitle$(title: _NSString): number;
    indexOfItemWithTag$(tag: number): number;
    indexOfItemWithRepresentedObject$(object_: NobjcObject | null): number;
    indexOfItemWithSubmenu$(submenu: _NSMenu | null): number;
    indexOfItemWithTarget$andAction$(target: NobjcObject | null, actionSelector: string | null): number;
    /**
     * Returns the first item in the menu with the given property, or nil if no item in the menu matches.
     */
    itemWithTitle$(title: _NSString): _NSMenuItem | null;
    itemWithTag$(tag: number): _NSMenuItem | null;
    /**
     * If the receiver is set to autoenable items, then this triggers autovalidation of all menu items according to the NSMenuValidation informal protocol; otherwise this does nothing. It is normally not necessary to call this; it will be called for you at the right time.
     */
    update(): void;
    /**
     * Attempts to perform the given key equivalent. If the event is a key down event that matches the key equivalent of a menu item in the receiver or, recursively, any menu item in a submenu of the receiver, then this triggers that menu item's action (if the item is enabled) and returns YES. Otherwise, this returns NO.
     */
    performKeyEquivalent$(event: _NSEvent): boolean;
    /**
     * This method is called when a menu item's enabled state, submenu, title, attributed title, image, key equivalent, key equivalent modifier mask, alternate status, indent, tooltip, view, or visibility (via isHidden) changes. This method posts NSMenuDidChangeItemNotification. Future properties will likely not call this method when they change, because posting a notification when a property changes is rather expensive.
     */
    itemChanged$(item: _NSMenuItem): void;
    /**
     * Triggers the action for the item at the given index in the receiver. This is useful as both an override point and something you may call directly. As an override point, this is called when the user chooses the item during normal menu tracking; subclassers can override it to take some different action. If you call it directly, it triggers the action for that item. In SnowLeopard and later, calling it directly will also highlight the menu (if present in the main menu) and trigger accessibility notifications, including VoiceOver speaking the title.
     */
    performActionForItemAtIndex$(index: number): void;
    /** Dismisses the menu and ends all menu tracking */
    cancelTracking(): void;
    /**
     * Dismisses the menu immediately, without any fade or other effect, and ends all menu tracking
     */
    cancelTrackingWithoutAnimation(): void;
    submenuAction$(sender: NobjcObject | null): void;
    /** @deprecated */
    setMenuRepresentation$(menuRep: NobjcObject): void;
    /** @deprecated */
    menuRepresentation(): NobjcObject;
    /** @deprecated */
    setContextMenuRepresentation$(menuRep: NobjcObject): void;
    /** @deprecated */
    contextMenuRepresentation(): NobjcObject;
    /** @deprecated */
    setTearOffMenuRepresentation$(menuRep: NobjcObject): void;
    /** @deprecated */
    tearOffMenuRepresentation(): NobjcObject;
    /** @deprecated */
    attachedMenu(): _NSMenu;
    /** @deprecated */
    isAttached(): boolean;
    /** @deprecated */
    sizeToFit(): void;
    /** @deprecated */
    locationForSubmenu$(submenu: _NSMenu): CGPoint;
    /** @deprecated */
    helpRequested$(eventPtr: _NSEvent): void;
    /**
     * Set and get the menu's title. The titles of the submenus of the application's main menu items appear in the menu bar.
     */
    title(): _NSString;
    setTitle$(value: _NSString): void;
    /**
     * Getter: Returns the menu containing the item that has the receiver as a submenu, or nil if this menu is not the submenu of an item in a menu. Setter: If a menu item has the receiver as a submenu, then this method will be called when the menu containing that item changes. You should never call this, but you may override it to take some action when the supermenu changes.
     */
    supermenu(): _NSMenu | null;
    setSupermenu$(value: _NSMenu | null): void;
    /**
     * Returns an array containing the receiver's menu items. This property is settable in macOS 10.14 and later.
     */
    itemArray(): _NSArray;
    setItemArray$(value: _NSArray): void;
    /** Returns the number of menu items in the menu. */
    numberOfItems(): number;
    /**
     * Set and get whether the menu autoenables items. If a menu autoenables items, then calls to -[NSMenuItem setEnabled:] are ignored, and the enabled state is computed via the NSMenuValidation informal protocol below. Autoenabling is on by default.
     */
    autoenablesItems(): boolean;
    setAutoenablesItems$(value: boolean): void;
    /**
     * Set and get the delegate for the menu. The delegate is weakly referenced for zeroing-weak compatible objects on 10.9 and later. Otherwise the behavior of this property is 'assign'. See the NSMenuDelegate protocol for methods that the delegate may implement.
     */
    delegate(): _PDFView | null;
    setDelegate$(value: _NSMenuDelegate | null): void;
    /**
     * If called on the main menu, returns the height of the menu bar in pixels. If called on any other menu, returns 0.
     */
    menuBarHeight(): number;
    /**
     * Returns the highlighted item in the menu, or nil if no item in the menu is highlighted
     */
    highlightedItem(): _NSMenuItem;
    /**
     * Set the minimum width of the menu, in screen coordinates. The menu will prefer to not draw smaller than its minimum width, but may draw larger if it needs more space. The default value is 0.
     */
    minimumWidth(): number;
    setMinimumWidth$(value: number): void;
    /**
     * Returns the size of the menu, in screen coordinates. The menu may draw at a smaller size when shown, depending on its positioning and display configuration.
     */
    size(): CGSize;
    /**
     * Sets the font for the menu. This also affects the font of all submenus that do not have their own font.
     */
    font(): _NSFont;
    setFont$(value: _NSFont): void;
    /**
     * Determines whether contextual menu plugins may be appended to the menu, if used as a context menu. The default is YES.
     */
    allowsContextMenuPlugIns(): boolean;
    setAllowsContextMenuPlugIns$(value: boolean): void;
    /**
     * Determines whether Writing Tools menu items may be inserted into the menu, if used as a context menu. The default is YES.
     */
    automaticallyInsertsWritingToolsItems(): boolean;
    setAutomaticallyInsertsWritingToolsItems$(value: boolean): void;
    /**
     * Determines whether the menu contains a column for the state image. The default is YES.
     */
    showsStateColumn(): boolean;
    setShowsStateColumn$(value: boolean): void;
    /**
     * Determines the layout direction for menu items in the menu. If no layout direction is explicitly set, the menu will default to the value of [NSApp userInterfaceLayoutDirection].
     */
    userInterfaceLayoutDirection(): NSUserInterfaceLayoutDirection;
    setUserInterfaceLayoutDirection$(value: NSUserInterfaceLayoutDirection): void;
    /**
     * The presentation style of the menu. @note This property is not respected if the menu is the main menu of the app.
     */
    presentationStyle(): NSMenuPresentationStyle;
    setPresentationStyle$(value: NSMenuPresentationStyle): void;
    /**
     * The selection mode of the menu. Note the selection mode only has effect on menu items that belong to the same selection group. A selection group consists of the items with the same target/action.
     */
    selectionMode(): NSMenuSelectionMode;
    setSelectionMode$(value: NSMenuSelectionMode): void;
    /**
     * The menu items that are selected. An item is selected when its state is `NSControl.StateValue.on`. @note This property is settable. Setting `selectedItems` will select any items that are contained in the provided array, and deselect any previously selected items that are not in the array.
     */
    selectedItems(): _NSArray;
    setSelectedItems$(value: _NSArray): void;
    propertiesToUpdate(): NSMenuProperties;
    /**
     * In OS X 10.6 and later, the following methods no longer do anything useful.
     * @deprecated
     */
    menuChangedMessagesEnabled(): boolean;
    setMenuChangedMessagesEnabled$(value: boolean): void;
    /** @deprecated */
    tornOff(): boolean;
}
export interface _NSMenu extends _NSCopying, _NSUserInterfaceItemIdentification, _NSAppearanceCustomization, _NSAccessibility {
}
