@marko/language-tools 2.5.57 → 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 +275 -172
- package/dist/index.mjs +275 -172
- package/marko.internal.d.ts +28 -6
- package/package.json +1 -1
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { type Node, Parsed, type Range, Repeatable, Repeated } from "../../../parser";
|
|
2
|
-
import
|
|
3
|
-
export interface Options {
|
|
4
|
-
parsed: Parsed;
|
|
5
|
-
scriptParser: ScriptParser;
|
|
6
|
-
}
|
|
2
|
+
import { ScriptParser } from "./script-parser";
|
|
7
3
|
export type Scope = ProgramScope | TagScope;
|
|
8
4
|
export interface ProgramScope {
|
|
9
5
|
parent: undefined;
|
|
@@ -54,7 +50,7 @@ type Bindings = {
|
|
|
54
50
|
/**
|
|
55
51
|
* Traverses the Marko tree and analyzes the bindings.
|
|
56
52
|
*/
|
|
57
|
-
export declare function crawlProgramScope(parsed: Parsed,
|
|
53
|
+
export declare function crawlProgramScope(parsed: Parsed, ast: ScriptParser): [Mutation, ...Mutation[]] | [...Mutation[], Mutation] | undefined;
|
|
58
54
|
export declare function getProgramBindings(node: Node.Program): {
|
|
59
55
|
all: Repeated<string>;
|
|
60
56
|
vars: Repeatable<string>;
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import type { types as t } from "@marko/compiler";
|
|
2
|
-
import type { Parsed } from "../../../parser";
|
|
2
|
+
import type { Node, Parsed } from "../../../parser";
|
|
3
3
|
export declare class ScriptParser {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(parsed: Parsed);
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
tagName(name: Node.OpenTagName): t.Expression[] | undefined;
|
|
7
|
+
tagShorthandId(shorthandId: Node.ShorthandId): t.Expression[] | undefined;
|
|
8
|
+
tagShorthandClassName(node: Node.ShorthandClassName): t.Expression[] | undefined;
|
|
9
|
+
tagVar(node: Node.TagVar): t.VariableDeclarator["id"] | undefined;
|
|
10
|
+
tagParams(node: Node.TagParams): t.FunctionParameter[] | undefined;
|
|
11
|
+
tagTypeParams(node: Node.TagTypeParams): t.TSTypeParameterDeclaration | undefined;
|
|
12
|
+
tagArgs(node: Node.TagArgs): t.CallExpression["arguments"] | undefined;
|
|
13
|
+
tagTypeArgs(node: Node.TagTypeArgs): t.TSTypeParameterInstantiation | undefined;
|
|
14
|
+
attrValue(node: Node.AttrValue): t.Expression | undefined;
|
|
15
|
+
attrSpread(node: Node.AttrSpread): t.Expression | undefined;
|
|
16
|
+
attrMethod(node: Node.AttrMethod): t.ObjectMethod | undefined;
|
|
17
|
+
attrArgs(node: Node.AttrArgs): t.Expression | undefined;
|
|
18
|
+
placeholder(node: Node.Placeholder): t.Expression | undefined;
|
|
19
|
+
scriptBody(node: Node.ParentTag): t.Statement[] | undefined;
|
|
20
|
+
scriptlet(node: Node.Scriptlet): t.Statement[] | undefined;
|
|
21
|
+
import(node: Node.Import): t.ImportDeclaration | undefined;
|
|
22
|
+
export(node: Node.Export): t.ExportDeclaration | undefined;
|
|
23
|
+
class(node: Node.Class): t.ClassExpression | undefined;
|
|
24
|
+
static(node: Node.Static): t.Statement[] | undefined;
|
|
8
25
|
}
|