@tsrx/preact 0.0.20 → 0.0.22
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/package.json +2 -2
- package/src/index.js +2 -1
- package/types/index.d.ts +3 -16
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Preact compiler built on @tsrx/core",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Dominic Gannaway",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.22",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"esrap": "^2.1.0",
|
|
32
32
|
"zimmerframe": "^1.1.2",
|
|
33
|
-
"@tsrx/core": "0.0.
|
|
33
|
+
"@tsrx/core": "0.0.27"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"preact": ">=10"
|
package/src/index.js
CHANGED
|
@@ -25,7 +25,7 @@ export function parse(source, filename, options) {
|
|
|
25
25
|
* @param {string} source
|
|
26
26
|
* @param {string} [filename]
|
|
27
27
|
* @param {CompileOptions & { collect?: boolean, loose?: boolean }} [compile_options]
|
|
28
|
-
* @returns {{ code: string, map: any, css:
|
|
28
|
+
* @returns {{ code: string, map: any, css: string, cssHash: string | null, errors: CompileError[] }}
|
|
29
29
|
*/
|
|
30
30
|
export function compile(source, filename, compile_options) {
|
|
31
31
|
const errors = /** @type {CompileError[]} */ ([]);
|
|
@@ -69,6 +69,7 @@ export function compile_to_volar_mappings(source, filename, options) {
|
|
|
69
69
|
...options,
|
|
70
70
|
collect: true,
|
|
71
71
|
loose: !!options?.loose,
|
|
72
|
+
typeOnly: true,
|
|
72
73
|
errors,
|
|
73
74
|
comments,
|
|
74
75
|
});
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Program } from 'estree';
|
|
2
|
-
import type {
|
|
2
|
+
import type { BaseCompileOptions, CompileFn, ParseOptions, VolarCompileFn } from '@tsrx/core/types';
|
|
3
3
|
|
|
4
4
|
export interface CompileOptions {
|
|
5
5
|
suspenseSource?: string;
|
|
@@ -9,19 +9,6 @@ export const DEFAULT_SUSPENSE_SOURCE: string;
|
|
|
9
9
|
|
|
10
10
|
export function parse(source: string, filename?: string, options?: ParseOptions): Program;
|
|
11
11
|
|
|
12
|
-
export
|
|
13
|
-
source: string,
|
|
14
|
-
filename?: string,
|
|
15
|
-
compile_options?: CompileOptions & { collect?: boolean; loose?: boolean },
|
|
16
|
-
): {
|
|
17
|
-
code: string;
|
|
18
|
-
map: unknown;
|
|
19
|
-
css: { code: string; hash: string } | null;
|
|
20
|
-
errors: CompileError[];
|
|
21
|
-
};
|
|
12
|
+
export const compile: CompileFn<CompileOptions & BaseCompileOptions>;
|
|
22
13
|
|
|
23
|
-
export
|
|
24
|
-
source: string,
|
|
25
|
-
filename?: string,
|
|
26
|
-
options?: ParseOptions & CompileOptions,
|
|
27
|
-
): VolarMappingsResult;
|
|
14
|
+
export const compile_to_volar_mappings: VolarCompileFn<ParseOptions & CompileOptions>;
|