# Stubs for posix1e (Python 3)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.

from typing import Optional, Union, Tuple, TypeVar
from builtins import _PathLike as PathLike

from typing import overload
ACL_DUPLICATE_ERROR: int
ACL_ENTRY_ERROR: int
ACL_EXECUTE: int
ACL_GROUP: int
ACL_GROUP_OBJ: int
ACL_MASK: int
ACL_MISS_ERROR: int
ACL_MULTI_ERROR: int
ACL_OTHER: int
ACL_READ: int
ACL_TYPE_ACCESS: int
ACL_TYPE_DEFAULT: int
ACL_UNDEFINED_TAG: int
ACL_USER: int
ACL_USER_OBJ: int
ACL_WRITE: int
HAS_ACL_CHECK: int
HAS_ACL_ENTRY: int
HAS_ACL_FROM_MODE: int
HAS_COPY_EXT: int
HAS_EQUIV_MODE: int
HAS_EXTENDED_CHECK: int
TEXT_ABBREVIATE: int
TEXT_ALL_EFFECTIVE: int
TEXT_NUMERIC_IDS: int
TEXT_SMART_INDENT: int
TEXT_SOME_EFFECTIVE: int

S = TypeVar('S', str, bytes, int, PathLike)

def delete_default(path: str) -> None: ...
def has_extended(item: S) -> bool: ...

class ACL:
    def __init__(*args, **kwargs) -> None: ...
    @overload
    def append(self) -> 'Entry': ...
    @overload
    def append(self, __entry: 'Entry') -> 'Entry': ...
    def applyto(self, __item, flag: Optional[int]=0) -> None: ...
    def calc_mask(self) -> None: ...
    def check(self) -> Union[bool, Tuple[int, int]]: ...
    def delete_entry(self, __entry: 'Entry') -> None: ...
    def equiv_mode(self) -> int: ...
    def to_any_text(self, prefix: str=..., separator: str=..., options: int=...) -> bytes: ...
    def valid(self) -> bool: ...
    def __iter__(self) -> 'ACL': ...
    def __next__(self) -> 'Entry': ...
    def __getstate__(self) -> bytes: ...
    def __setstate__(self, state: bytes) -> None: ...

class Entry:
    parent: ACL = ...
    permset: 'Permset' = ...
    qualifier: int = ...
    tag_type: int = ...
    def __init__(self, __acl: ACL) -> None: ...
    def copy(self, __src: 'Entry') -> None: ...

class Permset:
    execute: bool = ...
    read: bool = ...
    write: bool = ...
    def __init__(self, __entry: Entry) -> None: ...
    @classmethod
    def add(self, perm: int) -> None: ...
    def clear(self) -> None: ...
    def delete(self, perm: int) -> None: ...
    def test(self, perm: int) -> bool: ...
