Skip to content

Commit 15475b2

Browse files
authored
Add types for the manifest.json file (#96)
1 parent e1299f6 commit 15475b2

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

src/manifest.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,39 @@ export interface Moziot<T> {
99
schema: Record<string, unknown>;
1010
config: T;
1111
}
12+
13+
export interface ManifestFile {
14+
manifest_version: number;
15+
id: string;
16+
name: string;
17+
short_name: string;
18+
version: string;
19+
description: string;
20+
homepage_url: string;
21+
license: string;
22+
author: string;
23+
gateway_specific_settings: GatewaySpecificSettings;
24+
options?: Options;
25+
content_scripts?: ContentScript[];
26+
web_accessible_resources?: string[];
27+
}
28+
export interface GatewaySpecificSettings {
29+
webthings: WebthingsSettings;
30+
}
31+
32+
export interface WebthingsSettings {
33+
exec?: string;
34+
strict_min_version: string;
35+
strict_max_version: string;
36+
primary_type: 'adapter' | 'notifier' | 'extension';
37+
}
38+
39+
export interface Options {
40+
default?: Record<string, unknown>;
41+
schema: Record<string, unknown>;
42+
}
43+
44+
interface ContentScript {
45+
css?: string[];
46+
js?: string[];
47+
}

0 commit comments

Comments
 (0)