vite-plugin-html-pages 1.5.0 → 1.5.1

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/dist/page.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ type PageParams = Record<string, string | string[] | undefined>;
2
+
3
+ type PageContext = {
4
+ params: PageParams;
5
+ data?: unknown;
6
+ dev: boolean;
7
+ };
8
+
9
+ declare function definePage<T extends (ctx: PageContext) => any>(
10
+ fn: T,
11
+ ): T;
12
+
13
+ declare function defineStaticParams<
14
+ T extends () => Array<PageParams> | Promise<Array<PageParams>>
15
+ >(fn: T): T;
16
+
17
+ export { type PageContext, type PageParams, definePage, defineStaticParams };
package/dist/page.js ADDED
@@ -0,0 +1,12 @@
1
+ // src/page.ts
2
+ function definePage(fn) {
3
+ return fn;
4
+ }
5
+ function defineStaticParams(fn) {
6
+ return fn;
7
+ }
8
+ export {
9
+ definePage,
10
+ defineStaticParams
11
+ };
12
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/page.ts"],"sourcesContent":["export type PageParams = Record<string, string | string[] | undefined>;\n\nexport type PageContext = {\n params: PageParams;\n data?: unknown;\n dev: boolean;\n};\n\nexport function definePage<T extends (ctx: PageContext) => any>(fn: T): T {\n return fn;\n}\n\nexport function defineStaticParams<\n T extends () => Array<PageParams> | Promise<Array<PageParams>>\n>(fn: T): T {\n return fn;\n}"],"mappings":";AAQO,SAAS,WAAgD,IAAU;AACxE,SAAO;AACT;AAEO,SAAS,mBAEd,IAAU;AACV,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-html-pages",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "author": "Paul Browne",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -38,6 +38,10 @@
38
38
  "types": "./dist/index.d.ts",
39
39
  "import": "./dist/index.js"
40
40
  },
41
+ "./page": {
42
+ "types": "./dist/page.d.ts",
43
+ "import": "./dist/page.js"
44
+ },
41
45
  "./jsx-runtime": {
42
46
  "types": "./dist/jsx-runtime.d.ts",
43
47
  "import": "./dist/jsx-runtime.js"