@pi-r/android 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2023 An Pham
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ ### @pi-r/android
2
+
3
+ ### LICENSE
4
+
5
+ MIT
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const path = require("path");
4
+ const htmlparser2 = require("htmlparser2");
5
+ const domhandler = require("domhandler");
6
+ const domutils = require("domutils");
7
+ const domserializer = require("dom-serializer");
8
+ const util_1 = require("@e-mc/document/util");
9
+ const types_1 = require("@e-mc/types");
10
+ const Parser = htmlparser2.Parser;
11
+ const DomHandler = domhandler.DomHandler;
12
+ function finalize(instance) {
13
+ const config = instance.config;
14
+ if (!config.manifest) {
15
+ return;
16
+ }
17
+ let { localUri, source, existing } = instance.findTemplate(path.join(this.baseDirectory, config.mainParentDir, config.mainSrcDir), "AndroidManifest.xml" /* MANIFEST.FILENAME */, { detect: !this.archiving });
18
+ if (localUri && source && instance.canWrite(localUri, { ownPermissionOnly: true })) {
19
+ const { package: manifestPackage, application = {} } = config.manifest;
20
+ const { supportsRtl, label, theme, activity, metaData = [], activityName, fontProvider } = application;
21
+ const profileable = config.profileable;
22
+ let modified;
23
+ if (!existing) {
24
+ source = (0, util_1.replaceAll)(source.replace(manifestPackage ? '{{package}}' : ' package="{{package}}"', manifestPackage || ''), (name) => {
25
+ switch (name) {
26
+ case 'supportsRtl':
27
+ return supportsRtl === false ? 'false' : 'true';
28
+ case 'label':
29
+ return '@string/' + (label || 'app_name');
30
+ case 'theme':
31
+ return theme ? '@style/' + theme : '';
32
+ case 'activityName':
33
+ return activityName || '';
34
+ case 'profileable':
35
+ return profileable ? 'true' : 'false';
36
+ default:
37
+ return '';
38
+ }
39
+ });
40
+ }
41
+ else if (manifestPackage || theme || activityName || activity || supportsRtl !== undefined) {
42
+ new Parser(new DomHandler((err, dom) => {
43
+ if (err) {
44
+ instance.writeFail(['Unable to parse XML document', "AndroidManifest.xml" /* MANIFEST.FILENAME */], err, 0 /* LOG_TYPE.UNKNOWN */);
45
+ return;
46
+ }
47
+ let target = null;
48
+ if (manifestPackage && (target = domutils.findOne(elem => elem.tagName === 'manifest', dom, true))) {
49
+ target.attribs['package'] = manifestPackage;
50
+ modified = true;
51
+ }
52
+ if (target = domutils.findOne(elem => elem.tagName === 'application', dom, true)) {
53
+ if (label) {
54
+ target.attribs['android:label'] = '@string/' + label;
55
+ modified = true;
56
+ }
57
+ if (theme) {
58
+ target.attribs['android:theme'] = '@style/' + theme;
59
+ modified = true;
60
+ }
61
+ if (supportsRtl !== undefined) {
62
+ target.attribs['android:supportsRtl'] = supportsRtl.toString();
63
+ modified = true;
64
+ }
65
+ if (activityName || activity) {
66
+ const activities = domutils.getElementsByTagName('activity', target, true);
67
+ if (activityName) {
68
+ for (const item of activities) {
69
+ const intentFilter = domutils.findAll(elem => elem.tagName === 'intent-filter', [item]);
70
+ if (intentFilter.length) {
71
+ const action = domutils.findOne(elem => elem.tagName === 'action' && elem.attribs['android:name'] === 'android.intent.action.MAIN', intentFilter);
72
+ if (action) {
73
+ const attribs = item.attribs;
74
+ attribs['android:name'] = activityName;
75
+ attribs['android:exported'] = 'true';
76
+ modified = true;
77
+ break;
78
+ }
79
+ }
80
+ }
81
+ }
82
+ if (activity) {
83
+ for (const name in activity) {
84
+ const { layout: attribs } = activity[name];
85
+ if (attribs) {
86
+ let element = domutils.findOne(elem => elem.attribs['android:name'] === name, activities);
87
+ if (!element) {
88
+ domutils.appendChild(target, element = new domhandler.Element('activity', { 'android:name': name }));
89
+ domutils.append(element, new domhandler.Text('\n'));
90
+ }
91
+ let layout = domutils.findOne(elem => elem.tagName === 'layout', [element]), found = true;
92
+ if (!layout) {
93
+ domutils.appendChild(element, layout = new domhandler.Element('layout', {}));
94
+ domutils.append(layout, new domhandler.Text('\n'));
95
+ found = false;
96
+ }
97
+ for (const attr in attribs) {
98
+ switch (attr) {
99
+ case 'defaultHeight':
100
+ case 'defaultWidth':
101
+ case 'minHeight':
102
+ case 'minWidth':
103
+ case 'gravity': {
104
+ const value = attribs[attr];
105
+ if (!found || layout.attribs['android:' + attr] !== value) {
106
+ layout.attribs['android:' + attr] = value;
107
+ modified = true;
108
+ }
109
+ break;
110
+ }
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+ }
117
+ if (profileable !== undefined) {
118
+ const attribs = profileable ? { 'android:shell': 'true', 'android:enabled': 'true' } : { 'android:enabled': 'false' };
119
+ const element = domutils.findOne(elem => elem.tagName === 'profileable', [target]);
120
+ if (element) {
121
+ Object.assign(element.attribs, attribs);
122
+ }
123
+ else if (profileable) {
124
+ domutils.appendChild(target, new domhandler.Element('profileable', attribs));
125
+ domutils.appendChild(target, new domhandler.Text('\n'));
126
+ }
127
+ modified = true;
128
+ }
129
+ if (modified) {
130
+ source = domserializer.default(dom, { xmlMode: true });
131
+ }
132
+ }
133
+ }), { xmlMode: true, decodeEntities: false }).end(source);
134
+ }
135
+ if (fontProvider) {
136
+ metaData.push({ name: 'preloaded_fonts', resource: '@array/' + fontProvider });
137
+ }
138
+ if ((0, types_1.isArray)(metaData)) {
139
+ new Parser(new DomHandler((err, dom) => {
140
+ if (err) {
141
+ instance.writeFail(['Unable to parse XML document', "AndroidManifest.xml" /* MANIFEST.FILENAME */], err, 0 /* LOG_TYPE.UNKNOWN */);
142
+ return;
143
+ }
144
+ const app = domutils.findOne(elem => elem.tagName === 'application', dom, true);
145
+ if (app) {
146
+ for (const { name, resource, value } of metaData) {
147
+ if (name && (resource || value)) {
148
+ let item = domutils.findOne(elem => elem.tagName === 'meta-data' && elem.attribs['android:name'] === name, app.childNodes);
149
+ if (!item) {
150
+ domutils.appendChild(app, item = new domhandler.Element('meta-data', { 'android:name': name }));
151
+ domutils.append(item, new domhandler.Text('\n'));
152
+ }
153
+ else if (item.attribs['android:resource'] === resource || item.attribs['android:value'] === value) {
154
+ continue;
155
+ }
156
+ if (resource) {
157
+ item.attribs['android:resource'] = resource;
158
+ }
159
+ if (value) {
160
+ item.attribs['android:value'] = value;
161
+ }
162
+ source = domserializer.default(dom, { xmlMode: true });
163
+ modified = true;
164
+ }
165
+ }
166
+ }
167
+ }), { xmlMode: true, decodeEntities: false }).end(source);
168
+ }
169
+ if (modified || !existing) {
170
+ try {
171
+ if (instance.writeFile(localUri, source, { encoding: 'utf-8', ownPermissionOnly: true, throwsPermission: true }) && !existing) {
172
+ this.add(localUri);
173
+ }
174
+ }
175
+ catch (err) {
176
+ this.writeFail(["Unable to write file" /* ERR_MESSAGE.WRITE_FILE */, path.basename(localUri)], err, 8192 /* LOG_TYPE.PERMISSION */);
177
+ }
178
+ }
179
+ }
180
+ }
181
+
182
+ module.exports = finalize;
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const path = require("path");
4
+ const util_1 = require("@e-mc/document/util");
5
+ const types_1 = require("@e-mc/types");
6
+ const Document = require("@e-mc/document");
7
+ function finalize(instance) {
8
+ const config = instance.config;
9
+ const { profileable, dependencies, dataBinding, versionName, versionCode } = config;
10
+ if (!profileable && !dependencies && !dataBinding && !versionName && !versionCode && !config.namespace) {
11
+ return;
12
+ }
13
+ let { localUri, source, existing, kotlin } = instance.findTemplate(path.join(this.baseDirectory, config.mainParentDir), 'build.gradle', { detect: !this.archiving, languageOf: 'gradle' });
14
+ if (localUri && source && instance.canWrite(localUri, { ownPermissionOnly: true })) {
15
+ let { namespace, javaVersion } = config, jvmTarget, modified;
16
+ const upgrade = javaVersion > 0;
17
+ const setModified = (output) => {
18
+ if (output !== source) {
19
+ source = output;
20
+ modified = true;
21
+ }
22
+ };
23
+ if (dependencies) {
24
+ const items = dependencies.map(item => item.split(':'));
25
+ if (!kotlin && items.some(value => value[1].endsWith('-ktx'))) {
26
+ setModified(Document.updateGradle(source, ['plugins'], "id 'kotlin-android'", { multiple: true }));
27
+ }
28
+ const match = /dependencies\s+\{([^}]+)\}/.exec(source);
29
+ if (match) {
30
+ const writeImpl = (item) => 'implementation' + (kotlin ? `("${item.join(':')}")` : ` '${item.join(':')}'`);
31
+ const pattern = kotlin ? /([ \t]*)implementation\((?:\s*"([^"]+)"\s*\))?/g : /([ \t]*)implementation(?:\s*\(?\s*["']([^"']+)["']\s*\)?|\s+((?:\s*(?:group|name|version)\s*:\s*["'][^"']+["']\s*,?){3}))?/g;
32
+ let content = match[1], indent, impl;
33
+ while (impl = pattern.exec(match[1])) {
34
+ let group, name, version;
35
+ if (impl[2]) {
36
+ [group, name, version] = impl[2].trim().split(/\s*:\s*/);
37
+ }
38
+ else if (impl[3]) {
39
+ const method = /(group|name|version)\s*:\s*["']([^"']+)["']/g;
40
+ let param;
41
+ while (param = method.exec(impl[3])) {
42
+ const value = param[2].trim();
43
+ switch (param[1]) {
44
+ case 'group':
45
+ group = value;
46
+ break;
47
+ case 'name':
48
+ name = value;
49
+ break;
50
+ case 'version':
51
+ version = value;
52
+ break;
53
+ }
54
+ }
55
+ }
56
+ if (group && name) {
57
+ let found = 0, index = -1;
58
+ if (version) {
59
+ index = items.findIndex(seg => seg[0] === group && seg[1] === name);
60
+ if (index !== -1) {
61
+ found = 1;
62
+ if (version[0] !== '$' || !kotlin && impl[0].indexOf("'") !== -1) {
63
+ const current = items[index][2].split('.').map(seg => +seg);
64
+ const parts = version.split('.');
65
+ for (let i = 0, value; i < parts.length; ++i) {
66
+ if (isNaN(value = +parts[i]) || +current[i] > value) {
67
+ found = 2;
68
+ break;
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ if (found) {
75
+ if (found === 2) {
76
+ content = content.replace(impl[0].trim(), writeImpl(items[index]));
77
+ modified = true;
78
+ }
79
+ items.splice(index, 1);
80
+ }
81
+ }
82
+ if (impl[1]) {
83
+ indent = impl[1];
84
+ }
85
+ }
86
+ if (items.length) {
87
+ indent || (indent = (0, util_1.getIndent)(source));
88
+ content = items.reduce((a, b) => a + indent + writeImpl(b) + '\n', content);
89
+ modified = true;
90
+ }
91
+ if (modified || !existing) {
92
+ setModified(source.substring(0, match.index) + `dependencies {${content}}` + source.substring(match.index + match[0].length));
93
+ }
94
+ }
95
+ if (items.some(value => value[0] === 'androidx.compose.ui')) {
96
+ let output = source;
97
+ if (kotlin) {
98
+ output = Document.updateGradle(output, ['plugins'], 'kotlin("android")');
99
+ output = Document.updateGradle(output, ['android', 'buildFeatures'], 'compose = true');
100
+ }
101
+ else {
102
+ output = Document.updateGradle(output, ['plugins'], "id 'org.jetbrains.kotlin.android'", { upgrade: true, multiple: true, addendum: `version '${instance.findVersion('org.jetbrains.kotlin:kotlin-stdlib', "1.8.10" /* VERSIONS.KOTLIN_STDLIB */)}'` });
103
+ output = Document.updateGradle(output, ['android', 'buildFeatures'], "compose true");
104
+ output = Document.updateGradle(output, ['android', 'composeOptions'], `kotlinCompilerExtensionVersion '${instance.findVersion('kotlinCompilerExtensionVersion', "1.4.3" /* VERSIONS.KOTLIN_COMPILER */)}'`, true);
105
+ if (upgrade) {
106
+ output = Document.updateGradle(output, ['android', 'kotlinOptions'], `jvmTarget = '${javaVersion}'`, true);
107
+ }
108
+ else {
109
+ output = Document.updateGradle(output, ['android', 'kotlinOptions'], "jvmTarget = '1.8'");
110
+ jvmTarget = '1_8';
111
+ }
112
+ }
113
+ setModified(output);
114
+ }
115
+ }
116
+ if (upgrade || jvmTarget) {
117
+ const compatibility = 'JavaVersion.VERSION_' + (upgrade ? javaVersion.toString().replace(/\./g, '_') : jvmTarget);
118
+ let output = source;
119
+ if (kotlin) {
120
+ output = Document.updateGradle(output, ['java'], 'sourceCompatibility = ' + compatibility, upgrade);
121
+ output = Document.updateGradle(output, ['java'], 'targetCompatibility = ' + compatibility, upgrade);
122
+ output = Document.updateGradle(output, ['android', 'kotlinOptions'], `jvmTarget = "${javaVersion}"`, upgrade);
123
+ }
124
+ else {
125
+ output = Document.updateGradle(output, ['android', 'compileOptions'], 'sourceCompatibility ' + compatibility, upgrade);
126
+ output = Document.updateGradle(output, ['android', 'compileOptions'], 'targetCompatibility ' + compatibility, upgrade);
127
+ }
128
+ setModified(output);
129
+ }
130
+ if (!existing) {
131
+ const targetAPI = instance.targetAPI;
132
+ let output = source;
133
+ if (targetAPI) {
134
+ const values = typeof targetAPI === 'string' ? [`"android-${targetAPI}"`, `"${targetAPI}"`] : [targetAPI, targetAPI];
135
+ const updateOnly = +targetAPI >= 31;
136
+ let revised = Document.updateGradle(output, ['android'], kotlin ? `compileSdkVersion(${values[0]})` : 'compileSdkVersion ' + values[0], { upgrade: true, updateOnly });
137
+ if (revised === output) {
138
+ output = Document.updateGradle(output, ['android'], kotlin ? `compileSdk(${values[0]})` : 'compileSdk ' + values[0], true);
139
+ }
140
+ else {
141
+ output = revised;
142
+ }
143
+ revised = Document.updateGradle(output, ['android', 'defaultConfig'], kotlin ? `targetSdkVersion(${values[1]})` : 'targetSdkVersion ' + values[1], { upgrade: true, updateOnly });
144
+ if (revised === output) {
145
+ output = Document.updateGradle(output, ['android', 'defaultConfig'], kotlin ? `targetSdk(${values[1]})` : 'targetSdk ' + values[1], true);
146
+ }
147
+ else {
148
+ output = revised;
149
+ }
150
+ const version = instance.findVersion('buildToolsVersion');
151
+ if (version) {
152
+ output = Document.updateGradle(output, ['android'], kotlin ? `buildToolsVersion = "${version}"` : `buildToolsVersion "${version}"`, true);
153
+ }
154
+ }
155
+ if (namespace || (namespace = config.manifest?.package)) {
156
+ output = Document.updateGradle(output, ['android', 'defaultConfig'], (kotlin ? 'applicationId = ' : 'applicationId ') + `"${namespace}"`, true);
157
+ }
158
+ setModified(output);
159
+ }
160
+ if (dataBinding) {
161
+ setModified(Document.updateGradle(source, ['android', 'buildFeatures'], kotlin ? 'dataBinding = true' : 'dataBinding true', true));
162
+ }
163
+ if (namespace) {
164
+ setModified(Document.updateGradle(source, ['android'], (kotlin ? 'namespace = ' : 'namespace ') + `"${namespace}"`, true));
165
+ }
166
+ if (profileable) {
167
+ let name, items;
168
+ if (Array.isArray(profileable)) {
169
+ if (profileable.length && !profileable[0].startsWith('--')) {
170
+ name = profileable.shift();
171
+ }
172
+ items = profileable;
173
+ }
174
+ else if (typeof profileable === 'string') {
175
+ if (profileable.startsWith('--')) {
176
+ items = [profileable];
177
+ }
178
+ else {
179
+ name = profileable;
180
+ }
181
+ }
182
+ name || (name = 'debug');
183
+ setModified(Document.updateGradle(source, ['android', 'buildTypes', kotlin ? 'getByName("release")' : 'release'], 'signingConfig ' + (kotlin ? `= signingConfigs.getByName("${name}")` : 'signingConfigs.' + name), true));
184
+ if ((0, types_1.isArray)(items)) {
185
+ const parameters = items.map(value => `"${value}"`).join(', ');
186
+ setModified(Document.updateGradle(source, ['android', 'aaptOptions'], 'additionalParameters ' + (kotlin ? `= [${parameters}]` : parameters), true));
187
+ }
188
+ }
189
+ if (versionName) {
190
+ setModified(Document.updateGradle(source, ['android', 'defaultConfig'], (kotlin ? 'versionName = ' : 'versionName ') + `"${versionName}"`, true));
191
+ }
192
+ if (versionCode) {
193
+ setModified(Document.updateGradle(source, ['android', 'defaultConfig'], (kotlin ? 'versionCode = ' : 'versionCode ') + versionCode, true));
194
+ }
195
+ if (modified || !existing) {
196
+ try {
197
+ if (instance.writeFile(localUri, source, { encoding: 'utf-8', ownPermissionOnly: true, throwsPermission: true }) && !existing) {
198
+ this.add(localUri);
199
+ }
200
+ }
201
+ catch (err) {
202
+ this.writeFail(["Unable to write file" /* ERR_MESSAGE.WRITE_FILE */, path.basename(localUri)], err, 8192 /* LOG_TYPE.PERMISSION */);
203
+ }
204
+ }
205
+ }
206
+ }
207
+
208
+ module.exports = finalize;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const path = require("path");
4
+ const util_1 = require("@e-mc/document/util");
5
+ const parse_1 = require("@e-mc/document/parse");
6
+ function finalize(instance) {
7
+ const { dependencies, projectName, mainParentDir } = instance.config;
8
+ if (!dependencies && !projectName) {
9
+ return;
10
+ }
11
+ let { localUri, source, existing, kotlin } = instance.findTemplate(this.baseDirectory, 'settings.gradle', { detect: !this.archiving, languageOf: 'gradle' });
12
+ if (localUri && source && instance.canWrite(localUri, { ownPermissionOnly: true })) {
13
+ const targetName = projectName ? projectName.replace(/"/g, '\\"') : '';
14
+ let modified;
15
+ if (existing) {
16
+ let match;
17
+ if (dependencies) {
18
+ found: {
19
+ const pattern = kotlin ? /^\s*include\(((?:\s*"[^"]+"\s*,?\s*)+)\)/gm : /^\s*include\s*((?:(?:"[^"]+"|'[^']+')\s*,?\s*)+)/gm;
20
+ while (match = pattern.exec(source)) {
21
+ const namespace = /":?([^"]+)"|':?([^']+)'/g;
22
+ let app;
23
+ while (app = namespace.exec(match[1])) {
24
+ if (app[1] === mainParentDir || app[2] === mainParentDir) {
25
+ break found;
26
+ }
27
+ }
28
+ }
29
+ pattern.lastIndex = 0;
30
+ if (match = pattern.exec(source)) {
31
+ const index = match.index + match[0].length;
32
+ if (kotlin) {
33
+ source = source.substring(0, index - 1).trimEnd() + `, "${mainParentDir}")` + source.substring(index);
34
+ }
35
+ else {
36
+ source = parse_1.XmlWriter.replaceMatch(match, source, `, '${mainParentDir}'`, { trimLeading: true });
37
+ }
38
+ modified = true;
39
+ }
40
+ }
41
+ }
42
+ if (targetName) {
43
+ const value = `rootProject.name = "${targetName}"`;
44
+ if (match = new RegExp('^\\s*rootProject\\.name\\s*=\\s*' + parse_1.XmlWriter.PATTERN_QUOTEVALUE, 'm').exec(source)) {
45
+ source = parse_1.XmlWriter.replaceMatch(match, source, value);
46
+ }
47
+ else {
48
+ source += (0, util_1.getNewline)(source) + value;
49
+ }
50
+ modified = true;
51
+ }
52
+ }
53
+ else {
54
+ source = (0, util_1.replaceAll)(source, (name) => {
55
+ switch (name) {
56
+ case 'projectName':
57
+ return targetName;
58
+ case 'name':
59
+ return ':' + mainParentDir;
60
+ default:
61
+ return '';
62
+ }
63
+ });
64
+ }
65
+ if (modified || !existing) {
66
+ try {
67
+ if (instance.writeFile(localUri, source, { encoding: 'utf-8', ownPermissionOnly: true, throwsPermission: true }) && !existing) {
68
+ this.add(localUri);
69
+ }
70
+ }
71
+ catch (err) {
72
+ this.writeFail(["Unable to write file" /* ERR_MESSAGE.WRITE_FILE */, path.basename(localUri)], err, 8192 /* LOG_TYPE.PERMISSION */);
73
+ }
74
+ }
75
+ }
76
+ }
77
+
78
+ module.exports = finalize;
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const path = require("path");
4
+ const fs = require("fs");
5
+ const child_process = require("child_process");
6
+ const types_1 = require("@e-mc/types");
7
+ const Document = require("@e-mc/document");
8
+ async function finalize(instance) {
9
+ const commands = instance.config.commands;
10
+ if (!commands || this.archiving) {
11
+ return;
12
+ }
13
+ let taskArgs;
14
+ if (typeof commands === 'string') {
15
+ taskArgs = [[commands]];
16
+ }
17
+ else if ((0, types_1.isArray)(commands)) {
18
+ if (commands.every(value => typeof value === 'string')) {
19
+ taskArgs = [commands];
20
+ }
21
+ else {
22
+ taskArgs = commands.map(value => typeof value === 'string' ? [value] : value);
23
+ }
24
+ }
25
+ else {
26
+ return;
27
+ }
28
+ let { broadcastId, baseDirectory } = this, command = instance.settings.extensions?.task?.command, title, name, foundCwd;
29
+ if (command) {
30
+ if (command.indexOf('mvn') !== -1) {
31
+ title = 'maven';
32
+ }
33
+ else {
34
+ title = /([^\\/]+?)(?:\.[a-z]+)?$/i.exec(command)?.[1] || 'SPAWN';
35
+ }
36
+ command = path.normalize(command);
37
+ if (!command.includes(path.sep)) {
38
+ name = command;
39
+ }
40
+ command = Document.sanitizeCmd(command);
41
+ }
42
+ else {
43
+ name = 'gradlew';
44
+ command = '.' + path.sep + name;
45
+ title = 'gradle';
46
+ }
47
+ if (name) {
48
+ try {
49
+ let appDir = baseDirectory;
50
+ while (!(foundCwd = fs.existsSync(path.join(appDir, name)))) {
51
+ const parent = path.dirname(appDir);
52
+ if (parent === appDir) {
53
+ break;
54
+ }
55
+ appDir = parent;
56
+ }
57
+ if (foundCwd) {
58
+ baseDirectory = appDir;
59
+ }
60
+ }
61
+ catch {
62
+ }
63
+ }
64
+ for (const args of taskArgs) {
65
+ if (instance.aborted) {
66
+ return Promise.reject((0, types_1.createAbortError)());
67
+ }
68
+ const startTime = process.hrtime();
69
+ const task = args.join(' ');
70
+ await new Promise((resolve, reject) => {
71
+ this.formatMessage(4 /* LOG_TYPE.PROCESS */, title, ['Executing task...', task], baseDirectory);
72
+ let out = '', message = '';
73
+ const { stdout, stderr } = child_process.spawn(command, Document.sanitizeArgs(args), { cwd: baseDirectory, shell: true, stdio: Document.hasLogType(32768 /* LOG_TYPE.STDOUT */) && !broadcastId ? 'inherit' : undefined, signal: instance.signal })
74
+ .on('exit', code => {
75
+ if (!code) {
76
+ instance.addLog(types_1.STATUS_TYPE.INFO, out);
77
+ this.writeTimeProcess(title, 'Success -> ' + task, startTime);
78
+ resolve();
79
+ }
80
+ else {
81
+ reject((0, types_1.errorValue)(message || (!foundCwd && code === 1 ? "Unable to execute file" /* ERR_MESSAGE.EXECUTE_FILE */ : "Unknown" /* ERR_MESSAGE.UNKNOWN */), "Error code" /* ERR_MESSAGE.ERROR_CODE */ + ': ' + code));
82
+ }
83
+ })
84
+ .on('error', err => reject(err));
85
+ if (stdout) {
86
+ stdout.setEncoding('utf-8').on('data', (value) => {
87
+ if (broadcastId) {
88
+ this.formatMessage(types_1.STATUS_TYPE.INFO, '', value, null, { sessionId: '' });
89
+ }
90
+ out += value;
91
+ });
92
+ }
93
+ if (stderr) {
94
+ stderr.setEncoding('utf-8').on('data', (value) => {
95
+ if (broadcastId) {
96
+ this.formatMessage(types_1.STATUS_TYPE.ERROR, '', value, null, { sessionId: '' });
97
+ }
98
+ message += value;
99
+ });
100
+ }
101
+ })
102
+ .catch(err => instance.writeFail(["Unable to perform task" /* ERR_MESSAGE.PERFORM_TASK */, command + ' ' + task], err, { type: 4 /* LOG_TYPE.PROCESS */, startTime }));
103
+ }
104
+ }
105
+
106
+ module.exports = finalize;
package/index.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import type { IFileManager } from '@e-mc/types/types/lib';
2
+
3
+ import type { AndroidDocumentConstructor, DocumentAsset } from './types';
4
+
5
+ declare const Android: AndroidDocumentConstructor<IFileManager<DocumentAsset>>;
6
+
7
+ export = Android;
package/index.js ADDED
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ const types_1 = require("@e-mc/types");
6
+ const Document = require('@e-mc/document');
7
+ // @ts-ignore
8
+ class AndroidDocument extends Document {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.config = {
12
+ mainParentDir: 'app',
13
+ mainSrcDir: 'src/main',
14
+ mainActivityFile: '',
15
+ javaVersion: 0,
16
+ dataBinding: false,
17
+ projectName: undefined,
18
+ versionName: undefined,
19
+ versionCode: 0,
20
+ manifest: undefined,
21
+ namespace: undefined,
22
+ profileable: undefined,
23
+ dependencies: undefined,
24
+ commands: undefined
25
+ };
26
+ this.elements = [];
27
+ this.extensionData = {};
28
+ this._moduleName = 'android';
29
+ this._threadable = true;
30
+ }
31
+ static async finalize(instance) {
32
+ if (instance.aborted) {
33
+ return Promise.reject((0, types_1.createAbortError)());
34
+ }
35
+ if (instance.extensions.length) {
36
+ const config = instance.config;
37
+ const mainActivityFile = config.mainActivityFile;
38
+ if (mainActivityFile && !path.isAbsolute(mainActivityFile)) {
39
+ let pathname = /[\\/]/.test(mainActivityFile) && path.join(this.baseDirectory, mainActivityFile);
40
+ if (pathname && Document.isPath(pathname)) {
41
+ config.mainActivityFile = pathname;
42
+ }
43
+ else {
44
+ const directories = [this.baseDirectory, config.mainParentDir, config.mainSrcDir];
45
+ do {
46
+ if (Document.isPath(pathname = path.join(...directories.concat(mainActivityFile)))) {
47
+ config.mainActivityFile = pathname;
48
+ break;
49
+ }
50
+ directories.pop();
51
+ } while (directories.length);
52
+ }
53
+ }
54
+ }
55
+ return super.finalize.call(this, instance);
56
+ }
57
+ init(assets, config) {
58
+ if (config) {
59
+ const { targetAPI, mainParentDir, mainSrcDir, mainActivityFile, javaVersion, projectName, versionName, versionCode = 0, manifest, namespace, profileable, dependencies, dataBinding, commands, directories, elements, extensionData } = config;
60
+ const target = this.config;
61
+ if (projectName) {
62
+ target.projectName = projectName;
63
+ }
64
+ if (namespace) {
65
+ target.namespace = namespace;
66
+ }
67
+ if (mainParentDir) {
68
+ target.mainParentDir = mainParentDir;
69
+ }
70
+ if (mainSrcDir) {
71
+ target.mainSrcDir = mainSrcDir;
72
+ }
73
+ if (mainActivityFile) {
74
+ target.mainActivityFile = mainActivityFile;
75
+ }
76
+ if (versionName) {
77
+ target.versionName = versionName;
78
+ }
79
+ if (manifest) {
80
+ target.manifest = manifest;
81
+ }
82
+ if (profileable !== undefined) {
83
+ target.profileable = profileable;
84
+ }
85
+ if (versionCode >= 1) {
86
+ target.versionCode = Math.min(Math.ceil(versionCode), 2100000000);
87
+ }
88
+ if (commands) {
89
+ target.commands = commands;
90
+ }
91
+ if (javaVersion) {
92
+ target.javaVersion = +(typeof javaVersion === 'string' ? javaVersion.toString().replace(/_/g, '.') : javaVersion);
93
+ }
94
+ if (dataBinding) {
95
+ target.dataBinding = true;
96
+ }
97
+ if ((0, types_1.isArray)(dependencies)) {
98
+ target.dependencies = dependencies;
99
+ }
100
+ if (targetAPI) {
101
+ this.targetAPI = targetAPI;
102
+ }
103
+ if ((0, types_1.isPlainObject)(directories)) {
104
+ this.directories = directories;
105
+ }
106
+ if ((0, types_1.isArray)(elements)) {
107
+ this.elements = elements;
108
+ }
109
+ if ((0, types_1.isPlainObject)(extensionData)) {
110
+ this.extensionData = extensionData;
111
+ }
112
+ }
113
+ return super.init(assets, config);
114
+ }
115
+ findVersion(name, fallback) {
116
+ const targetAPI = this.targetAPI;
117
+ if (targetAPI) {
118
+ if (!Array.isArray(name)) {
119
+ name = [name];
120
+ }
121
+ for (let i = 0; i < name.length; i += 2) {
122
+ name.splice(i, 0, name[i] + '-' + targetAPI);
123
+ }
124
+ }
125
+ return super.findVersion(name, fallback);
126
+ }
127
+ async using(data) {
128
+ if (this.aborted) {
129
+ return Promise.reject((0, types_1.createAbortError)());
130
+ }
131
+ const { host, file } = data;
132
+ const localUri = file.localUri;
133
+ switch (file.mimeType) {
134
+ case 'font/unknown':
135
+ switch (await host.findMime(file, true)) {
136
+ case 'font/ttf':
137
+ case 'font/otf':
138
+ return;
139
+ case 'font/woff':
140
+ case 'font/woff2':
141
+ break;
142
+ default:
143
+ host.deleteFile(localUri);
144
+ return;
145
+ }
146
+ case 'font/woff':
147
+ case 'font/woff2': {
148
+ const instance = host.loadModule('compress');
149
+ const buffer = host.getBuffer(file);
150
+ if (instance && buffer) {
151
+ await instance.tryFile(buffer, localUri, { format: 'ttf', etag: file.etag }, (err, result) => {
152
+ if (err) {
153
+ host.deleteFile(localUri);
154
+ host.writeFail("Unable to compress file" /* ERR_MESSAGE.COMPRESS_FILE */, err, 8 /* LOG_TYPE.COMPRESS */);
155
+ }
156
+ else if ((0, types_1.isString)(result)) {
157
+ host.replace(file, result);
158
+ }
159
+ });
160
+ }
161
+ break;
162
+ }
163
+ }
164
+ }
165
+ findTemplate(baseDir, filename, options) {
166
+ let detect, languageOf;
167
+ if (options) {
168
+ ({ detect, languageOf } = options);
169
+ }
170
+ let kotlin, language;
171
+ if (languageOf) {
172
+ kotlin = (language = this.settings.language?.[languageOf]) === 'kotlin';
173
+ const isKts = this.detectKts(baseDir, filename);
174
+ detect = isKts !== null && (kotlin && isKts || !kotlin && !isKts);
175
+ if (kotlin) {
176
+ filename += '.kts';
177
+ }
178
+ }
179
+ const localUri = path.join(baseDir, filename);
180
+ try {
181
+ const existing = detect && fs.existsSync(localUri);
182
+ const paths = language ? [language, filename] : [filename];
183
+ let uri;
184
+ if (!existing && !(uri = this.resolveDir('template', ...paths)) && !fs.existsSync(uri = path.join(__dirname, 'template', ...paths))) {
185
+ throw (0, types_1.errorValue)("File not found" /* ERR_MESSAGE.NOTFOUND_FILE */, uri);
186
+ }
187
+ return { localUri, source: fs.readFileSync(uri || localUri, 'utf-8'), existing, kotlin, language };
188
+ }
189
+ catch (err) {
190
+ this.writeFail(["Unable to read file" /* ERR_MESSAGE.READ_FILE */, path.basename(localUri)], err, 32 /* LOG_TYPE.FILE */);
191
+ }
192
+ return { kotlin, language };
193
+ }
194
+ detectKts(...paths) {
195
+ try {
196
+ const file = path.join(...paths);
197
+ if (fs.existsSync(file)) {
198
+ return false;
199
+ }
200
+ if (fs.existsSync(file + '.kts')) {
201
+ return true;
202
+ }
203
+ }
204
+ catch {
205
+ }
206
+ return null;
207
+ }
208
+ get settings() {
209
+ var _a;
210
+ return (_a = this.module).settings || (_a.settings = {});
211
+ }
212
+ }
213
+
214
+ module.exports = AndroidDocument;
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@pi-r/android",
3
+ "version": "0.0.1",
4
+ "description": "Android document constructor for E-mc.",
5
+ "main": "index.js",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/anpham6/pi-r.git",
12
+ "directory": "src/module/android"
13
+ },
14
+ "keywords": [
15
+ "squared",
16
+ "e-mc",
17
+ "squared-functions"
18
+ ],
19
+ "author": "An Pham <anpham6@gmail.com>",
20
+ "license": "MIT",
21
+ "homepage": "https://github.com/anpham6/pi-r#readme",
22
+ "dependencies": {
23
+ "@e-mc/document": "^0.4.0",
24
+ "@e-mc/types": "^0.4.0",
25
+ "htmlparser2": "^8.0.1"
26
+ }
27
+ }
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="{{package}}">
3
+
4
+ <application
5
+ android:icon="@mipmap/ic_launcher"
6
+ android:label="{{label}}"
7
+ android:supportsRtl="{{supportsRtl}}"
8
+ android:theme="{{theme}}">
9
+ <activity
10
+ android:name="{{activityName}}"
11
+ android:exported="true"
12
+ android:label="{{label}}"
13
+ android:theme="{{theme}}">
14
+ <intent-filter>
15
+ <action android:name="android.intent.action.MAIN" />
16
+
17
+ <category android:name="android.intent.category.LAUNCHER" />
18
+ </intent-filter>
19
+ </activity>
20
+ <profileable android:shell="true" android:enabled="{{profileable}}" />
21
+ </application>
22
+
23
+ </manifest>
@@ -0,0 +1,39 @@
1
+ plugins {
2
+ id 'com.android.application'
3
+ }
4
+
5
+ android {
6
+ namespace ''
7
+ compileSdk 33
8
+
9
+ defaultConfig {
10
+ applicationId ''
11
+ minSdk 19
12
+ targetSdk 33
13
+ versionCode 1
14
+ versionName '1.0'
15
+
16
+ testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
17
+ }
18
+ buildTypes {
19
+ release {
20
+ debuggable false
21
+ minifyEnabled true
22
+ shrinkResources false
23
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
24
+ }
25
+ }
26
+ compileOptions {
27
+ sourceCompatibility JavaVersion.VERSION_1_8
28
+ targetCompatibility JavaVersion.VERSION_1_8
29
+ }
30
+ buildFeatures {
31
+ viewBinding false
32
+ }
33
+ }
34
+
35
+ dependencies {
36
+ testImplementation 'junit:junit:4.13.2'
37
+ androidTestImplementation 'androidx.test.ext:junit:1.1.5'
38
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
39
+ }
@@ -0,0 +1,18 @@
1
+ pluginManagement {
2
+ repositories {
3
+ gradlePluginPortal()
4
+ google()
5
+ mavenCentral()
6
+ }
7
+ }
8
+
9
+ dependencyResolutionManagement {
10
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
11
+ repositories {
12
+ google()
13
+ mavenCentral()
14
+ }
15
+ }
16
+
17
+ rootProject.name = '{{projectName}}'
18
+ include '{{name}}'
@@ -0,0 +1,44 @@
1
+ plugins {
2
+ id 'com.android.application'
3
+ id 'org.jetbrains.kotlin.android'
4
+ }
5
+
6
+ android {
7
+ namespace ''
8
+ compileSdk 33
9
+
10
+ defaultConfig {
11
+ applicationId ''
12
+ minSdk 19
13
+ targetSdk 33
14
+ versionCode 1
15
+ versionName '1.0'
16
+
17
+ testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
18
+ }
19
+ buildTypes {
20
+ release {
21
+ debuggable false
22
+ minifyEnabled true
23
+ shrinkResources false
24
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
25
+ }
26
+ }
27
+ compileOptions {
28
+ sourceCompatibility JavaVersion.VERSION_1_8
29
+ targetCompatibility JavaVersion.VERSION_1_8
30
+ }
31
+ kotlinOptions {
32
+ jvmTarget = '1.8'
33
+ }
34
+ buildFeatures {
35
+ viewBinding false
36
+ }
37
+ }
38
+
39
+ dependencies {
40
+ implementation 'androidx.core:core-ktx:1.9.0'
41
+ testImplementation 'junit:junit:4.13.2'
42
+ androidTestImplementation 'androidx.test.ext:junit:1.1.5'
43
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
44
+ }
@@ -0,0 +1,18 @@
1
+ pluginManagement {
2
+ repositories {
3
+ gradlePluginPortal()
4
+ google()
5
+ mavenCentral()
6
+ }
7
+ }
8
+
9
+ dependencyResolutionManagement {
10
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
11
+ repositories {
12
+ google()
13
+ mavenCentral()
14
+ }
15
+ }
16
+
17
+ rootProject.name = '{{projectName}}'
18
+ include '{{name}}'
@@ -0,0 +1,46 @@
1
+ plugins {
2
+ id("com.android.application")
3
+ kotlin("android")
4
+ }
5
+
6
+ android {
7
+ namespace = ""
8
+ compileSdk(33)
9
+
10
+ defaultConfig {
11
+ applicationId = ""
12
+ minSdk(19)
13
+ targetSdk(33)
14
+ versionCode = 1
15
+ versionName = "1.0"
16
+
17
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18
+ }
19
+ buildTypes {
20
+ getByName("release") {
21
+ isDebuggable = false
22
+ isMinifyEnabled = true
23
+ isShrinkResources = false
24
+ proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
25
+ }
26
+ }
27
+ kotlinOptions {
28
+ jvmTarget = "1.8"
29
+ }
30
+ buildFeatures {
31
+ viewBinding = true
32
+ }
33
+ }
34
+
35
+ java {
36
+ sourceCompatibility = JavaVersion.VERSION_1_8
37
+ targetCompatibility = JavaVersion.VERSION_1_8
38
+ }
39
+
40
+ dependencies {
41
+ implementation("org.jetbrains.kotlin:kotlin-stdlib:1.8.10")
42
+ implementation("androidx.core:core-ktx:1.9.0")
43
+ testImplementation("junit:junit:4.13.2")
44
+ androidTestImplementation("androidx.test.ext:junit:1.1.5")
45
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
46
+ }
@@ -0,0 +1,18 @@
1
+ pluginManagement {
2
+ repositories {
3
+ gradlePluginPortal()
4
+ google()
5
+ mavenCentral()
6
+ }
7
+ }
8
+
9
+ dependencyResolutionManagement {
10
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
11
+ repositories {
12
+ google()
13
+ mavenCentral()
14
+ }
15
+ }
16
+
17
+ rootProject.name = "${{projectName}}"
18
+ include("{{name}}")
@@ -0,0 +1,67 @@
1
+ import type { FinalizedElement } from '@e-mc/types/lib/squared';
2
+
3
+ import type { DocumentConstructor, IDocument, IFileManager } from '@e-mc/types/lib';
4
+ import type { ExternalAsset } from '@e-mc/types/lib/asset';
5
+ import type { DocumentDirectory as IDocumentDirectory, DocumentModule as IDocumentModule } from '@e-mc/types/lib/settings';
6
+
7
+ import type { DocumentOutput } from './squared';
8
+
9
+ interface DocumentDirectory extends IDocumentDirectory {
10
+ template?: string;
11
+ }
12
+
13
+ interface AndroidDocumentSettings extends PlainObject {
14
+ extensions?: {
15
+ task?: {
16
+ command?: string;
17
+ };
18
+ };
19
+ language?: {
20
+ gradle?: "java" | "kotlin" | "java+kotlin";
21
+ };
22
+ directory?: DocumentDirectory;
23
+ }
24
+
25
+ type LanguageType = "gradle";
26
+ type DocumentProperties = "targetAPI" | "elements" | "extensionData" | "directories";
27
+
28
+ export interface UserConfig extends Omit<DocumentOutput, DocumentProperties> {
29
+ mainParentDir: string;
30
+ mainSrcDir: string;
31
+ mainActivityFile: string;
32
+ javaVersion: number;
33
+ dataBinding: boolean;
34
+ }
35
+
36
+ export interface DocumentModule extends IDocumentModule {
37
+ settings?: AndroidDocumentSettings;
38
+ }
39
+
40
+ export interface TemplateData {
41
+ localUri?: string;
42
+ source?: string;
43
+ existing?: boolean;
44
+ kotlin?: boolean;
45
+ language?: string;
46
+ }
47
+
48
+ export interface FindTemplateOptions {
49
+ detect?: boolean;
50
+ languageOf?: LanguageType;
51
+ }
52
+
53
+ export interface IAndroidDocument<T extends IFileManager<U>, U extends DocumentAsset = DocumentAsset> extends IDocument<T, U>, Pick<DocumentOutput, DocumentProperties> {
54
+ config: UserConfig;
55
+ elements: FinalizedElement[];
56
+ extensionData: PlainObject;
57
+ findTemplate(baseDir: string, filename: string, options?: FindTemplateOptions): TemplateData;
58
+ detectKts(...paths: string[]): Null<boolean>;
59
+ get settings(): AndroidDocumentSettings;
60
+ }
61
+
62
+ export interface AndroidDocumentConstructor<T extends IFileManager<U>, U extends DocumentAsset = DocumentAsset> extends DocumentConstructor<T, U> {
63
+ readonly prototype: IAndroidDocument<T, U>;
64
+ new(module?: DocumentModule, ...args: unknown[]): IAndroidDocument<T, U>;
65
+ }
66
+
67
+ export type DocumentAsset = ExternalAsset;
@@ -0,0 +1,53 @@
1
+ import type { FinalizedElement, ControllerSettingsDirectoryUI as IControllerSettingsDirectoryUI } from '@e-mc/types/lib/squared';
2
+
3
+ import type { ExternalAsset } from '@e-mc/types/lib/asset';
4
+ import type { RequestData as IRequestData } from '@e-mc/types/lib/node';
5
+
6
+ export interface DocumentOutput {
7
+ targetAPI?: NumString;
8
+ manifest?: ManifestData;
9
+ namespace?: string;
10
+ profileable?: boolean | StringOfArray;
11
+ dependencies?: string[];
12
+ directories?: ControllerSettingsDirectoryUI;
13
+ elements?: FinalizedElement[];
14
+ projectName?: string;
15
+ mainParentDir?: string;
16
+ mainSrcDir?: string;
17
+ mainActivityFile?: string;
18
+ javaVersion?: NumString;
19
+ versionName?: string;
20
+ versionCode?: number;
21
+ dataBinding?: boolean;
22
+ commands?: ArrayOf<StringOfArray>;
23
+ extensionData?: PlainObject;
24
+ }
25
+
26
+ export interface RequestData extends IRequestData<ExternalAsset>, DocumentOutput {}
27
+
28
+ export interface ManifestData {
29
+ package?: string;
30
+ application?: {
31
+ supportsRtl?: boolean;
32
+ label?: string;
33
+ theme?: string;
34
+ metaData?: { name?: string; resource?: string; value?: string }[];
35
+ activity?: ObjectMap<{
36
+ layout?: {
37
+ defaultWidth?: string;
38
+ defaultHeight?: string;
39
+ minWidth?: string;
40
+ minHeight?: string;
41
+ gravity?: string;
42
+ };
43
+ }>;
44
+ activityName?: string;
45
+ fontProvider?: string;
46
+ };
47
+ }
48
+
49
+ export interface ControllerSettingsDirectoryUI extends IControllerSettingsDirectoryUI {
50
+ main: string;
51
+ animation: string;
52
+ theme: string;
53
+ }