@@ -207,10 +207,27 @@ export interface ShareTargetFiles {
207
207
}
208
208
209
209
/**
210
- * https://developer.mozilla.org/en-US/docs/Web/Manifest/launch_handler#launch_handler_item_values
210
+ * @see https://developer.mozilla.org/en-US/docs/Web/Manifest/launch_handler#launch_handler_item_values
211
211
*/
212
212
export type LaunchHandlerClientMode = 'auto' | 'focus-existing' | 'navigate-existing' | 'navigate-new'
213
213
214
+ export type Display = 'fullscreen' | 'standalone' | 'minimal-ui' | 'browser'
215
+ export type DisplayOverride = Display | 'window-controls-overlay'
216
+ export type IconPurpose = 'monochrome' | 'maskable' | 'any'
217
+
218
+ /**
219
+ * @see https://w3c.github.io/manifest/#manifest-image-resources
220
+ */
221
+ export interface IconResource {
222
+ sizes ?: string
223
+ src : string
224
+ type ?: string
225
+ /**
226
+ * **NOTE**: string values for backward compatibility with the old type.
227
+ */
228
+ purpose ?: string | IconPurpose | IconPurpose [ ]
229
+ }
230
+
214
231
export interface ManifestOptions {
215
232
/**
216
233
* @default _npm_package_name_
@@ -225,13 +242,20 @@ export interface ManifestOptions {
225
242
*/
226
243
description : string
227
244
/**
228
- *
245
+ * @default []
246
+ * @see https://developer.mozilla.org/en-US/docs/Web/Manifest/icons
247
+ * @see https://w3c.github.io/manifest/#icons-member
229
248
*/
230
- icons : Record < string , any > [ ]
249
+ icons : IconResource [ ]
231
250
/**
232
- *
251
+ * @default []
252
+ * @see https://developer.mozilla.org/en-US/docs/Web/Manifest/file_handlers
253
+ * @see https://wicg.github.io/manifest-incubations/#file_handlers-member
233
254
*/
234
- file_handlers : Record < string , any > [ ]
255
+ file_handlers : {
256
+ action : string
257
+ accept : Record < string , string [ ] >
258
+ } [ ]
235
259
/**
236
260
* @default `routerBase + '?standalone=true'`
237
261
*/
@@ -250,12 +274,16 @@ export interface ManifestOptions {
250
274
orientation : 'any' | 'natural' | 'landscape' | 'landscape-primary' | 'landscape-secondary' | 'portrait' | 'portrait-primary' | 'portrait-secondary'
251
275
/**
252
276
* @default `standalone`
277
+ * @see https://developer.mozilla.org/en-US/docs/Web/Manifest/display
278
+ * @see https://w3c.github.io/manifest/#display-member
253
279
*/
254
- display : string
280
+ display : Display
255
281
/**
256
282
* @default []
283
+ * @see https://developer.mozilla.org/en-US/docs/Web/Manifest/display_override
284
+ * @see https://wicg.github.io/manifest-incubations/#display_override-member
257
285
*/
258
- display_override : string [ ]
286
+ display_override : DisplayOverride [ ]
259
287
/**
260
288
* @default `#ffffff`
261
289
*/
@@ -297,16 +325,19 @@ export interface ManifestOptions {
297
325
} [ ]
298
326
/**
299
327
* @default []
328
+ * @see https://developer.mozilla.org/en-US/docs/Web/Manifest/shortcuts
329
+ * @see https://w3c.github.io/manifest/#shortcuts-member
300
330
*/
301
331
shortcuts : {
302
332
name : string
303
333
short_name ?: string
304
334
url : string
305
335
description ?: string
306
- icons ?: Record < string , any > [ ]
336
+ icons ?: IconResource [ ]
307
337
} [ ]
308
338
/**
309
339
* @default []
340
+ * @see https://developer.mozilla.org/en-US/docs/Web/Manifest/screenshots
310
341
*/
311
342
screenshots : {
312
343
src : string
@@ -324,9 +355,13 @@ export interface ManifestOptions {
324
355
* @default ''
325
356
*/
326
357
iarc_rating_id : string
358
+ /**
359
+ * @see https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target
360
+ * @see https://w3c.github.io/web-share-target/level-2/#share_target-member
361
+ */
327
362
share_target : {
328
363
action : string
329
- method ?: string
364
+ method ?: 'GET' | 'POST'
330
365
enctype ?: string
331
366
params : {
332
367
title ?: string
@@ -336,23 +371,23 @@ export interface ManifestOptions {
336
371
}
337
372
}
338
373
/**
339
- * https://github.com/WICG/pwa-url-handler/blob/main/handle_links/explainer.md#handle_links-manifest-member
374
+ * @see https://github.com/WICG/pwa-url-handler/blob/main/handle_links/explainer.md#handle_links-manifest-member
340
375
*/
341
376
handle_links ?: 'auto' | 'preferred' | 'not-preferred'
342
377
/**
343
- * https://developer.mozilla.org/en-US/docs/Web/Manifest/launch_handler#launch_handler_item_values
378
+ * @see https://developer.mozilla.org/en-US/docs/Web/Manifest/launch_handler#launch_handler_item_values
344
379
*/
345
380
launch_handler ?: {
346
381
client_mode : LaunchHandlerClientMode | LaunchHandlerClientMode [ ]
347
382
}
348
383
/**
349
- * https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/sidebar#enable-sidebar-support-in-your-pwa
384
+ * @see https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/sidebar#enable-sidebar-support-in-your-pwa
350
385
*/
351
386
edge_side_panel ?: {
352
387
preferred_width ?: number
353
388
}
354
389
/**
355
- * https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md
390
+ * @see https://github.com/WICG/manifest-incubations/blob/gh-pages/scope_extensions-explainer.md
356
391
* @default []
357
392
*/
358
393
scope_extensions : {
@@ -407,7 +442,7 @@ export interface VitePluginPWAAPI {
407
442
*/
408
443
pwaInDevEnvironment : boolean
409
444
/**
410
- * Returns the PWA webmanifest url for the manifest link:
445
+ * Returns the PWA web manifest url for the manifest link:
411
446
* <link rel="manifest" href="<webManifestUrl>" />
412
447
*
413
448
* Will also return if the manifest will require credentials:
0 commit comments