boltdocs 3.3.5 → 3.4.0
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/{adapters-BKzKe2mO.mjs → adapters-BXiBWAKs.mjs} +1 -1
- package/dist/{adapters-DwDTQoCG.cjs → adapters-Czl3WtQt.cjs} +1 -1
- package/dist/{build-B672n0hL.cjs → build-CNkXRdk8.cjs} +1 -1
- package/dist/{build-BVoMHMhw.mjs → build-CqUBsXVC.mjs} +1 -1
- package/dist/client/index.cjs +245 -56
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +246 -60
- package/dist/client/mdx.cjs +1 -1
- package/dist/client/mdx.js +1 -1
- package/dist/client/primitives.cjs +5 -5
- package/dist/client/primitives.d.cts +92 -42
- package/dist/client/primitives.d.ts +101 -51
- package/dist/client/primitives.js +4 -4
- package/dist/client/router.cjs +1 -1
- package/dist/client/router.d.cts +1 -1
- package/dist/client/router.d.ts +1 -1
- package/dist/client/router.js +1 -1
- package/dist/client/theme/reset.css +41 -0
- package/dist/config-B3SEoVjG.cjs +7 -0
- package/dist/{config-PLvresCv.cjs → config-Bfakeadu.cjs} +1 -1
- package/dist/config-CTcfF-0c.mjs +7 -0
- package/dist/dev-D1DmOSjn.mjs +6 -0
- package/dist/dev-DH6cSge8.cjs +6 -0
- package/dist/{docs-layout-CbZ7LDRe.js → docs-layout-CmntYM6p.js} +46 -147
- package/dist/{docs-layout-vzfXed1Q.cjs → docs-layout-DIgxJ5c7.cjs} +23 -130
- package/dist/{doctor-DMECtdK6.cjs → doctor-BLxm2alc.cjs} +1 -1
- package/dist/{doctor-FuFY1jBz.cjs → doctor-Dd-JMTRo.cjs} +1 -1
- package/dist/{doctor-i8Qmd8DJ.mjs → doctor-DogHujrP.mjs} +1 -1
- package/dist/{image-Hnaa2bJd.cjs → image-Bke2ojW1.cjs} +3 -3
- package/dist/{image-B-NDSDuY.js → image-CaY2w0ua.js} +2 -1
- package/dist/index--xbYbT8N.d.ts +343 -0
- package/dist/{index-Bg-JtZeK.d.cts → index-B_o5y34l.d.cts} +112 -13
- package/dist/{index-B3o307nd.d.ts → index-Bx0CUd7Q.d.ts} +112 -13
- package/dist/index-RK7W_Fxy.d.cts +343 -0
- package/dist/{link-CgdI6O2o.js → link-CSe_oD8Y.js} +137 -139
- package/dist/{link-vZjmD-es.cjs → link-Xb69Oy2F.cjs} +144 -169
- package/dist/{mdx-D0Absdq5.cjs → mdx-BCOrMd-P.cjs} +68 -16
- package/dist/{mdx-BRT71V5Q.js → mdx-BijiEbkp.js} +62 -15
- package/dist/{native-nLA4Jr0T.cjs → native-BbtRkce5.cjs} +1 -1
- package/dist/node/cli-entry.cjs +1 -1
- package/dist/node/cli-entry.mjs +1 -1
- package/dist/node/highlight.d.cts +2 -2
- package/dist/node/highlight.d.mts +2 -2
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +19 -37
- package/dist/node/index.d.mts +20 -38
- package/dist/node/index.mjs +1 -1
- package/dist/node/mdx/shiki-adapter.cjs +1 -1
- package/dist/node/mdx/shiki-adapter.d.cts +7 -2
- package/dist/node/mdx/shiki-adapter.d.mts +7 -2
- package/dist/node/mdx/shiki-adapter.mjs +1 -1
- package/dist/node-BgiLCa0I.cjs +39 -0
- package/dist/node-Da3tYBHo.mjs +39 -0
- package/dist/{package-CNqjEYE1.cjs → package-D1gVs5gQ.cjs} +1 -1
- package/dist/{package-sdcKhDhe.mjs → package-YgQJn3Yh.mjs} +1 -1
- package/dist/pages-external-B_r6gvqP.cjs +6 -0
- package/dist/pages-external-jmK7AHaO.mjs +6 -0
- package/dist/{parser-CD8Oo8qh.mjs → parser-CvNZc5s3.mjs} +1 -1
- package/dist/{parser-vPaKvzLp.cjs → parser-DJLWTiO-.cjs} +1 -1
- package/dist/plugin-DW9K2fW5.mjs +69 -0
- package/dist/plugin-NwGKyTJX.cjs +69 -0
- package/dist/{plugin-context-DuSg-Hax.mjs → plugin-context-COh-cbsW.mjs} +1 -1
- package/dist/{plugin-context-CscLcXjH.cjs → plugin-context-FIHaWn6r.cjs} +2 -2
- package/dist/{plugin-lifecycle-BywrEoWK.cjs → plugin-lifecycle-D9fTRaWY.cjs} +1 -1
- package/dist/{registry-BbB6NqSv.d.cts → registry-BFmzj1yg.d.mts} +1 -1
- package/dist/{registry-sJqDv0kE.d.mts → registry-BoswPzYV.d.cts} +1 -1
- package/dist/{resolve-C5rT6B21.mjs → resolve-5puUe7eS.mjs} +1 -1
- package/dist/{resolve-BelytNYR.cjs → resolve-CF4ZLfqx.cjs} +1 -1
- package/dist/route-paths-B6ocUfNY.cjs +6 -0
- package/dist/route-paths-DyDji4bX.mjs +6 -0
- package/dist/{router-CZBxMRAH.js → router-B5e8k4qK.js} +175 -10
- package/dist/{router-C3kygdRK.cjs → router-DKC0Lu0n.cjs} +204 -9
- package/dist/{routes-C3_w9fLX.cjs → routes-D55M8UrH.cjs} +1 -1
- package/dist/routes-DdE6Lfcl.cjs +6 -0
- package/dist/routes-_I_8PQYF.mjs +6 -0
- package/dist/{search-dialog-x_qHU8ty.cjs → search-dialog-BOQRHKTb.cjs} +197 -24
- package/dist/{search-dialog-BqkzDTq2.js → search-dialog-BXil4_7P.js} +190 -29
- package/dist/search-dialog-CwlBd-Mu.cjs +747 -0
- package/dist/{search-dialog-B9mdxsUC.js → search-dialog-D3Obh3eA.js} +1 -1
- package/dist/search-dialog-DeplpVEB.js +717 -0
- package/dist/{search-dialog-DCtm2dyR.cjs → search-dialog-cHXR5zhL.cjs} +1 -1
- package/dist/server/index.cjs +1 -1
- package/dist/server/index.d.mts +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/ssg-static-options-Br1_u9qp.mjs +6 -0
- package/dist/ssg-static-options-CVvGKM8i.cjs +6 -0
- package/dist/types-58Ac3UGI.d.cts +114 -0
- package/dist/types-BwnGf-1E.d.mts +114 -0
- package/dist/virtual-modules-C4-qxFlL.cjs +40 -0
- package/dist/virtual-modules-DiWUKJGP.mjs +40 -0
- package/package.json +8 -5
- package/src/shared/types.ts +133 -987
- package/dist/config-CrsQJHQz.cjs +0 -7
- package/dist/config-DC0nMMk7.mjs +0 -7
- package/dist/dev-B49V6O6p.mjs +0 -6
- package/dist/dev-DbuhNcF5.cjs +0 -6
- package/dist/index-CgWkOCCn.d.cts +0 -1193
- package/dist/index-CuNSD3E2.d.ts +0 -1193
- package/dist/node-BljvHMpS.cjs +0 -23
- package/dist/node-CWxGw4H4.mjs +0 -23
- package/dist/pages-external-BBw8ObVK.mjs +0 -6
- package/dist/pages-external-DPiPFxxP.cjs +0 -6
- package/dist/plugin-BPcm1cU0.mjs +0 -69
- package/dist/plugin-WUhxnpko.cjs +0 -69
- package/dist/routes-C0kb4ue6.cjs +0 -6
- package/dist/routes-C4wrLWwu.mjs +0 -6
- package/dist/search-dialog-Bp_ouN1c.cjs +0 -550
- package/dist/search-dialog-an2BNMj6.js +0 -526
- package/dist/types-Db6zToZH.d.mts +0 -975
- package/dist/types-o7iZ2BAR.d.cts +0 -975
- package/dist/virtual-modules-B2X4Ht2r.mjs +0 -39
- package/dist/virtual-modules-DPsdHKcu.cjs +0 -39
- /package/dist/{audit-CMc_ydRr.mjs → audit-CYAkXXvP.mjs} +0 -0
- /package/dist/{audit-CHkGiV3c.cjs → audit-DxCZZTuX.cjs} +0 -0
- /package/dist/{csp-BiGAG8aF.cjs → csp-B-gc2Iha.cjs} +0 -0
- /package/dist/{csp-D0BOH8ae.mjs → csp-f8DOcI_7.mjs} +0 -0
- /package/dist/{generator-BCrZL53x.cjs → generator-CBAPKY6r.cjs} +0 -0
- /package/dist/{generator-CFukoGa0.mjs → generator-MRpn-yp6.mjs} +0 -0
- /package/dist/{handler-Lex5DbvG.mjs → handler-DBZqoWt2.mjs} +0 -0
- /package/dist/{handler-Ch-Q9NAB.cjs → handler-ryZR9Q41.cjs} +0 -0
- /package/dist/{index-HAwIo4nZ.d.mts → index-CPr34I2C.d.mts} +0 -0
- /package/dist/{native-BYKMke79.mjs → native-DZ6WMwjG.mjs} +0 -0
- /package/dist/{native-BOet8hpE.cjs → native-DeKxny_T.cjs} +0 -0
- /package/dist/{update-check-BXD1atVv.mjs → update-check-BXx8te9F.mjs} +0 -0
- /package/dist/{update-check-DFQZyoSU.cjs → update-check-CiIeC7CX.cjs} +0 -0
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
|
|
2
|
+
import * as _$react from "react";
|
|
3
|
+
import React$1, { ComponentType, ReactNode } from "react";
|
|
4
|
+
import { IncomingMessage, ServerResponse } from "node:http";
|
|
5
|
+
import { AliasOptions, Plugin, UserConfig } from "vite";
|
|
6
|
+
import { BadgeValue, BoltdocsCollectionsConfig, BoltdocsConfigContract, BoltdocsI18nConfig, BoltdocsIntegrationsConfig, BoltdocsVersionsConfig, CodeHighlightConfig, CodeTheme, JsonLdObject, PluginDefinition, RedirectConfig, RedirectStatus, StructuredData } from "@bdocs/contracts";
|
|
7
|
+
|
|
8
|
+
//#region src/shared/types.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Represents a single social link in the configuration.
|
|
11
|
+
*/
|
|
12
|
+
interface BoltdocsSocialLink {
|
|
13
|
+
icon: 'discord' | 'x' | 'github' | 'bluesky' | string;
|
|
14
|
+
link: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Theme-specific configuration options.
|
|
18
|
+
*/
|
|
19
|
+
interface BoltdocsThemeConfig {
|
|
20
|
+
title?: string | Record<string, string>;
|
|
21
|
+
description?: string | Record<string, string>;
|
|
22
|
+
logo?: string | {
|
|
23
|
+
dark: string;
|
|
24
|
+
light: string;
|
|
25
|
+
alt?: string;
|
|
26
|
+
width?: number;
|
|
27
|
+
height?: number;
|
|
28
|
+
};
|
|
29
|
+
navbar?: Array<{
|
|
30
|
+
label: string | Record<string, string>;
|
|
31
|
+
href: BoltdocsRoutePathWithFallback;
|
|
32
|
+
items?: Array<{
|
|
33
|
+
label: string | Record<string, string>;
|
|
34
|
+
href: BoltdocsRoutePathWithFallback;
|
|
35
|
+
}>;
|
|
36
|
+
}>;
|
|
37
|
+
sidebar?: Record<string, Array<{
|
|
38
|
+
text: string;
|
|
39
|
+
link: BoltdocsRoutePathWithFallback;
|
|
40
|
+
}>>;
|
|
41
|
+
sidebarGroups?: Record<string, {
|
|
42
|
+
title?: string | Record<string, string>;
|
|
43
|
+
icon?: string;
|
|
44
|
+
}>;
|
|
45
|
+
socialLinks?: BoltdocsSocialLink[];
|
|
46
|
+
editLink?: string;
|
|
47
|
+
communityHelp?: string;
|
|
48
|
+
version?: string;
|
|
49
|
+
githubRepo?: string;
|
|
50
|
+
favicon?: string;
|
|
51
|
+
tabs?: Array<{
|
|
52
|
+
id: string;
|
|
53
|
+
text: string | Record<string, string>;
|
|
54
|
+
icon?: string;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Legacy alias for `codeHighlighting.theme`. Kept for backwards
|
|
58
|
+
* compatibility — prefer `codeHighlighting`.
|
|
59
|
+
* @deprecated Use `codeHighlighting` instead.
|
|
60
|
+
*/
|
|
61
|
+
codeTheme?: CodeTheme;
|
|
62
|
+
/**
|
|
63
|
+
* Configures the markdown code highlighting engine. The engine is
|
|
64
|
+
* engine-agnostic: `engine` accepts a registry id (`'shiki'` by default),
|
|
65
|
+
* an adapter instance, or an adapter factory — so any highlighter can be
|
|
66
|
+
* plugged in without changes to the core.
|
|
67
|
+
*
|
|
68
|
+
* Shorthand: a plain string is a registry id, i.e. `'shiki'` is
|
|
69
|
+
* equivalent to `{ engine: 'shiki' }` (resolved by
|
|
70
|
+
* `normalizeCodeHighlightConfig()` at every read site).
|
|
71
|
+
*/
|
|
72
|
+
codeHighlighting?: CodeHighlightConfig | string;
|
|
73
|
+
}
|
|
74
|
+
interface BoltdocsPlugin extends PluginDefinition<BoltdocsConfig, IncomingMessage, ServerResponse> {
|
|
75
|
+
vitePlugins?: Plugin[];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The root configuration object for Boltdocs.
|
|
79
|
+
*/
|
|
80
|
+
interface BoltdocsConfig extends BoltdocsConfigContract<BoltdocsPlugin> {
|
|
81
|
+
theme?: BoltdocsThemeConfig;
|
|
82
|
+
aliases?: AliasOptions;
|
|
83
|
+
vite?: UserConfig;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Global namespace for Boltdocs types that can be augmented by generated code.
|
|
87
|
+
* This allows for strictly typed locales and versions based on the project configuration.
|
|
88
|
+
*/
|
|
89
|
+
declare global {
|
|
90
|
+
namespace Boltdocs {
|
|
91
|
+
interface Types {}
|
|
92
|
+
/**
|
|
93
|
+
* Marker interface augmented by generated code to provide strict route path typing.
|
|
94
|
+
* When no types have been generated (e.g., before first dev server start),
|
|
95
|
+
* keyof is never, and BoltdocsRoutePath falls back to string.
|
|
96
|
+
*/
|
|
97
|
+
interface RoutePaths {}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
type BoltdocsTypes = Boltdocs.Types;
|
|
101
|
+
type BoltdocsRoutePath = keyof Boltdocs.RoutePaths;
|
|
102
|
+
type ExternalRouteReference = `/${string}` | `#${string}` | `?${string}` | `site:/${string}` | `site:${string}` | `http://${string}` | `https://${string}` | `//${string}`;
|
|
103
|
+
type BoltdocsRoutePathWithFallback = BoltdocsRoutePath | ExternalRouteReference | string;
|
|
104
|
+
type BoltdocsLocale = Boltdocs.Types extends {
|
|
105
|
+
Locale: infer L;
|
|
106
|
+
} ? L : string;
|
|
107
|
+
type BoltdocsVersion = Boltdocs.Types extends {
|
|
108
|
+
Version: infer V;
|
|
109
|
+
} ? V : string;
|
|
110
|
+
type UnpackMdxComponents<T> = T extends {
|
|
111
|
+
default: infer D;
|
|
112
|
+
} ? D : T;
|
|
113
|
+
type TransformMdxComponents<T> = { [K in keyof T as K extends `Frontmatter_${string}` ? never : K]: T[K] } & {
|
|
114
|
+
Frontmatter: { [K in keyof T as K extends `Frontmatter_${infer Name}` ? Name : never]: T[K] };
|
|
115
|
+
};
|
|
116
|
+
type BoltdocsMdxComponents = Boltdocs.Types extends {
|
|
117
|
+
MdxComponents: infer M;
|
|
118
|
+
} ? TransformMdxComponents<UnpackMdxComponents<M>> : Omit<Record<string, ComponentType<unknown>>, 'Frontmatter'> & {
|
|
119
|
+
Frontmatter: Record<string, ComponentType<unknown>>;
|
|
120
|
+
};
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/client/router/types.d.ts
|
|
123
|
+
interface LoaderFunctionArgs {
|
|
124
|
+
request: Request;
|
|
125
|
+
params: Record<string, string>;
|
|
126
|
+
}
|
|
127
|
+
type LoaderFunction<T = unknown> = (args: LoaderFunctionArgs) => Promise<T> | T;
|
|
128
|
+
type PrefetchFunction$1 = (to: string) => Promise<void>;
|
|
129
|
+
interface RouteMatch {
|
|
130
|
+
route: RouteRecord;
|
|
131
|
+
params: Record<string, string>;
|
|
132
|
+
pathname: string;
|
|
133
|
+
pathnameBase: string;
|
|
134
|
+
data?: Record<string, unknown>;
|
|
135
|
+
}
|
|
136
|
+
interface LazyRouteResult {
|
|
137
|
+
Component?: ComponentType<any>;
|
|
138
|
+
element?: ReactNode;
|
|
139
|
+
loader?: LoaderFunction;
|
|
140
|
+
ErrorBoundary?: ComponentType<any>;
|
|
141
|
+
}
|
|
142
|
+
/** Structurally compatible with react-router-dom's route objects */
|
|
143
|
+
interface RouteRecord {
|
|
144
|
+
path?: string;
|
|
145
|
+
index?: boolean;
|
|
146
|
+
id?: string;
|
|
147
|
+
element?: ReactNode;
|
|
148
|
+
Component?: ComponentType<any>;
|
|
149
|
+
loader?: LoaderFunction;
|
|
150
|
+
action?: (...args: any[]) => any;
|
|
151
|
+
ErrorBoundary?: ComponentType<any>;
|
|
152
|
+
hasErrorBoundary?: boolean;
|
|
153
|
+
HydrateFallback?: ComponentType<any>;
|
|
154
|
+
children?: RouteRecord[];
|
|
155
|
+
lazy?: () => Promise<LazyRouteResult>;
|
|
156
|
+
caseSensitive?: boolean;
|
|
157
|
+
shouldRevalidate?: (...args: any[]) => boolean;
|
|
158
|
+
getStaticPaths?: () => string[] | Promise<string[]>;
|
|
159
|
+
entry?: string;
|
|
160
|
+
/** Locale this route belongs to (used by i18n fallbacks) */
|
|
161
|
+
locale?: string;
|
|
162
|
+
}
|
|
163
|
+
interface RouterOptions {
|
|
164
|
+
routes: RouteRecord[];
|
|
165
|
+
basename?: string;
|
|
166
|
+
future?: Record<string, boolean>;
|
|
167
|
+
}
|
|
168
|
+
interface RouteRendererProps {
|
|
169
|
+
routes: RouteRecord[];
|
|
170
|
+
pathname?: string;
|
|
171
|
+
loaderData?: Record<string, unknown> | null;
|
|
172
|
+
/** Whether loaderData was explicitly produced for the initial SSR route. */
|
|
173
|
+
hasLoaderData?: boolean;
|
|
174
|
+
/** Resolved branch supplied by SSR so lazy MDX routes render without effects. */
|
|
175
|
+
resolvedBranch?: RouteRecord[];
|
|
176
|
+
basename?: string;
|
|
177
|
+
/** Default locale is omitted from external URLs. */
|
|
178
|
+
defaultLocale?: string;
|
|
179
|
+
/** Optional route prefetcher used by Link hover/focus interactions. */
|
|
180
|
+
prefetch?: PrefetchFunction$1;
|
|
181
|
+
/** Enables native View Transitions for route updates. */
|
|
182
|
+
viewTransitions?: boolean | {
|
|
183
|
+
enabled?: boolean;
|
|
184
|
+
types?: string[];
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
interface CreateRoutesResult {
|
|
188
|
+
routes: RouteRecord[];
|
|
189
|
+
RouteRenderer: ComponentType<RouteRendererProps>;
|
|
190
|
+
matchRouteBranch: (routes: RouteRecord[], pathname: string) => RouteRecord[];
|
|
191
|
+
matchRouteBranchWithParams: (routes: RouteRecord[], pathname: string, basename?: string) => Array<{
|
|
192
|
+
route: RouteRecord;
|
|
193
|
+
params: Record<string, string>;
|
|
194
|
+
}>;
|
|
195
|
+
resolveRouteBranch: (branch: RouteRecord[]) => Promise<RouteRecord[]>;
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/client/router/context.d.ts
|
|
199
|
+
interface LocationState {
|
|
200
|
+
pathname: string;
|
|
201
|
+
search: string;
|
|
202
|
+
hash: string;
|
|
203
|
+
}
|
|
204
|
+
type PrefetchFunction = (to: string) => Promise<void>;
|
|
205
|
+
type NavigateFunction = (to: string, options?: {
|
|
206
|
+
replace?: boolean;
|
|
207
|
+
state?: unknown; /** Disable the router transition when an outer transition owns the update. */
|
|
208
|
+
viewTransition?: boolean;
|
|
209
|
+
}) => void;
|
|
210
|
+
declare const defaultNavigate: NavigateFunction;
|
|
211
|
+
declare const LocationContext: _$react.Context<LocationState>;
|
|
212
|
+
declare const NavigateContext: _$react.Context<NavigateFunction>;
|
|
213
|
+
declare const PrefetchContext: _$react.Context<PrefetchFunction>;
|
|
214
|
+
declare const RouteDataContext: _$react.Context<Record<string, unknown> | null>;
|
|
215
|
+
declare const MatchesContext: _$react.Context<RouteMatch[]>;
|
|
216
|
+
interface LocationProviderProps {
|
|
217
|
+
pathname?: string;
|
|
218
|
+
children: React.ReactNode;
|
|
219
|
+
loaderData?: Record<string, unknown> | null;
|
|
220
|
+
matches?: RouteMatch[];
|
|
221
|
+
/** Base path of the application. Only links under this path are handled as SPA navigation. */
|
|
222
|
+
basename?: string;
|
|
223
|
+
/** Default locale is omitted from external URLs. */
|
|
224
|
+
defaultLocale?: string;
|
|
225
|
+
/** Optional route prefetcher used by Link hover/focus interactions. */
|
|
226
|
+
prefetch?: PrefetchFunction;
|
|
227
|
+
/** Enables the native View Transition API for route updates. */
|
|
228
|
+
viewTransitions?: boolean | {
|
|
229
|
+
enabled?: boolean;
|
|
230
|
+
types?: string[];
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
declare const LocationProvider: React.FC<LocationProviderProps>;
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region src/client/router/hooks.d.ts
|
|
236
|
+
declare function useLocation(): LocationState;
|
|
237
|
+
declare function useNavigate(): NavigateFunction;
|
|
238
|
+
declare function usePrefetch(): (to: string) => Promise<void>;
|
|
239
|
+
declare function useRouteData<T = Record<string, unknown>>(): T;
|
|
240
|
+
/** Alias for useRouteData — parity with react-router-dom's useLoaderData */
|
|
241
|
+
declare function useLoaderData<T = Record<string, unknown>>(): T;
|
|
242
|
+
declare function useMatches(): RouteMatch[];
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region src/client/router/outlet.d.ts
|
|
245
|
+
declare const OutletContext: _$react.Context<_$react.ReactNode>;
|
|
246
|
+
declare const Outlet: React.FC;
|
|
247
|
+
//#endregion
|
|
248
|
+
//#region src/client/router/renderer.d.ts
|
|
249
|
+
interface RouteBranchMatch {
|
|
250
|
+
route: RouteRecord;
|
|
251
|
+
params: Record<string, string>;
|
|
252
|
+
}
|
|
253
|
+
declare function matchRouteBranchWithParams(routes: RouteRecord[], pathname: string, basename?: string): RouteBranchMatch[];
|
|
254
|
+
declare function matchRouteBranch(routes: RouteRecord[], pathname: string, basename?: string): RouteRecord[];
|
|
255
|
+
declare function resolveRouteBranch(branch: RouteRecord[]): Promise<RouteRecord[]>;
|
|
256
|
+
declare const RouteRenderer: React$1.FC<RouteRendererProps>;
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/client/router/utils.d.ts
|
|
259
|
+
declare function normalizeBasename(basename?: string): string;
|
|
260
|
+
declare function hasBasename(path: string, basename: string): boolean;
|
|
261
|
+
declare function stripBasename(path: string, basename: string): string;
|
|
262
|
+
declare function addBasename(path: string, basename: string): string;
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/client/router/url-contract.d.ts
|
|
265
|
+
type UrlRouteKind = 'doc' | 'external' | 'collection';
|
|
266
|
+
interface UrlContractConfig {
|
|
267
|
+
base?: string;
|
|
268
|
+
i18n?: Pick<BoltdocsI18nConfig, 'defaultLocale' | 'locales'>;
|
|
269
|
+
versions?: Pick<BoltdocsVersionsConfig, 'defaultVersion' | 'prefix' | 'versions'>;
|
|
270
|
+
collections?: readonly string[] | BoltdocsCollectionsConfig;
|
|
271
|
+
}
|
|
272
|
+
interface UrlRouteHint {
|
|
273
|
+
path: string;
|
|
274
|
+
kind?: UrlRouteKind;
|
|
275
|
+
collection?: string;
|
|
276
|
+
}
|
|
277
|
+
interface ParsedUrl {
|
|
278
|
+
/** The normalized pathname, without query string or hash. */
|
|
279
|
+
pathname: string;
|
|
280
|
+
/** The normalized route content after removing structural prefixes. */
|
|
281
|
+
routePath: string;
|
|
282
|
+
/** Query string including `?`, when present. */
|
|
283
|
+
search: string;
|
|
284
|
+
/** Hash including `#`, when present. */
|
|
285
|
+
hash: string;
|
|
286
|
+
kind: UrlRouteKind;
|
|
287
|
+
locale?: string;
|
|
288
|
+
version?: string;
|
|
289
|
+
collection?: string;
|
|
290
|
+
/** Whether the input used the explicit `site:` protocol. */
|
|
291
|
+
siteProtocol: boolean;
|
|
292
|
+
/** Whether the input pathname contained the configured documentation base. */
|
|
293
|
+
hadBase: boolean;
|
|
294
|
+
}
|
|
295
|
+
interface BuildUrlOptions {
|
|
296
|
+
kind: UrlRouteKind;
|
|
297
|
+
/** Route content, e.g. `/guides/start`, `/about`, or `/my-post`. */
|
|
298
|
+
path?: string;
|
|
299
|
+
locale?: string;
|
|
300
|
+
version?: string;
|
|
301
|
+
collection?: string;
|
|
302
|
+
search?: string;
|
|
303
|
+
hash?: string;
|
|
304
|
+
/** The input pathname already contained the configured base. */
|
|
305
|
+
hadBase?: boolean;
|
|
306
|
+
}
|
|
307
|
+
interface ResolveUrlOptions {
|
|
308
|
+
/** Explicitly choose the route family when the path is ambiguous. */
|
|
309
|
+
kind?: UrlRouteKind;
|
|
310
|
+
/** Known route metadata used to classify paths outside `base`. */
|
|
311
|
+
routes?: readonly UrlRouteHint[];
|
|
312
|
+
/** Locale/version to apply when building a canonical target. */
|
|
313
|
+
locale?: string;
|
|
314
|
+
version?: string;
|
|
315
|
+
}
|
|
316
|
+
declare function normalizeUrlBase(base?: string): string;
|
|
317
|
+
declare function normalizeUrlPath(path: string): string;
|
|
318
|
+
declare function hasUrlBase(pathname: string, base?: string): boolean;
|
|
319
|
+
declare function stripUrlBase(pathname: string, base?: string): string;
|
|
320
|
+
declare function addUrlBase(pathname: string, base?: string): string;
|
|
321
|
+
declare function getConfiguredLocales(config: UrlContractConfig): string[];
|
|
322
|
+
declare function getConfiguredVersions(config: UrlContractConfig): string[];
|
|
323
|
+
declare function getVersionPrefixSegments(config: UrlContractConfig): string[];
|
|
324
|
+
declare function getVersionSegments(version: string | undefined, config: UrlContractConfig): string[];
|
|
325
|
+
declare function isConfiguredLocale(value: string | undefined, config: UrlContractConfig): value is string;
|
|
326
|
+
declare function isConfiguredVersion(value: string | undefined, config: UrlContractConfig): value is string;
|
|
327
|
+
declare function splitUrlReference(to: string): {
|
|
328
|
+
pathname: string;
|
|
329
|
+
search: string;
|
|
330
|
+
hash: string;
|
|
331
|
+
};
|
|
332
|
+
declare function stripSiteProtocol(to: string): {
|
|
333
|
+
value: string;
|
|
334
|
+
siteProtocol: boolean;
|
|
335
|
+
};
|
|
336
|
+
/** Returns true for URI schemes such as `mailto:`, `tel:`, or `data:`. */
|
|
337
|
+
declare function hasUriScheme(value: string): boolean;
|
|
338
|
+
declare function classifyUrlPath(pathname: string, config: UrlContractConfig, options?: Pick<ResolveUrlOptions, 'kind' | 'routes'>): UrlRouteKind;
|
|
339
|
+
declare function parseUrlReference(to: string, config: UrlContractConfig, options?: Pick<ResolveUrlOptions, 'kind' | 'routes'>): ParsedUrl;
|
|
340
|
+
declare function buildUrl(options: BuildUrlOptions, config: UrlContractConfig): string;
|
|
341
|
+
declare function resolveUrlReference(to: string, config: UrlContractConfig, options?: ResolveUrlOptions): string;
|
|
342
|
+
//#endregion
|
|
343
|
+
export { LazyRouteResult as $, matchRouteBranch as A, useRouteData as B, stripSiteProtocol as C, normalizeBasename as D, hasBasename as E, useLoaderData as F, MatchesContext as G, LocationProvider as H, useLocation as I, PrefetchContext as J, NavigateContext as K, useMatches as L, resolveRouteBranch as M, Outlet as N, stripBasename as O, OutletContext as P, CreateRoutesResult as Q, useNavigate as R, splitUrlReference as S, addBasename as T, LocationProviderProps as U, LocationContext as V, LocationState as W, RouteDataContext as X, PrefetchFunction as Y, defaultNavigate as Z, isConfiguredVersion as _, RedirectConfig as _t, UrlRouteHint as a, RouterOptions as at, parseUrlReference as b, buildUrl as c, BoltdocsIntegrationsConfig as ct, getConfiguredVersions as d, BoltdocsRoutePath as dt, LoaderFunction as et, getVersionPrefixSegments as f, BoltdocsRoutePathWithFallback as ft, isConfiguredLocale as g, JsonLdObject as gt, hasUrlBase as h, BoltdocsVersion as ht, UrlContractConfig as i, RouteRendererProps as it, matchRouteBranchWithParams as j, RouteRenderer as k, classifyUrlPath as l, BoltdocsLocale as lt, hasUriScheme as m, BoltdocsTypes as mt, ParsedUrl as n, RouteMatch as nt, UrlRouteKind as o, BadgeValue as ot, getVersionSegments as p, BoltdocsSocialLink as pt, NavigateFunction as q, ResolveUrlOptions as r, RouteRecord as rt, addUrlBase as s, BoltdocsConfig as st, BuildUrlOptions as t, LoaderFunctionArgs as tt, getConfiguredLocales as u, BoltdocsMdxComponents as ut, normalizeUrlBase as v, RedirectStatus as vt, stripUrlBase as w, resolveUrlReference as x, normalizeUrlPath as y, StructuredData as yt, usePrefetch as z };
|