@@ -6,6 +6,11 @@ import { invoke } from './core'
66import { Image } from './image'
77import { Theme } from './window'
88
9+ /**
10+ * Identifier type used for data stores on macOS and iOS.
11+ *
12+ * Represents a 128-bit identifier, commonly expressed as a 16-byte UUID.
13+ */
914export type DataStoreIdentifier = [
1015 number ,
1116 number ,
@@ -78,7 +83,7 @@ async function getName(): Promise<string> {
7883}
7984
8085/**
81- * Gets the Tauri version.
86+ * Gets the Tauri framework version used by this application .
8287 *
8388 * @example
8489 * ```typescript
@@ -109,7 +114,8 @@ async function getIdentifier(): Promise<string> {
109114}
110115
111116/**
112- * Shows the application on macOS. This function does not automatically focus any specific app window.
117+ * Shows the application on macOS. This function does not automatically
118+ * focus any specific app window.
113119 *
114120 * @example
115121 * ```typescript
@@ -166,37 +172,37 @@ async function fetchDataStoreIdentifiers(): Promise<DataStoreIdentifier[]> {
166172 * ```typescript
167173 * import { fetchDataStoreIdentifiers, removeDataStore } from '@tauri-apps/api/app';
168174 * for (const id of (await fetchDataStoreIdentifiers())) {
169- * await removeDataStore(id);
175+ * await removeDataStore(id);
170176 * }
171177 * ```
172178 *
173179 * @since 2.4.0
174180 */
175- async function removeDataStore (
176- uuid : DataStoreIdentifier
177- ) : Promise < DataStoreIdentifier [ ] > {
181+ async function removeDataStore ( uuid : DataStoreIdentifier ) : Promise < void > {
178182 return invoke ( 'plugin:app|remove_data_store' , { uuid } )
179183}
180184
181185/**
182- * Get the default window icon.
186+ * Gets the default window icon.
183187 *
184188 * @example
185189 * ```typescript
186190 * import { defaultWindowIcon } from '@tauri-apps/api/app';
187- * await defaultWindowIcon();
191+ * const icon = await defaultWindowIcon();
188192 * ```
189193 *
190194 * @since 2.0.0
191195 */
196+
192197async function defaultWindowIcon ( ) : Promise < Image | null > {
193198 return invoke < number | null > ( 'plugin:app|default_window_icon' ) . then ( ( rid ) =>
194199 rid ? new Image ( rid ) : null
195200 )
196201}
197202
198203/**
199- * Set app's theme, pass in `null` or `undefined` to follow system theme
204+ * Sets the application's theme. Pass in `null` or `undefined` to follow
205+ * the system theme.
200206 *
201207 * @example
202208 * ```typescript
@@ -217,13 +223,31 @@ async function setTheme(theme?: Theme | null): Promise<void> {
217223/**
218224 * Sets the dock visibility for the application on macOS.
219225 *
220- * @param visible whether the dock should be visible or not
226+ * @param visible - Whether the dock should be visible or not.
227+ *
228+ * @example
229+ * ```typescript
230+ * import { setDockVisibility } from '@tauri-apps/api/app';
231+ * await setDockVisibility(false);
232+ * ```
233+ *
221234 * @since 2.5.0
222235 */
223236async function setDockVisibility ( visible : boolean ) : Promise < void > {
224237 return invoke ( 'plugin:app|set_dock_visibility' , { visible } )
225238}
226239
240+ /**
241+ * Gets the application bundle type.
242+ *
243+ * @example
244+ * ```typescript
245+ * import { getBundleType } from '@tauri-apps/api/app';
246+ * const type = await getBundleType();
247+ * ```
248+ *
249+ * @since 2.5.0
250+ */
227251async function getBundleType ( ) : Promise < BundleType > {
228252 return invoke ( 'plugin:app|bundle_type' )
229253}
0 commit comments