# typings/AppKit.pyi

from typing import Any, List, Self, Tuple, overload, Type, Mapping
from Foundation import NSObject, NSDictionary, NSArray, NSString, NSURL, NSAffineTransform, NSMutableAttributedString, NSData
from Foundation import NSPointLike, NSRectLike, NSRange, NSSizeLike, NSLineCapStyle, NSLineJoinStyle, NSCompositingOperation, NSTextAlignment
from Quartz import CGContextRef

def NSRectFill(rect: NSRectLike) -> None: ...

def NSMakePoint(x: float, y: float) -> NSPointLike: ...

def NSMakeRange(location: int, length: int) -> NSRange: ...

def NSLog(log: str) -> None: ...


class NSDocument(NSObject):
	def windowForSheet(self) -> "NSWindow": ...

class NSDocumentController(NSObject):
	@classmethod
	def sharedDocumentController(cls) -> "NSDocumentController": ...
	def addDocument_(self, document: NSDocument) -> None: ...


class NSApplication(NSObject):
	@classmethod
	def sharedApplication(cls) -> "NSApplication": ...
	def currentFontDocument(self) -> NSDocument: ...
	def currentEvent(self) -> "NSEvent": ...


def NSApp() -> NSApplication: ...

NSEventModifierFlags = int

class NSEvent(NSObject):
	def locationInWindow(self) -> NSPointLike: ...
	def characters(self) -> str: ...
	@overload
	def modifierFlags(self: "NSEvent") -> NSEventModifierFlags: ...  # type: ignore[override]
	@classmethod
	@overload
	def modifierFlags(cls: Type["NSEvent"]) -> NSEventModifierFlags: ...
	def keyCode(self) -> int: ...
	def clickCount(self) -> int: ...
	def tabletPointingDeviceType(self) -> int: ...
	def pressure(self) -> float: ...


class NSFileManager(NSObject):
	@classmethod
	def defaultManager(cls) -> "NSFileManager": ...
	def fileExistsAtPath_isDirectory_(self, path: str, isDirectory: None) -> tuple[bool, bool]: ...
	def createDirectoryAtPath_withIntermediateDirectories_attributes_error_(
		self,
		path: str,
		createIntermediates: bool,
		attributes: Mapping[str, Any] | None,
		error: None,
	) -> tuple[bool, bool]: ...
	def isReadableFileAtPath_(self, path: NSString | str) -> bool: ...
	def copyItemAtPath_toPath_error_(self, srcPath: NSString | str, dstPath: NSString | str, error: None) -> tuple[bool, bool]: ...

class NSScreen(NSObject):
	...


class NSNib(NSObject):
	def initWithNibNamed_bundle_(self, name: str, bundle: "NSBundle") -> Self: ...
	def instantiateWithOwner_topLevelObjects_(self, owner: Any, topLevelObjects: Any | None = None) -> Tuple[bool, str]: ...


class NSMenuItem(NSObject):
	@classmethod
	def separatorItem(cls) -> "NSMenuItem": ...
	def initWithTitle_action_keyEquivalent_(self, title: str, action: Any, keyEquivalent: str) -> Self: ...
	def setTitle_(self, title: str) -> None: ...
	def setImage_(self, image: 'NSImage') -> None: ...
	def setSubmenu_(self, subMenu: "NSMenu") -> None: ...
	def view(self) -> "NSView": ...
	def setView_(self, view: "NSView") -> None: ...
	def state(self) -> int: ...
	def setState_(self, state: int) -> None: ...
	def enabled(self) -> bool: ...
	def setEnabled_(self, value: bool) -> None: ...
	def action(self) -> Any: ...
	def setAction_(self, action: Any) -> None: ...
	def target(self) -> Any: ...
	def setTarget_(self, target: Any) -> None: ...
	def setOnStateImage_(self, image: "NSImage") -> None: ...
	def setKeyEquivalent_(self, key: str) -> None: ...
	def setKeyEquivalentModifierMask_(self, mast: int) -> None: ...
	def setRepresentedObject_(self, value: Any) -> None: ...


class NSMenu(NSObject):
	def insertItem_atIndex_(self, item: NSMenuItem, idx: int) -> None: ...
	def initWithTitle_(self, title: str | NSString) -> Self: ...
	def addItem_(self, item: NSMenuItem) -> None: ...
	def itemAtIndex_(self, idx: int) -> NSMenuItem: ...
	def setAutoenablesItems_(self, value: bool) -> None: ...

NSLocalizedDescriptionKey: str
NSLocalizedRecoverySuggestionErrorKey: str

class NSError(NSObject):
	@classmethod
	def errorWithDomain_code_userInfo_(cls, domain: "NSString" | str, code: int, userInfo: dict) -> Self: ...


class NSLayoutAnchor(NSObject):
	...


class NSViewController(NSObject):
	def view(self) -> "NSView": ...

class NSPrintOperation(NSObject):
	@classmethod
	def printOperationWithView_(cls, view: "NSView") -> Self: ...
	def runOperation(self) -> None: ...

class NSBezierPath(NSObject):
	"""Stub for Cocoa’s NSBezierPath"""
	@classmethod
	def bezierPath(cls) -> "NSBezierPath": ...
	@classmethod
	def bezierPathWithRect_(cls, rect: NSRectLike) -> "NSBezierPath": ...
	@classmethod
	def bezierPathWithOvalInRect_(cls, rect: NSRectLike) -> "NSBezierPath": ...
	@classmethod
	def bezierPathWithRoundedRect_xRadius_yRadius_(cls, rect: NSRectLike, x: float, y: float) -> "NSBezierPath": ...
	@classmethod
	def defaultLineWidth(cls) -> float: ...
	@classmethod
	def setDefaultLineWidth_(cls, value: float) -> None: ...
	@classmethod
	def strokeLineFromPoint_toPoint_(cls, start: NSPointLike | tuple, end: NSPointLike | tuple) -> None: ...
	@classmethod
	def bezierPathWithRoundedRect_cornerRadius_(cls, rect: NSRectLike, radius: float) -> "NSBezierPath": ...
	def appendBezierPath_(self, otherPath: "NSBezierPath") -> None: ...
	def appendBezierPathWithOvalInRect_(self, rect: NSRectLike) -> None: ...
	def appendBezierPathWithRect_(self, rect: NSRectLike) -> None: ...
	def moveToPoint_(self, point: NSPointLike | tuple) -> None: ...
	def lineToPoint_(self, point: NSPointLike | tuple) -> None: ...
	def curveToPoint_controlPoint1_controlPoint2_(self, curve: NSPointLike | tuple, off1: NSPointLike | tuple, off2: NSPointLike | tuple) -> None: ...
	def fill(self) -> None: ...
	def stroke(self) -> None: ...
	def setLineWidth_(self, lineWidth: float) -> None: ...
	def setMiterLimit_(self, lineWidth: float) -> None: ...
	def setLineJoinStyle_(self, lineJoinStyle: NSLineJoinStyle) -> None: ...
	def setLineCapStyle_(self, lineCapStyle: NSLineCapStyle) -> None: ...
	def addClip(self) -> None: ...
	def closePath(self) -> None: ...
	def bounds(self) -> NSRectLike: ...
	def transformUsingAffineTransform_(self, transform: "NSAffineTransform") -> None: ...
	def setLineDash_count_phase_(self, lineDash: Any, count: int, phase: float) -> None: ...
	@classmethod
	def clipRect_(cls, rect: NSRectLike) -> None: ...
	@classmethod
	def fillRect_(cls, rect: NSRectLike) -> None: ...
	def containsPoint_(self, point: NSPointLike) -> bool: ...
	def elementCount(self) -> int: ...
	def elementAtIndex_associatedPoints_(self, idx: int) -> tuple[int, list[NSPointLike]]: ...

class NSImage(NSObject):
	def initWithContentsOfFile_(self, file: str) -> Self: ...
	def initByReferencingFile_(self, file: str) -> Self: ...
	def initWithSize_(self, size: NSSizeLike) -> Self: ...
	def drawAtPoint_fromRect_operation_fraction_(self, point: NSPointLike, fromRect: NSRectLike, op: NSCompositingOperation, fraction: float) -> None: ...
	def drawInRect_fromRect_operation_fraction_(self, rect: NSRectLike, fromRect: NSRectLike, op: NSCompositingOperation, fraction: float) -> None: ...
	def lockFocus(self) -> None: ...
	def unlockFocus(self) -> None: ...
	@classmethod
	def imageNamed_(cls, name: str) -> Self | None: ...
	def name(self) -> str: ...
	def setName_(self, name: str) -> None: ...
	def setTemplate_(self, value: bool) -> None: ...
	def size(self) -> NSSizeLike: ...
	def setSize_(self, size: NSSizeLike) -> None: ...
	@classmethod
	def imageWithSystemSymbolName_accessibilityDescription_(cls, name: str, desc: str | None) -> Self: ...


class NSBitmapImageRep(NSObject):
	@classmethod
	def imageRepWithData_(cls, data: NSData) -> Self: ...
	def valueForProperty_(self, key: str) -> Any: ...
	def setProperty_withValue_(self, key: str, value: Any) -> None: ...

NSFontAttributeName: str
NSForegroundColorAttributeName: str

class NSFont(NSObject):
	def pointSize(self) -> float: ...
	@classmethod
	def labelFontOfSize_(cls, size: float) -> Self: ...
	@classmethod
	def systemFontOfSize_(cls, size: float) -> Self: ...
	@classmethod
	def systemFontSize(cls) -> float: ...
	@classmethod
	def systemFontOfSize_weight_(cls, size: float, weight: float) -> Self: ...
	@classmethod
	def boldSystemFontOfSize_(cls, size: float) -> Self: ...
	@classmethod
	def fontWithName_size_(cls, name: str, size: float) -> Self: ...
	@classmethod
	def monospacedSystemFontOfSize_weight_(cls, size: float, weight: float) -> Self: ...
	@classmethod
	def monospacedDigitSystemFontOfSize_weight_(cls, size: float, weight: float) -> Self: ...
	@classmethod
	def userFixedPitchFontOfSize_(cls, size: float) -> Self: ...
	def fontName(self) -> str: ...
	@classmethod
	def systemFontSizeForControlSize_(cls, controlSize: int) -> float: ...
	@classmethod
	def smallSystemFontSize(cls) -> float: ...

class NSColor:
	"""Stubs for Cocoa’s default colors"""
	@classmethod
	def clearColor(cls) -> Self: ...
	@classmethod
	def blackColor(cls) -> Self: ...
	@classmethod
	def darkGrayColor(cls) -> Self: ...
	@classmethod
	def lightGrayColor(cls) -> Self: ...
	@classmethod
	def whiteColor(cls) -> Self: ...
	@classmethod
	def grayColor(cls) -> Self: ...
	@classmethod
	def redColor(cls) -> Self: ...
	@classmethod
	def greenColor(cls) -> Self: ...
	@classmethod
	def blueColor(cls) -> Self: ...
	@classmethod
	def cyanColor(cls) -> Self: ...
	@classmethod
	def yellowColor(cls) -> Self: ...
	@classmethod
	def magentaColor(cls) -> Self: ...
	@classmethod
	def orangeColor(cls) -> Self: ...
	@classmethod
	def purpleColor(cls) -> Self: ...
	@classmethod
	def brownColor(cls) -> Self: ...
	@classmethod
	def systemGrayColor(cls) -> Self: ...
	@classmethod
	def systemCyanColor(cls) -> Self: ...
	@classmethod
	def systemPinkColor(cls) -> Self: ...
	# some frequently used system colors
	@classmethod
	def windowBackgroundColor(cls) -> Self: ...
	@classmethod
	def controlBackgroundColor(cls) -> Self: ...
	@classmethod
	def textColor(cls) -> Self: ...
	@classmethod
	def selectedTextColor(cls) -> Self: ...
	@classmethod
	def textBackgroundColor(cls) -> Self: ...
	@classmethod
	def disabledControlTextColor(cls) -> Self: ...
	@classmethod
	def labelColor(cls) -> Self: ...
	@classmethod
	def secundaryLabelColor(cls) -> Self: ...
	@classmethod
	def tertiaryLabelColor(cls) -> Self: ...
	@classmethod
	def quaternaryLabelColor(cls) -> Self: ...
	@classmethod
	def controlAccentColor(cls) -> Self: ...
	@classmethod
	def separatorColor(cls) -> Self: ...
	@classmethod
	def colorWithRed_green_blue_alpha_(cls, red: float, gree: float, blue: float, alpha: float) -> Self: ...
	@classmethod
	def colorWithSRGBRed_green_blue_alpha_(cls, red: float, gree: float, blue: float, alpha: float) -> Self: ...
	@classmethod
	def colorWithDeviceRed_green_blue_alpha_(cls, red: float, gree: float, blue: float, alpha: float) -> Self: ...
	@classmethod
	def colorWithCalibratedRed_green_blue_alpha_(cls, red: float, gree: float, blue: float, alpha: float) -> Self: ...
	@classmethod
	def colorWithGenericGamma22White_alpha_(cls, white: float, alpha: float) -> Self: ...
	@classmethod
	def colorWithDeviceWhite_alpha_(cls, white: float, alpha: float) -> Self: ...
	@classmethod
	def colorWithCalibratedWhite_alpha_(cls, white: float, alpha: float) -> Self: ...
	@classmethod
	def colorWithHue_saturation_brightness_alpha_(cls, hue: float, saturation: float, brightness: float, alpha: float) -> Self: ...
	def set(self) -> None: ...

	def redComponent(self) -> float: ...
	def greenComponent(self) -> float: ...
	def blueComponent(self) -> float: ...
	def alphaComponent(self) -> float: ...
	def colorWithAlphaComponent_(self, alpha: float) -> Self: ...
	def highlightWithLevel_(self, level: float) -> Self: ...
	@classmethod
	def colorWithString_(cls, string: str) -> Self: ...  # Defined in Glyphs


class NSGradient(NSObject):
	def initWithColors_(self, colors: list[NSColor]) -> Self: ...
	def initWithColors_atLocations_colorSpace_(self, colors: list[NSColor], locations: list[float], colorSpace: Any) -> Self: ...
	def drawInBezierPath_angle_(self, path: NSBezierPath, angle: float) -> None: ...
	def drawFromPoint_toPoint_options_(self, start: NSPointLike, end: NSPointLike, options: int) -> None: ...
	@classmethod
	def initWithStartingColor_endingColor_(cls, color1: NSColor, color2: NSColor) -> "NSGradient": ...


class NSMutableParagraphStyle(NSObject):
	def setAlignment_(self, value: int) -> None: ...


class NSUserDefaultsController(NSObject):
	@classmethod
	def sharedUserDefaultsController(cls) -> "NSUserDefaultsController": ...


class NSUserDefaults(NSObject):
	@classmethod
	def standardUserDefaults(cls) -> "NSUserDefaults": ...
	def registerDefaults_(self, defaults: "NSDictionary" | dict) -> None: ...
	def objectForKey_(self, key: NSObject | str) -> NSObject: ...
	def setObject_forKey_(self, obj: Any | str, key: NSObject | str) -> None: ...
	def removeObjectForKey_(self, key: NSObject | str) -> None: ...

	def boolForKey_(self, key: NSObject | str) -> bool: ...
	def setBool_forKey_(self, value: bool, key: NSObject | str) -> None: ...

	def integerForKey_(self, key: NSObject | str) -> int: ...
	def setInteger_forKey_(self, value: int, key: NSObject | str) -> None: ...

	def floatForKey_(self, key: NSObject | str) -> float: ...
	def setFloat_forKey_(self, value: float, key: NSObject | str) -> None: ...

	def doubleForKey_(self, key: NSObject | str) -> float: ...
	def setDouble_forKey_(self, value: float, key: NSObject | str) -> None: ...

	def colorForKey_(self, key: NSObject | str) -> NSColor: ...  # Defined in Glyphs
	def setColor_forKey_(self, color: NSColor, key: NSObject | str) -> None: ...

	def stringForKey_(self, key: str) -> str | None: ...


class NSFormatter(NSObject):
	...


class NSNumberFormatter(NSFormatter):
	def setMinimumFractionDigits_(self, digits: int) -> None: ...
	def setMaximumFractionDigits_(self, digits: int) -> None: ...
	def stringFromNumber_(self, number: int | float) -> str: ...
	def numberFromString_(self, string: str) -> int | float: ...


class NSResponder(NSObject):
	def setNextResponder_(self, value: "NSResponder") -> None: ...
	def keyDown_(self, theEvent: NSEvent) -> None: ...
	def mouseDown_(self, theEvent: NSEvent) -> None: ...
	def mouseUp_(self, theEvent: NSEvent) -> None: ...
	def mouseMoved_(self, theEvent: NSEvent) -> None: ...


class NSView(NSResponder):
	def initWithFrame_(self, frame: NSRectLike) -> Self: ...
	def subviews(self) -> list["NSView"]: ...
	def addSubview_(self, subView: "NSView") -> None: ...
	def removeFromSuperview(self) -> None: ...
	def setNeedsDisplay_(self, needsDisplay: bool) -> None: ...
	def bounds(self) -> NSRectLike: ...
	def frame(self) -> NSRectLike: ...
	def setFrame_(self, frame: NSRectLike) -> None: ...
	def frameSize(self) -> NSSizeLike: ...
	def convertPoint_fromView_(self, point: NSPointLike, view: "NSView" | None) -> NSPointLike: ...
	def window(self) -> "NSWindow": ...
	def leadingAnchor(self) -> NSLayoutAnchor: ...
	def trailingAnchor(self) -> NSLayoutAnchor: ...
	def topAnchor(self) -> NSLayoutAnchor: ...
	def bottomAnchor(self) -> NSLayoutAnchor: ...
	def centerXAnchor(self) -> NSLayoutAnchor: ...
	def centerYAnchor(self) -> NSLayoutAnchor: ...
	def widthAnchor(self) -> NSLayoutAnchor: ...
	def heightAnchor(self) -> NSLayoutAnchor: ...
	def firstBaselineAnchor(self) -> NSLayoutAnchor: ...
	@property
	def left(self) -> NSLayoutAnchor: ...
	@property
	def right(self) -> NSLayoutAnchor: ...
	@property
	def top(self) -> NSLayoutAnchor: ...
	@property
	def bottom(self) -> NSLayoutAnchor: ...
	@property
	def centerX(self) -> NSLayoutAnchor: ...
	@property
	def centerY(self) -> NSLayoutAnchor: ...
	@property
	def width(self) -> NSLayoutAnchor: ...
	@property
	def height(self) -> NSLayoutAnchor: ...
	@property
	def baseline(self) -> NSLayoutAnchor: ...

	def setTranslatesAutoresizingMaskIntoConstraints_(self, value: bool) -> None: ...

	@property
	def huggingHorizontal(self) -> int: ...
	@property
	def huggingVertical(self) -> int: ...
	@property
	def compressionHorizontal(self) -> int: ...
	@property
	def compressionVertical(self) -> int: ...

	def setToolTip_(self, toolTip: str) -> None: ...


class NSStackView(NSView):
	...


class NSCell(NSObject):
	def setImagePosition_(self, value: int) -> None: ...
	def setImageScaling_(self, value: int) -> None: ...


class NSControl(NSView):
	def objectValue(self) -> Any: ...
	def setObjectValue_(self, objectValue: Any) -> None: ...
	def setControlSize_(self, controlSize: int) -> None: ...
	def setAlignment_(self, alignment: NSTextAlignment) -> None: ...
	def isContinuous(self) -> bool: ...
	def setContinuous_(self, continuous: bool) -> None: ...
	def target(self) -> Any: ...
	def setTarget_(self, target: Any) -> None: ...
	def action(self) -> Any: ...
	def setAction_(self, action: Any) -> None: ...
	def delegate(self) -> Any: ...
	def setDelegate_(self, delegate: Any) -> None: ...

	def setBezelStyle_(self, value: int) -> None: ...
	def setBordered_(self, value: int) -> None: ...
	def setButtonType_(self, value: int) -> None: ...
	def setTitle_(self, value: str) -> None: ...
	def cell(self) -> NSCell: ...
	def setImage_(self, value: NSImage | None) -> None: ...
	def setToolTip_(self, value: str) -> None: ...
	def floatValue(self) -> float: ...
	def doubleValue(self) -> float: ...
	def intValue(self) -> int: ...


class NSButton(NSControl):
	@classmethod
	def buttonWithTitle_image_target_action_(cls, title: str, image: NSImage, target: Any, action: Any) -> "NSButton": ...
	@classmethod
	def buttonWithTitle_target_action_(cls, title: str, target: Any, action: Any) -> "NSButton": ...
	@classmethod
	def checkboxWithTitle_target_action_(cls, title: str, target: Any, action: Any) -> "NSButton": ...
	@property
	def keyEquivalent(self) -> str: ...
	@keyEquivalent.setter
	def keyEquivalent(self, value: str) -> None: ...
	def stringValue(self) -> str: ...
	def setStringValue_(self, value: str) -> None: ...
	def state(self) -> int: ...
	def setState_(self, state: int) -> None: ...
	def enabled(self) -> bool: ...
	def setEnabled_(self, value: bool) -> None: ...


class NSTextField(NSControl):
	@classmethod
	def textFieldWithString_(cls, title: str) -> "NSTextField": ...
	@classmethod
	def labelWithString_(cls, title: str) -> "NSTextField": ...
	@classmethod
	def wrappingLabelWithString_(cls, title: str) -> "NSTextField": ...
	def setStringValue_(self, value: str) -> None: ...
	def isSelectable(self) -> bool: ...
	def setSelectable_(self, selectable: bool) -> None: ...
	def setCompletes_(self, completes: bool) -> None: ...
	def setBezeled_(self, value: bool) -> None: ...
	def setDrawsBackground_(self, value: bool) -> None: ...
	def setEditable_(self, value: bool) -> None: ...
	def setFont_(self, value: NSFont) -> None: ...
	def state(self) -> int: ...
	def setState_(self, state: int) -> None: ...


class NSTextView(NSView):
	def setFont_(self, value: NSFont) -> None: ...
	def setAutomaticSpellingCorrectionEnabled_(self, value: bool) -> None: ...
	def setAutomaticTextReplacementEnabled_(self, value: bool) -> None: ...
	def setContinuousSpellCheckingEnabled_(self, value: bool) -> None: ...
	def setGrammarCheckingEnabled_(self, value: bool) -> None: ...
	def setAutomaticQuoteSubstitutionEnabled_(self, value: bool) -> None: ...

class NSSearchField(NSTextField):
	...
class NSComboBox(NSTextField):
	def objectValueOfSelectedItem(self) -> Any: ...
	def addItemsWithObjectValues_(self, values: List[Any]) -> None: ...


class NSPopUpButton(NSControl):
	def menu(self) -> NSMenu: ...
	def initWithFrame_pullsDown_(self, frame: NSRectLike, pullsDown: bool) -> Self: ...
	def addItemsWithTitles_(self, titles: list[str]) -> None: ...
	def addItemWithTitle_(self, title: str) -> None: ...
	def setEnabled_(self, value: bool) -> None: ...


class NSScrollView(NSView):
	def setBorderType_(self, value: int) -> None: ...
	def setDocumentView_(self, view: NSView | None) -> None: ...


class NSTableColumn(NSObject):
	def identifier(self) -> str: ...
	def setResizingMask_(self, value: int) -> None: ...
	def initWithIdentifier_(self, identifier: str) -> Self: ...
	def title(self) -> str: ...
	def setTitle_(self, title: str) -> None: ...
	def setWidth_(self, width: float) -> None: ...
	def setMinWidth_(self, minWidth: float) -> None: ...
	def setMaxWidth_(self, maxWidth: float) -> None: ...


class NSTableView(NSControl):
	def setDoubleAction_(self, action: Any) -> None: ...
	def tableColumns(self) -> List[NSTableColumn]: ...
	def setRowHeight_(self, rowHeight: float) -> None: ...
	def addTableColumn_(self, column: NSTableColumn) -> None: ...
	def setRowSizeStyle_(self, sizeStyle: int) -> None: ...
	def setAllowsColumnReordering_(self, value: bool) -> None: ...
	def setColumnAutoresizingStyle_(self, value: int) -> None: ...

class NSArrayController(NSObject):
	def content(self) -> List[Any]: ...
	def setContent_(self, content: List[Any]) -> None: ...
	def setSortDescriptors_(self, Any) -> None: ...


class NSGraphicsContext:
	@classmethod
	def currentContext(cls) -> "NSGraphicsContext": ...
	@classmethod
	def saveGraphicsState(cls) -> None: ...
	@classmethod
	def restoreGraphicsState(cls) -> None: ...
	@classmethod
	def CGContext(cls) -> CGContextRef: ...


class NSURLRequest(NSObject):
	@classmethod
	def requestWithURL_(cls, url: NSURL) -> "NSURLRequest": ...


class NSNotificationCenter(NSObject):
	@classmethod
	def defaultCenter(cls) -> "NSNotificationCenter": ...
	def addObserver_selector_name_object_(self, callee: Any, selector: Any, callbackType: Any, obj: Any) -> None: ...
	def removeObserver_(self, callee: Any) -> None: ...
	def postNotificationName_object_(self, name: str, obj: Any) -> None: ...


class NSPredicate(NSObject):
	@classmethod
	def predicateWithFormat_(cls, format: str) -> "NSPredicate": ...


class NSCursor(NSObject):
	def initWithImage_hotSpot_(self, image: NSImage, pos: NSPointLike) -> Self: ...
	@classmethod
	def resizeLeftRightCursor(cls) -> "NSCursor": ...
	@classmethod
	def operationNotAllowedCursor(cls) -> "NSCursor": ...


class NSTextStorage(NSMutableAttributedString):
	def selectedRange(self) -> NSRange: ...


class NSWorkspace(NSObject):
	@classmethod
	def sharedWorkspace(cls) -> "NSWorkspace": ...
	def typeOfFile_error_(self, absoluteFilePath: str, outError: NSError | None) -> Tuple[NSString | None, NSError]: ...
	def openURL_(self, url: NSURL) -> None: ...

class NSBundle(NSObject):
	@classmethod
	def mainBundle(cls) -> Self: ...
	@classmethod
	def bundleWithPath_(cls, path: str) -> Self: ...
	@classmethod
	def bundleForClass_(cls, Class: type[NSObject]) -> Self: ...
	@classmethod
	def loadNibNamed_owner_(cls, name: str, owner: Any) -> bool: ...
	def objectForInfoDictionaryKey_(self, key: str) -> NSObject: ...
	def pathForResource_ofType_(self, name: str, tyle: str) -> str: ...
	def pathForImageResource_(self, name: str) -> str: ...
	def imageForResource_(self, name: str) -> NSImage: ...
	def infoDictionary(self) -> NSDictionary: ...

class NSNotification(NSObject):
	def object(self) -> NSObject: ...


NSAppearanceNameVibrantDark: str

class NSAppearance(NSObject):
	@classmethod
	def appearanceNamed_(cls, name: str) -> Self: ...

class NSWindowController(NSObject):
	def window(self) -> "NSWindow": ...
	def contentViewController(self) -> NSViewController: ...


NSFloatingWindowLevel: int
NSNormalWindowLevel: int

class NSWindow(NSObject):
	def windowController(self) -> NSWindowController: ...
	def makeKeyWindow(self) -> None: ...
	def orderOut_(self, sender: Any | None = None) -> None: ...
	def leadingAnchor(self) -> NSLayoutAnchor: ...
	def trailingAnchor(self) -> NSLayoutAnchor: ...
	def topAnchor(self) -> NSLayoutAnchor: ...
	def bottomAnchor(self) -> NSLayoutAnchor: ...
	def centerXAnchor(self) -> NSLayoutAnchor: ...
	def centerYAnchor(self) -> NSLayoutAnchor: ...
	@property
	def left(self) -> NSLayoutAnchor: ...
	@property
	def right(self) -> NSLayoutAnchor: ...
	@property
	def top(self) -> NSLayoutAnchor: ...
	@property
	def bottom(self) -> NSLayoutAnchor: ...
	@property
	def centerX(self) -> NSLayoutAnchor: ...
	@property
	def centerY(self) -> NSLayoutAnchor: ...
	def isVisible(self) -> bool: ...
	# implemented in Glyphs:
	def reallyVisible(self) -> bool: ...

class NSPanel(NSWindow):
	...


class NSSavePanel(NSPanel):
	@classmethod
	def savePanel(cls) -> Self: ...
	def setExtensionHidden_(self, value: bool) -> None: ...
	def setCanCreateDirectories_(self, value: bool) -> None: ...
	def setTitle_(self, message) -> None: ...
	def setAllowedFileTypes_(self, filetypes: NSArray) -> None: ...
	def setDirectoryURL_(self, url: NSURL) -> None: ...
	def setNameFieldStringValue_(self, fileName: str) -> None: ...
	def runModal(self) -> int: ...
	def filename(self) -> str: ...


class NSOpenPanel(NSSavePanel):
	@classmethod
	def openPanel(cls) -> Self: ...
	def setCanChooseFiles_(self, value: bool) -> None: ...
	def setCanChooseDirectories_(self, value: bool) -> None: ...
	def setCanCreateDirectories_(self, value: bool) -> None: ...
	def setAllowsMultipleSelection_(self, value: bool) -> None: ...
	def setDirectory_(self, path: str) -> None: ...
	def setMessage_(self, message: str) -> None: ...
	def setTitle_(self, title: str) -> None: ...
	def setAllowedFileTypes_(self, fileTypes: NSArray) -> None: ...
	def filename(self) -> str: ...
	def filenames(self) -> NSArray: ...

NSAlertStyleCritical: int

class NSAlert(NSObject):
	def setMessageText_(self, text: str) -> None: ...
	def setInformativeText_(self, text: str) -> None: ...
	def addButtonWithTitle_(self, text: str) -> NSButton: ...
	def setAlertStyle_(self, style: int) -> None: ...
	def runModal(self) -> int: ...


def NSLocalizedString(key: str, comment: str | None) -> str: ...


NSControlStateValueOn: int
# A constant value that indicates a control is on or selected.
NSControlStateValueOff: int
# A constant value that indicates a control is off or unselected.
NSControlStateValueMixed: int
# A constant value that indicates a control is in a mixed state, neither on nor off.

# Window style & backing-store masks
NSTitledWindowMask: int
NSClosableWindowMask: int
NSWindowStyleMaskResizable: int
NSUtilityWindowMask: int
NSBackingStoreBuffered: int

# Control + text enums
NSTextAlignmentNatural: int
NSControlSizeRegular: int
NSControlSizeSmall: int
NSControlStateValueOff: int

# Layout & constraint enums
NSLayoutConstraintOrientationHorizontal: int
NSLayoutConstraintOrientationVertical: int
NSLayoutRelationGreaterThanOrEqual: int
NSLayoutRelationLessThanOrEqual: int

# Table/column resizing masks
NSTableColumnUserResizingMask: int

NSShiftKeyMask: int
NSControlKeyMask: int
NSAlternateKeyMask: int
NSCommandKeyMask: int

# Border types
NSBezelBorder: int
NSNoBorder: int

# Cocoa bindings
NSValueBinding: str

NSModalResponseOK: int  # 1
NSModalResponseCancel: int  # 0

NSEventModifierFlagControl: int
NSEventModifierFlagCommand: int
NSEventModifierFlagShift: int
NSEventModifierFlagOption: int

NSOKButton: int
NSOnState: int
NSOffState: int
NSMixedState: int

NSCenterTextAlignment: int
NSFontAttributeName: str
NSParagraphStyleAttributeName: str
NSForegroundColorAttributeName: str
NSBackgroundColorAttributeName: str
NSFontWeightRegular: float
NSFontWeightBold: float
NSKernAttributeName: str
NSMiniaturizableWindowMask: int
NSResizableWindowMask: int

NSTexturedRoundedBezelStyle: int
NSToggleButton: int
NSImageOnly: int
NSImageScaleNone: int

NSNumberFormatterDecimalStyle: int

NSImageNameRefreshTemplate: str
NSImageNameStatusUnavailable: str

NSImageFrameCount: str
NSImageCurrentFrame: str
NSImageCurrentFrameDuration: str

NSImageNameTouchBarGoUpTemplate: str
NSImageNameTouchBarGoDownTemplate: str

NSDragOperationMove: int

NSBezierPathElementMoveTo: int
NSBezierPathElementLineTo: int
NSBezierPathElementCurveTo: int
NSBezierPathElementQuadraticCurveTo: int
NSBezierPathElementClosePath: int
NSRoundLineJoinStyle: int
