from dataclasses import dataclass

from kiutils.utils import sexpr as sexpr
from kiutils.utils.strings import dequote as dequote

@dataclass
class Library:
    name: str = ...
    type: str = ...
    uri: str = ...
    options: str = ...
    description: str = ...
    active: bool = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> Library: ...
    def to_sexpr(self, indent: int = 2, newline: bool = True) -> str: ...

@dataclass
class LibTable:
    type: str = ...
    libs: list[Library] = ...
    filePath: str | None = ...
    @classmethod
    def from_sexpr(cls, exp: list) -> LibTable: ...
    @classmethod
    def from_file(cls, filepath: str, encoding: str | None = None) -> LibTable: ...
    @classmethod
    def create_new(cls, type: str = 'sym_lib_table') -> LibTable: ...
    def to_file(self, filepath=None, encoding: str | None = None): ...
    def to_sexpr(self, indent: int = 0, newline: bool = True) -> str: ...
