# This file was auto-generated by Fern from our API Definition.

import typing_extensions
from ..core.serialization import FieldMetadata
from ..types.parse_config_advanced_options_excel_parsing_mode import ParseConfigAdvancedOptionsExcelParsingMode
from .page_ranges import PageRangesParams
from .parse_config_advanced_options_return_ocr import ParseConfigAdvancedOptionsReturnOcrParams


class ParseConfigAdvancedOptionsParams(typing_extensions.TypedDict):
    page_rotation_enabled: typing_extensions.NotRequired[
        typing_extensions.Annotated[bool, FieldMetadata(alias="pageRotationEnabled")]
    ]
    """
    Whether to automatically detect and correct page rotation.
    """

    page_ranges: typing_extensions.NotRequired[
        typing_extensions.Annotated[PageRangesParams, FieldMetadata(alias="pageRanges")]
    ]
    excel_parsing_mode: typing_extensions.NotRequired[
        typing_extensions.Annotated[ParseConfigAdvancedOptionsExcelParsingMode, FieldMetadata(alias="excelParsingMode")]
    ]
    """
    Controls how Excel files are parsed.
    
    * `basic`: Fast, deterministic parsing.
    * `advanced`: Enable layout block detection for complex spreadsheets.
    
    For `.xls` files, `basic` mode is always used.
    """

    excel_skip_hidden_content: typing_extensions.NotRequired[
        typing_extensions.Annotated[bool, FieldMetadata(alias="excelSkipHiddenContent")]
    ]
    """
    Whether to exclude hidden rows, columns, and sheets when parsing Excel files.
    """

    vertical_grouping_threshold: typing_extensions.NotRequired[
        typing_extensions.Annotated[float, FieldMetadata(alias="verticalGroupingThreshold")]
    ]
    """
    Multiplier for the Y-axis threshold used to determine if text blocks should be placed on the same line or not (0.1-5.0, default 1.0). Higher values group elements that are further apart vertically. Only applies when the spatial target is set.
    """

    return_ocr: typing_extensions.NotRequired[
        typing_extensions.Annotated[ParseConfigAdvancedOptionsReturnOcrParams, FieldMetadata(alias="returnOcr")]
    ]
    """
    Options for returning raw OCR data in the response.
    """
