@theatrejs/loader-aseprite 1.2.0 → 1.3.0
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/package.json +1 -1
- package/sources/aseprite.loader.js +15 -15
package/package.json
CHANGED
|
@@ -12,24 +12,24 @@ const pngjs = require('pngjs').PNG.sync;
|
|
|
12
12
|
module.exports = function loader() {
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* @typedef {Object}
|
|
16
|
-
* @property {Array<number>}
|
|
17
|
-
* @property {Array<number>}
|
|
15
|
+
* @typedef {Object} TypeColorswap A swap of two colors.
|
|
16
|
+
* @property {Array<number>} TypeColorswap.source The source color to swap from (in rgba).
|
|
17
|
+
* @property {Array<number>} TypeColorswap.target The target color to swap to (in rgba).
|
|
18
18
|
* @private
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* @typedef {Object}
|
|
23
|
-
* @property {string}
|
|
24
|
-
* @property {Object} [
|
|
25
|
-
* @property {('colums' | 'horizontal' | 'packed' | 'rows' | 'vertical')} [
|
|
26
|
-
* @property {boolean} [
|
|
27
|
-
* @property {Object} [
|
|
28
|
-
* @property {Array<
|
|
22
|
+
* @typedef {Object} TypeOptions The options for the loader.
|
|
23
|
+
* @property {string} TypeOptions.aseprite The path to the Aseprite executable.
|
|
24
|
+
* @property {Object} [TypeOptions.prepare] The options for the Aseprite CLI.
|
|
25
|
+
* @property {('colums' | 'horizontal' | 'packed' | 'rows' | 'vertical')} [TypeOptions.prepare.sheet] The output sheet type ('rows' by default).
|
|
26
|
+
* @property {boolean} [TypeOptions.prepare.trim] The 'trim cels' option (false by default).
|
|
27
|
+
* @property {Object} [TypeOptions.processing] The options for processing the output files.
|
|
28
|
+
* @property {Array<TypeColorswap>} [TypeOptions.processing.colorswap] The swaps of colors.
|
|
29
29
|
* @private
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
const context = /** @type {webpack.LoaderContext<
|
|
32
|
+
const context = /** @type {webpack.LoaderContext<TypeOptions>} */(this);
|
|
33
33
|
|
|
34
34
|
const file = context.resourcePath;
|
|
35
35
|
const options = context.getOptions();
|
|
@@ -42,9 +42,9 @@ module.exports = function loader() {
|
|
|
42
42
|
require.resolve('@theatrejs/plugin-aseprite');
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
catch (error) {
|
|
45
|
+
catch ($error) {
|
|
46
46
|
|
|
47
|
-
throw error;
|
|
47
|
+
throw $error;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (typeof aseprite === 'undefined') {
|
|
@@ -139,9 +139,9 @@ module.exports = function loader() {
|
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
catch (error) {
|
|
142
|
+
catch ($error) {
|
|
143
143
|
|
|
144
|
-
throw error;
|
|
144
|
+
throw $error;
|
|
145
145
|
}
|
|
146
146
|
};
|
|
147
147
|
|