marko 6.0.0-next.3.65 → 6.0.0-next.3.67

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.
@@ -0,0 +1,18 @@
1
+ import { types as t } from "@marko/compiler";
2
+ import type { Opt } from "./optional";
3
+ import { type Binding, type ReferencedBindings } from "./references";
4
+ import { type Section } from "./sections";
5
+ export declare function getDynamicSourcesForBinding(binding: Binding): true | import("./optional").OneMany<Binding> | undefined;
6
+ export declare function getDynamicSourcesForReferences(referencedBindings: ReferencedBindings): true | Binding | import("./optional").Many<Binding> | undefined;
7
+ export declare function getDynamicSourcesForExtra(extra: t.NodeExtra): true | Binding | import("./optional").Many<Binding> | undefined;
8
+ export declare function getDynamicSourcesForExtras(extras: Iterable<t.NodeExtra>): true | Opt<Binding>;
9
+ export declare function getDynamicSourcesForSection(section: Section): {
10
+ referenced: true | Binding | import("./optional").Many<Binding> | undefined;
11
+ closures: true | Binding | import("./optional").Many<Binding> | undefined;
12
+ all: true | Opt<Binding>;
13
+ } | undefined;
14
+ export declare function getDynamicSourcesForSections(sections: (Section | undefined)[]): {
15
+ referenced: true | Binding | import("./optional").Many<Binding> | undefined;
16
+ closures: true | Binding | import("./optional").Many<Binding> | undefined;
17
+ all: true | Opt<Binding>;
18
+ } | undefined;
@@ -8,6 +8,8 @@ export declare class Sorted<T> {
8
8
  add(data: Opt<T>, item: T): OneMany<T>;
9
9
  union(a: Opt<T>, b: Opt<T>): Opt<T>;
10
10
  find(data: Opt<T>, item: T): T | undefined;
11
+ findIndex(data: Opt<T>, item: T): number;
12
+ isSuperset(superset: Opt<T>, subset: Opt<T>): boolean;
11
13
  }
12
14
  export declare function push<T>(data: Opt<T>, item: T): Opt<T>;
13
15
  export declare function concat<T>(a: Opt<T>, b: Opt<T>): Opt<T>;
@@ -13,7 +13,7 @@ export declare enum BindingType {
13
13
  derived = 4,
14
14
  hoist = 5
15
15
  }
16
- export type Binding = {
16
+ export interface Binding {
17
17
  id: number;
18
18
  name: string;
19
19
  type: BindingType;
@@ -21,7 +21,7 @@ export type Binding = {
21
21
  section: Section;
22
22
  closureSections: Opt<Section>;
23
23
  serialize: boolean;
24
- sources: Set<Binding>;
24
+ sources: Opt<Binding>;
25
25
  aliases: Set<Binding>;
26
26
  hoists: Map<Section, Binding>;
27
27
  property: string | undefined;
@@ -34,7 +34,7 @@ export type Binding = {
34
34
  export: string | undefined;
35
35
  declared: boolean;
36
36
  nullable: boolean;
37
- };
37
+ }
38
38
  export type ReferencedBindings = Opt<Binding>;
39
39
  export type Intersection = Many<Binding>;
40
40
  declare module "@marko/compiler/dist/types" {
@@ -57,9 +57,10 @@ export declare function forEachSection(fn: (section: Section) => void): void;
57
57
  export declare function forEachSectionReverse(fn: (section: Section) => void): void;
58
58
  export declare function getNodeContentType(path: t.NodePath<t.Statement>, extraMember: "startType" | "endType", contentInfo?: Section["content"]): ContentType | null;
59
59
  export declare const isSerializedSection: (section: Section) => boolean;
60
- export declare const isStatefulSection: (section: Section) => boolean;
61
- export declare const checkStatefulClosures: (section: Section, immediateOnly: boolean) => boolean;
60
+ export declare function isSectionWithHoists(section: Section): true | undefined;
62
61
  export declare function isImmediateOwner(section: Section, binding: Binding): boolean;
62
+ export declare function isDirectClosure(section: Section, closure: Binding): boolean;
63
63
  export declare function isDynamicClosure(section: Section, closure: Binding): boolean;
64
+ export declare function getDirectClosures(section: Section): import("./optional").Opt<Binding>;
64
65
  export declare function isSameOrChildSection(section: Section, other: Section): boolean;
65
66
  export declare function getCommonSection(section: Section, other: Section): Section;
@@ -33,8 +33,8 @@ export type Signal = {
33
33
  };
34
34
  type closureSignalBuilder = (closure: Binding, render: t.Expression) => t.Expression;
35
35
  export declare function setClosureSignalBuilder(tag: t.NodePath<t.MarkoTag>, builder: closureSignalBuilder): void;
36
- export declare function setForceResumeScope(section: Section): void;
37
- export declare function setSerializedProperty(section: Section, key: string, value: t.Expression): void;
36
+ export declare function serializeSectionIfNeeded(section: Section, reason: undefined | boolean | Opt<Binding>): void;
37
+ export declare function setSerializedProperty(section: Section, key: string, expression: t.Expression, reason: undefined | boolean | Opt<Binding>): void;
38
38
  export declare const getHTMLSectionStatements: (section: Section) => t.Statement[];
39
39
  export declare function getHoistFunctionIdentifier(hoistedBinding: Binding): t.Identifier;
40
40
  export declare function getSignal(section: Section, referencedBindings: ReferencedBindings, name?: string): Signal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.0.0-next.3.65",
3
+ "version": "6.0.0-next.3.67",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",
@@ -48,7 +48,7 @@
48
48
  "build": "node -r ~ts ./scripts/bundle.ts"
49
49
  },
50
50
  "dependencies": {
51
- "@marko/compiler": "^5.39.13",
51
+ "@marko/compiler": "^5.39.14",
52
52
  "csstype": "^3.1.3",
53
53
  "magic-string": "^0.30.17"
54
54
  },
@@ -1,3 +0,0 @@
1
- import { type Binding, type ReferencedBindings } from "./references";
2
- export declare function isStatefulReferences(referencedBindings: ReferencedBindings): boolean;
3
- export declare function isStatefulBinding(binding: Binding): boolean;