diff --git a/.changes/fix-removeDataStore-return-type.md b/.changes/fix-removeDataStore-return-type.md new file mode 100644 index 000000000..ba1ec4168 --- /dev/null +++ b/.changes/fix-removeDataStore-return-type.md @@ -0,0 +1,5 @@ +--- +"@tauri-apps/cli": patch:bug +--- + +Fixes `removeDataStore` return type. diff --git a/packages/api/src/app.ts b/packages/api/src/app.ts index 5c6d8b8ee..55b0f3e2f 100644 --- a/packages/api/src/app.ts +++ b/packages/api/src/app.ts @@ -6,6 +6,11 @@ import { invoke } from './core' import { Image } from './image' import { Theme } from './window' +/** + * Identifier type used for data stores on macOS and iOS. + * + * Represents a 128-bit identifier, commonly expressed as a 16-byte UUID. + */ export type DataStoreIdentifier = [ number, number, @@ -78,7 +83,7 @@ async function getName(): Promise { } /** - * Gets the Tauri version. + * Gets the Tauri framework version used by this application. * * @example * ```typescript @@ -109,7 +114,8 @@ async function getIdentifier(): Promise { } /** - * Shows the application on macOS. This function does not automatically focus any specific app window. + * Shows the application on macOS. This function does not automatically + * focus any specific app window. * * @example * ```typescript @@ -166,29 +172,28 @@ async function fetchDataStoreIdentifiers(): Promise { * ```typescript * import { fetchDataStoreIdentifiers, removeDataStore } from '@tauri-apps/api/app'; * for (const id of (await fetchDataStoreIdentifiers())) { - * await removeDataStore(id); + * await removeDataStore(id); * } * ``` * * @since 2.4.0 */ -async function removeDataStore( - uuid: DataStoreIdentifier -): Promise { +async function removeDataStore(uuid: DataStoreIdentifier): Promise { return invoke('plugin:app|remove_data_store', { uuid }) } /** - * Get the default window icon. + * Gets the default window icon. * * @example * ```typescript * import { defaultWindowIcon } from '@tauri-apps/api/app'; - * await defaultWindowIcon(); + * const icon = await defaultWindowIcon(); * ``` * * @since 2.0.0 */ + async function defaultWindowIcon(): Promise { return invoke('plugin:app|default_window_icon').then((rid) => rid ? new Image(rid) : null @@ -196,7 +201,8 @@ async function defaultWindowIcon(): Promise { } /** - * Set app's theme, pass in `null` or `undefined` to follow system theme + * Sets the application's theme. Pass in `null` or `undefined` to follow + * the system theme. * * @example * ```typescript @@ -217,13 +223,31 @@ async function setTheme(theme?: Theme | null): Promise { /** * Sets the dock visibility for the application on macOS. * - * @param visible whether the dock should be visible or not + * @param visible - Whether the dock should be visible or not. + * + * @example + * ```typescript + * import { setDockVisibility } from '@tauri-apps/api/app'; + * await setDockVisibility(false); + * ``` + * * @since 2.5.0 */ async function setDockVisibility(visible: boolean): Promise { return invoke('plugin:app|set_dock_visibility', { visible }) } +/** + * Gets the application bundle type. + * + * @example + * ```typescript + * import { getBundleType } from '@tauri-apps/api/app'; + * const type = await getBundleType(); + * ``` + * + * @since 2.5.0 + */ async function getBundleType(): Promise { return invoke('plugin:app|bundle_type') }