@qwik.dev/router 2.0.0-alpha.9 → 2.0.0-beta.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.
- package/README.md +1 -1
- package/lib/adapters/azure-swa/vite/index.cjs +3 -3
- package/lib/adapters/azure-swa/vite/index.d.ts +13 -13
- package/lib/adapters/bun-server/vite/index.cjs +3 -3
- package/lib/adapters/bun-server/vite/index.d.ts +14 -14
- package/lib/adapters/cloud-run/vite/index.cjs +3 -3
- package/lib/adapters/cloud-run/vite/index.d.ts +13 -13
- package/lib/adapters/cloudflare-pages/vite/index.cjs +3 -3
- package/lib/adapters/cloudflare-pages/vite/index.d.ts +27 -27
- package/lib/adapters/deno-server/vite/index.cjs +3 -3
- package/lib/adapters/deno-server/vite/index.d.ts +14 -14
- package/lib/adapters/netlify-edge/vite/index.cjs +3 -3
- package/lib/adapters/netlify-edge/vite/index.d.ts +44 -44
- package/lib/adapters/node-server/vite/index.cjs +3 -3
- package/lib/adapters/node-server/vite/index.d.ts +14 -14
- package/lib/adapters/shared/vite/index.cjs +10 -3
- package/lib/adapters/shared/vite/index.d.ts +114 -114
- package/lib/adapters/shared/vite/index.mjs +7 -0
- package/lib/adapters/static/vite/index.cjs +10 -3
- package/lib/adapters/static/vite/index.d.ts +10 -10
- package/lib/adapters/static/vite/index.mjs +7 -0
- package/lib/adapters/vercel-edge/vite/index.cjs +3 -3
- package/lib/adapters/vercel-edge/vite/index.d.ts +45 -45
- package/lib/index.d.ts +878 -810
- package/lib/index.qwik.cjs +110 -48
- package/lib/index.qwik.mjs +112 -50
- package/lib/middleware/aws-lambda/index.d.ts +48 -48
- package/lib/middleware/azure-swa/index.d.ts +28 -28
- package/lib/middleware/bun/index.d.ts +35 -35
- package/lib/middleware/cloudflare-pages/index.d.ts +35 -35
- package/lib/middleware/deno/index.d.ts +47 -47
- package/lib/middleware/firebase/index.d.ts +26 -26
- package/lib/middleware/netlify-edge/index.d.ts +27 -27
- package/lib/middleware/node/index.cjs +3 -3
- package/lib/middleware/node/index.d.ts +64 -64
- package/lib/middleware/request-handler/index.cjs +142 -73
- package/lib/middleware/request-handler/index.d.ts +710 -676
- package/lib/middleware/request-handler/index.mjs +138 -70
- package/lib/middleware/vercel-edge/index.d.ts +26 -26
- package/lib/service-worker.cjs +13 -263
- package/lib/service-worker.d.ts +15 -4
- package/lib/service-worker.mjs +13 -263
- package/lib/static/index.cjs +3 -3
- package/lib/static/index.d.ts +96 -96
- package/lib/static/node.cjs +3 -3
- package/lib/vite/index.cjs +209 -261
- package/lib/vite/index.d.ts +154 -154
- package/lib/vite/index.mjs +207 -259
- package/package.json +7 -7
package/lib/vite/index.d.ts
CHANGED
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
import type { BuiltinsWithOptionalParams } from 'svgo/plugins/plugins-types';
|
|
2
|
-
import type { CompileOptions } from '@mdx-js/mdx';
|
|
3
|
-
import type { Config } from 'svgo';
|
|
4
|
-
import { ConfigEnv } from 'vite';
|
|
5
|
-
import type { Plugin as Plugin_2 } from 'vite';
|
|
6
|
-
import type { PluginOption } from 'vite';
|
|
7
|
-
import { UserConfigExport } from 'vite';
|
|
8
|
-
|
|
9
|
-
declare interface BuildEntry extends ParsedPathname {
|
|
10
|
-
id: string;
|
|
11
|
-
chunkFileName: string;
|
|
12
|
-
filePath: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
declare interface BuildLayout {
|
|
16
|
-
filePath: string;
|
|
17
|
-
dirPath: string;
|
|
18
|
-
id: string;
|
|
19
|
-
layoutType: 'top' | 'nested';
|
|
20
|
-
layoutName: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
declare interface BuildRoute extends ParsedPathname {
|
|
24
|
-
/** Unique id built from its relative file system path */
|
|
25
|
-
id: string;
|
|
26
|
-
/** Local file system path */
|
|
27
|
-
filePath: string;
|
|
28
|
-
ext: string;
|
|
29
|
-
/** URL Pathname */
|
|
30
|
-
pathname: string;
|
|
31
|
-
layouts: BuildLayout[];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** @public */
|
|
35
|
-
export declare function extendConfig(baseConfigExport: UserConfigExport, serverConfigExport: UserConfigExport): (env: ConfigEnv) => Promise<Record<string, any>>;
|
|
36
|
-
|
|
37
|
-
/** @public */
|
|
38
|
-
declare interface ImageOptimizationOptions {
|
|
39
|
-
jsxDirectives?: {
|
|
40
|
-
quality?: `${number}`;
|
|
41
|
-
format?: 'webp' | 'avif' | 'png';
|
|
42
|
-
w?: string;
|
|
43
|
-
h?: string;
|
|
44
|
-
[key: string]: string | undefined;
|
|
45
|
-
};
|
|
46
|
-
svgo?: Pick<Config, 'floatPrecision' | 'multipass' | 'plugins'> & {
|
|
47
|
-
defaultPresetOverrides?: BuiltinsWithOptionalParams['preset-default']['overrides'];
|
|
48
|
-
prefixIds?: BuiltinsWithOptionalParams['prefixIds'] | false;
|
|
49
|
-
};
|
|
50
|
-
enabled?: boolean | 'only-production';
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/** @public */
|
|
54
|
-
export declare type MdxOptions = CompileOptions;
|
|
55
|
-
|
|
56
|
-
declare interface MdxPlugins {
|
|
57
|
-
remarkGfm: boolean;
|
|
58
|
-
rehypeSyntaxHighlight: boolean;
|
|
59
|
-
rehypeAutolinkHeadings: boolean;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
declare type P<T> = Plugin_2<T> & {
|
|
63
|
-
api: T;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
declare interface ParsedPathname {
|
|
67
|
-
routeName: string;
|
|
68
|
-
pattern: RegExp;
|
|
69
|
-
paramNames: string[];
|
|
70
|
-
segments: PathnameSegment[];
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
declare type PathnameSegment = PathnameSegmentPart[];
|
|
74
|
-
|
|
75
|
-
declare interface PathnameSegmentPart {
|
|
76
|
-
content: string;
|
|
77
|
-
dynamic: boolean;
|
|
78
|
-
rest: boolean;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** @public */
|
|
82
|
-
declare interface PluginOptions {
|
|
83
|
-
/** Directory of the `routes`. Defaults to `src/routes`. */
|
|
84
|
-
routesDir?: string;
|
|
85
|
-
/** Directory of the `server plugins`. Defaults to `src/server-plugins`. */
|
|
86
|
-
serverPluginsDir?: string;
|
|
87
|
-
/**
|
|
88
|
-
* The base pathname is used to create absolute URL paths up to the `hostname`, and must always
|
|
89
|
-
* start and end with a `/`. Defaults to `/`.
|
|
90
|
-
*/
|
|
91
|
-
basePathname?: string;
|
|
92
|
-
/**
|
|
93
|
-
* Ensure a trailing slash ends page urls. Defaults to `true`. (Note: Previous versions defaulted
|
|
94
|
-
* to `false`).
|
|
95
|
-
*/
|
|
96
|
-
trailingSlash?: boolean;
|
|
97
|
-
/** Enable or disable MDX plugins included by default in qwik-router. */
|
|
98
|
-
mdxPlugins?: MdxPlugins;
|
|
99
|
-
/** MDX Options https://mdxjs.com/ */
|
|
100
|
-
mdx?: any;
|
|
101
|
-
/** The platform object which can be used to mock the Cloudflare bindings. */
|
|
102
|
-
platform?: Record<string, unknown>;
|
|
103
|
-
/** Configuration to rewrite url paths */
|
|
104
|
-
rewriteRoutes?: RewriteRouteOption[];
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* @deprecated Use `qwikRouter` instead. Will be removed in V3
|
|
109
|
-
* @public
|
|
110
|
-
*/
|
|
111
|
-
export declare function qwikCity(userOpts?: QwikCityVitePluginOptions): PluginOption[];
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* @deprecated Use `QwikRouterPlugin` instead. Will be removed in V3
|
|
115
|
-
* @public
|
|
116
|
-
*/
|
|
117
|
-
export declare type QwikCityPlugin = QwikRouterPlugin;
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* @deprecated Use `QwikRouterVitePluginOptions` instead. Will be removed in V3
|
|
121
|
-
* @public
|
|
122
|
-
*/
|
|
123
|
-
export declare type QwikCityVitePluginOptions = QwikRouterVitePluginOptions;
|
|
124
|
-
|
|
125
|
-
/** @public */
|
|
126
|
-
export declare function qwikRouter(userOpts?: QwikRouterVitePluginOptions): PluginOption[];
|
|
127
|
-
|
|
128
|
-
/** @public */
|
|
129
|
-
export declare interface QwikRouterPlugin extends P<QwikRouterPluginApi> {
|
|
130
|
-
name: 'vite-plugin-qwik-router';
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/** @public */
|
|
134
|
-
declare interface QwikRouterPluginApi {
|
|
135
|
-
getBasePathname: () => string;
|
|
136
|
-
getRoutes: () => BuildRoute[];
|
|
137
|
-
getServiceWorkers: () => BuildEntry[];
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/** @public */
|
|
141
|
-
export declare interface QwikRouterVitePluginOptions extends Omit<PluginOptions, 'basePathname'> {
|
|
142
|
-
mdxPlugins?: MdxPlugins;
|
|
143
|
-
mdx?: MdxOptions;
|
|
144
|
-
platform?: Record<string, unknown>;
|
|
145
|
-
imageOptimization?: ImageOptimizationOptions;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
/** @public */
|
|
149
|
-
declare interface RewriteRouteOption {
|
|
150
|
-
prefix?: string;
|
|
151
|
-
paths: Record<string, string>;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export { }
|
|
1
|
+
import type { BuiltinsWithOptionalParams } from 'svgo/plugins/plugins-types';
|
|
2
|
+
import type { CompileOptions } from '@mdx-js/mdx';
|
|
3
|
+
import type { Config } from 'svgo';
|
|
4
|
+
import { ConfigEnv } from 'vite';
|
|
5
|
+
import type { Plugin as Plugin_2 } from 'vite';
|
|
6
|
+
import type { PluginOption } from 'vite';
|
|
7
|
+
import { UserConfigExport } from 'vite';
|
|
8
|
+
|
|
9
|
+
declare interface BuildEntry extends ParsedPathname {
|
|
10
|
+
id: string;
|
|
11
|
+
chunkFileName: string;
|
|
12
|
+
filePath: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare interface BuildLayout {
|
|
16
|
+
filePath: string;
|
|
17
|
+
dirPath: string;
|
|
18
|
+
id: string;
|
|
19
|
+
layoutType: 'top' | 'nested';
|
|
20
|
+
layoutName: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare interface BuildRoute extends ParsedPathname {
|
|
24
|
+
/** Unique id built from its relative file system path */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Local file system path */
|
|
27
|
+
filePath: string;
|
|
28
|
+
ext: string;
|
|
29
|
+
/** URL Pathname */
|
|
30
|
+
pathname: string;
|
|
31
|
+
layouts: BuildLayout[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** @public */
|
|
35
|
+
export declare function extendConfig(baseConfigExport: UserConfigExport, serverConfigExport: UserConfigExport): (env: ConfigEnv) => Promise<Record<string, any>>;
|
|
36
|
+
|
|
37
|
+
/** @public */
|
|
38
|
+
declare interface ImageOptimizationOptions {
|
|
39
|
+
jsxDirectives?: {
|
|
40
|
+
quality?: `${number}`;
|
|
41
|
+
format?: 'webp' | 'avif' | 'png';
|
|
42
|
+
w?: string;
|
|
43
|
+
h?: string;
|
|
44
|
+
[key: string]: string | undefined;
|
|
45
|
+
};
|
|
46
|
+
svgo?: Pick<Config, 'floatPrecision' | 'multipass' | 'plugins'> & {
|
|
47
|
+
defaultPresetOverrides?: BuiltinsWithOptionalParams['preset-default']['overrides'];
|
|
48
|
+
prefixIds?: BuiltinsWithOptionalParams['prefixIds'] | false;
|
|
49
|
+
};
|
|
50
|
+
enabled?: boolean | 'only-production';
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/** @public */
|
|
54
|
+
export declare type MdxOptions = CompileOptions;
|
|
55
|
+
|
|
56
|
+
declare interface MdxPlugins {
|
|
57
|
+
remarkGfm: boolean;
|
|
58
|
+
rehypeSyntaxHighlight: boolean;
|
|
59
|
+
rehypeAutolinkHeadings: boolean;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare type P<T> = Plugin_2<T> & {
|
|
63
|
+
api: T;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
declare interface ParsedPathname {
|
|
67
|
+
routeName: string;
|
|
68
|
+
pattern: RegExp;
|
|
69
|
+
paramNames: string[];
|
|
70
|
+
segments: PathnameSegment[];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
declare type PathnameSegment = PathnameSegmentPart[];
|
|
74
|
+
|
|
75
|
+
declare interface PathnameSegmentPart {
|
|
76
|
+
content: string;
|
|
77
|
+
dynamic: boolean;
|
|
78
|
+
rest: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** @public */
|
|
82
|
+
declare interface PluginOptions {
|
|
83
|
+
/** Directory of the `routes`. Defaults to `src/routes`. */
|
|
84
|
+
routesDir?: string;
|
|
85
|
+
/** Directory of the `server plugins`. Defaults to `src/server-plugins`. */
|
|
86
|
+
serverPluginsDir?: string;
|
|
87
|
+
/**
|
|
88
|
+
* The base pathname is used to create absolute URL paths up to the `hostname`, and must always
|
|
89
|
+
* start and end with a `/`. Defaults to `/`.
|
|
90
|
+
*/
|
|
91
|
+
basePathname?: string;
|
|
92
|
+
/**
|
|
93
|
+
* Ensure a trailing slash ends page urls. Defaults to `true`. (Note: Previous versions defaulted
|
|
94
|
+
* to `false`).
|
|
95
|
+
*/
|
|
96
|
+
trailingSlash?: boolean;
|
|
97
|
+
/** Enable or disable MDX plugins included by default in qwik-router. */
|
|
98
|
+
mdxPlugins?: MdxPlugins;
|
|
99
|
+
/** MDX Options https://mdxjs.com/ */
|
|
100
|
+
mdx?: any;
|
|
101
|
+
/** The platform object which can be used to mock the Cloudflare bindings. */
|
|
102
|
+
platform?: Record<string, unknown>;
|
|
103
|
+
/** Configuration to rewrite url paths */
|
|
104
|
+
rewriteRoutes?: RewriteRouteOption[];
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated Use `qwikRouter` instead. Will be removed in V3
|
|
109
|
+
* @public
|
|
110
|
+
*/
|
|
111
|
+
export declare function qwikCity(userOpts?: QwikCityVitePluginOptions): PluginOption[];
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @deprecated Use `QwikRouterPlugin` instead. Will be removed in V3
|
|
115
|
+
* @public
|
|
116
|
+
*/
|
|
117
|
+
export declare type QwikCityPlugin = QwikRouterPlugin;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @deprecated Use `QwikRouterVitePluginOptions` instead. Will be removed in V3
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
123
|
+
export declare type QwikCityVitePluginOptions = QwikRouterVitePluginOptions;
|
|
124
|
+
|
|
125
|
+
/** @public */
|
|
126
|
+
export declare function qwikRouter(userOpts?: QwikRouterVitePluginOptions): PluginOption[];
|
|
127
|
+
|
|
128
|
+
/** @public */
|
|
129
|
+
export declare interface QwikRouterPlugin extends P<QwikRouterPluginApi> {
|
|
130
|
+
name: 'vite-plugin-qwik-router';
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** @public */
|
|
134
|
+
declare interface QwikRouterPluginApi {
|
|
135
|
+
getBasePathname: () => string;
|
|
136
|
+
getRoutes: () => BuildRoute[];
|
|
137
|
+
getServiceWorkers: () => BuildEntry[];
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** @public */
|
|
141
|
+
export declare interface QwikRouterVitePluginOptions extends Omit<PluginOptions, 'basePathname'> {
|
|
142
|
+
mdxPlugins?: MdxPlugins;
|
|
143
|
+
mdx?: MdxOptions;
|
|
144
|
+
platform?: Record<string, unknown>;
|
|
145
|
+
imageOptimization?: ImageOptimizationOptions;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** @public */
|
|
149
|
+
declare interface RewriteRouteOption {
|
|
150
|
+
prefix?: string;
|
|
151
|
+
paths: Record<string, string>;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export { }
|