@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.
@@ -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("../../util/extractor").Extracted;
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("../../util/extractor").Extracted;
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 type { ScriptParser } from "./script-parser";
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, scriptParser: ScriptParser): [Mutation, ...Mutation[]] | [...Mutation[], Mutation] | undefined;
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,4 +1,4 @@
1
- import { type Node, Repeated } from "../../../parser";
1
+ import { type Node, type Repeated } from "../../../parser";
2
2
  export declare function isTextOnlyScript(tag: Node.ParentTag): tag is Node.Tag & {
3
3
  nameText: "script";
4
4
  args: undefined;
@@ -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
- statementAt<T = t.Statement[]>(startIndex: number, src: string): never[] | (T extends unknown[] ? T : readonly [T]);
7
- expressionAt<T = t.Expression>(startIndex: number, src: string): T | undefined;
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
  }