@hono-filebased-route/core 0.2.1 → 0.2.3

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Hono File-Based Routing
1
+ # Hono File-Based Routing Core
2
2
 
3
3
  一个基于 Hono 框架的文件路由系统,使用 Turborepo 管理的 monorepo 项目,支持类似 Next.js 的文件路由模式。
4
4
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,13 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
+ declare const METHODS: readonly [
4
+ "GET",
5
+ "POST"
6
+ ];
7
+ export type Method = (typeof METHODS)[number];
8
+ export type ExportedMethods = {
9
+ [key in Method]: boolean;
10
+ };
3
11
  /**
4
12
  * 遍历指定目录并获取所有文件路径
5
13
  * @param dir 要遍历的目录
@@ -13,6 +21,12 @@ export declare function getFiles(dir: string): Promise<string[]>;
13
21
  * @returns 转换后的 Hono 路由路径
14
22
  */
15
23
  export declare function getRoutePath(filePath: string, baseDir: string): string;
16
- export declare function generateRoutesFile(dir?: string, output?: string): Promise<void>;
24
+ /**
25
+ * 从文件中提取导出的 HTTP 方法
26
+ * @param filePath 文件的绝对路径
27
+ * @returns 导出的 HTTP 方法对象
28
+ */
29
+ export declare function getExportedHttpMethods(filePath: string): ExportedMethods;
30
+ export declare function generateRoutesFile(dir?: string, output?: string, write?: boolean): Promise<string>;
17
31
 
18
32
  export {};