from _typeshed import Incomplete
from docassemble.base.config import daconfig as daconfig
from docassemble.base.error import DAError as DAError
from docassemble.base.generate_key import random_alphanumeric as random_alphanumeric
from docassemble.base.logger import logmessage as logmessage
from docassemble.webapp.update import get_pip_info as get_pip_info

cloud: Incomplete
UPLOAD_DIRECTORY: Incomplete

def listfiles(directory: str) -> list: ...
def listdirs(directory: str) -> list: ...
def path_to_key(path) -> str: ...
def url_sanitize(url: str) -> str: ...

class SavedFile:
    extension: Incomplete
    filename: Incomplete
    subdir: Incomplete
    fixed: bool
    file_number: Incomplete
    section: Incomplete
    directory: Incomplete
    path: Incomplete
    def __init__(self, file_number, extension: Incomplete | None = ..., fix: bool = ..., section: str = ..., filename: str = ..., subdir: Incomplete | None = ..., should_not_exist: bool = ..., must_exist: bool = ...) -> None: ...
    modtimes: Incomplete
    keydict: Incomplete
    def fix(self, must_exist: bool = ...) -> None: ...
    def delete_file(self, filename) -> None: ...
    def delete_directory(self, directory) -> None: ...
    def delete(self) -> None: ...
    def save(self, finalize: bool = ...) -> None: ...
    def fetch_url(self, url, **kwargs) -> None: ...
    def fetch_url_post(self, url, post_args, **kwargs) -> None: ...
    def size_in_bytes(self, **kwargs): ...
    def list_of_files(self): ...
    def list_of_dirs(self): ...
    def copy_from(self, orig_path, **kwargs) -> None: ...
    def get_modtime(self, **kwargs): ...
    def write_content(self, content, **kwargs) -> None: ...
    def write_as_json(self, obj, **kwargs) -> None: ...
    def temp_url_for(self, **kwargs): ...
    def cloud_path(self, filename: Incomplete | None = ...): ...
    def url_for(self, **kwargs): ...
    def finalize(self) -> None: ...

def get_ext_and_mimetype(filename): ...
def publish_package(pkgname, info, author_info, current_project: str = ...): ...
def make_package_zip(pkgname, info, author_info, tz_name, current_project: str = ...): ...
def get_version_suffix(package_name) -> str: ...
def make_package_dir(pkgname, info, author_info, directory: Incomplete | None = ..., current_project: str = ...): ...
def directory_for(area, current_project: str): ...
def update_access_time(filepath) -> None: ...
