@@ -6,6 +6,11 @@ import { invoke } from './core'
6
6
import { Image } from './image'
7
7
import { Theme } from './window'
8
8
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
+ */
9
14
export type DataStoreIdentifier = [
10
15
number ,
11
16
number ,
@@ -78,7 +83,7 @@ async function getName(): Promise<string> {
78
83
}
79
84
80
85
/**
81
- * Gets the Tauri version.
86
+ * Gets the Tauri framework version used by this application .
82
87
*
83
88
* @example
84
89
* ```typescript
@@ -109,7 +114,8 @@ async function getIdentifier(): Promise<string> {
109
114
}
110
115
111
116
/**
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.
113
119
*
114
120
* @example
115
121
* ```typescript
@@ -166,37 +172,37 @@ async function fetchDataStoreIdentifiers(): Promise<DataStoreIdentifier[]> {
166
172
* ```typescript
167
173
* import { fetchDataStoreIdentifiers, removeDataStore } from '@tauri-apps/api/app';
168
174
* for (const id of (await fetchDataStoreIdentifiers())) {
169
- * await removeDataStore(id);
175
+ * await removeDataStore(id);
170
176
* }
171
177
* ```
172
178
*
173
179
* @since 2.4.0
174
180
*/
175
- async function removeDataStore (
176
- uuid : DataStoreIdentifier
177
- ) : Promise < DataStoreIdentifier [ ] > {
181
+ async function removeDataStore ( uuid : DataStoreIdentifier ) : Promise < void > {
178
182
return invoke ( 'plugin:app|remove_data_store' , { uuid } )
179
183
}
180
184
181
185
/**
182
- * Get the default window icon.
186
+ * Gets the default window icon.
183
187
*
184
188
* @example
185
189
* ```typescript
186
190
* import { defaultWindowIcon } from '@tauri-apps/api/app';
187
- * await defaultWindowIcon();
191
+ * const icon = await defaultWindowIcon();
188
192
* ```
189
193
*
190
194
* @since 2.0.0
191
195
*/
196
+
192
197
async function defaultWindowIcon ( ) : Promise < Image | null > {
193
198
return invoke < number | null > ( 'plugin:app|default_window_icon' ) . then ( ( rid ) =>
194
199
rid ? new Image ( rid ) : null
195
200
)
196
201
}
197
202
198
203
/**
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.
200
206
*
201
207
* @example
202
208
* ```typescript
@@ -217,13 +223,31 @@ async function setTheme(theme?: Theme | null): Promise<void> {
217
223
/**
218
224
* Sets the dock visibility for the application on macOS.
219
225
*
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
+ *
221
234
* @since 2.5.0
222
235
*/
223
236
async function setDockVisibility ( visible : boolean ) : Promise < void > {
224
237
return invoke ( 'plugin:app|set_dock_visibility' , { visible } )
225
238
}
226
239
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
+ */
227
251
async function getBundleType ( ) : Promise < BundleType > {
228
252
return invoke ( 'plugin:app|bundle_type' )
229
253
}
0 commit comments