Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
feat: add missing optional properties to ManifestOptions interface (#55)
Browse files Browse the repository at this point in the history
* 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
toniengelhardt authored Oct 22, 2022
1 parent bdd4b4f commit 0779344
Showing 1 changed file with 60 additions and 2 deletions.
62 changes: 60 additions & 2 deletions src/parts/manifest/types.ts
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[]
}

0 comments on commit 0779344

Please sign in to comment.