import type { NobjcObject } from "objc-js";
import type { _NSArray } from "../Foundation/NSArray.js";
import type { _NSAttributedString } from "../Foundation/NSAttributedString.js";
import type { _NSDictionary } from "../Foundation/NSDictionary.js";
import type { _NSObject } from "../Foundation/NSObject.js";
import type { _NSFont } from "./NSFont.js";
import type { _NSLayoutManager } from "./NSLayoutManager.js";
import type { _NSParagraphStyle } from "./NSParagraphStyle.js";
import type { _NSTextContainer } from "./NSTextContainer.js";
import type { _NSTextTab } from "./NSTextTab.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 { NSTypesetterBehavior } from "./NSTypesetterBehavior.js";
import type { NSTypesetterControlCharacterAction } from "./NSTypesetterControlCharacterAction.js";
import type { NSWritingDirection } from "./NSWritingDirection.js";
export declare class _NSTypesetter extends _NSObject {
    static alloc(): _NSTypesetter;
    static new(): _NSTypesetter;
    init(): _NSTypesetter;
    /** Returns the offset to be applied to the glyph in question when printing. */
    static printingAdjustmentInLayoutManager$forNominallySpacedGlyphRange$packedGlyphs$count$(layoutMgr: _NSLayoutManager, nominallySpacedGlyphsRange: NSRange, packedGlyphs: string, packedGlyphsCount: number): CGSize;
    static sharedSystemTypesetterForBehavior$(behavior: NSTypesetterBehavior): NobjcObject;
    /** Factory methods */
    static sharedSystemTypesetter(): _NSTypesetter;
    static defaultTypesetterBehavior(): NSTypesetterBehavior;
    /** Screen/printer font mapping */
    substituteFontForFont$(originalFont: _NSFont): _NSFont;
    /**
     * Tab stops Returns an NSTextTab instance for glyphLocation from the current text tab array. glyphLocation must be in the base typesetter coordinate (should not include line fragment rect origin and lineFragmentPadding). direction should be either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft. maxLocation specifies the maximum location a glyph can be assigned in the base typesetter coordinate.
     */
    textTabForGlyphLocation$writingDirection$maxLocation$(glyphLocation: number, direction: NSWritingDirection, maxLocation: number): _NSTextTab | null;
    setParagraphGlyphRange$separatorGlyphRange$(paragraphRange: NSRange, paragraphSeparatorRange: NSRange): void;
    /**
     * layout primitive lineFragmentOrigin specifies the upper-left corner of line fragment rect. On return, set to the next origin. The method returns the next glyph index. Usually the index right after paragraph separator but can be inside the paragraph range (i.e. text container exhaustion). Concrete subclasses must implement this method. A concrete implementation must invoke -beginParagraph, -endParagraph, -beginLineWithGlyphAtIndex: and -endLineWithGlyphRange:.
     */
    layoutParagraphAtPoint$(lineFragmentOrigin: NobjcObject): number;
    /** should be invoked at the beginning of -layoutParagraphAtPoint: */
    beginParagraph(): void;
    /** should be invoked at the end of -layoutParagraphAtPoint: */
    endParagraph(): void;
    /** should be invoked at the beginning of each line */
    beginLineWithGlyphAtIndex$(glyphIndex: number): void;
    /** should be invoked at the end of each line */
    endLineWithGlyphRange$(lineGlyphRange: NSRange): void;
    /** Line/paragraph spacing */
    lineSpacingAfterGlyphAtIndex$withProposedLineFragmentRect$(glyphIndex: number, rect: CGRect): number;
    paragraphSpacingBeforeGlyphAtIndex$withProposedLineFragmentRect$(glyphIndex: number, rect: CGRect): number;
    paragraphSpacingAfterGlyphAtIndex$withProposedLineFragmentRect$(glyphIndex: number, rect: CGRect): number;
    /**
     * Empty paragraph handling This method calculates the line fragment rect/line fragment used rect for blank lines. theParagraphSeparatorGlyphRange with length == 0 indicates extra line fragment.
     */
    getLineFragmentRect$usedRect$forParagraphSeparatorGlyphRange$atProposedOrigin$(lineFragmentRect: NobjcObject, lineFragmentUsedRect: NobjcObject, paragraphSeparatorGlyphRange: NSRange, lineOrigin: CGPoint): void;
    /**
     * Forces NSLayoutManager to invalidate glyph cache in range when invalidating layout.
     */
    setHardInvalidation$forGlyphRange$(flag: boolean, glyphRange: NSRange): void;
    /**
     * Actually lay out glyphs starting at the given index. The given number of line fragments will be generated as long as the NSGlyphStorage doesn't run out of glyphs. nextGlyph will be set to the index of the next glyph that needs to be laid out. New applications should use -layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments: instead.
     */
    layoutGlyphsInLayoutManager$startingAtGlyphIndex$maxNumberOfLineFragments$nextGlyphIndex$(layoutManager: _NSLayoutManager, startGlyphIndex: number, maxNumLines: number, nextGlyph: NobjcObject): void;
    /**
     * Layouts characters in characterRange for layoutManager. The method returns the actual character range that the receiving NSTypesetter processed. The layout process can be interrupted when the number of line fragments exceeds maxNumLines. Specify NSUIntegerMax for unlimited number of line fragments.
     */
    layoutCharactersInRange$forLayoutManager$maximumNumberOfLineFragments$(characterRange: NSRange, layoutManager: _NSLayoutManager, maxNumLines: number): NSRange;
    baselineOffsetInLayoutManager$glyphIndex$(layoutMgr: _NSLayoutManager, glyphIndex: number): number;
    /** Called right before setLineFragmentRect:forGlyphRange:usedRect: */
    willSetLineFragmentRect$forGlyphRange$usedRect$baselineOffset$(lineRect: NobjcObject, glyphRange: NSRange, usedRect: NobjcObject, baselineOffset: NobjcObject): void;
    shouldBreakLineByWordBeforeCharacterAtIndex$(charIndex: number): boolean;
    shouldBreakLineByHyphenatingBeforeCharacterAtIndex$(charIndex: number): boolean;
    hyphenationFactorForGlyphAtIndex$(glyphIndex: number): number;
    hyphenCharacterForGlyphAtIndex$(glyphIndex: number): number;
    boundingBoxForControlGlyphAtIndex$forTextContainer$proposedLineFragment$glyphPosition$characterIndex$(glyphIndex: number, textContainer: _NSTextContainer, proposedRect: CGRect, glyphPosition: CGPoint, charIndex: number): CGRect;
    /** Glyph/character range mappings */
    characterRangeForGlyphRange$actualGlyphRange$(glyphRange: NSRange, actualGlyphRange: NobjcObject | null): NSRange;
    glyphRangeForCharacterRange$actualCharacterRange$(charRange: NSRange, actualCharRange: NobjcObject | null): NSRange;
    /**
     * NSTextContainer attribute Calculates line fragment rect, line fragment used rect, and remaining rect for a line fragment starting at glyph index startingGlyphIndex with proposedRect. The height is determined using lineSpacing, paragraphSpacingBefore, and paragraphSpacingAfter as well as proposedRect. The width for lineFragmentUsedRect is set to the lineFragmentRect width. In the standard implementation, paragraph spacing is included in the line fragment rect but not the line fragment used rect; line spacing is included in both.
     */
    getLineFragmentRect$usedRect$remainingRect$forStartingGlyphAtIndex$proposedRect$lineSpacing$paragraphSpacingBefore$paragraphSpacingAfter$(lineFragmentRect: NobjcObject, lineFragmentUsedRect: NobjcObject, remainingRect: NobjcObject, startingGlyphIndex: number, proposedRect: CGRect, lineSpacing: number, paragraphSpacingBefore: number, paragraphSpacingAfter: number): void;
    /** Layout storage */
    setLineFragmentRect$forGlyphRange$usedRect$baselineOffset$(fragmentRect: CGRect, glyphRange: NSRange, usedRect: CGRect, baselineOffset: number): void;
    setNotShownAttribute$forGlyphRange$(flag: boolean, glyphRange: NSRange): void;
    setDrawsOutsideLineFragment$forGlyphRange$(flag: boolean, glyphRange: NSRange): void;
    setLocation$withAdvancements$forStartOfGlyphRange$(location: CGPoint, advancements: NobjcObject, glyphRange: NSRange): void;
    setAttachmentSize$forGlyphRange$(attachmentSize: CGSize, glyphRange: NSRange): void;
    setBidiLevels$forGlyphRange$(levels: NobjcObject, glyphRange: NSRange): void;
    /**
     * Deprecated. Use -layoutManager:shouldUseAction:forControlCharacterAtIndex: instead
     * @deprecated
     */
    actionForControlCharacterAtIndex$(charIndex: number): NSTypesetterControlCharacterAction;
    /** @deprecated */
    getGlyphsInRange$glyphs$characterIndexes$glyphInscriptions$elasticBits$bidiLevels$(glyphsRange: NSRange, glyphBuffer: NobjcObject, charIndexBuffer: NobjcObject, inscribeBuffer: NobjcObject, elasticBuffer: NobjcObject, bidiLevelBuffer: string): number;
    /** @deprecated */
    substituteGlyphsInRange$withGlyphs$(glyphRange: NSRange, glyphs: NobjcObject): void;
    /** @deprecated */
    insertGlyph$atGlyphIndex$characterIndex$(glyph: number, glyphIndex: number, characterIndex: number): void;
    /** @deprecated */
    deleteGlyphsInRange$(glyphRange: NSRange): void;
    /**
     * Primitive typesetting methods NSLayoutManager attributes Controls whether leading value specified by fonts affects line spacing
     */
    usesFontLeading(): boolean;
    setUsesFontLeading$(value: boolean): void;
    /** Controls various typesetting behavior for backward compatibility */
    typesetterBehavior(): NSTypesetterBehavior;
    setTypesetterBehavior$(value: NSTypesetterBehavior): void;
    /** Controls hyphenation factor. The value should be between 0.0 and 1.0. */
    hyphenationFactor(): number;
    setHyphenationFactor$(value: number): void;
    /** NSTextContainer attributes Controls padding at both ends of line fragment. */
    lineFragmentPadding(): number;
    setLineFragmentPadding$(value: number): void;
    /**
     * Bidi control Controls whether to perform bi-directional processing. You can disable the layout stage if you know the parapgraph does not need this stage (i.e. the backing-store is in the display order).
     */
    bidiProcessingEnabled(): boolean;
    setBidiProcessingEnabled$(value: boolean): void;
    attributedString(): _NSAttributedString | null;
    setAttributedString$(value: _NSAttributedString | null): void;
    /** does not include paragraphSeparatorGlyphRange */
    paragraphGlyphRange(): NSRange;
    paragraphSeparatorGlyphRange(): NSRange;
    paragraphCharacterRange(): NSRange;
    paragraphSeparatorCharacterRange(): NSRange;
    /**
     * Extra line fragment handling This method returns the attributes used to layout the extra line fragment. The default implementation tries to use -[NSTextView typingAttributes] if possible; otherwise, uses attributes for the last character.
     */
    attributesForExtraLineFragment(): _NSDictionary;
    /**
     * Control/format character handling Cocoa Text System specific interface methods Friend class accessors
     */
    layoutManager(): _NSLayoutManager | null;
    textContainers(): _NSArray | null;
    currentTextContainer(): _NSTextContainer | null;
    currentParagraphStyle(): _NSParagraphStyle | null;
}
