@mdsvex/render 1.0.0-next.2 → 1.0.0-next.4

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/scope.d.ts CHANGED
@@ -9,7 +9,31 @@ export interface ComponentImport {
9
9
  readonly specifier: string;
10
10
  /** generated local binding, internal and never api */
11
11
  readonly local: string;
12
+ /** a directive whose component renders at build time when a shell is given */
13
+ readonly static?: boolean;
12
14
  }
15
+ /**
16
+ * a static directive rendered once, its html with a hole where each snippet
17
+ * goes, html has one more entry than holes, braces escaped and comments gone
18
+ */
19
+ export interface Shell {
20
+ readonly html: readonly string[];
21
+ readonly holes: readonly ('label' | 'children')[];
22
+ /**
23
+ * import statements a document that uses the shell adds, the styles of
24
+ * the component and the files its html names, left out for none
25
+ */
26
+ readonly imports?: readonly string[];
27
+ }
28
+ /** the shells a render may use, by shell_key */
29
+ export interface ShellTable {
30
+ get(key: string): Shell | undefined;
31
+ }
32
+ /**
33
+ * the key of the shell for one use of a static directive, the component,
34
+ * its args and which snippets it is given, the same for every use alike
35
+ */
36
+ export declare function shell_key(specifier: string, name: string, args: Readonly<Record<string, string>> | undefined, label: boolean, children: boolean): string;
13
37
  /** an element component_mode all keeps because a component can not take its directive */
14
38
  export interface ReplaceWarning {
15
39
  readonly tag: string;
@@ -23,11 +47,19 @@ export interface ComponentSource {
23
47
  specifier: string;
24
48
  /** the export names of the module */
25
49
  names: string[];
50
+ /**
51
+ * the names among names whose component renders at build time, only for
52
+ * directives, left out for none, a renderer with no shell for one renders
53
+ * it live
54
+ */
55
+ static?: readonly string[];
26
56
  }
27
57
  export declare class ComponentScope {
28
58
  readonly parent: ComponentScope | null;
29
59
  /** names added here and in every parent */
30
60
  readonly size: number;
61
+ /** true when this scope or a parent serves a directive statically */
62
+ readonly has_static: boolean;
31
63
  private readonly own;
32
64
  private readonly locals;
33
65
  /**
@@ -39,6 +71,8 @@ export declare class ComponentScope {
39
71
  get(name: string): ComponentImport | undefined;
40
72
  private local_for;
41
73
  }
74
+ /** an import that only runs the module at specifier */
75
+ export declare function side_effect_import(specifier: string): string;
42
76
  /** a default import, a template the document is wrapped in */
43
77
  export interface DefaultImport {
44
78
  readonly specifier: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdsvex/render",
3
- "version": "1.0.0-next.2",
3
+ "version": "1.0.0-next.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pngwn/MDsveX.git",
@@ -52,7 +52,7 @@
52
52
  }
53
53
  },
54
54
  "dependencies": {
55
- "@mdsvex/parse": "1.0.0-next.2"
55
+ "@mdsvex/parse": "1.0.0-next.3"
56
56
  },
57
57
  "author": "pngwn <hello@pngwn.io>",
58
58
  "license": "MIT",