Unverified Commit 17bdfd8e authored by coderfin's avatar coderfin Committed by GitHub

[Type Definition] - Updates the manifest types to reflect the current specifications (#68273)

Co-authored-by: 's avatarJiachi Liu <inbox@huozhi.im>
parent 64fdbcb5
type ClientModeEnum =
| 'auto'
| 'focus-existing'
| 'navigate-existing'
| 'navigate-new'
type File = {
name: string
accept: string | string[]
}
type Icon = {
src: string
type?: string
sizes?: string
purpose?: 'any' | 'maskable' | 'monochrome'
}
export type Manifest = { export type Manifest = {
background_color?: string background_color?: string
categories?: string[] categories?: string[]
...@@ -15,19 +33,13 @@ export type Manifest = { ...@@ -15,19 +33,13 @@ export type Manifest = {
action: string action: string
accept: { accept: {
[mimeType: string]: string[] [mimeType: string]: string[]
}[] }
}[]
icons?: {
src: string
type?: string
sizes?: string
purpose?: 'any' | 'maskable' | 'monochrome' | 'badge'
}[] }[]
icons?: Icon[]
id?: string id?: string
lang?: string lang?: string
launch_handler?: { launch_handler?: {
platform?: 'windows' | 'macos' | 'linux' client_mode: ClientModeEnum | ClientModeEnum[]
url?: string
} }
name?: string name?: string
orientation?: orientation?:
...@@ -43,7 +55,6 @@ export type Manifest = { ...@@ -43,7 +55,6 @@ export type Manifest = {
protocol_handlers?: { protocol_handlers?: {
protocol: string protocol: string
url: string url: string
title?: string
}[] }[]
related_applications?: { related_applications?: {
platform: string platform: string
...@@ -52,35 +63,36 @@ export type Manifest = { ...@@ -52,35 +63,36 @@ export type Manifest = {
}[] }[]
scope?: string scope?: string
screenshots?: { screenshots?: {
form_factor?: 'narrow' | 'wide'
label?: string
platform?:
| 'android'
| 'chromeos'
| 'ipados'
| 'ios'
| 'kaios'
| 'macos'
| 'windows'
| 'xbox'
| 'chrome_web_store'
| 'itunes'
| 'microsoft-inbox'
| 'microsoft-store'
| 'play'
src: string src: string
type?: string type?: string
sizes?: string sizes?: string
}[] }[]
serviceworker?: {
src?: string
scope?: string
type?: string
update_via_cache?: 'import' | 'none' | 'all'
}
share_target?: { share_target?: {
action?: string action: string
method?: 'get' | 'post' method?: 'get' | 'post' | 'GET' | 'POST'
enctype?: enctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data'
| 'application/x-www-form-urlencoded' params: {
| 'multipart/form-data' title?: string
| 'text/plain' text?: string
params?: { url?: string
name: string files?: File | File[]
value: string }
required?: boolean
}[]
url?: string
title?: string
text?: string
files?: {
accept?: string[]
name?: string
}[]
} }
short_name?: string short_name?: string
shortcuts?: { shortcuts?: {
...@@ -88,12 +100,7 @@ export type Manifest = { ...@@ -88,12 +100,7 @@ export type Manifest = {
short_name?: string short_name?: string
description?: string description?: string
url: string url: string
icons?: { icons?: Icon[]
src: string
type?: string
sizes?: string
purpose?: 'any' | 'maskable' | 'monochrome' | 'badge'
}[]
}[] }[]
start_url?: string start_url?: string
theme_color?: string theme_color?: string
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment