File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,15 @@ export type Display = 'fullscreen' | 'standalone' | 'minimal-ui' | 'browser'
218
218
export type DisplayOverride = Display | 'window-controls-overlay'
219
219
export type IconPurpose = 'monochrome' | 'maskable' | 'any'
220
220
221
+ interface Nothing { }
222
+
223
+ /**
224
+ * type StringLiteralUnion<'maskable'> = 'maskable' | string
225
+ * This has auto completion whereas `'maskable' | string` doesn't
226
+ * Adapted from https://github.com/microsoft/TypeScript/issues/29729
227
+ */
228
+ export type StringLiteralUnion < T extends U , U = string > = T | ( U & Nothing )
229
+
221
230
/**
222
231
* @see https://w3c.github.io/manifest/#manifest-image-resources
223
232
*/
@@ -228,7 +237,7 @@ export interface IconResource {
228
237
/**
229
238
* **NOTE**: string values for backward compatibility with the old type.
230
239
*/
231
- purpose ?: string | IconPurpose | IconPurpose [ ]
240
+ purpose ?: StringLiteralUnion < IconPurpose > | IconPurpose [ ]
232
241
}
233
242
234
243
export interface ManifestOptions {
You can’t perform that action at this time.
0 commit comments