# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright The Lance Authors

from typing import Any, Dict, List, Optional

import pyarrow as pa

class LanceField:
    def name(self) -> str: ...
    def id(self) -> int: ...
    def children(self) -> List[LanceField]: ...
    def is_unenforced_primary_key(self) -> bool: ...
    def unenforced_primary_key_position(self) -> Optional[int]: ...
    def is_unenforced_clustering_key(self) -> bool: ...
    def unenforced_clustering_key_position(self) -> Optional[int]: ...

class LanceSchema:
    def fields(self) -> List[LanceField]: ...
    def unenforced_primary_key(self) -> List[LanceField]: ...
    def unenforced_clustering_key(self) -> List[LanceField]: ...
    def to_pyarrow(self) -> pa.Schema: ...
    @staticmethod
    def from_pyarrow(schema: pa.Schema) -> "LanceSchema": ...

def schema_to_json(schema: pa.Schema) -> Dict[str, Any]: ...
def json_to_schema(schema_json: Dict[str, Any]) -> pa.Schema: ...
