/** * @module * Unix. */ import { PlatformDirsABC } from "./api.ts"; /** * On Unix/Linux, we follow the [XDG Basedir * Spec](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html). * * The spec allows overriding directories via environment variables. The * examples shown are the default values, alongside the name of the environment * variable that overrides them. Makes use of the * {@link PlatformDirsABC.appname}, {@link PlatformDirsABC.version}, * {@link PlatformDirsABC.multipath}, {@link PlatformDirsABC.opinion}, * {@link PlatformDirsABC.ensureExists}. */ export declare class Unix extends PlatformDirsABC { /** * @return data directory tied to the user, e.g. `~/.local/share/$appname/$version` or `$XDG_DATA_HOME/$appname/$version` */ get userDataDir(): string; /** * @ignore @internal */ protected get _siteDataDirs(): string[]; /** * @return data directories shared by users (if * {@link PlatformDirsABC.multipath} is enabled and `XDG_DATA_DIRS` is and a * multi path the response is also a multi path separated by the OS path * separator), e.g. * `/usr/local/share/$appname/$version:/usr/share/$appname/$version` */ get siteDataDir(): string; /** * @return config directory tied to the user, e.g. `~/.config/$appname/$version` or `$XDG_CONFIG_HOME/$appname/$version` */ get userConfigDir(): string; /** * @ignore @internal */ protected get _siteConfigDirs(): string[]; /** * @return config directories shared by users (if * {@link PlatformDirsABC.multipath} is enabled and `XDG_CONFIG_DIRS` is and * a multi path the response is also a multi path separated by the OS path * separator), e.g. `/etc/xdg/$appname/$version` */ get siteConfigDir(): string; /** * @return cache directory tied to the user, e.g. `~/.cache/$appname/$version` or `$XDG_CACHE_HOME/$appname/$version` */ get userCacheDir(): string; /** * @return cache directory shared by users, e.g. `/var/cache/$appname/$version` */ get siteCacheDir(): string; /** * @return state directory tied to the user, e.g. `~/.local/state/$appname/$version` or `$XDG_STATE_HOME/$appname/$version` */ get userStateDir(): string; /** * @return log directory tied to the user, same as `userCacheDir` if not opinionated else `log` in it. */ get userLogDir(): string; /** * @return documents directory tied to the user, e.g. `~/Documents` */ get userDocumentsDir(): string; /** * @return downloads directory tied to the user, e.g. `~/Downloads` */ get userDownloadsDir(): string; /** * @return pictures directory tied to the user, e.g. `~/Pictures` */ get userPicturesDir(): string; /** * @return videos directory tied to the user, e.g. `~/Videos` */ get userVideosDir(): string; /** * @return music directory tied to the user, e.g. `~/Music` */ get userMusicDir(): string; /** * @return desktop directory tied to the user, e.g. `~/Desktop` */ get userDesktopDir(): string; /** * @return runtime directory tied to the user, e.g. `/run/user/$(id -u)/$appname/$version` or `$XDG_RUNTIME_DIR/$appname/$version`. * * For FreeBSD/OpenBSD/NetBSD, it would return `/var/run/user/$(id -u)/$appname/$version` if it exists, otherwise `/tmp/runtime-$(id -u)/$appname/$version`, if `XDG_RUNTIME_DIR` is not set. */ get userRuntimeDir(): string; /** * @return runtime directory shared by users, e.g. `/run/$appname/$version` or `$XDG_RUNTIME_DIR/$appname/$version`. * * Note that this behaves almost exactly like `userRuntimeDir` if `XDG_RUNTIME_DIR` is set, but will fall back to paths associated to the root user isntead of a regular logged-in user if it's not set. * * If you wish to ensure that a logged-in user path is returned e.g. `/run/user/0`, use `userRuntimeDir` instead. * * For FreeBSD/OpenBSD/NetBSD, it would return `/var/run/$appname/$version` if `XDG_RUNTIME_DIR` is not set. */ get siteRuntimeDir(): string; /** * @return data path shared by users. Only return the first item, even if `multipath` is set to `true`. */ get siteDataPath(): string; /** * @return config path shared by users. Only return the first item, even if `multipath` is set to `true`. */ get siteConfigPath(): string; /** * @return cache path shared by users. Only return the first item, even if `multipath` is set to `true`. */ get siteCachePath(): string; /** * @yields all user and site configuation directories */ iterConfigDirs(): Generator; /** * @yields all user and site data directories */ iterDataDirs(): Generator; }