import * as React from "react";
import { PerseusI18nContext } from "../../components/i18n-context";
import type { ParseState } from "./passage-markdown";
import type { SerializedHighlightSet } from "../../components/highlighting/types";
import type { WidgetProps, Widget, PerseusDependenciesV2 } from "../../types";
import type { PassagePromptJSON } from "../../widget-ai-utils/passage/passage-ai-utils";
import type { PerseusPassageWidgetOptions, PerseusWidget } from "@khanacademy/perseus-core";
import type { SingleASTNode } from "@khanacademy/simple-markdown";
export declare class LineHeightMeasurer extends React.Component<Record<any, any>> {
    _line: HTMLDivElement | null | undefined;
    measureLineHeight(): number;
    render(): React.ReactNode;
}
type FindWidgetsCallback = (id: string, widgetInfo: PerseusWidget) => boolean;
type PassageProps = WidgetProps<PerseusPassageWidgetOptions> & {
    findWidgets: (arg1: FindWidgetsCallback) => ReadonlyArray<Passage>;
    dependencies: PerseusDependenciesV2;
};
type DefaultPassageProps = {
    passageTitle: PassageProps["passageTitle"];
    passageText: PassageProps["passageText"];
    footnotes: PassageProps["footnotes"];
    showLineNumbers: PassageProps["showLineNumbers"];
    linterContext: PassageProps["linterContext"];
};
type PassageState = {
    nLines: number | null | undefined;
    startLineNumbersAfter: number;
    stylesAreApplied: boolean;
    highlights: SerializedHighlightSet;
};
export type Reference = {
    startLine: number;
    endLine: number;
    content: string | null | undefined;
};
export declare class Passage extends React.Component<PassageProps, PassageState> implements Widget {
    static contextType: React.Context<import("../../components/i18n-context").I18nContextType>;
    context: React.ContextType<typeof PerseusI18nContext>;
    _contentRef: HTMLDivElement | null | undefined;
    _lineHeightMeasurerRef: LineHeightMeasurer | null | undefined;
    _onResize: () => Record<any, any>;
    _stylesAppiedTimer: number;
    static defaultProps: DefaultPassageProps;
    isWidget: true;
    state: PassageState;
    componentDidMount(): void;
    shouldComponentUpdate(nextProps: PassageProps, nextState: PassageState): any | boolean;
    componentDidUpdate(): void;
    componentWillUnmount(): void;
    _handleSerializedHighlightsUpdate: (serializedHighlights: SerializedHighlightSet) => void;
    /**
     * Line numbering
     *
     * These functions support passage line numbering, which is non-trivial
     * because we manually measure lines to support resizing as well as
     * continuing line numbers from previous passages.
     */
    _updateState(): void;
    _measureLines(): number;
    _getInitialLineNumber(): number;
    _getLineHeight(): number;
    getLineCount(): number;
    /**
     * Passage refs
     *
     * These are functions to support the passage refs inter-widgets feature
     * where other widgets can fetch the line numbers of a reference inside of
     * a passage.
     *
     * todo(matthewc): The refs are created by PassageMarkdown's refStart and refEnd,
     * somehow bubbling up to Passage's `this.refs`. This runs against
     * current best practices for refs by using string refs, but also
     * by breaking our expectation of explicit data flow.
     */
    _getStartRefLineNumber(referenceNumber: number): number | null | undefined;
    _getEndRefLineNumber(referenceNumber: number): number | null | undefined;
    _convertPosToLineNumber(absoluteVPos: number): number;
    _getRefContent(referenceNumber: number): string | null | undefined;
    getReference(referenceNumber: number): Reference | null | undefined;
    getPromptJSON(): PassagePromptJSON;
    /**
     * Rendering
     *
     * Functions to render the passage widget.
     */
    _renderInstructions(parseState: ParseState): React.ReactElement<any>;
    shouldRenderJipt(): boolean;
    _renderContent(parsed: Array<SingleASTNode>): React.ReactElement<any>;
    _hasFootnotes(): boolean;
    _renderFootnotes(): React.ReactNode;
    render(): React.ReactNode;
}
declare const _default: {
    name: string;
    displayName: string;
    hidden: true;
    widget: React.ForwardRefExoticComponent<Omit<PassageProps, "dependencies"> & React.RefAttributes<any>>;
    isLintable: true;
};
export default _default;
