Skip to main content

Functions

appDir#

appDir(): Promise<string>

Returns the path to the suggested directory for your app config files. Resolves to ${configDir}/${bundleIdentifier}, where bundleIdentifier is the value configured on tauri.conf.json > tauri > bundle > identifier.

Returns: Promise<string>

Defined in: path.ts:19


audioDir#

audioDir(): Promise<string>

Returns the path to the user's audio directory.

Linux#

Resolves to $XDG_MUSIC_DIR.

macOS#

Resolves to $HOME/Music.

Windows#

Resolves to {FOLDERID_Music}.

Returns: Promise<string>

Defined in: path.ts:41


cacheDir#

cacheDir(): Promise<string>

Returns the path to the user's cache directory.

Linux#

Resolves to $XDG_CACHE_HOME or $HOME/.cache.

macOS#

Resolves to $HOME/Library/Caches.

Windows#

Resolves to {FOLDERID_LocalAppData}.

Returns: Promise<string>

Defined in: path.ts:63


configDir#

configDir(): Promise<string>

Returns the path to the user's config directory.

Linux#

Resolves to $XDG_CONFIG_HOME or $HOME/.config.

macOS#

Resolves to $HOME/Library/Application Support.

Windows#

Resolves to {FOLDERID_LocalAppData}.

Returns: Promise<string>

Defined in: path.ts:85


currentDir#

currentDir(): Promise<string>

Returns the path to the current working directory.

Returns: Promise<string>

Defined in: path.ts:403


dataDir#

dataDir(): Promise<string>

Returns the path to the user's data directory.

Linux#

Resolves to $XDG_DATA_HOME or $HOME/.local/share.

macOS#

Resolves to $HOME/Library/Application Support.

Windows#

Resolves to {FOLDERID_RoamingAppData}.

Returns: Promise<string>

Defined in: path.ts:107


desktopDir#

desktopDir(): Promise<string>

Returns the path to the user's desktop directory.

Linux#

Resolves to $XDG_DESKTOP_DIR.

macOS#

Resolves to $HOME/Library/Desktop.

Windows#

Resolves to {FOLDERID_Desktop}.

Returns: Promise<string>

Defined in: path.ts:129


documentDir#

documentDir(): Promise<string>

Returns the path to the user's document directory.

Linux#

Resolves to $XDG_DOCUMENTS_DIR.

macOS#

Resolves to $HOME/Documents.

Windows#

Resolves to {FOLDERID_Documents}.

Returns: Promise<string>

Defined in: path.ts:151


downloadDir#

downloadDir(): Promise<string>

Returns the path to the user's download directory.

Linux#

Resolves to $XDG_DOWNLOAD_DIR.

macOS#

Resolves to $HOME/Downloads.

Windows#

Resolves to {FOLDERID_Downloads}.

Returns: Promise<string>

Defined in: path.ts:173


executableDir#

executableDir(): Promise<string>

Returns the path to the user's executable directory.

Linux#

Resolves to $XDG_BIN_HOME/../bin or $XDG_DATA_HOME/../bin or $HOME/.local/bin.

macOS#

Not supported.

Windows#

Not supported.

Returns: Promise<string>

Defined in: path.ts:195


fontDir#

fontDir(): Promise<string>

Returns the path to the user's font directory.

Linux#

Resolves to $XDG_DATA_HOME/fonts or $HOME/.local/share/fonts.

macOS#

Resolves to $HOME/Library/Fonts.

Windows#

Not supported.

Returns: Promise<string>

Defined in: path.ts:217


homeDir#

homeDir(): Promise<string>

Returns the path to the user's home directory.

Linux#

Resolves to $HOME.

macOS#

Resolves to $HOME.

Windows#

Resolves to {FOLDERID_Profile}.

Returns: Promise<string>

Defined in: path.ts:239


localDataDir#

localDataDir(): Promise<string>

Returns the path to the user's local data directory.

Linux#

Resolves to $XDG_DATA_HOME or $HOME/.local/share.

macOS#

Resolves to $HOME/Library/Application Support.

Windows#

Resolves to {FOLDERID_LocalAppData}.

Returns: Promise<string>

Defined in: path.ts:261


pictureDir#

pictureDir(): Promise<string>

Returns the path to the user's picture directory.

Linux#

Resolves to $XDG_PICTURES_DIR.

macOS#

Resolves to $HOME/Pictures.

Windows#

Resolves to {FOLDERID_Pictures}.

Returns: Promise<string>

Defined in: path.ts:283


publicDir#

publicDir(): Promise<string>

Returns the path to the user's public directory.

Linux#

Resolves to $XDG_PUBLICSHARE_DIR.

macOS#

Resolves to $HOME/Public.

Windows#

Resolves to {FOLDERID_Public}.

Returns: Promise<string>

Defined in: path.ts:305


resolvePath#

resolvePath(path: string, directory: BaseDirectory): Promise<string>

Resolves the path with the optional base directory.

Parameters:#

NameTypeDescription
pathstringA path to resolve
directoryBaseDirectoryA base directory to use when resolving the given path

Returns: Promise<string>

A path resolved to the given base directory.

Defined in: path.ts:421


resourceDir#

resourceDir(): Promise<string>

Returns the path to the user's resource directory.

Returns: Promise<string>

Defined in: path.ts:321


runtimeDir#

runtimeDir(): Promise<string>

Returns the path to the user's runtime directory.

Linux#

Resolves to $XDG_RUNTIME_DIR.

macOS#

Not supported.

Windows#

Not supported.

Returns: Promise<string>

Defined in: path.ts:343


templateDir#

templateDir(): Promise<string>

Returns the path to the user's template directory.

Linux#

Resolves to $XDG_TEMPLATES_DIR.

macOS#

Not supported.

Windows#

Resolves to {FOLDERID_Templates}.

Returns: Promise<string>

Defined in: path.ts:365


videoDir#

videoDir(): Promise<string>

Returns the path to the user's video directory.

Linux#

Resolves to $XDG_VIDEOS_DIR.

macOS#

Resolves to $HOME/Movies.

Windows#

Resolves to {FOLDERID_Videos}.

Returns: Promise<string>

Defined in: path.ts:387