This repository has been archived by the owner on May 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add missing optional properties to ManifestOptions interface (#55)
* Add missing properties to ManifestOptions interface According to https://developer.mozilla.org/en-US/docs/Web/Manifest/protocol_handlers * Make new ManifestOptions optional All added ones are optional now
- Loading branch information
1 parent
bdd4b4f
commit 0779344
Showing
1 changed file
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,76 @@ | ||
export type ManifestDisplay = 'fullscreen' | 'standalone' | 'minimal-ui' | 'browser' | ||
|
||
export type ManifestDisplayOverride = ManifestDisplay | 'window-controls-overlay' | ||
|
||
export type ManifestOrientation = 'any' | 'natural' | 'landscape' | 'landscape-primary' | 'landscape-secondary' | 'portrait' | 'portrait-primary' | 'portrait-secondary' | ||
|
||
export type ManifestPlatform = 'chrome_web_store' | 'play' | 'itunes' | 'webapp' | 'windows' | 'f-droid' | 'amazon' | ||
|
||
export interface ManifestIcon { | ||
src: string | ||
type: string | ||
sizes: string | ||
purpose: 'any' | 'maskable' | ||
purpose: 'any' | 'maskable' | 'monochrome' | ||
} | ||
|
||
export interface ManifestScreenshot { | ||
src: string | ||
type: string | ||
sizes: string | ||
} | ||
|
||
export interface ManifestShortcut { | ||
name: string | ||
short_name: string | ||
url: string | ||
icons: ManifestIcon[] | ||
} | ||
|
||
export interface ManifestRelatedApplication { | ||
id: string | ||
platform: ManifestPlatform | ||
url: string | ||
} | ||
|
||
export interface ManifestShareTarget { | ||
action: string | ||
method?: 'GET' | 'POST' | ||
enctype?: string | ||
params: { | ||
title?: string | ||
text?: string | ||
url?: string | ||
files?: { | ||
name: string | ||
accept: string | ||
} | ||
} | ||
} | ||
|
||
export interface ManifestProtocolHandler { | ||
protocol: string | ||
url: string | ||
} | ||
|
||
export interface ManifestOptions { | ||
id?: string, | ||
name: string | ||
short_name: string | ||
description: string | ||
lang: string | ||
scope?: string | ||
start_url: string | ||
display: string | ||
display: ManifestDisplay | ||
display_override?: ManifestDislplayOverlay[] | ||
orientation?: ManifestOrientation | ||
background_color: string | ||
theme_color: string | ||
categories?: string[] | ||
icons: ManifestIcon[] | ||
screenshots?: ManifestScreenshot[] | ||
shortcuts?: ManifestShortcut[] | ||
related_applications?: ManifestRelatedApplication[] | ||
prefer_related_applications?: boolean | ||
share_target?: ManifestShareTarget | ||
protocol_handlers?: ManifestProtocolHandler[] | ||
} |