@tsrx/preact 0.1.28 → 0.1.29

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.js +7 -3
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.1.28",
6
+ "version": "0.1.29",
7
7
  "type": "module",
8
8
  "publishConfig": {
9
9
  "access": "public"
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "esrap": "^2.2.8",
39
39
  "zimmerframe": "^1.1.2",
40
- "@tsrx/core": "0.1.28"
40
+ "@tsrx/core": "0.1.29"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "preact": ">=10"
package/src/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  /** @import * as AST from 'estree' */
2
2
  /** @import { CompileError, ParseOptions } from '@tsrx/core/types' */
3
+ /** @import { NonEmptyString } from '@tsrx/core/types/helpers' */
3
4
  /** @import { CompileOptions } from './transform.js' */
4
5
 
5
6
  import { createVolarMappingsResult, dedupeMappings, parseModule } from '@tsrx/core';
@@ -10,8 +11,9 @@ export { isRefProp } from './ref.js';
10
11
 
11
12
  /**
12
13
  * Parse tsrx-preact source code to an ESTree AST.
14
+ * @template {string} T
13
15
  * @param {string} source
14
- * @param {string} [filename]
16
+ * @param {NonEmptyString<T>} filename
15
17
  * @param {ParseOptions} [options]
16
18
  * @returns {AST.Program}
17
19
  */
@@ -23,8 +25,9 @@ export function parse(source, filename, options) {
23
25
  * Compile tsrx-preact source code to a TSX/JSX module suitable for use with
24
26
  * Preact's automatic jsx runtime (consumed by a downstream JSX transform).
25
27
  *
28
+ * @template {string} T
26
29
  * @param {string} source
27
- * @param {string} [filename]
30
+ * @param {NonEmptyString<T>} filename
28
31
  * @param {CompileOptions & { collect?: boolean, loose?: boolean }} [compile_options]
29
32
  * @returns {{ code: string, map: any, css: string, cssHash: string | null, errors: CompileError[] }}
30
33
  */
@@ -51,8 +54,9 @@ export function compile(source, filename, compile_options) {
51
54
  /**
52
55
  * Compile tsrx-preact source to virtual TSX plus Volar mappings for editor tooling.
53
56
  *
57
+ * @template {string} T
54
58
  * @param {string} source
55
- * @param {string} [filename]
59
+ * @param {NonEmptyString<T>} filename
56
60
  * @param {ParseOptions & CompileOptions} [options]
57
61
  * @returns {import('@tsrx/core/types').VolarMappingsResult}
58
62
  */