import type { NobjcObject } from "objc-js";
import type { _NSArray } from "../Foundation/NSArray.js";
import type { _NSAttributedString } from "../Foundation/NSAttributedString.js";
import type { _NSCoder } from "../Foundation/NSCoder.js";
import type { _NSDictionary } from "../Foundation/NSDictionary.js";
import type { _NSObject } from "../Foundation/NSObject.js";
import type { _NSOperationQueue } from "../Foundation/NSOperationQueue.js";
import type { _NSString } from "../Foundation/NSString.js";
import type { _NSTextContainer } from "./NSTextContainer.js";
import type { _NSTextContentManager } from "./NSTextContentManager.js";
import type { _NSTextLayoutFragment } from "./NSTextLayoutFragment.js";
import type { _NSTextLayoutManagerDelegate } from "./NSTextLayoutManagerDelegate.js";
import type { _NSTextLocation } from "./NSTextLocation.js";
import type { _NSTextRange } from "./NSTextRange.js";
import type { _NSTextSelectionDataSource } from "./NSTextSelectionDataSource.js";
import type { _NSTextSelectionNavigation } from "./NSTextSelectionNavigation.js";
import type { _NSTextViewportLayoutController } from "./NSTextViewportLayoutController.js";
import type { CGPoint } from "../structs/CGPoint.js";
import type { CGRect } from "../structs/CGRect.js";
import type { NSTextLayoutFragmentEnumerationOptions } from "./NSTextLayoutFragmentEnumerationOptions.js";
import type { NSTextLayoutManagerSegmentOptions } from "./NSTextLayoutManagerSegmentOptions.js";
import type { NSTextLayoutManagerSegmentType } from "./NSTextLayoutManagerSegmentType.js";
export declare class _NSTextLayoutManager extends _NSObject {
    static alloc(): _NSTextLayoutManager;
    static new(): _NSTextLayoutManager;
    /**
     * The default set of attributes for rendering NSLinkAttributeName. The base NSTextLayoutManager class returns with NSUnderlineStyleSingle for NSUnderlineStyleAttributeName and the platform link color for NSForegroundColorAttributeName. The platform color for macOS is +linkColor. Other platforms uses +blueColor.
     */
    static linkRenderingAttributes(): _NSDictionary;
    init(): _NSTextLayoutManager;
    initWithCoder$(coder: _NSCoder): _NSTextLayoutManager | null;
    /**
     * This method should be used in order to replace an NSTextContentManager with a new one, leaving all related objects intact. This method makes sure the NSTextLayoutManager doesn't get deallocated while migrating to the new manager.
     */
    replaceTextContentManager$(textContentManager: _NSTextContentManager): void;
    /** Performs the layout for textRange. */
    ensureLayoutForRange$(range: _NSTextRange): void;
    /** Performs the layout for filling bounds inside the last text container. */
    ensureLayoutForBounds$(bounds: CGRect): void;
    /** Invalidates layout information for textRange */
    invalidateLayoutForRange$(range: _NSTextRange): void;
    /**
     * Returns the text layout fragment containing position inside the coordinate system for textContainer.
     */
    textLayoutFragmentForPosition$(position: CGPoint): _NSTextLayoutFragment | null;
    /** Returns the text layout fragment containing the document location, location. */
    textLayoutFragmentForLocation$(location: _NSTextLocation): _NSTextLayoutFragment | null;
    /**
     * Enumerates the text layout fragments starting at textLocation. If textLocation=nil, it assumes self.textContentManager.documentRange.location; uses self.documentRange.endLocation for reverse enumeration. When enumerating backward, it starts with the fragment preceding the one containing textLocation. If enumerated at least one fragment, it returns the edge of the enumerated range. Note that the enumerated range might not match the range of the last element returned. It enumerates the elements in the sequence, but it can skip a range (it can limit the maximum number of text elements enumerated for a single invocation or hide some elements from the layout). Returning NO from block breaks out of the enumeration.
     */
    enumerateTextLayoutFragmentsFromLocation$options$usingBlock$(location: _NSTextLocation | null, options: NSTextLayoutFragmentEnumerationOptions, block: (layoutFragment: _NSTextLayoutFragment) => boolean): _NSTextLocation | null;
    /**
     * Enumerates the rendering attributes from location. It enumerates only ranges with rendering attributes specified. Returning NO from block breaks out of the enumeration.
     */
    enumerateRenderingAttributesFromLocation$reverse$usingBlock$(location: _NSTextLocation, reverse: boolean, block: (textLayoutManager: _NSTextLayoutManager, attributes: _NSDictionary, textRange: _NSTextRange) => boolean): void;
    /** Sets the rendering attributes. */
    setRenderingAttributes$forTextRange$(renderingAttributes: _NSDictionary, textRange: _NSTextRange): void;
    /**
     * Sets the rendering attribute. Passing nil value indicates overriding the specified attribute by removing from the final attributes passed to the layout and rendering engine. This is a convenience over -setRenderingAttributes:forTextRange:.
     */
    addRenderingAttribute$value$forTextRange$(renderingAttribute: _NSString, value: NobjcObject | null, textRange: _NSTextRange): void;
    /**
     * Removes attribute from textRange. This is a convenience over -setRenderingAttributes:forTextRange:.
     */
    removeRenderingAttribute$forTextRange$(renderingAttribute: _NSString, textRange: _NSTextRange): void;
    /**
     * Invalidates the rendering attributes in textRange. Enumerating rendering attributes will skip the invalidated range.
     */
    invalidateRenderingAttributesForTextRange$(textRange: _NSTextRange): void;
    /**
     * Returns a dictionary of rendering attributes for rendering NSLinkAttributeName. Just as other rendering attributes, specifying NSNull removes the attribute from the final attributes used for rendering. It has priority over the general rendering attributes.
     */
    renderingAttributesForLink$atLocation$(link: NobjcObject, location: _NSTextLocation): _NSDictionary;
    /**
     * Enumerates text segments of type in textRange. A text segment is both logically and visually contiguous portion of the text content inside a line fragment. It can be defined with a single text range. The segments are enumerated visually from left to right. Returning NO from block breaks out of the enumeration.
     */
    enumerateTextSegmentsInRange$type$options$usingBlock$(textRange: _NSTextRange, type: NSTextLayoutManagerSegmentType, options: NSTextLayoutManagerSegmentOptions, block: ((textSegmentRange: _NSTextRange, textSegmentFrame: CGRect, baselinePosition: number, textContainer: _NSTextContainer) => boolean) | null): void;
    replaceContentsInRange$withTextElements$(range: _NSTextRange, textElements: _NSArray): void;
    replaceContentsInRange$withAttributedString$(range: _NSTextRange, attributedString: _NSAttributedString): void;
    delegate(): _NSTextLayoutManagerDelegate | null;
    setDelegate$(value: _NSTextLayoutManagerDelegate | null): void;
    /**
     * If YES, uses the leading as specified by the font. However, this is not appropriate for most UI text. YES by default.
     */
    usesFontLeading(): boolean;
    setUsesFontLeading$(value: boolean): void;
    /**
     * When YES, enables internal security analysis for malicious inputs and activates defensive behaviors. By enabling this functionality, it's possible certain text such as a very long paragraph might result in unexpected layout. NO by default.
     */
    limitsLayoutForSuspiciousContents(): boolean;
    setLimitsLayoutForSuspiciousContents$(value: boolean): void;
    /**
     * When YES, NSTextLayoutManager will attempt to hyphenate when wrapping lines. May be overridden on a per-paragraph basis by the NSParagraphStyle's usesDefaultHyphenation. The receiver makes the best effort to decide the exact logic including the hyphenation factor based on the context. The default value is NO. Can be overridden by the preference key @"NSUsesDefaultHyphenation".
     */
    usesHyphenation(): boolean;
    setUsesHyphenation$(value: boolean): void;
    /**
     * Specifies the behavior for resolving ``NSTextAlignment.natural`` to the visual alignment. When set to ``true``, the resolved visual alignment is determined by the resolved base writing direction; otherwise, it is using the user’s preferred language. The default value is ``true``.
     */
    resolvesNaturalAlignmentWithBaseWritingDirection(): boolean;
    setResolvesNaturalAlignmentWithBaseWritingDirection$(value: boolean): void;
    /**
     * Pointing to the NSTextContentManager object strongly referencing the text layout manager.
     */
    textContentManager(): _NSTextContentManager | null;
    /**
     * The text container object providing geometric information for the layout destination. If isSimpleRectangularTextContainer=NO, NSTextLayoutManager always fill from the top instead of allowing non-contiguous layout support.
     */
    textContainer(): _NSTextContainer | null;
    setTextContainer$(value: _NSTextContainer | null): void;
    /**
     * The usage bounds for textContainer. KVO-compliant. Views can observe this property in order to trigger a resize operation. For example, UIView/NSView should call setNeedsUpdateConstraints() when the usage bounds changes.
     */
    usageBoundsForTextContainer(): CGRect;
    /** Returns NSTextViewportLayoutController associated with textContainer. */
    textViewportLayoutController(): _NSTextViewportLayoutController;
    /**
     * If non-nil, it performs layout in the specified queue until estimatedUsageBounds=NO.
     */
    layoutQueue(): _NSOperationQueue | null;
    setLayoutQueue$(value: _NSOperationQueue | null): void;
    /**
     * An array of NSTextSelections associated by the text layout manager. Each NSTextSelection represents an insertion point. The selection state is shared among all view ports connected to the text layout manager via text containers.
     */
    textSelections(): _NSArray;
    setTextSelections$(value: _NSArray): void;
    /**
     * Returns an NSTextSelectionNavigation configured to have the text layout manager as NSTextSelectionDataSource
     */
    textSelectionNavigation(): _NSTextSelectionNavigation;
    setTextSelectionNavigation$(value: _NSTextSelectionNavigation): void;
    /**
     * A callback block invoked whenever NSTextLayoutManager needs to validate the rendering attributes for the range. The validator should use -setRenderingAttributes:forTextRange: to fill the rendering attributes appropriate for the range inside textLayoutFragment.
     */
    renderingAttributesValidator(): ((arg0: _NSTextLayoutManager, arg1: _NSTextLayoutFragment) => void) | null;
    setRenderingAttributesValidator$(value: ((arg0: _NSTextLayoutManager, arg1: _NSTextLayoutFragment) => void) | null): void;
}
export interface _NSTextLayoutManager extends _NSTextSelectionDataSource {
}
