import { BlockNodeType, ReceiptFailure, ReceiptInsert, TextAddress } from '../types/index.js';
import { DiscoveryOutput } from '../types/discovery.js';
export type ListItemAddress = {
    kind: 'block';
    nodeType: 'listItem';
    nodeId: string;
};
/** Any block-level paragraph, whether or not it is a list item. */
export type BlockAddress = {
    kind: 'block';
    nodeType: 'paragraph';
    nodeId: string;
};
/** Contiguous range of paragraphs. */
export type BlockRange = {
    from: BlockAddress;
    to: BlockAddress;
};
export type ListWithinAddress = {
    kind: 'block';
    nodeType: BlockNodeType;
    nodeId: string;
};
export type ListKind = 'ordered' | 'bullet';
export type ListInsertPosition = 'before' | 'after';
export type JoinDirection = 'withPrevious' | 'withNext';
export type MutationScope = 'definition' | 'instance';
export type LevelAlignment = 'left' | 'center' | 'right';
export type TrailingCharacter = 'tab' | 'space' | 'nothing';
export type ListPresetId = 'decimal' | 'decimalParenthesis' | 'lowerLetter' | 'upperLetter' | 'lowerRoman' | 'upperRoman' | 'disc' | 'circle' | 'square' | 'dash';
export declare const LIST_KINDS: readonly ["ordered", "bullet"];
export declare const LIST_INSERT_POSITIONS: readonly ["before", "after"];
export declare const JOIN_DIRECTIONS: readonly ["withPrevious", "withNext"];
export declare const MUTATION_SCOPES: readonly ["definition", "instance"];
export declare const LEVEL_ALIGNMENTS: readonly ["left", "center", "right"];
export declare const TRAILING_CHARACTERS: readonly ["tab", "space", "nothing"];
export declare const LIST_PRESET_IDS: readonly ["decimal", "decimalParenthesis", "lowerLetter", "upperLetter", "lowerRoman", "upperRoman", "disc", "circle", "square", "dash"];
export type ListsFailureCode = 'NO_OP' | 'INVALID_TARGET' | 'INCOMPATIBLE_DEFINITIONS' | 'NO_COMPATIBLE_PREVIOUS' | 'ALREADY_CONTINUOUS' | 'NO_PREVIOUS_LIST' | 'NO_ADJACENT_SEQUENCE' | 'ALREADY_SAME_SEQUENCE' | 'LEVEL_OUT_OF_RANGE' | 'LEVEL_NOT_FOUND' | 'CAPABILITY_UNAVAILABLE' | 'INVALID_INPUT';
export type CanContinueReason = 'NO_PREVIOUS_LIST' | 'INCOMPATIBLE_DEFINITIONS' | 'ALREADY_CONTINUOUS';
export type CanJoinReason = 'NO_ADJACENT_SEQUENCE' | 'INCOMPATIBLE_DEFINITIONS' | 'ALREADY_SAME_SEQUENCE';
export interface ListsListQuery {
    within?: ListWithinAddress;
    limit?: number;
    offset?: number;
    kind?: ListKind;
    level?: number;
    ordinal?: number;
}
export interface ListsGetInput {
    address: ListItemAddress;
}
export interface ListItemInfo {
    address: ListItemAddress;
    listId: string;
    marker?: string;
    ordinal?: number;
    path?: number[];
    level?: number;
    kind?: ListKind;
    text?: string;
}
export interface ListItemDomain {
    address: ListItemAddress;
    listId: string;
    marker?: string;
    ordinal?: number;
    path?: number[];
    level?: number;
    kind?: ListKind;
    text?: string;
}
export type ListsListResult = DiscoveryOutput<ListItemDomain>;
export interface ListInsertInput {
    target: ListItemAddress;
    position: ListInsertPosition;
    text?: string;
}
export interface ListTargetInput {
    target: ListItemAddress;
}
/**
 * Create a new list from existing paragraphs.
 *
 * When `sequence.mode` is `'continuePrevious'`, `preset` and `style` are
 * not allowed: the new items inherit formatting from the previous sequence.
 */
export type ListsCreateInput = {
    mode: 'empty';
    at: BlockAddress;
    kind?: ListKind;
    level?: number;
    preset?: ListPresetId;
    style?: ListStyle;
    sequence?: {
        mode: 'new';
        startAt?: number;
    };
} | {
    mode: 'empty';
    at: BlockAddress;
    kind?: ListKind;
    level?: number;
    preset?: never;
    style?: never;
    sequence: {
        mode: 'continuePrevious';
    };
} | {
    mode: 'fromParagraphs';
    target: BlockAddress | BlockRange;
    kind?: ListKind;
    level?: number;
    preset?: ListPresetId;
    style?: ListStyle;
    sequence?: {
        mode: 'new';
        startAt?: number;
    };
} | {
    mode: 'fromParagraphs';
    target: BlockAddress | BlockRange;
    kind?: ListKind;
    level?: number;
    preset?: never;
    style?: never;
    sequence: {
        mode: 'continuePrevious';
    };
};
export interface ListsAttachInput {
    target: BlockAddress | BlockRange;
    attachTo: ListItemAddress;
    level?: number;
}
export interface ListsDetachInput {
    target: ListItemAddress;
}
export interface ListsJoinInput {
    target: ListItemAddress;
    direction: JoinDirection;
}
export interface ListsCanJoinInput {
    target: ListItemAddress;
    direction: JoinDirection;
}
export interface ListsSeparateInput {
    target: ListItemAddress;
    copyOverrides?: boolean;
}
export interface ListsMergeInput {
    target: ListItemAddress;
    direction: JoinDirection;
}
export interface ListsSplitInput {
    target: ListItemAddress;
    restartNumbering?: boolean;
}
export interface ListsSetLevelInput {
    target: ListItemAddress;
    level: number;
}
export interface ListsSetValueInput {
    target: ListItemAddress;
    value: number | null;
}
export interface ListsContinuePreviousInput {
    target: ListItemAddress;
}
export interface ListsCanContinuePreviousInput {
    target: ListItemAddress;
}
export interface ListsSetLevelRestartInput {
    target: ListItemAddress;
    level: number;
    restartAfterLevel: number | null;
    scope?: MutationScope;
}
export interface ListsConvertToTextInput {
    target: ListItemAddress;
    includeMarker?: boolean;
}
/** A captured snapshot of one level's formatting properties. */
export interface ListLevelTemplate {
    level: number;
    numFmt?: string;
    lvlText?: string;
    start?: number;
    alignment?: LevelAlignment;
    indents?: {
        left?: number;
        hanging?: number;
        firstLine?: number;
    };
    trailingCharacter?: TrailingCharacter;
    markerFont?: string;
    pictureBulletId?: number;
    tabStopAt?: number | null;
}
/** A full list template: an array of level snapshots. */
export interface ListTemplate {
    version: 1;
    levels: ListLevelTemplate[];
}
/** Reusable list style object: alias of ListTemplate for user-facing naming. */
export type ListStyle = ListTemplate;
/** Reusable level style: alias of ListLevelTemplate for user-facing naming. */
export type ListLevelStyle = ListLevelTemplate;
/**
 * Dialog-shaped layout input for `lists.setLevelLayout`.
 * All numeric values are in twips.
 *
 * Partial-update semantics:
 *   - undefined (omitted): leave current value unchanged
 *   - null (explicit):      remove/clear the value (only valid for tabStopAt)
 *   - present value:        set it
 */
export interface ListLevelLayout {
    alignment?: LevelAlignment;
    alignedAt?: number;
    textIndentAt?: number;
    followCharacter?: TrailingCharacter;
    tabStopAt?: number | null;
}
export interface ListsApplyTemplateInput {
    target: ListItemAddress;
    template: ListTemplate;
    levels?: number[];
}
export interface ListsApplyPresetInput {
    target: ListItemAddress;
    preset: ListPresetId;
    levels?: number[];
}
export interface ListsSetTypeInput {
    target: ListItemAddress;
    kind: ListKind;
    /** Controls whether adjacent sequences of the same kind are merged after conversion.
     *  - `'preserve'` (default): merge adjacent compatible sequences to maintain continuous numbering.
     *  - `'none'`: only apply the preset, do not merge sequences. */
    continuity?: 'preserve' | 'none';
}
export interface ListsCaptureTemplateInput {
    target: ListItemAddress;
    levels?: number[];
}
export interface ListsSetLevelNumberingInput {
    target: ListItemAddress;
    level: number;
    numFmt: string;
    lvlText: string;
    start?: number;
}
export interface ListsSetLevelBulletInput {
    target: ListItemAddress;
    level: number;
    markerText: string;
}
export interface ListsSetLevelPictureBulletInput {
    target: ListItemAddress;
    level: number;
    pictureBulletId: number;
}
export interface ListsSetLevelAlignmentInput {
    target: ListItemAddress;
    level: number;
    alignment: LevelAlignment;
}
export interface ListsSetLevelIndentsInput {
    target: ListItemAddress;
    level: number;
    left?: number;
    hanging?: number;
    firstLine?: number;
}
export interface ListsSetLevelTrailingCharacterInput {
    target: ListItemAddress;
    level: number;
    trailingCharacter: TrailingCharacter;
}
export interface ListsSetLevelMarkerFontInput {
    target: ListItemAddress;
    level: number;
    fontFamily: string;
}
export interface ListsClearLevelOverridesInput {
    target: ListItemAddress;
    level: number;
}
export interface ListsGetStyleInput {
    target: ListItemAddress;
    levels?: number[];
}
export interface ListsApplyStyleInput {
    target: ListItemAddress;
    style: ListStyle;
    levels?: number[];
}
export interface ListsRestartAtInput {
    target: ListItemAddress;
    startAt: number;
}
export interface ListsSetLevelNumberStyleInput {
    target: ListItemAddress;
    level: number;
    numberStyle: string;
}
export interface ListsSetLevelTextInput {
    target: ListItemAddress;
    level: number;
    text: string;
}
export interface ListsSetLevelStartInput {
    target: ListItemAddress;
    level: number;
    startAt: number;
}
export interface ListsSetLevelLayoutInput {
    target: ListItemAddress;
    level: number;
    layout: ListLevelLayout;
}
export interface ListsGetStyleSuccessResult {
    success: true;
    style: ListStyle;
}
export type ListsGetStyleResult = ListsGetStyleSuccessResult | ListsFailureResult;
export interface ListsCaptureTemplateSuccessResult {
    success: true;
    template: ListTemplate;
}
export type ListsCaptureTemplateResult = ListsCaptureTemplateSuccessResult | ListsFailureResult;
export interface ListsInsertSuccessResult {
    success: true;
    item: ListItemAddress;
    insertionPoint: TextAddress;
    trackedChangeRefs?: ReceiptInsert[];
}
export interface ListsMutateItemSuccessResult {
    success: true;
    item: ListItemAddress;
}
export interface ListsCreateSuccessResult {
    success: true;
    listId: string;
    item: ListItemAddress;
}
export interface ListsJoinSuccessResult {
    success: true;
    listId: string;
}
export interface ListsSeparateSuccessResult {
    success: true;
    listId: string;
    numId: number;
}
export interface ListsMergeSuccessResult {
    success: true;
    listId: string;
    absorbedCount: number;
    removedEmptyBlocks: number;
}
export interface ListsSplitSuccessResult {
    success: true;
    listId: string;
    numId: number;
    restartedAt: number | null;
}
export interface ListsDetachSuccessResult {
    success: true;
    paragraph: {
        kind: 'block';
        nodeType: 'paragraph';
        nodeId: string;
    };
}
export interface ListsConvertToTextSuccessResult {
    success: true;
    paragraph: {
        kind: 'block';
        nodeType: 'paragraph';
        nodeId: string;
    };
}
export interface ListsCanJoinResult {
    canJoin: boolean;
    reason?: CanJoinReason;
    adjacentListId?: string;
}
export interface ListsCanContinuePreviousResult {
    canContinue: boolean;
    reason?: CanContinueReason;
    previousListId?: string;
}
export interface ListsFailureResult {
    success: false;
    failure: ReceiptFailure;
}
export type ListsInsertResult = ListsInsertSuccessResult | ListsFailureResult;
export type ListsMutateItemResult = ListsMutateItemSuccessResult | ListsFailureResult;
export type ListsCreateResult = ListsCreateSuccessResult | ListsFailureResult;
export type ListsJoinResult = ListsJoinSuccessResult | ListsFailureResult;
export type ListsSeparateResult = ListsSeparateSuccessResult | ListsFailureResult;
export type ListsMergeResult = ListsMergeSuccessResult | ListsFailureResult;
export type ListsSplitResult = ListsSplitSuccessResult | ListsFailureResult;
export type ListsDetachResult = ListsDetachSuccessResult | ListsFailureResult;
export type ListsConvertToTextResult = ListsConvertToTextSuccessResult | ListsFailureResult;
//# sourceMappingURL=lists.types.d.ts.map