@easy-electron/ts-parser 1.0.1-alpha.1 → 1.0.1-alpha.2

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/README.md +16 -0
  2. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,16 @@
1
+ # @easy-electron/ts-parser
2
+
3
+ 基于 TypeScript Compiler API 的 TS 源文件解析器。
4
+
5
+ 为 `@easy-electron/preload` 提供 AST 分析能力,用于扫描 `defineIpc` / `defineEvents` 调用并提取类型信息。
6
+
7
+ **通常不直接使用。** 如果需要解析 TypeScript 文件的结构(import/export、interface、class、function 等),可以:
8
+
9
+ ```typescript
10
+ import { TsParser } from '@easy-electron/ts-parser'
11
+
12
+ const parser = new TsParser()
13
+ const result = parser.parse('./src/example.ts')
14
+ console.log(result.interfaces)
15
+ console.log(result.functions)
16
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-electron/ts-parser",
3
- "version": "1.0.1-alpha.1",
3
+ "version": "1.0.1-alpha.2",
4
4
  "description": "Generic TypeScript file parser based on TypeScript Compiler API.",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",