"""
I/O utilities for SLTK.
"""

from sltk.io.annotations import (
    SCHEMA_VERSION,
    TIER_CAPTION,
    TIER_GLOSS,
    TIER_GLOSS_LH,
    TIER_GLOSS_RH,
    TIER_MOUTHING,
    TIER_SUBTITLE,
    TIER_TRANSLATION,
    generate_manifest,
    list_samples,
    read_manifest,
    read_unified_annotation,
    validate_annotation,
    write_manifest,
    write_unified_annotation,
)
from sltk.io.converters import (
    convert_asl_citizen_csv,
    convert_asldict_json,
    convert_bobsl,
    convert_bslzone,
    convert_csl_daily_json,
    convert_dataset,
    convert_elan,
    convert_how2sign_csv,
    convert_msasl_json,
    convert_phoenix_csv,
    convert_vtt,
    convert_vtt_directory,
    convert_wlasl_json,
    convert_youtube_asl_directory,
    convert_youtube_asl_json,
    convert_ytsl_tsv,
    get_converter,
    list_converters,
)
from sltk.io.elan import get_eaf_metadata, read_eaf, write_eaf
from sltk.io.h5 import (
    get_frame_detections,
    get_h5_metadata,
    load_h5_features,
    load_poses_h5,
    save_poses_h5,
)
from sltk.io.safe_write import (
    AtomicWriteError,
    BackupError,
    FileExistsError,
    SafeWriteError,
    atomic_write,
    atomic_write_with_callback,
    backup_before_modify,
    backup_file,
    cleanup_old_backups,
    cleanup_old_versions,
    file_lock,
    generate_export_path,
    safe_add_tier_to_eaf,
    safe_write_eaf,
    suggest_safe_path,
    versioned_save,
    versioned_save_with_callback,
)

__all__ = [
    # Safe Write Operations
    "SafeWriteError",
    "FileExistsError",
    "AtomicWriteError",
    "BackupError",
    "file_lock",
    "atomic_write",
    "atomic_write_with_callback",
    "versioned_save",
    "versioned_save_with_callback",
    "backup_file",
    "backup_before_modify",
    "generate_export_path",
    "suggest_safe_path",
    "safe_write_eaf",
    "safe_add_tier_to_eaf",
    "cleanup_old_versions",
    "cleanup_old_backups",
    # ELAN
    "read_eaf",
    "write_eaf",
    "get_eaf_metadata",
    # H5
    "load_h5_features",
    "get_h5_metadata",
    "save_poses_h5",
    "load_poses_h5",
    "get_frame_detections",
    # Unified Annotations
    "read_unified_annotation",
    "write_unified_annotation",
    "validate_annotation",
    "read_manifest",
    "write_manifest",
    "generate_manifest",
    "list_samples",
    "SCHEMA_VERSION",
    "TIER_GLOSS",
    "TIER_GLOSS_RH",
    "TIER_GLOSS_LH",
    "TIER_MOUTHING",
    "TIER_TRANSLATION",
    "TIER_CAPTION",
    "TIER_SUBTITLE",
    # Converters
    "convert_elan",
    "convert_wlasl_json",
    "convert_msasl_json",
    "convert_asldict_json",
    "convert_how2sign_csv",
    "convert_asl_citizen_csv",
    "convert_bobsl",
    "convert_csl_daily_json",
    "convert_vtt",
    "convert_vtt_directory",
    "convert_bslzone",
    "convert_phoenix_csv",
    "convert_ytsl_tsv",
    "convert_youtube_asl_json",
    "convert_youtube_asl_directory",
    "convert_dataset",
    "get_converter",
    "list_converters",
]
