@marko/language-tools 2.5.56 → 2.5.58
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/extractors/script/util/attach-scopes.d.ts +2 -6
- package/dist/extractors/script/util/script-parser.d.ts +20 -3
- package/dist/index.js +301 -186
- package/dist/index.mjs +301 -186
- package/marko.internal.d.ts +28 -6
- package/package.json +5 -5
package/marko.internal.d.ts
CHANGED
|
@@ -15,7 +15,10 @@ declare global {
|
|
|
15
15
|
* Do not use or you will be fired.
|
|
16
16
|
*/
|
|
17
17
|
namespace _ {
|
|
18
|
-
export const voidReturn
|
|
18
|
+
export const voidReturn = new (class Void {
|
|
19
|
+
readonly [Marko._.scope] = Marko._.never;
|
|
20
|
+
declare return: void;
|
|
21
|
+
})();
|
|
19
22
|
export const scope: unique symbol;
|
|
20
23
|
export const never: never;
|
|
21
24
|
export const any: any;
|
|
@@ -179,6 +182,10 @@ declare global {
|
|
|
179
182
|
fallback: Promise<{ default: Template }>,
|
|
180
183
|
): [0] extends [1 & Tag] ? Template : Tag;
|
|
181
184
|
export function input<Name>(tag: Name): InputFor<Name>;
|
|
185
|
+
export function inputForAttr<
|
|
186
|
+
Name,
|
|
187
|
+
Path extends readonly [string, ...string[]],
|
|
188
|
+
>(tag: Name, ...path: Path): AttrTagValue<InputFor<Name>, Path>;
|
|
182
189
|
export function renderDynamicTag<Name>(tag: Name): DynamicRenderer<Name>;
|
|
183
190
|
|
|
184
191
|
export function returnTag<
|
|
@@ -280,7 +287,8 @@ declare global {
|
|
|
280
287
|
: Value extends readonly (infer Item)[] | Iterable<infer Item>
|
|
281
288
|
? Item
|
|
282
289
|
: never,
|
|
283
|
-
const Return
|
|
290
|
+
const Return extends Partial<Constraint>,
|
|
291
|
+
Constraint = unknown,
|
|
284
292
|
>(
|
|
285
293
|
input: {
|
|
286
294
|
of: Value & (Iterable<unknown> | false | void | null);
|
|
@@ -290,6 +298,7 @@ declare global {
|
|
|
290
298
|
index: number,
|
|
291
299
|
all: Exclude<Value, false | void | null>,
|
|
292
300
|
) => Return,
|
|
301
|
+
constraint?: Constraint,
|
|
293
302
|
): {
|
|
294
303
|
[Key in keyof Return]: Return[Key] extends
|
|
295
304
|
| readonly (infer Item)[]
|
|
@@ -298,11 +307,16 @@ declare global {
|
|
|
298
307
|
: never;
|
|
299
308
|
};
|
|
300
309
|
|
|
301
|
-
export function forInAttrTag<
|
|
310
|
+
export function forInAttrTag<
|
|
311
|
+
Value extends object,
|
|
312
|
+
const Return extends Partial<Constraint>,
|
|
313
|
+
Constraint = unknown,
|
|
314
|
+
>(
|
|
302
315
|
input: {
|
|
303
316
|
in: Value | false | void | null;
|
|
304
317
|
},
|
|
305
318
|
content: (key: keyof Value, value: Value[keyof Value]) => Return,
|
|
319
|
+
constraint?: Constraint,
|
|
306
320
|
): {
|
|
307
321
|
[Key in keyof Return]: Return[Key] extends
|
|
308
322
|
| readonly (infer Item)[]
|
|
@@ -315,7 +329,8 @@ declare global {
|
|
|
315
329
|
To extends number,
|
|
316
330
|
From extends void | number,
|
|
317
331
|
Step extends void | number,
|
|
318
|
-
const Return
|
|
332
|
+
const Return extends Partial<Constraint>,
|
|
333
|
+
Constraint = unknown,
|
|
319
334
|
>(
|
|
320
335
|
input: {
|
|
321
336
|
to: To;
|
|
@@ -323,6 +338,7 @@ declare global {
|
|
|
323
338
|
step?: Step;
|
|
324
339
|
},
|
|
325
340
|
content: (index: number) => Return,
|
|
341
|
+
constraint?: Constraint,
|
|
326
342
|
): {
|
|
327
343
|
[Key in keyof Return]: Return[Key] extends
|
|
328
344
|
| readonly (infer Item)[]
|
|
@@ -341,7 +357,8 @@ declare global {
|
|
|
341
357
|
Until extends number,
|
|
342
358
|
From extends void | number,
|
|
343
359
|
Step extends void | number,
|
|
344
|
-
const Return
|
|
360
|
+
const Return extends Partial<Constraint>,
|
|
361
|
+
Constraint = unknown,
|
|
345
362
|
>(
|
|
346
363
|
input: {
|
|
347
364
|
until: Until;
|
|
@@ -349,6 +366,7 @@ declare global {
|
|
|
349
366
|
step?: Step;
|
|
350
367
|
},
|
|
351
368
|
content: (index: number) => Return,
|
|
369
|
+
constraint?: Constraint,
|
|
352
370
|
): {
|
|
353
371
|
[Key in keyof Return]: Return[Key] extends
|
|
354
372
|
| readonly (infer Item)[]
|
|
@@ -363,7 +381,10 @@ declare global {
|
|
|
363
381
|
: never;
|
|
364
382
|
};
|
|
365
383
|
|
|
366
|
-
export function forAttrTag<
|
|
384
|
+
export function forAttrTag<
|
|
385
|
+
const Return extends Partial<Constraint>,
|
|
386
|
+
Constraint = unknown,
|
|
387
|
+
>(
|
|
367
388
|
input:
|
|
368
389
|
| {
|
|
369
390
|
of: Iterable<unknown> | false | void | null;
|
|
@@ -382,6 +403,7 @@ declare global {
|
|
|
382
403
|
step?: number;
|
|
383
404
|
},
|
|
384
405
|
content: (...args: unknown[]) => Return,
|
|
406
|
+
constraint?: Constraint,
|
|
385
407
|
): {
|
|
386
408
|
[Key in keyof Return]: Return[Key] extends
|
|
387
409
|
| readonly (infer Item)[]
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/language-tools",
|
|
3
3
|
"description": "Marko Language Tools",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.58",
|
|
5
5
|
"bugs": "https://github.com/marko-js/language-server/issues/new?template=Bug_report.md",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@marko/compiler": "^5.39.
|
|
7
|
+
"@marko/compiler": "^5.39.61",
|
|
8
8
|
"@luxass/strip-json-comments": "^1.4.0",
|
|
9
|
-
"htmljs-parser": "^5.
|
|
9
|
+
"htmljs-parser": "^5.10.2",
|
|
10
10
|
"relative-import-path": "^1.0.0"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/babel__code-frame": "^7.27.0",
|
|
14
|
-
"@typescript/vfs": "^1.6.
|
|
15
|
-
"marko": "^5.38.
|
|
14
|
+
"@typescript/vfs": "^1.6.4",
|
|
15
|
+
"marko": "^5.38.31",
|
|
16
16
|
"mitata": "^1.0.34",
|
|
17
17
|
"tsx": "^4.21.0"
|
|
18
18
|
},
|