import type { NobjcObject } from "objc-js";
import type { _NSFont } from "./NSFont.js";
import type { _NSLayoutManager } from "./NSLayoutManager.js";
import type { _NSTextContainer } from "./NSTextContainer.js";
import type { _NSDictionary } from "../Foundation/NSDictionary.js";
import type { CGPoint } from "../structs/CGPoint.js";
import type { CGRect } from "../structs/CGRect.js";
import type { CGSize } from "../structs/CGSize.js";
import type { NSRange } from "../structs/NSRange.js";
import type { NSControlCharacterAction } from "./NSControlCharacterAction.js";
export interface _NSLayoutManagerDelegate {
    /**
     * This is sent whenever layoutManager is about to store the initial glyph information via -setGlyphs:properties:characterIndexes:forGlyphRange:. This method allows customizing the initial glyph generation process. It can invoke -setGlyphs:properties:characterIndexes:forGlyphRange: with modified glyph information. The return value specifies the actual glyph range stored in this method. By returning 0, it can indicate layoutManager to do the default processing. Note that querying glyph information surrounding glyphRange could lead to recursion since the data might not be available, yet.
     */
    layoutManager$shouldGenerateGlyphs$properties$characterIndexes$font$forGlyphRange$?(layoutManager: _NSLayoutManager, glyphs: NobjcObject, props: NobjcObject, charIndexes: NobjcObject, aFont: _NSFont, glyphRange: NSRange): number;
    /** Returns the spacing after the line ending with glyphIndex. */
    layoutManager$lineSpacingAfterGlyphAtIndex$withProposedLineFragmentRect$?(layoutManager: _NSLayoutManager, glyphIndex: number, rect: CGRect): number;
    /** Returns the paragraph spacing before the line starting with glyphIndex. */
    layoutManager$paragraphSpacingBeforeGlyphAtIndex$withProposedLineFragmentRect$?(layoutManager: _NSLayoutManager, glyphIndex: number, rect: CGRect): number;
    /** Returns the paragraph spacing after the line ending with glyphIndex. */
    layoutManager$paragraphSpacingAfterGlyphAtIndex$withProposedLineFragmentRect$?(layoutManager: _NSLayoutManager, glyphIndex: number, rect: CGRect): number;
    /** Returns the control character action for the control character at charIndex. */
    layoutManager$shouldUseAction$forControlCharacterAtIndex$?(layoutManager: _NSLayoutManager, action: NSControlCharacterAction, charIndex: number): NSControlCharacterAction;
    /**
     * Invoked while determining the soft line break point. When NO, NSLayoutManager tries to find the next line break opportunity before charIndex
     */
    layoutManager$shouldBreakLineByWordBeforeCharacterAtIndex$?(layoutManager: _NSLayoutManager, charIndex: number): boolean;
    /**
     * Invoked while determining the hyphenation point. When NO, NSLayoutManager tries to find the next hyphenation opportunity before charIndex
     */
    layoutManager$shouldBreakLineByHyphenatingBeforeCharacterAtIndex$?(layoutManager: _NSLayoutManager, charIndex: number): boolean;
    /**
     * Invoked for resolving the glyph metrics for NSControlCharacterWhitespaceAction control character.
     */
    layoutManager$boundingBoxForControlGlyphAtIndex$forTextContainer$proposedLineFragment$glyphPosition$characterIndex$?(layoutManager: _NSLayoutManager, glyphIndex: number, textContainer: _NSTextContainer, proposedRect: CGRect, glyphPosition: CGPoint, charIndex: number): CGRect;
    /**
     * Allows NSLayoutManagerDelegate to customize the line fragment geometry before committing to the layout cache. The implementation of this method should make sure that the modified fragments are still valid inside the text container coordinate. When it returns YES, the layout manager uses the modified rects. Otherwise, it ignores the rects returned from this method.
     */
    layoutManager$shouldSetLineFragmentRect$lineFragmentUsedRect$baselineOffset$inTextContainer$forGlyphRange$?(layoutManager: _NSLayoutManager, lineFragmentRect: NobjcObject, lineFragmentUsedRect: NobjcObject, baselineOffset: NobjcObject, textContainer: _NSTextContainer, glyphRange: NSRange): boolean;
    /**
     * This is sent whenever layout or glyphs become invalidated in a layout manager which previously had all layout complete.
     */
    layoutManagerDidInvalidateLayout$?(sender: _NSLayoutManager): void;
    /**
     * This is sent whenever a container has been filled. This method can be useful for paginating. The textContainer might be nil if we have completed all layout and not all of it fit into the existing containers. The atEnd flag indicates whether all layout is complete.
     */
    layoutManager$didCompleteLayoutForTextContainer$atEnd$?(layoutManager: _NSLayoutManager, textContainer: _NSTextContainer | null, layoutFinishedFlag: boolean): void;
    /**
     * This is sent right before layoutManager invalidates the layout due to textContainer changing geometry. The receiver of this method can react to the geometry change and perform adjustments such as recreating the exclusion path.
     */
    layoutManager$textContainer$didChangeGeometryFromSize$?(layoutManager: _NSLayoutManager, textContainer: _NSTextContainer, oldSize: CGSize): void;
    /**
     * This is sent when the layout manager is drawing and needs to decide whether to use temporary attributes or not. The delegate returns a dictionary of temporary attributes to be used, or nil to suppress the use of temporary attributes altogether. The effectiveCharRange argument is both an in and out by-reference effective range for those attributes. The default behavior if this method is not implemented is to use temporary attributes only when drawing to the screen, so an implementation to match that behavior would return attrs if toScreen is YES and nil otherwise, without changing effectiveCharRange.
     */
    layoutManager$shouldUseTemporaryAttributes$forDrawingToScreen$atCharacterIndex$effectiveRange$?(layoutManager: _NSLayoutManager, attrs: _NSDictionary, toScreen: boolean, charIndex: number, effectiveCharRange: NobjcObject | null): _NSDictionary | null;
}
