import io
from _typeshed import Incomplete
from arelle import PackageManager as PackageManager, XmlUtil as XmlUtil
from arelle.UrlUtil import isHttpUrl as isHttpUrl
from operator import indexOf as indexOf

pluginClassMethods: Incomplete
archivePathSeparators: Incomplete
archiveFilenameSuffixes: Incomplete
POST_UPLOADED_ZIP: Incomplete
SERVER_WEB_CACHE: Incomplete
XMLdeclaration: Incomplete
TAXONOMY_PACKAGE_FILE_NAMES: Incomplete

def openFileSource(filename, cntlr: Incomplete | None = ..., sourceZipStream: Incomplete | None = ..., checkIfXmlIsEis: bool = ..., reloadCache: bool = ..., base: Incomplete | None = ..., sourceFileSource: Incomplete | None = ...): ...
def archiveFilenameParts(filename, checkIfXmlIsEis: bool = ...): ...

class FileNamedStringIO(io.StringIO):
    fileName: Incomplete
    def __init__(self, fileName, *args, **kwargs) -> None: ...
    def close(self) -> None: ...

class FileNamedTextIOWrapper(io.TextIOWrapper):
    fileName: Incomplete
    def __init__(self, fileName, *args, **kwargs) -> None: ...

class FileNamedBytesIO(io.BytesIO):
    fileName: Incomplete
    def __init__(self, fileName, *args, **kwargs) -> None: ...
    def close(self) -> None: ...

class ArchiveFileIOError(IOError):
    fileName: Incomplete
    url: Incomplete
    def __init__(self, fileSource, errno, fileName) -> None: ...

class FileSource:
    url: Incomplete
    baseIsHttp: Incomplete
    cntlr: Incomplete
    type: Incomplete
    isTarGz: Incomplete
    isZip: Incomplete
    isZipBackslashed: bool
    isEis: Incomplete
    isXfd: Incomplete
    isRss: Incomplete
    isInstalledTaxonomyPackage: bool
    isOpen: bool
    fs: Incomplete
    selection: Incomplete
    filesDir: Incomplete
    referencedFileSources: Incomplete
    taxonomyPackage: Incomplete
    mappedPaths: Incomplete
    def __init__(self, url, cntlr: Incomplete | None = ..., checkIfXmlIsEis: bool = ...) -> None: ...
    def logError(self, err) -> None: ...
    basefile: Incomplete
    baseurl: Incomplete
    eisDocument: Incomplete
    xfdDocument: Incomplete
    rssDocument: Incomplete
    def open(self, reloadCache: bool = ...) -> None: ...
    def loadTaxonomyPackageMappings(self, errors=..., expectTaxonomyPackage: Incomplete | None = ...) -> None: ...
    def openZipStream(self, sourceZipStream) -> None: ...
    def close(self) -> None: ...
    @property
    def isArchive(self): ...
    @property
    def isTaxonomyPackage(self): ...
    @property
    def taxonomyPackageMetadataFiles(self): ...
    def isInArchive(self, filepath, checkExistence: bool = ...): ...
    def isMappedUrl(self, url): ...
    def mappedUrl(self, url): ...
    def fileSourceContainingFilepath(self, filepath): ...
    def file(self, filepath, binary: bool = ..., stripDeclaration: bool = ..., encoding: Incomplete | None = ...): ...
    def exists(self, filepath): ...
    @property
    def dir(self): ...
    def basedUrl(self, selection): ...
    def select(self, selection) -> None: ...

def openFileStream(cntlr, filepath, mode: str = ..., encoding: Incomplete | None = ...): ...
def openXmlFileStream(cntlr, filepath, stripDeclaration: bool = ...): ...
def stripDeclarationBytes(xml): ...
def saveFile(cntlr, filepath, contents, encoding: Incomplete | None = ..., mode: str = ...) -> None: ...

gaeMemcache: Incomplete
GAE_MEMCACHE_MAX_ITEM_SIZE: Incomplete
GAE_EXPIRE_WEEK: Incomplete

def gaeGet(key): ...
def gaeDelete(key): ...
def gaeSet(key, bytesValue): ...
