extwee 2.2.4 → 2.2.6

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.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Read a JSON file and return its contents.
3
+ * @param {string} path Path to the JSON file.
4
+ * @returns {object} Parsed JSON object.
5
+ * @throws {Error} If the file does not exist.
6
+ * @throws {Error} If the file is not a valid JSON file.
7
+ * @example
8
+ * const contents = reader('test/Config/files/valid.json');
9
+ * console.log(contents); // {"story-format": 'Harlowe', "story-title": "My Story"}
10
+ */
11
+ export function reader(path: string): object;
@@ -68,12 +68,12 @@ export default class Passage {
68
68
  * @param {object} m - Replacement object
69
69
  * @throws {Error} Metadata must be an object literal!
70
70
  */
71
- set metadata(m: any);
71
+ set metadata(m: object);
72
72
  /**
73
73
  * Metadata
74
74
  * @returns {object} Metadata
75
75
  */
76
- get metadata(): any;
76
+ get metadata(): object;
77
77
  /**
78
78
  * @param {string} t - Replacement text
79
79
  * @throws {Error} Text should be a String!
package/types/Story.d.ts CHANGED
@@ -50,12 +50,12 @@ export class Story {
50
50
  /**
51
51
  * @param {object} a - Replacement tag colors
52
52
  */
53
- set tagColors(a: any);
53
+ set tagColors(a: object);
54
54
  /**
55
55
  * Tag Colors object (each property is a tag and its color)
56
56
  * @returns {object} tag colors array
57
57
  */
58
- get tagColors(): any;
58
+ get tagColors(): object;
59
59
  /**
60
60
  * @param {string} i - Replacement IFID.
61
61
  */
@@ -86,12 +86,12 @@ export class Story {
86
86
  /**
87
87
  * @param {object} o - Replacement metadata
88
88
  */
89
- set metadata(o: any);
89
+ set metadata(o: object);
90
90
  /**
91
91
  * Metadata of Story.
92
92
  * @returns {object} metadata of story
93
93
  */
94
- get metadata(): any;
94
+ get metadata(): object;
95
95
  /**
96
96
  * @param {string} f - Replacement format
97
97
  */
@@ -226,5 +226,5 @@ export class Story {
226
226
  #private;
227
227
  }
228
228
  export const creatorName: "extwee";
229
- export const creatorVersion: "2.2.4";
229
+ export const creatorVersion: "2.2.6";
230
230
  import Passage from './Passage.js';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Compiles a {@link StoryFormat} object into a JSONP string for writing to a `format.js` file.
3
+ * @see {@link https://github.com/iftechfoundation/twine-specs/blob/master/twine-2-storyformats-spec.md Twine 2 Story Formats Specification}
4
+ * @param {StoryFormat} storyFormat Story format object to compile.
5
+ * @returns {string} JSONP string.
6
+ */
7
+ export function compile(storyFormat: StoryFormat): string;
8
+ import StoryFormat from '../StoryFormat.js';
@@ -30,6 +30,7 @@
30
30
  * sf.source = 'New';
31
31
  */
32
32
  export default class StoryFormat {
33
+ constructor(name?: string, version?: string, description?: string, author?: string, image?: string, url?: string, license?: string, proofing?: boolean, source?: string);
33
34
  /**
34
35
  * @param {string} n - Replacement name.
35
36
  */
@@ -117,5 +118,11 @@ export default class StoryFormat {
117
118
  * @returns {string} - A string representation of the story format.
118
119
  */
119
120
  toString(): string;
121
+ /**
122
+ * Produces a JSON representation of the story format object.
123
+ * @method toJSON
124
+ * @returns {object} - A JSON representation of the story format.
125
+ */
126
+ toJSON(): object;
120
127
  #private;
121
128
  }
package/build/extwee DELETED
Binary file
package/build/extwee.exe DELETED
Binary file