@hpcc-js/observablehq-compiler 1.1.4 → 1.2.0

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/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type { ohq } from "@hpcc-js/observable-shim";
2
2
  export * from "./compiler";
3
- export { ojs2notebook, omd2notebook, parseOmd, download } from "./util";
3
+ export { ojs2notebook, omd2notebook, download } from "./util";
4
4
  import "../src/index.css";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAEpD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAExE,OAAO,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAEpD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAE9D,OAAO,kBAAkB,CAAC"}
package/types/util.d.ts CHANGED
@@ -19,7 +19,6 @@ interface ParsedOJS {
19
19
  error: any;
20
20
  }
21
21
  export declare function encodeBacktick(str: string): string;
22
- export declare function parseOmd(_: string): ParsedOJS[];
23
22
  export declare function notebook2ojs(_: string): ParsedOJS[];
24
23
  export declare function ojs2notebook(ojs: string): ohq.Notebook;
25
24
  export declare function omd2notebook(omd: string): ohq.Notebook;
@@ -1 +1 @@
1
- {"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,0BAA0B,C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AAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAiBpD,UAAU,GAAG;IACT,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,IAAI;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,OAAO,EAAE,GAAG,EAAE,CAAC;CAClB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,UAAQ,EAAE,SAAS,UAAQ,EAAE,cAAc,UAAQ,EAAE,IAAI,CAAC,EAAE,MAAM,OAYjH;AAGD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,MAAM,gBAEjD;AAED,UAAU,SAAS;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,EAAE,GAAG,CAAC;CACd;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,UAIzC;AAgDD,wBAAgB,YAAY,CAAC,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,CAGnD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,QAAQ,CActD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC,QAAQ,CActD;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,SAAuC,EAAE,YAAY,SAAK,qBAezG;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAK9D"}
@@ -1,4 +1,4 @@
1
1
  export declare const PKG_NAME = "@hpcc-js/observablehq-compiler";
2
- export declare const PKG_VERSION = "1.1.4";
3
- export declare const BUILD_VERSION = "2.104.8";
2
+ export declare const PKG_VERSION = "1.2.0";
3
+ export declare const BUILD_VERSION = "2.104.9";
4
4
  //# sourceMappingURL=__package__.d.ts.map
@@ -1,91 +1,157 @@
1
1
  import { ohq } from "@hpcc-js/observable-shim";
2
2
  import { Writer } from "./writer";
3
- declare function createCell(node: ohq.Node, baseUrl: string): Promise<{
4
- (runtime: ohq.Runtime, main: ohq.Module, inspector?: ohq.InspectorFactory): void;
5
- id: string;
3
+ export declare type InspectorFactoryEx = (name: string | undefined, id: string | number) => Inspector;
4
+ export interface Inspector {
5
+ _node?: HTMLDivElement;
6
+ pending(): any;
7
+ fulfilled(value: any): any;
8
+ rejected(error: any): any;
9
+ }
10
+ declare function createCell(node: ohq.Node, options: CompileOptions): Promise<{
11
+ (runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): void;
12
+ id: string | number;
6
13
  modules: {
7
- (runtime: ohq.Runtime, main: ohq.Module, inspector?: ohq.InspectorFactory): ohq.Module;
14
+ (runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): ohq.Module;
8
15
  importVariables: {
9
16
  (main: ohq.Module, otherModule: ohq.Module): void;
10
- dispose(): void;
17
+ delete(): void;
11
18
  }[];
12
19
  variables: {
13
- (module: ohq.Module, inspector?: ohq.InspectorFactory): ohq.Variable;
14
- dispose(): void;
20
+ (module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
21
+ delete(): void;
15
22
  write(w: Writer): void;
16
23
  }[];
17
- dispose(): void;
24
+ delete(): void;
18
25
  write(w: Writer): void;
19
26
  }[];
20
27
  variables: {
21
- (module: ohq.Module, inspector?: ohq.InspectorFactory): ohq.Variable;
22
- dispose(): void;
28
+ (module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
29
+ delete(): void;
23
30
  write(w: Writer): void;
24
31
  }[];
25
- dispose(): void;
32
+ delete(): void;
26
33
  write(w: Writer): void;
27
34
  }>;
28
35
  export declare type CellFunc = Awaited<ReturnType<typeof createCell>>;
29
- declare function createFile(file: ohq.File, baseUrl: string): [
30
- string,
31
- any
32
- ];
33
- export declare type FileFunc = ReturnType<typeof createFile>;
34
- export declare function compile(notebook: ohq.Notebook, baseUrl?: string): Promise<{
35
- (runtime: ohq.Runtime, inspector?: ohq.InspectorFactory): ohq.Module;
36
+ export interface CompileOptions {
37
+ baseUrl?: string;
38
+ importMode?: "recursive" | "precompiled";
39
+ }
40
+ export declare function notebook(_files?: ohq.File[], _cells?: CellFunc[], { baseUrl, importMode }?: CompileOptions): {
41
+ (runtime: ohq.Runtime, inspector?: InspectorFactoryEx): ohq.Module;
36
42
  fileAttachments: Map<string, any>;
37
- cells: Map<string, {
38
- (runtime: ohq.Runtime, main: ohq.Module, inspector?: ohq.InspectorFactory): void;
39
- id: string;
43
+ cells: Map<string | number, {
44
+ (runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): void;
45
+ id: string | number;
40
46
  modules: {
41
- (runtime: ohq.Runtime, main: ohq.Module, inspector?: ohq.InspectorFactory): ohq.Module;
47
+ (runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): ohq.Module;
42
48
  importVariables: {
43
49
  (main: ohq.Module, otherModule: ohq.Module): void;
44
- dispose(): void;
50
+ delete(): void;
45
51
  }[];
46
52
  variables: {
47
- (module: ohq.Module, inspector?: ohq.InspectorFactory): ohq.Variable;
48
- dispose(): void;
53
+ (module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
54
+ delete(): void;
49
55
  write(w: Writer): void;
50
56
  }[];
51
- dispose(): void;
57
+ delete(): void;
52
58
  write(w: Writer): void;
53
59
  }[];
54
60
  variables: {
55
- (module: ohq.Module, inspector?: ohq.InspectorFactory): ohq.Variable;
56
- dispose(): void;
61
+ (module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
62
+ delete(): void;
57
63
  write(w: Writer): void;
58
64
  }[];
59
- dispose(): void;
65
+ delete(): void;
60
66
  write(w: Writer): void;
61
67
  }>;
62
- appendCell(n: ohq.Node, baseUrl: any): Promise<{
63
- (runtime: ohq.Runtime, main: ohq.Module, inspector?: ohq.InspectorFactory): void;
64
- id: string;
68
+ set(n: ohq.Node): Promise<CellFunc>;
69
+ get(id: string | number): CellFunc;
70
+ delete(id: string | number): boolean;
71
+ clear(): void;
72
+ write(w: Writer): void;
73
+ toString(w?: Writer): string;
74
+ };
75
+ export declare function compile(notebookOrOjs: ohq.Notebook | string, { baseUrl, importMode }?: CompileOptions): Promise<{
76
+ (runtime: ohq.Runtime, inspector?: InspectorFactoryEx): ohq.Module;
77
+ fileAttachments: Map<string, any>;
78
+ cells: Map<string | number, {
79
+ (runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): void;
80
+ id: string | number;
81
+ modules: {
82
+ (runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): ohq.Module;
83
+ importVariables: {
84
+ (main: ohq.Module, otherModule: ohq.Module): void;
85
+ delete(): void;
86
+ }[];
87
+ variables: {
88
+ (module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
89
+ delete(): void;
90
+ write(w: Writer): void;
91
+ }[];
92
+ delete(): void;
93
+ write(w: Writer): void;
94
+ }[];
95
+ variables: {
96
+ (module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
97
+ delete(): void;
98
+ write(w: Writer): void;
99
+ }[];
100
+ delete(): void;
101
+ write(w: Writer): void;
102
+ }>;
103
+ set(n: ohq.Node): Promise<{
104
+ (runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): void;
105
+ id: string | number;
65
106
  modules: {
66
- (runtime: ohq.Runtime, main: ohq.Module, inspector?: ohq.InspectorFactory): ohq.Module;
107
+ (runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): ohq.Module;
67
108
  importVariables: {
68
109
  (main: ohq.Module, otherModule: ohq.Module): void;
69
- dispose(): void;
110
+ delete(): void;
70
111
  }[];
71
112
  variables: {
72
- (module: ohq.Module, inspector?: ohq.InspectorFactory): ohq.Variable;
73
- dispose(): void;
113
+ (module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
114
+ delete(): void;
74
115
  write(w: Writer): void;
75
116
  }[];
76
- dispose(): void;
117
+ delete(): void;
77
118
  write(w: Writer): void;
78
119
  }[];
79
120
  variables: {
80
- (module: ohq.Module, inspector?: ohq.InspectorFactory): ohq.Variable;
81
- dispose(): void;
121
+ (module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
122
+ delete(): void;
82
123
  write(w: Writer): void;
83
124
  }[];
84
- dispose(): void;
125
+ delete(): void;
85
126
  write(w: Writer): void;
86
127
  }>;
87
- disposeCell(id: string): Promise<void>;
88
- dispose(): void;
128
+ get(id: string | number): {
129
+ (runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): void;
130
+ id: string | number;
131
+ modules: {
132
+ (runtime: ohq.Runtime, main: ohq.Module, inspector?: InspectorFactoryEx): ohq.Module;
133
+ importVariables: {
134
+ (main: ohq.Module, otherModule: ohq.Module): void;
135
+ delete(): void;
136
+ }[];
137
+ variables: {
138
+ (module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
139
+ delete(): void;
140
+ write(w: Writer): void;
141
+ }[];
142
+ delete(): void;
143
+ write(w: Writer): void;
144
+ }[];
145
+ variables: {
146
+ (module: ohq.Module, inspector?: InspectorFactoryEx): ohq.Variable;
147
+ delete(): void;
148
+ write(w: Writer): void;
149
+ }[];
150
+ delete(): void;
151
+ write(w: Writer): void;
152
+ };
153
+ delete(id: string | number): boolean;
154
+ clear(): void;
89
155
  write(w: Writer): void;
90
156
  toString(w?: Writer): string;
91
157
  }>;
@@ -1,5 +1,5 @@
1
1
  export { ohq } from "@hpcc-js/observable-shim";
2
2
  export * from "./compiler";
3
- export { ojs2notebook, omd2notebook, parseOmd, download } from "./util";
3
+ export { ojs2notebook, omd2notebook, download } from "./util";
4
4
  import "../src/index.css";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -19,7 +19,6 @@ interface ParsedOJS {
19
19
  error: any;
20
20
  }
21
21
  export declare function encodeBacktick(str: string): string;
22
- export declare function parseOmd(_: string): ParsedOJS[];
23
22
  export declare function notebook2ojs(_: string): ParsedOJS[];
24
23
  export declare function ojs2notebook(ojs: string): ohq.Notebook;
25
24
  export declare function omd2notebook(omd: string): ohq.Notebook;