import type { NobjcObject } from "objc-js";
import type { _NSCollectionView } from "./NSCollectionView.js";
import type { _NSCollectionViewItem } from "./NSCollectionViewItem.js";
import type { _NSCollectionViewLayout } from "./NSCollectionViewLayout.js";
import type { _NSCollectionViewTransitionLayout } from "./NSCollectionViewTransitionLayout.js";
import type { _NSColor } from "./NSColor.js";
import type { _NSDraggingInfo } from "./NSDraggingInfo.js";
import type { _NSDraggingSession } from "./NSDraggingSession.js";
import type { _NSEvent } from "./NSEvent.js";
import type { _NSFilePromiseProvider } from "./NSFilePromiseProvider.js";
import type { _NSImage } from "./NSImage.js";
import type { _NSPasteboard } from "./NSPasteboard.js";
import type { _NSPasteboardItem } from "./NSPasteboardItem.js";
import type { _NSSound } from "./NSSound.js";
import type { _NSView } from "./NSView.js";
import type { _NSArray } from "../Foundation/NSArray.js";
import type { _NSIndexPath } from "../Foundation/NSIndexPath.js";
import type { _NSIndexSet } from "../Foundation/NSIndexSet.js";
import type { _NSSet } from "../Foundation/NSSet.js";
import type { _NSString } from "../Foundation/NSString.js";
import type { _NSURL } from "../Foundation/NSURL.js";
import type { CGPoint } from "../structs/CGPoint.js";
import type { NSCollectionViewDropOperation } from "./NSCollectionViewDropOperation.js";
import type { NSCollectionViewItemHighlightState } from "./NSCollectionViewItemHighlightState.js";
import type { NSDragOperation } from "./NSDragOperation.js";
export interface _NSCollectionViewDelegate {
    /**
     * The return value indicates whether the collection view can attempt to initiate a drag for the given event and items. If the delegate does not implement this method, the collection view will act as if it returned YES.
     */
    collectionView$canDragItemsAtIndexPaths$withEvent$?(collectionView: _NSCollectionView, indexPaths: _NSSet, event: _NSEvent): boolean;
    /**
     * Old Form (Single Section Only)
     * @deprecated Use -collectionView:pasteboardWriterForItemAtIndexPath: instead
     */
    collectionView$canDragItemsAtIndexes$withEvent$?(collectionView: _NSCollectionView, indexes: _NSIndexSet, event: _NSEvent): boolean;
    /**
     * This method is called after it has been determined that a drag should begin, but before the drag has been started. To refuse the drag, return NO. To start the drag, declare the pasteboard types that you support with -[NSPasteboard declareTypes:owner:], place your data for the items at the given index paths on the pasteboard, and return YES from the method. The drag image and other drag related information will be set up and provided by the view once this call returns YES. You need to implement this method, or -collectionView:pasteboardWriterForItemAtIndexPath: (its more modern counterpart), for your collection view to be a drag source. If you want to put file promises on the pasteboard, using the modern NSFilePromiseProvider API added in macOS 10.12, implement -collectionView:pasteboardWriterForItemAtIndexPath: instead of this method, and have it return an NSFilePromiseProvider.
     * @deprecated Use -collectionView:pasteboardWriterForItemAtIndexPath: instead
     */
    collectionView$writeItemsAtIndexPaths$toPasteboard$?(collectionView: _NSCollectionView, indexPaths: _NSSet, pasteboard: _NSPasteboard): boolean;
    /**
     * Old Form (Single Section Only)
     * @deprecated Use -collectionView:pasteboardWriterForItemAtIndexPath: instead
     */
    collectionView$writeItemsAtIndexes$toPasteboard$?(collectionView: _NSCollectionView, indexes: _NSIndexSet, pasteboard: _NSPasteboard): boolean;
    /**
     * This is a legacy method for file promise dragging, that's invoked when the delegate has placed NSFilesPromisePboardType data on the dragging pasteboard (typically in -collectionView:writeItemsAtIndexPaths:toPasteboard:). When using file promises and targeting macOS 10.12 and later, you should instead implement -collectionView:pasteboardWriterForItemAtIndexPath: to return a fully configured NSFilePromiseProvider, whose delegate provides the file name resolution functionality that was previously delegated to this method. NSCollectionView implements -namesOfPromisedFilesDroppedAtDestination: to return the results of this delegate method. This method should return an array of filenames (not full paths) for the created files. `dropURL` specifies the drop location. You do not need to implement this method for your collection view to be a drag source.
     * @deprecated Use NSFilePromiseReceiver objects instead
     */
    collectionView$namesOfPromisedFilesDroppedAtDestination$forDraggedItemsAtIndexPaths$?(collectionView: _NSCollectionView, dropURL: _NSURL, indexPaths: _NSSet): _NSArray;
    /**
     * Old Form (Single Section Only)
     * @deprecated Use NSFilePromiseReceiver objects instead
     */
    collectionView$namesOfPromisedFilesDroppedAtDestination$forDraggedItemsAtIndexes$?(collectionView: _NSCollectionView, dropURL: _NSURL, indexes: _NSIndexSet): _NSArray;
    /**
     * Allows the delegate to construct a custom dragging image for the items being dragged. 'indexPaths' contains the (section,item) identification of the items being dragged. 'event' is a reference to the mouse down event that began the drag. 'dragImageOffset' is an in/out parameter. This method will be called with dragImageOffset set to NSZeroPoint, but it can be modified to re-position the returned image. A dragImageOffset of NSZeroPoint will cause the image to be centered under the mouse. You can safely call -[NSCollectionView draggingImageForItemsAtIndexPaths:withEvent:offset:] from within this method. You do not need to implement this method for your collection view to be a drag source.
     */
    collectionView$draggingImageForItemsAtIndexPaths$withEvent$offset$?(collectionView: _NSCollectionView, indexPaths: _NSSet, event: _NSEvent, dragImageOffset: NobjcObject): _NSImage;
    /** Old Form (Single Section Only) */
    collectionView$draggingImageForItemsAtIndexes$withEvent$offset$?(collectionView: _NSCollectionView, indexes: _NSIndexSet, event: _NSEvent, dragImageOffset: NobjcObject): _NSImage;
    /**
     * This method is used by the collection view to determine a valid drop target. Based on the mouse position, the collection view will suggest a proposed (section,item) index path and drop operation. These values are in/out parameters and can be changed by the delegate to retarget the drop operation. The collection view will propose NSCollectionViewDropOn when the dragging location is closer to the middle of the item than either of its edges. Otherwise, it will propose NSCollectionViewDropBefore. You may override this default behavior by changing proposedDropOperation or proposedDropIndexPath. This method must return a value that indicates which dragging operation the data source will perform. It must return something other than NSDragOperationNone to accept the drop. Note: to receive drag messages, you must first send -registerForDraggedTypes: to the collection view with the drag types you want to support (typically this is done in -awakeFromNib). You must implement this method for your collection view to be a drag destination. Multi-image drag and drop: You can set draggingFormation, animatesToDestination, numberOfValidItemsForDrop within this method.
     */
    collectionView$validateDrop$proposedIndexPath$dropOperation$?(collectionView: _NSCollectionView, draggingInfo: _NSDraggingInfo, proposedDropIndexPath: NobjcObject, proposedDropOperation: NobjcObject): NSDragOperation;
    /** Old Form (Single Section Only) */
    collectionView$validateDrop$proposedIndex$dropOperation$?(collectionView: _NSCollectionView, draggingInfo: _NSDraggingInfo, proposedDropIndex: NobjcObject, proposedDropOperation: NobjcObject): NSDragOperation;
    /**
     * This method is called when the mouse is released over a collection view that previously decided to allow a drop via the above validateDrop method. At this time, the delegate should incorporate the data from the dragging pasteboard and update the collection view's contents. You must implement this method for your collection view to be a drag destination. Multi-image drag and drop: If draggingInfo.animatesToDestination is set to YES, you should enumerate and update the dragging items with the proper image components and frames so that they dragged images animate to the proper locations.
     */
    collectionView$acceptDrop$indexPath$dropOperation$?(collectionView: _NSCollectionView, draggingInfo: _NSDraggingInfo, indexPath: _NSIndexPath, dropOperation: NSCollectionViewDropOperation): boolean;
    /** Old Form (Single Section Only) */
    collectionView$acceptDrop$index$dropOperation$?(collectionView: _NSCollectionView, draggingInfo: _NSDraggingInfo, index: number, dropOperation: NSCollectionViewDropOperation): boolean;
    /**
     * Dragging Source Support - Required for multi-image drag and drop. Return a custom object that implements NSPasteboardWriting (or simply use NSPasteboardItem), or nil to prevent dragging for the item. For each valid item returned, NSCollectionView will create an NSDraggingItem with the draggingFrame equal to the frame of the item view at the given index path and components from -[NSCollectionViewItem draggingItem]. If this method is implemented, then -collectionView:writeItemsAtIndexPaths:toPasteboard: and -collectionView:draggingImageForItemsAtIndexPaths:withEvent:offset: will not be called.
     */
    collectionView$pasteboardWriterForItemAtIndexPath$?(collectionView: _NSCollectionView, indexPath: _NSIndexPath): _NSColor | _NSFilePromiseProvider | _NSImage | _NSPasteboardItem | _NSSound | null;
    /** Old Form (Single Section Only) */
    collectionView$pasteboardWriterForItemAtIndex$?(collectionView: _NSCollectionView, index: number): _NSColor | _NSFilePromiseProvider | _NSImage | _NSPasteboardItem | _NSSound | null;
    /**
     * Dragging Source Support - Optional. Implement this method to know when the dragging session is about to begin and to potentially modify the dragging session.
     */
    collectionView$draggingSession$willBeginAtPoint$forItemsAtIndexPaths$?(collectionView: _NSCollectionView, session: _NSDraggingSession, screenPoint: CGPoint, indexPaths: _NSSet): void;
    /** Old Form (Single Section Only) */
    collectionView$draggingSession$willBeginAtPoint$forItemsAtIndexes$?(collectionView: _NSCollectionView, session: _NSDraggingSession, screenPoint: CGPoint, indexes: _NSIndexSet): void;
    /**
     * Dragging Source Support - Optional. Implement this method to know when the dragging session has ended. This delegate method can be used to know when the dragging source operation ended at a specific location, such as the trash (by checking for an operation of NSDragOperationDelete).
     */
    collectionView$draggingSession$endedAtPoint$dragOperation$?(collectionView: _NSCollectionView, session: _NSDraggingSession, screenPoint: CGPoint, operation: NSDragOperation): void;
    /**
     * Dragging Destination Support - Required for multi-image drag and drop. Implement this method to update dragging items as they are dragged over the view. Typically this will involve calling [draggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:] and setting the draggingItem's imageComponentsProvider to a proper image based on the NSDraggingItem's -item value.
     */
    collectionView$updateDraggingItemsForDrag$?(collectionView: _NSCollectionView, draggingInfo: _NSDraggingInfo): void;
    /**
     * Sent during interactive selection or dragging, to inform the delegate that the CollectionView would like to change the "highlightState" property of the items at the specified "indexPaths" to the specified "highlightState". In addition to optionally reacting to the proposed change, you can approve it (by returning "indexPaths" as-is), or selectively refuse some or all of the proposed highlightState changes (by returning a modified autoreleased mutableCopy of indexPaths, or an empty indexPaths instance). Refusing a proposed highlightState change for an item will suppress the associated action for that item (selection change or eligibility to be a drop target).
     */
    collectionView$shouldChangeItemsAtIndexPaths$toHighlightState$?(collectionView: _NSCollectionView, indexPaths: _NSSet, highlightState: NSCollectionViewItemHighlightState): _NSSet;
    /**
     * Sent during interactive selection or dragging, to inform the delegate that the CollectionView has changed the "highlightState" property of the items at the specified "indexPaths" to the specified "highlightState".
     */
    collectionView$didChangeItemsAtIndexPaths$toHighlightState$?(collectionView: _NSCollectionView, indexPaths: _NSSet, highlightState: NSCollectionViewItemHighlightState): void;
    /**
     * Sent during interactive selection, to inform the delegate that the CollectionView would like to select the items at the specified "indexPaths". In addition to optionally reacting to the proposed change, you can approve it (by returning "indexPaths" as-is), or selectively refuse some or all of the proposed selection changes (by returning a modified autoreleased mutableCopy of indexPaths, or an empty indexPaths instance).
     */
    collectionView$shouldSelectItemsAtIndexPaths$?(collectionView: _NSCollectionView, indexPaths: _NSSet): _NSSet;
    /**
     * Sent during interactive selection, to inform the delegate that the CollectionView would like to de-select the items at the specified "indexPaths". In addition to optionally reacting to the proposed change, you can approve it (by returning "indexPaths" as-is), or selectively refuse some or all of the proposed selection changes (by returning a modified autoreleased mutableCopy of indexPaths, or an empty indexPaths instance).
     */
    collectionView$shouldDeselectItemsAtIndexPaths$?(collectionView: _NSCollectionView, indexPaths: _NSSet): _NSSet;
    /**
     * Sent at the end of interactive selection, to inform the delegate that the CollectionView has selected the items at the specified "indexPaths".
     */
    collectionView$didSelectItemsAtIndexPaths$?(collectionView: _NSCollectionView, indexPaths: _NSSet): void;
    /**
     * Sent at the end of interactive selection, to inform the delegate that the CollectionView has de-selected the items at the specified "indexPaths".
     */
    collectionView$didDeselectItemsAtIndexPaths$?(collectionView: _NSCollectionView, indexPaths: _NSSet): void;
    /**
     * Sent to notify the delegate that the CollectionView is about to add an NSCollectionViewItem. The indexPath identifies the object that the item represents.
     */
    collectionView$willDisplayItem$forRepresentedObjectAtIndexPath$?(collectionView: _NSCollectionView, item: _NSCollectionViewItem, indexPath: _NSIndexPath): void;
    /**
     * Sent to notify the delegate that the CollectionView is about to add a supplementary view (e.g. a section header or footer view). Each NSCollectionViewLayout class defines its own possible values and associated meanings for "elementKind". (For example, NSCollectionViewFlowLayout declares NSCollectionElementKindSectionHeader and NSCollectionElementKindSectionFooter.)
     */
    collectionView$willDisplaySupplementaryView$forElementKind$atIndexPath$?(collectionView: _NSCollectionView, view: _NSView, elementKind: _NSString, indexPath: _NSIndexPath): void;
    /**
     * Sent to notify the delegate that the CollectionView is no longer displaying the given NSCollectionViewItem instance. This happens when the model changes, or when an item is scrolled out of view. You should perform any actions necessary to help decommission the item (such as releasing expensive resources). The CollectionView may retain the item instance and later reuse it to represent the same or a different model object.
     */
    collectionView$didEndDisplayingItem$forRepresentedObjectAtIndexPath$?(collectionView: _NSCollectionView, item: _NSCollectionViewItem, indexPath: _NSIndexPath): void;
    /**
     * Sent to notify the delegate that the CollectionView is no longer displaying the given supplementary view. This happens when the model changes, or when a supplementary view is scrolled out of view. You should perform any actions necessary to help decommission the view (such as releasing expensive resources). The CollectionView may retain the view and later reuse it.
     */
    collectionView$didEndDisplayingSupplementaryView$forElementOfKind$atIndexPath$?(collectionView: _NSCollectionView, view: _NSView, elementKind: _NSString, indexPath: _NSIndexPath): void;
    /**
     * Sent when the CollectionView switches to a different layout, to allow the delegate to provide a custom transition if desired.
     */
    collectionView$transitionLayoutForOldLayout$newLayout$?(collectionView: _NSCollectionView, fromLayout: _NSCollectionViewLayout, toLayout: _NSCollectionViewLayout): _NSCollectionViewTransitionLayout;
}
