from .Cntlr import Cntlr as Cntlr
from _typeshed import Incomplete
from arelle.FileSource import SERVER_WEB_CACHE as SERVER_WEB_CACHE, archiveFilenameParts as archiveFilenameParts
from arelle.PluginManager import pluginClassMethods as pluginClassMethods
from arelle.UrlUtil import isHttpUrl as isHttpUrl
from typing import Optional
from urllib import request as request

addServerWebCache: Incomplete
DIRECTORY_INDEX_FILE: str
INF: Incomplete
RETRIEVAL_RETRY_COUNT: int
HTTP_USER_AGENT: Incomplete

def proxyDirFmt(httpProxyTuple): ...
def proxyTuple(url): ...
def lastModifiedTime(headers): ...

class WebCache:
    default_timeout: Incomplete
    cntlr: Incomplete
    cacheDir: Incomplete
    encodeFileChars: Incomplete
    decodeFileChars: Incomplete
    workOffline: bool
    maxAgeSeconds: Incomplete
    urlCheckJsonFile: Incomplete
    cachedUrlCheckTimes: Incomplete
    cachedUrlCheckTimesModified: bool
    def __init__(self, cntlr: Cntlr, httpProxyTuple: Optional[tuple[bool, str, str, str, str]]) -> None: ...
    @property
    def timeout(self): ...
    @timeout.setter
    def timeout(self, seconds) -> None: ...
    @property
    def recheck(self): ...
    @recheck.setter
    def recheck(self, recheckInterval) -> None: ...
    @property
    def logDownloads(self): ...
    @logDownloads.setter
    def logDownloads(self, _logDownloads) -> None: ...
    def saveUrlCheckTimes(self) -> None: ...
    @property
    def noCertificateCheck(self): ...
    @noCertificateCheck.setter
    def noCertificateCheck(self, check) -> None: ...
    @property
    def httpUserAgent(self): ...
    @httpUserAgent.setter
    def httpUserAgent(self, userAgent) -> None: ...
    @property
    def httpsRedirect(self): ...
    @httpsRedirect.setter
    def httpsRedirect(self, value) -> None: ...
    hasNTLM: bool
    proxy_handler: Incomplete
    proxy_auth_handler: Incomplete
    http_auth_handler: Incomplete
    ntlm_auth_handler: Incomplete
    opener: Incomplete
    def resetProxies(self, httpProxyTuple) -> None: ...
    def normalizeUrl(self, url, base: Incomplete | None = ...): ...
    def encodeForFilename(self, pathpart): ...
    def urlToCacheFilepath(self, url): ...
    def cacheFilepathToUrl(self, cacheFilepath): ...
    progressUrl: Incomplete
    def getfilename(self, url: Union[str, None], base: Union[str, None] = ..., reload: bool = ..., checkModifiedTime: bool = ..., normalize: bool = ..., filenameOnly: bool = ...) -> Union[str, None]: ...
    def internetRecheckFailedRecovery(self, filepath, url, err, timeNowStr): ...
    def reportProgress(self, blockCount, blockSize, totalSize) -> None: ...
    def clear(self) -> None: ...
    def getheaders(self, url): ...
    def geturl(self, url): ...
    def getAttachmentFilename(self, url: str) -> str: ...
    def retrieve(self, url, filename: Incomplete | None = ..., filestream: Incomplete | None = ..., reporthook: Incomplete | None = ..., data: Incomplete | None = ...): ...
