1 | import { TargetSpecificOptions } from "../core";
|
2 | import { CommonLinuxOptions } from "./linuxOptions";
|
3 | export interface SnapOptions extends CommonLinuxOptions, TargetSpecificOptions {
|
4 | /**
|
5 | * The type of [confinement](https://snapcraft.io/docs/reference/confinement) supported by the snap.
|
6 | * @default strict
|
7 | */
|
8 | readonly confinement?: "devmode" | "strict" | "classic" | null;
|
9 | /**
|
10 | * The custom environment. Defaults to `{"TMPDIR: "$XDG_RUNTIME_DIR"}`. If you set custom, it will be merged with default.
|
11 | */
|
12 | readonly environment?: {
|
13 | [key: string]: string;
|
14 | } | null;
|
15 | /**
|
16 | * The 78 character long summary. Defaults to [productName](/configuration/configuration#Configuration-productName).
|
17 | */
|
18 | readonly summary?: string | null;
|
19 | /**
|
20 | * The quality grade of the snap. It can be either `devel` (i.e. a development version of the snap, so not to be published to the “stable” or “candidate” channels) or “stable” (i.e. a stable release or release candidate, which can be released to all channels).
|
21 | * @default stable
|
22 | */
|
23 | readonly grade?: "devel" | "stable" | null;
|
24 | /**
|
25 | * The list of features that must be supported by the core in order for this snap to install.
|
26 | */
|
27 | readonly assumes?: Array<string> | string | null;
|
28 | /**
|
29 | * The list of debian packages needs to be installed for building this snap.
|
30 | */
|
31 | readonly buildPackages?: Array<string> | null;
|
32 | /**
|
33 | * The list of Ubuntu packages to use that are needed to support the `app` part creation. Like `depends` for `deb`.
|
34 | * Defaults to `["libnspr4", "libnss3", "libxss1", "libappindicator3-1", "libsecret-1-0"]`.
|
35 | *
|
36 | * If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom package `foo` in addition to defaults.
|
37 | */
|
38 | readonly stagePackages?: Array<string> | null;
|
39 | /**
|
40 | * The [hooks](https://docs.snapcraft.io/build-snaps/hooks) directory, relative to `build` (build resources directory).
|
41 | * @default build/snap-hooks
|
42 | */
|
43 | readonly hooks?: string | null;
|
44 | /**
|
45 | * The list of [plugs](https://snapcraft.io/docs/reference/interfaces).
|
46 | * Defaults to `["desktop", "desktop-legacy", "home", "x11", "unity7", "browser-support", "network", "gsettings", "audio-playback", "pulseaudio", "opengl"]`.
|
47 | *
|
48 | * If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom plug `foo` in addition to defaults.
|
49 | *
|
50 | * Additional attributes can be specified using object instead of just name of plug:
|
51 | * ```
|
52 | *[
|
53 | * {
|
54 | * "browser-sandbox": {
|
55 | * "interface": "browser-support",
|
56 | * "allow-sandbox": true
|
57 | * },
|
58 | * },
|
59 | * "another-simple-plug-name"
|
60 | *]
|
61 | * ```
|
62 | */
|
63 | readonly plugs?: Array<string | PlugDescriptor> | PlugDescriptor | null;
|
64 | /**
|
65 | * The list of [slots](https://snapcraft.io/docs/reference/interfaces).
|
66 | *
|
67 | * Additional attributes can be specified using object instead of just name of slot:
|
68 | * ```
|
69 | *[
|
70 | * {
|
71 | * "mpris": {
|
72 | * "name": "chromium"
|
73 | * },
|
74 | * }
|
75 | *]
|
76 | *
|
77 | * In case you want your application to be a compliant MPris player, you will need to definie
|
78 | * The mpris slot with "chromium" name.
|
79 | * This electron has it [hardcoded](https://source.chromium.org/chromium/chromium/src/+/master:components/system_media_controls/linux/system_media_controls_linux.cc;l=51;bpv=0;bpt=1),
|
80 | * and we need to pass this name so snap [will allow it](https://forum.snapcraft.io/t/unable-to-use-mpris-interface/15360/7) in strict confinement.
|
81 | *
|
82 | */
|
83 | readonly slots?: Array<string | SlotDescriptor> | PlugDescriptor | null;
|
84 | /**
|
85 | * Specifies any [parts](https://snapcraft.io/docs/reference/parts) that should be built before this part.
|
86 | * Defaults to `["desktop-gtk2""]`.
|
87 | *
|
88 | * If list contains `default`, it will be replaced to default list, so, `["default", "foo"]` can be used to add custom parts `foo` in addition to defaults.
|
89 | */
|
90 | readonly after?: Array<string> | null;
|
91 | /**
|
92 | * Whether to use template snap. Defaults to `true` if `stagePackages` not specified.
|
93 | */
|
94 | readonly useTemplateApp?: boolean;
|
95 | /**
|
96 | * Whether or not the snap should automatically start on login.
|
97 | * @default false
|
98 | */
|
99 | readonly autoStart?: boolean;
|
100 | /**
|
101 | * Specifies any files to make accessible from locations such as `/usr`, `/var`, and `/etc`. See [snap layouts](https://snapcraft.io/docs/snap-layouts) to learn more.
|
102 | */
|
103 | readonly layout?: {
|
104 | [key: string]: {
|
105 | [key: string]: string;
|
106 | };
|
107 | } | null;
|
108 | /**
|
109 | * Specifies which files from the app part to stage and which to exclude. Individual files, directories, wildcards, globstars, and exclusions are accepted. See [Snapcraft filesets](https://snapcraft.io/docs/snapcraft-filesets) to learn more about the format.
|
110 | *
|
111 | * The defaults can be found in [snap.ts](https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/templates/snap/snapcraft.yaml#L29).
|
112 | */
|
113 | readonly appPartStage?: Array<string> | null;
|
114 | /**
|
115 | * An optional title for the snap, may contain uppercase letters and spaces. Defaults to `productName`. See [snap format documentation](https://snapcraft.io/docs/snap-format).
|
116 | */
|
117 | readonly title?: string | null;
|
118 | }
|
119 | export interface PlugDescriptor {
|
120 | [key: string]: {
|
121 | [key: string]: any;
|
122 | } | null;
|
123 | }
|
124 | export interface SlotDescriptor {
|
125 | [key: string]: {
|
126 | [key: string]: any;
|
127 | } | null;
|
128 | }
|