import type { NobjcObject } from "objc-js";
import type { _NSApplication } from "./NSApplication.js";
import type { _NSMenu } from "./NSMenu.js";
import type { _NSArray } from "../Foundation/NSArray.js";
import type { _NSCoder } from "../Foundation/NSCoder.js";
import type { _NSData } from "../Foundation/NSData.js";
import type { _NSDictionary } from "../Foundation/NSDictionary.js";
import type { _NSError } from "../Foundation/NSError.js";
import type { _NSNotification } from "../Foundation/NSNotification.js";
import type { _NSString } from "../Foundation/NSString.js";
import type { _NSUserActivity } from "../Foundation/NSUserActivity.js";
import type { _INIntent } from "../Intents/INIntent.js";
import type { _CKShareMetadata } from "../CloudKit/CKShareMetadata.js";
import type { NSApplicationPrintReply } from "./NSApplicationPrintReply.js";
import type { NSApplicationTerminateReply } from "./NSApplicationTerminateReply.js";
export interface _NSApplicationDelegate {
    /**
     * Allowable return values are: @c NSTerminateNow - it is ok to proceed with termination @c NSTerminateCancel - the application should not be terminated @c NSTerminateLater - it may be ok to proceed with termination later. The application must call `-replyToApplicationShouldTerminate:` with @c YES or @c NO once the answer is known @note This return value is for delegates who need to provide document modal alerts (sheets) in order to decide whether to quit.
     */
    applicationShouldTerminate$?(sender: _NSApplication): NSApplicationTerminateReply;
    /**
     * This will be called for any URLs your application is asked to open. This includes URL types (CFBundleURLTypes) defined in your Info.plist, and Document types (@c CFBundleDocumentTypes) that have no associated @c NSDocument class. Document URLs that have an associated @c NSDocument class will be opened through @c NSDocumentController. If this is implemented, `-application:openFiles:` and `-application:openFile:` will not be called.
     */
    application$openURLs$?(application: _NSApplication, urls: _NSArray): void;
    application$openFile$?(sender: _NSApplication, filename: _NSString): boolean;
    application$openFiles$?(sender: _NSApplication, filenames: _NSArray): void;
    application$openTempFile$?(sender: _NSApplication, filename: _NSString): boolean;
    applicationShouldOpenUntitledFile$?(sender: _NSApplication): boolean;
    applicationOpenUntitledFile$?(sender: _NSApplication): boolean;
    application$openFileWithoutUI$?(sender: NobjcObject, filename: _NSString): boolean;
    application$printFile$?(sender: _NSApplication, filename: _NSString): boolean;
    application$printFiles$withSettings$showPrintPanels$?(application: _NSApplication, fileNames: _NSArray, printSettings: _NSDictionary, showPrintPanels: boolean): NSApplicationPrintReply;
    applicationShouldTerminateAfterLastWindowClosed$?(sender: _NSApplication): boolean;
    applicationShouldHandleReopen$hasVisibleWindows$?(sender: _NSApplication, hasVisibleWindows: boolean): boolean;
    applicationDockMenu$?(sender: _NSApplication): _NSMenu | null;
    application$willPresentError$?(application: _NSApplication, error: _NSError): _NSError;
    application$didRegisterForRemoteNotificationsWithDeviceToken$?(application: _NSApplication, deviceToken: _NSData): void;
    application$didFailToRegisterForRemoteNotificationsWithError$?(application: _NSApplication, error: _NSError): void;
    application$didReceiveRemoteNotification$?(application: _NSApplication, userInfo: _NSDictionary): void;
    /**
     * Method to opt-in to secure restorable state. When this returns @c YES: NSCoders that are passed into the various @c NSWindowRestoration methods will @c requiresSecureCoding and have a @c decodingFailurePolicy of @c NSDecodingFailurePolicySetErrorAndReturn. Any @c restorationClass set on a window must explicitly conform to @c NSWindowRestoration. This method will be called prior to any state encoding or restoration.
     */
    applicationSupportsSecureRestorableState$?(app: _NSApplication): boolean;
    /** @return The object capable of handling the specified intent. */
    application$handlerForIntent$?(application: _NSApplication, intent: _INIntent): NobjcObject | null;
    /**
     * Method called by `-[NSApplication encodeRestorableStateWithCoder:]` to give the delegate a chance to encode any additional state into the @c NSCoder. If the restorable state managed by the delegate changes, you must call `-[NSApplication invalidateRestorableState]` so that it will be re-encoded. See the header `NSWindowRestoration.h` for more information.
     */
    application$willEncodeRestorableState$?(app: _NSApplication, coder: _NSCoder): void;
    /**
     * Method called by `-[NSApplication restoreStateWithCoder:]` to give the delegate a chance to restore its own state, which it may decode from the @c NSCoder. See the header `NSWindowRestoration.h` for more information.
     */
    application$didDecodeRestorableState$?(app: _NSApplication, coder: _NSCoder): void;
    /**
     * This will be called on the main thread as soon as the user indicates they want to continue an activity in your application. The @c NSUserActivity object may not be available instantly, so use this as an opportunity to show the user that an activity will be continued shortly. Return @c YES to indicate that you are doing so. Return @c NO (or leave it unimplemented) and AppKit/UIKit will put up a default UI. For each `-application:willContinueUserActivityWithType:` invocation, you are guaranteed to get exactly one invocation of `-application:continueUserActivity:restorationHandler:` on success, or `-application:didFailToContinueUserActivityWithType:error:` if an error was encountered.
     */
    application$willContinueUserActivityWithType$?(application: _NSApplication, userActivityType: _NSString): boolean;
    /**
     * This will be called on the main thread after the @c NSUserActivity object is available. Use the data you stored in the NSUserActivity object to re-create what the user was doing. @return @c YES to indicate that the activity was handled. Return @c NO (or leave it unimplemented) and AppKit will attempt to continue the user activity. You should create/fetch any restorable objects associated with the user activity, and pass them to the restorationHandler. They will then get the above `-restoreUserActivityState:` method invoked with the user activity. Invoking the @c restorationHandler is optional. It may be copied and invoked later, but must be invoked on the main thread. If this user activity was created automatically by having @c NSUbiquitousDocumentUserActivityType in a @c CFBundleDocumentTypes entry, AppKit can automatically restore the NSUserActivity on OS X if NO is returned, or this method is unimplemented. It will do so by creating a document of the appropriate type using the URL stored in the userInfo under the @c NSUserActivityDocumentURLKey. The document will have `-restoreUserActivity:` called on it.
     */
    application$continueUserActivity$restorationHandler$?(application: _NSApplication, userActivity: _NSUserActivity, restorationHandler: (restorableObjects: _NSArray) => void): boolean;
    /**
     * There are instances where continuing a @c NSUserActivity may fail. This will get called on the main thread if it does so. If it is unimplemented, AppKit will present the error.
     */
    application$didFailToContinueUserActivityWithType$error$?(application: _NSApplication, userActivityType: _NSString, error: _NSError): void;
    /**
     * This will be called on the main thread when a user activity managed by AppKit/UIKit has been updated. You should use this as a last chance to add additional data to the @c userActivity.
     */
    application$didUpdateUserActivity$?(application: _NSApplication, userActivity: _NSUserActivity): void;
    /**
     * This will be called on the main thread after the user indicates they want to accept a CloudKit sharing invitation in your application. You should use the @c CKShareMetadata object's @c shareURL and containerIdentifier to schedule a @c CKAcceptSharesOperation, then start using the resulting @c CKShare and its associated record(s), which will appear in the @c CKContainer's shared database in a zone matching that of the record's owner.
     */
    application$userDidAcceptCloudKitShareWithMetadata$?(application: _NSApplication, metadata: _CKShareMetadata): void;
    /**
     * @return @c YES if the receiving delegate object can respond to key value coding messages for a specific keyed attribute, to-one relationship, or to-many relationship. Return @c NO otherwise.
     */
    application$delegateHandlesKey$?(sender: _NSApplication, key: _NSString): boolean;
    /**
     * This method will be called once during application launch at `-[NSApplication finishLaunching]`. @return @c NO if the receiving delegate object wishes to opt-out of system-wide keyboard shortcut localization for all application-supplied menus. Return @c YES by default for apps linked against 12.0 and later SDK.
     */
    applicationShouldAutomaticallyLocalizeKeyEquivalents$?(application: _NSApplication): boolean;
    applicationWillFinishLaunching$?(notification: _NSNotification): void;
    applicationDidFinishLaunching$?(notification: _NSNotification): void;
    applicationWillHide$?(notification: _NSNotification): void;
    applicationDidHide$?(notification: _NSNotification): void;
    applicationWillUnhide$?(notification: _NSNotification): void;
    applicationDidUnhide$?(notification: _NSNotification): void;
    applicationWillBecomeActive$?(notification: _NSNotification): void;
    applicationDidBecomeActive$?(notification: _NSNotification): void;
    applicationWillResignActive$?(notification: _NSNotification): void;
    applicationDidResignActive$?(notification: _NSNotification): void;
    applicationWillUpdate$?(notification: _NSNotification): void;
    applicationDidUpdate$?(notification: _NSNotification): void;
    applicationWillTerminate$?(notification: _NSNotification): void;
    applicationDidChangeScreenParameters$?(notification: _NSNotification): void;
    applicationDidChangeOcclusionState$?(notification: _NSNotification): void;
    applicationProtectedDataWillBecomeUnavailable$?(notification: _NSNotification): void;
    applicationProtectedDataDidBecomeAvailable$?(notification: _NSNotification): void;
}
