@marko/language-tools 2.5.57 → 2.5.59
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/html/index.d.ts +2 -2
- package/dist/extractors/script/index.d.ts +1 -1
- package/dist/extractors/script/util/attach-scopes.d.ts +3 -7
- package/dist/extractors/script/util/get-runtime-api.d.ts +1 -1
- package/dist/extractors/script/util/is-text-only-script.d.ts +1 -1
- package/dist/extractors/script/util/script-parser.d.ts +20 -3
- package/dist/index.js +309 -201
- package/dist/index.mjs +312 -204
- package/dist/util/get-node-at-offset.d.ts +1 -1
- package/marko.internal.d.ts +44 -22
- package/package.json +30 -30
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Parsed } from "../../parser";
|
|
1
|
+
import { type Parsed } from "../../parser";
|
|
2
2
|
export declare function extractHTML(parsed: Parsed): {
|
|
3
|
-
extracted: import("
|
|
3
|
+
extracted: import("../..").Extracted;
|
|
4
4
|
nodeDetails: {
|
|
5
5
|
[id: string]: {
|
|
6
6
|
hasDynamicAttrs: boolean;
|
|
@@ -17,4 +17,4 @@ export interface ExtractScriptOptions {
|
|
|
17
17
|
runtimeTypesCode?: string;
|
|
18
18
|
translator: Meta["config"]["translator"];
|
|
19
19
|
}
|
|
20
|
-
export declare function extractScript(opts: ExtractScriptOptions): import("
|
|
20
|
+
export declare function extractScript(opts: ExtractScriptOptions): import("../..").Extracted;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { type Node, Parsed, type Range, Repeatable, Repeated } from "../../../parser";
|
|
2
|
-
import
|
|
3
|
-
export interface Options {
|
|
4
|
-
parsed: Parsed;
|
|
5
|
-
scriptParser: ScriptParser;
|
|
6
|
-
}
|
|
1
|
+
import { type Node, type Parsed, type Range, type Repeatable, type Repeated } from "../../../parser";
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import type { TaglibLookup } from "@marko/compiler/babel-utils";
|
|
2
|
-
import { Parsed } from "../../../parser";
|
|
2
|
+
import { type Parsed } from "../../../parser";
|
|
3
3
|
export type RuntimeAPI = (typeof RuntimeAPI)[keyof typeof RuntimeAPI];
|
|
4
4
|
export declare const RuntimeAPI: {
|
|
5
5
|
readonly tags: "tags";
|
|
@@ -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
|
}
|