@bscotch/gcdata 0.20.1 → 0.21.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/dist/cl2.character.pointers.d.ts +3 -0
- package/dist/cl2.character.pointers.d.ts.map +1 -0
- package/dist/cl2.character.pointers.js +2 -0
- package/dist/cl2.character.pointers.js.map +1 -0
- package/dist/cl2.chat.pointers.d.ts +3 -0
- package/dist/cl2.chat.pointers.d.ts.map +1 -0
- package/dist/cl2.chat.pointers.js +2 -0
- package/dist/cl2.chat.pointers.js.map +1 -0
- package/dist/cl2.comfort.d.ts +3 -3
- package/dist/cl2.comfort.d.ts.map +1 -1
- package/dist/cl2.comfort.js +3 -3
- package/dist/cl2.comfort.js.map +1 -1
- package/dist/cl2.comfort.parse.d.ts +4 -4
- package/dist/cl2.comfort.parse.d.ts.map +1 -1
- package/dist/cl2.comfort.parse.js +32 -180
- package/dist/cl2.comfort.parse.js.map +1 -1
- package/dist/cl2.comfort.pointers.d.ts +2 -2
- package/dist/cl2.comfort.pointers.d.ts.map +1 -1
- package/dist/cl2.comfort.stringify.d.ts +2 -2
- package/dist/cl2.comfort.stringify.d.ts.map +1 -1
- package/dist/cl2.comfort.stringify.js +5 -3
- package/dist/cl2.comfort.stringify.js.map +1 -1
- package/dist/cl2.comfort.types.d.ts +6 -28
- package/dist/cl2.comfort.types.d.ts.map +1 -1
- package/dist/cl2.comfort.types.js +3 -67
- package/dist/cl2.comfort.types.js.map +1 -1
- package/dist/cl2.quest.d.ts +1 -1
- package/dist/cl2.quest.d.ts.map +1 -1
- package/dist/cl2.quest.js +1 -1
- package/dist/cl2.quest.js.map +1 -1
- package/dist/cl2.quest.parse.d.ts +1 -1
- package/dist/cl2.quest.parse.d.ts.map +1 -1
- package/dist/cl2.quest.parse.js +41 -201
- package/dist/cl2.quest.parse.js.map +1 -1
- package/dist/cl2.quest.types.d.ts +15 -25
- package/dist/cl2.quest.types.d.ts.map +1 -1
- package/dist/cl2.quest.types.js +1 -2
- package/dist/cl2.quest.types.js.map +1 -1
- package/dist/cl2.quest.utils.d.ts +0 -2
- package/dist/cl2.quest.utils.d.ts.map +1 -1
- package/dist/cl2.quest.utils.js +0 -14
- package/dist/cl2.quest.utils.js.map +1 -1
- package/dist/cl2.shared.parse.d.ts +38 -0
- package/dist/cl2.shared.parse.d.ts.map +1 -0
- package/dist/cl2.shared.parse.js +223 -0
- package/dist/cl2.shared.parse.js.map +1 -0
- package/dist/cl2.shared.types.d.ts +52 -11
- package/dist/cl2.shared.types.d.ts.map +1 -1
- package/dist/cl2.shared.types.js +25 -1
- package/dist/cl2.shared.types.js.map +1 -1
- package/dist/cl2.storyline.d.ts +1 -1
- package/dist/cl2.storyline.d.ts.map +1 -1
- package/dist/cl2.storyline.js +1 -1
- package/dist/cl2.storyline.js.map +1 -1
- package/dist/cl2.storyline.parse.d.ts.map +1 -1
- package/dist/cl2.storyline.parse.js +18 -177
- package/dist/cl2.storyline.parse.js.map +1 -1
- package/dist/cl2.storyline.stringify.d.ts +1 -1
- package/dist/cl2.storyline.stringify.d.ts.map +1 -1
- package/dist/cl2.storyline.types.d.ts +5 -24
- package/dist/cl2.storyline.types.d.ts.map +1 -1
- package/dist/cl2.storyline.types.js +1 -6
- package/dist/cl2.storyline.types.js.map +1 -1
- package/dist/cl2.types.auto.d.ts +10635 -10434
- package/dist/cl2.types.auto.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/types.editor.d.ts +10 -0
- package/dist/types.editor.d.ts.map +1 -1
- package/dist/util.d.ts +2 -2
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +3 -0
- package/dist/util.js.map +1 -1
- package/package.json +1 -1
- package/dist/cl2.storyline.utils.d.ts +0 -1
- package/dist/cl2.storyline.utils.d.ts.map +0 -1
- package/dist/cl2.storyline.utils.js +0 -2
- package/dist/cl2.storyline.utils.js.map +0 -1
- package/dist/cl2.types.editor.d.ts +0 -33
- package/dist/cl2.types.editor.d.ts.map +0 -1
- package/dist/cl2.types.editor.js +0 -2
- package/dist/cl2.types.editor.js.map +0 -1
- package/dist/cl3.storyline.d.ts +0 -4
- package/dist/cl3.storyline.d.ts.map +0 -1
- package/dist/cl3.storyline.js +0 -4
- package/dist/cl3.storyline.js.map +0 -1
- package/dist/cl3.storyline.parse.d.ts +0 -7
- package/dist/cl3.storyline.parse.d.ts.map +0 -1
- package/dist/cl3.storyline.parse.js +0 -257
- package/dist/cl3.storyline.parse.js.map +0 -1
- package/dist/cl3.storyline.pointers.d.ts +0 -3
- package/dist/cl3.storyline.pointers.d.ts.map +0 -1
- package/dist/cl3.storyline.pointers.js +0 -2
- package/dist/cl3.storyline.pointers.js.map +0 -1
- package/dist/cl3.storyline.stringify.d.ts +0 -4
- package/dist/cl3.storyline.stringify.d.ts.map +0 -1
- package/dist/cl3.storyline.stringify.js +0 -23
- package/dist/cl3.storyline.stringify.js.map +0 -1
- package/dist/cl3.storyline.types.d.ts +0 -36
- package/dist/cl3.storyline.types.d.ts.map +0 -1
- package/dist/cl3.storyline.types.js +0 -87
- package/dist/cl3.storyline.types.js.map +0 -1
- package/dist/dict.d.ts +0 -3
- package/dist/dict.d.ts.map +0 -1
- package/dist/dict.js +0 -49777
- package/dist/dict.js.map +0 -1
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { assert } from './assert.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { bsArrayToArray, createBsArrayKey, updateBsArrayOrder, } from './helpers.js';
|
|
6
|
-
import { checkWords, includes } from './util.js';
|
|
2
|
+
import { isCommentLine, isStageLine, prepareParserHelpers, updateWipChangesFromParsed, } from './cl2.shared.parse.js';
|
|
3
|
+
import { storylineSchemaId } from './cl2.shared.types.js';
|
|
4
|
+
import { getStorylineSchema, linePatterns, } from './cl2.storyline.types.js';
|
|
7
5
|
export function parseStringifiedStoryline(text, packed, options = {}) {
|
|
8
6
|
const result = {
|
|
9
7
|
diagnostics: [],
|
|
@@ -15,124 +13,25 @@ export function parseStringifiedStoryline(text, packed, options = {}) {
|
|
|
15
13
|
comments: [],
|
|
16
14
|
},
|
|
17
15
|
};
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
'Description',
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const stagingOptions = getStagingOptions(packed.working);
|
|
24
|
-
/** Terms from the glossary for use in autocompletes */
|
|
25
|
-
const glossaryTerms = (packed.glossary?.relevantTerms() || []).map((t) => t.text);
|
|
26
|
-
const checkSpelling = (item) => {
|
|
27
|
-
if (!item || !options.checkSpelling)
|
|
28
|
-
return;
|
|
29
|
-
result.words.push(...checkWords(item, packed.glossary));
|
|
30
|
-
};
|
|
31
|
-
const lines = text.split(/(\r?\n)/g);
|
|
32
|
-
let index = 0;
|
|
33
|
-
let lineNumber = 0;
|
|
34
|
-
for (const line of lines) {
|
|
16
|
+
const helpers = prepareParserHelpers(text, packed, {
|
|
17
|
+
...options,
|
|
18
|
+
globalLabels: new Set(['Name', 'Description', 'Stage']),
|
|
19
|
+
}, result);
|
|
20
|
+
for (const line of helpers.lines) {
|
|
35
21
|
const trace = [];
|
|
36
22
|
try {
|
|
37
|
-
// Is this just a newline?
|
|
38
|
-
if (line.match(/\r?\n/)) {
|
|
39
|
-
// Then we just need to increment the index
|
|
40
|
-
index += line.length;
|
|
41
|
-
lineNumber++;
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
const lineRange = {
|
|
45
|
-
start: {
|
|
46
|
-
index,
|
|
47
|
-
line: lineNumber,
|
|
48
|
-
character: 0,
|
|
49
|
-
},
|
|
50
|
-
end: {
|
|
51
|
-
index: index + line.length,
|
|
52
|
-
line: lineNumber,
|
|
53
|
-
character: line.length,
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
// Is this just a blank line?
|
|
57
23
|
if (!line) {
|
|
58
|
-
// Add global autocompletes
|
|
59
|
-
result.completions.push({
|
|
60
|
-
type: 'labels',
|
|
61
|
-
start: lineRange.start,
|
|
62
|
-
end: lineRange.end,
|
|
63
|
-
options: availableGlobalLabels,
|
|
64
|
-
});
|
|
65
24
|
continue;
|
|
66
25
|
}
|
|
26
|
+
const lineRange = helpers.currentLineRange;
|
|
67
27
|
// Find the first matching pattern and pull the values from it.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
parsedLine = parseIfMatch(pattern, line, lineRange.start);
|
|
71
|
-
if (parsedLine)
|
|
72
|
-
break;
|
|
73
|
-
}
|
|
74
|
-
if (!parsedLine) {
|
|
75
|
-
// Then this is likely the result of uncommenting something
|
|
76
|
-
// that was commented out, resulting in a line that starts with
|
|
77
|
-
// the comment's array tag. Provide a deletion edit!
|
|
78
|
-
parsedLine = parseIfMatch(`^${arrayTagPattern} +(?<text>.*)$`, line, lineRange.start);
|
|
79
|
-
if (parsedLine) {
|
|
80
|
-
result.edits.push({
|
|
81
|
-
start: lineRange.start,
|
|
82
|
-
end: lineRange.end,
|
|
83
|
-
newText: parsedLine.text.value,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
result.diagnostics.push({
|
|
88
|
-
message: `Unfamiliar syntax: ${line}`,
|
|
89
|
-
...lineRange,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
index += line.length;
|
|
28
|
+
const parsedLine = helpers.parseCurrentLine(linePatterns);
|
|
29
|
+
if (!parsedLine)
|
|
93
30
|
continue;
|
|
94
|
-
}
|
|
95
|
-
// Ensure the array tag. It goes right after the label or indicator.
|
|
96
|
-
if (!parsedLine.arrayTag?.value && lineIsArrayItem(line)) {
|
|
97
|
-
const arrayTag = createBsArrayKey();
|
|
98
|
-
const start = parsedLine.indicator?.end || parsedLine.label?.end;
|
|
99
|
-
result.edits.push({
|
|
100
|
-
start,
|
|
101
|
-
end: start,
|
|
102
|
-
newText: `#${arrayTag}`,
|
|
103
|
-
});
|
|
104
|
-
parsedLine.arrayTag = {
|
|
105
|
-
start,
|
|
106
|
-
end: start,
|
|
107
|
-
value: arrayTag,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
// If this has a label, remove it from the list of available labels
|
|
111
|
-
if (parsedLine.label?.value &&
|
|
112
|
-
availableGlobalLabels.has(parsedLine.label.value)) {
|
|
113
|
-
availableGlobalLabels.delete(parsedLine.label.value);
|
|
114
|
-
}
|
|
115
|
-
// If this has a text section, provide glossary autocompletes
|
|
116
|
-
if ('text' in parsedLine) {
|
|
117
|
-
const start = parsedLine.text.start;
|
|
118
|
-
const end = parsedLine.text.end;
|
|
119
|
-
result.completions.push({
|
|
120
|
-
type: 'glossary',
|
|
121
|
-
start,
|
|
122
|
-
end,
|
|
123
|
-
options: glossaryTerms,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
31
|
// Work through each line type to add diagnostics and completions
|
|
127
32
|
const labelLower = parsedLine.label?.value?.toLowerCase();
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
// Then this is a comment/note
|
|
131
|
-
result.parsed.comments.push({
|
|
132
|
-
id: parsedLine.arrayTag?.value?.trim(),
|
|
133
|
-
text: parsedLine.text?.value?.trim(),
|
|
134
|
-
});
|
|
135
|
-
checkSpelling(parsedLine.text);
|
|
33
|
+
if (isCommentLine(parsedLine)) {
|
|
34
|
+
helpers.addComment(parsedLine);
|
|
136
35
|
}
|
|
137
36
|
else if (labelLower === 'name') {
|
|
138
37
|
result.parsed.name = parsedLine.text?.value?.trim();
|
|
@@ -145,26 +44,10 @@ export function parseStringifiedStoryline(text, packed, options = {}) {
|
|
|
145
44
|
}
|
|
146
45
|
else if (labelLower === 'description') {
|
|
147
46
|
result.parsed.description = parsedLine.text?.value?.trim();
|
|
148
|
-
checkSpelling(parsedLine.text);
|
|
47
|
+
helpers.checkSpelling(parsedLine.text);
|
|
149
48
|
}
|
|
150
|
-
else if (
|
|
151
|
-
|
|
152
|
-
if (includes(stagingOptions, stage)) {
|
|
153
|
-
result.parsed.stage = stage;
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
result.diagnostics.push({
|
|
157
|
-
message: `Stage must be one of: ${stagingOptions.join(', ')}`,
|
|
158
|
-
...lineRange,
|
|
159
|
-
});
|
|
160
|
-
// Provide autocomplete options
|
|
161
|
-
result.completions.push({
|
|
162
|
-
type: 'stages',
|
|
163
|
-
options: stagingOptions,
|
|
164
|
-
start: parsedLine.labelGroup.end,
|
|
165
|
-
end: lineRange.end,
|
|
166
|
-
});
|
|
167
|
-
}
|
|
49
|
+
else if (isStageLine(parsedLine)) {
|
|
50
|
+
helpers.addStage(parsedLine);
|
|
168
51
|
}
|
|
169
52
|
else {
|
|
170
53
|
// Then we're in an error state on this line!
|
|
@@ -180,7 +63,7 @@ export function parseStringifiedStoryline(text, packed, options = {}) {
|
|
|
180
63
|
}
|
|
181
64
|
throw err;
|
|
182
65
|
}
|
|
183
|
-
index += line.length;
|
|
66
|
+
helpers.index += line.length;
|
|
184
67
|
}
|
|
185
68
|
return result;
|
|
186
69
|
}
|
|
@@ -192,8 +75,6 @@ export async function updateChangesFromParsedStoryline(parsed, moteId, packed) {
|
|
|
192
75
|
// We're always going to be computing ALL changes, so clear whatever
|
|
193
76
|
// we previously had.
|
|
194
77
|
packed.clearMoteChanges(moteId);
|
|
195
|
-
const storylineMoteBase = getStorylineMote(packed.base, moteId);
|
|
196
|
-
const storylineMoteWorking = getStorylineMote(packed.working, moteId);
|
|
197
78
|
const schema = getStorylineSchema(packed.working);
|
|
198
79
|
assert(schema, `${storylineSchemaId} schema not found in working copy`);
|
|
199
80
|
assert(schema.name, 'Quest mote must have a name pointer');
|
|
@@ -202,47 +83,7 @@ export async function updateChangesFromParsedStoryline(parsed, moteId, packed) {
|
|
|
202
83
|
};
|
|
203
84
|
updateMote('data/name/text', parsed.name);
|
|
204
85
|
updateMote('data/description/text', parsed.description);
|
|
205
|
-
|
|
206
|
-
updateMote('data/wip/staging', parsed.stage);
|
|
207
|
-
}
|
|
208
|
-
else if (storylineMoteWorking?.data.wip) {
|
|
209
|
-
updateMote('data/wip/staging', null);
|
|
210
|
-
}
|
|
211
|
-
const parsedComments = parsed.comments.filter((c) => !!c.text);
|
|
212
|
-
//#region COMMENTS
|
|
213
|
-
// Add/Update COMMENTS
|
|
214
|
-
trace(`Updating comments`);
|
|
215
|
-
for (const comment of parsedComments) {
|
|
216
|
-
trace(`Updating comment ${comment.id} with text "${comment.text}"`);
|
|
217
|
-
updateMote(`data/wip/notes/${comment.id}/element/text`, comment.text);
|
|
218
|
-
}
|
|
219
|
-
// Remove deleted comments
|
|
220
|
-
for (const existingComment of bsArrayToArray(storylineMoteBase?.data.wip?.notes || {})) {
|
|
221
|
-
if (!parsedComments.find((c) => c.id === existingComment.id)) {
|
|
222
|
-
trace(`Deleting comment ${existingComment.id}`);
|
|
223
|
-
updateMote(`data/wip/notes/${existingComment.id}`, null);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
// Get the BASE order of the comments (if any) and use those
|
|
227
|
-
// as the starting point for an up to date order.
|
|
228
|
-
const comments = parsedComments.map((c) => {
|
|
229
|
-
// Look up the base comment
|
|
230
|
-
let comment = storylineMoteBase?.data.wip?.notes?.[c.id];
|
|
231
|
-
if (!comment) {
|
|
232
|
-
comment = storylineMoteWorking?.data.wip?.notes?.[c.id];
|
|
233
|
-
// @ts-expect-error - order is a required field, but it'll be re-added
|
|
234
|
-
delete comment?.order;
|
|
235
|
-
}
|
|
236
|
-
assert(comment, `Comment ${c.id} not found in base or working mote`);
|
|
237
|
-
return { ...comment, id: c.id };
|
|
238
|
-
});
|
|
239
|
-
trace('Updating comment order');
|
|
240
|
-
updateBsArrayOrder(comments);
|
|
241
|
-
comments.forEach((comment) => {
|
|
242
|
-
trace(`Updating comment ${comment.id} order to ${comment.order}`);
|
|
243
|
-
updateMote(`data/wip/notes/${comment.id}/order`, comment.order);
|
|
244
|
-
});
|
|
245
|
-
//#endregion
|
|
86
|
+
updateWipChangesFromParsed(parsed, moteId, packed, trace);
|
|
246
87
|
trace(`Writing changes`);
|
|
247
88
|
await packed.writeChanges();
|
|
248
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cl2.storyline.parse.js","sourceRoot":"","sources":["../src/cl2.storyline.parse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"cl2.storyline.parse.js","sourceRoot":"","sources":["../src/cl2.storyline.parse.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EACL,kBAAkB,EAClB,YAAY,GAEb,MAAM,0BAA0B,CAAC;AAElC,MAAM,UAAU,yBAAyB,CACvC,IAAY,EACZ,MAAmB,EACnB,UAEI,EAAE;IAEN,MAAM,MAAM,GAA0B;QACpC,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,WAAW,EAAE,EAAE;QACf,KAAK,EAAE,EAAE;QACT,MAAM,EAAE;YACN,QAAQ,EAAE,EAAE;SACb;KACF,CAAC;IAEF,MAAM,OAAO,GAAG,oBAAoB,CAClC,IAAI,EACJ,MAAM,EACN;QACE,GAAG,OAAO;QACV,YAAY,EAAE,IAAI,GAAG,CAAS,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;KAChE,EACD,MAAM,CACP,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QACjC,MAAM,KAAK,GAAU,EAAE,CAAC;QACxB,IAAI,CAAC;YACH,IAAI,CAAC,IAAI,EAAE,CAAC;gBACV,SAAS;YACX,CAAC;Y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AC9B,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC1B,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;YACzB,GAAG,CAAC,KAAK,GAAG,UAAU,CAAC;QACzB,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
import { StorylineMote } from './cl2.shared.types.js';
|
|
1
2
|
import type { GameChanger } from './GameChanger.js';
|
|
2
|
-
import { type StorylineMote } from './cl2.storyline.types.js';
|
|
3
3
|
export declare function stringifyStoryline(mote: StorylineMote, packed: GameChanger): string;
|
|
4
4
|
//# sourceMappingURL=cl2.storyline.stringify.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cl2.storyline.stringify.d.ts","sourceRoot":"","sources":["../src/cl2.storyline.stringify.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"cl2.storyline.stringify.d.ts","sourceRoot":"","sources":["../src/cl2.storyline.stringify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,WAAW,GAClB,MAAM,CA2BR"}
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
import type { Gcdata } from './GameChanger.js';
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export type StorylineData = Crashlands2.Schemas['cl2_storyline'];
|
|
8
|
-
export type StorylineMote = Mote<StorylineData>;
|
|
9
|
-
type CompletionsData = {
|
|
10
|
-
type: 'glossary';
|
|
11
|
-
options: string[];
|
|
12
|
-
} | {
|
|
13
|
-
type: 'stages';
|
|
14
|
-
options: string[];
|
|
15
|
-
} | {
|
|
16
|
-
type: 'labels';
|
|
17
|
-
options: Set<string>;
|
|
18
|
-
};
|
|
19
|
-
export interface StorylineUpdateResult extends ParserResult {
|
|
20
|
-
parsed: ParsedBase & {
|
|
21
|
-
description?: string;
|
|
22
|
-
};
|
|
23
|
-
completions: (Range & CompletionsData)[];
|
|
2
|
+
import { ParserResult, StorylineMote } from './cl2.shared.types.js';
|
|
3
|
+
import type { BschemaRoot } from './types.js';
|
|
4
|
+
export interface StorylineUpdateResult extends ParserResult<{
|
|
5
|
+
description?: string;
|
|
6
|
+
}> {
|
|
24
7
|
}
|
|
25
8
|
export declare function listStorylines(gcData: Gcdata): StorylineMote[];
|
|
26
9
|
export declare function isStorylineMote(mote: any): mote is StorylineMote;
|
|
27
10
|
export declare function getStorylineMote(gcData: Gcdata, moteId: string): StorylineMote | undefined;
|
|
28
|
-
export declare function getStorylineMotes(gcData: Gcdata): StorylineMote[];
|
|
29
11
|
export declare function getStorylineSchema(gcData: Gcdata): BschemaRoot | undefined;
|
|
30
12
|
export declare const linePatterns: string[];
|
|
31
|
-
export {};
|
|
32
13
|
//# sourceMappingURL=cl2.storyline.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cl2.storyline.types.d.ts","sourceRoot":"","sources":["../src/cl2.storyline.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"cl2.storyline.types.d.ts","sourceRoot":"","sources":["../src/cl2.storyline.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAEL,YAAY,EAEZ,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,qBACf,SAAQ,YAAY,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;CAAG;AAEP,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,EAAE,CAE9D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,IAAI,aAAa,CAEhE;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,aAAa,GAAG,SAAS,CAI3B;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAE1E;AAED,eAAO,MAAM,YAAY,UAKxB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { assert } from './assert.js';
|
|
2
|
-
import { arrayTagPattern } from './cl2.shared.types.js';
|
|
3
|
-
export const storylineSchemaId = 'cl2_storyline';
|
|
2
|
+
import { arrayTagPattern, storylineSchemaId, } from './cl2.shared.types.js';
|
|
4
3
|
export function listStorylines(gcData) {
|
|
5
4
|
return gcData.listMotesBySchema(storylineSchemaId);
|
|
6
5
|
}
|
|
@@ -12,10 +11,6 @@ export function getStorylineMote(gcData, moteId) {
|
|
|
12
11
|
assert(!mote || isStorylineMote(mote), `Mote ${moteId} is not a storyline`);
|
|
13
12
|
return mote;
|
|
14
13
|
}
|
|
15
|
-
export function getStorylineMotes(gcData) {
|
|
16
|
-
const motes = gcData.listMotesBySchema(storylineSchemaId);
|
|
17
|
-
return motes;
|
|
18
|
-
}
|
|
19
14
|
export function getStorylineSchema(gcData) {
|
|
20
15
|
return gcData.getSchema(storylineSchemaId);
|
|
21
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cl2.storyline.types.js","sourceRoot":"","sources":["../src/cl2.storyline.types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"cl2.storyline.types.js","sourceRoot":"","sources":["../src/cl2.storyline.types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EACL,eAAe,EAIf,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAQ/B,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,MAAM,CAAC,iBAAiB,CAAgB,iBAAiB,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,IAAS;IACvC,OAAO,IAAI,CAAC,SAAS,KAAK,iBAAiB,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,MAAc;IAEd,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,CAAgB,MAAM,CAAC,CAAC;IACnD,MAAM,CAAC,CAAC,IAAI,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,QAAQ,MAAM,qBAAqB,CAAC,CAAC;IAC5E,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,MAAc;IAC/C,OAAO,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAgB,CAAC;AAC5D,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,iBAAiB;IACjB,4EAA4E;IAC5E,mBAAmB;IACnB,yBAAyB,eAAe,wBAAwB;CACjE,CAAC"}
|