ui-router-server / ui-router-server / Verdict
Type Alias: Verdict
type Verdict =
| {
kind: "shell";
mount: string;
status?: number;
}
| {
kind: "redirect";
location: string;
mount: string;
status: number;
}
| {
kind: "notFound";
mount?: string;
};Defined in: index.ts:74
What the caller should serve for a pathname — the one output of ServerRouter.resolve. Discriminate on kind. (Consumer note: under oxlint's switch-exhaustiveness-check + consistent-return combination, an if-chain reads cleaner than a switch over this union.)
Union Members
Type Literal
{
kind: "shell";
mount: string;
status?: number;
}Serve the app shell. Status precedence: when status is absent, serve the shell however you normally would — including 304 conditional responses. When it is set (404 via the otherwise projection today; 401/403-with-shell for a future auth tier), the verdict's status wins outright — and you must suppress the conditional path BY STRIPPING the request's validators (If-None-Match, If-Modified-Since) before the assets fetch, so it returns 200 + full body to relabel. Never relabel a 304 itself: it has no body (a 404 with a null body is malformed) and would let a probe read cache freshness for a path that doesn't exist.
| Name | Type | Description | Defined in |
|---|---|---|---|
kind | "shell" | Discriminates the shell verdict. | index.ts:88 |
mount | string | Base of the mount that owned the pathname. | index.ts:90 |
status? | number | Status to serve the shell as; absent means serve it however you normally would. | index.ts:92 |
Type Literal
{
kind: "redirect";
location: string;
mount: string;
status: number;
}Redirect to location: the mount-joined target path, which MAY carry its own query string when the target declares search params. Callers preserving the request's search must MERGE query params into it — string concatenation (location + url.search) produces ?a=1?b=2. The matcher tier resolves pathnames only: incoming search values never flow into redirect params.
| Name | Type | Description | Defined in |
|---|---|---|---|
kind | "redirect" | Discriminates the redirect verdict. | index.ts:104 |
location | string | The mount-joined target path; merge the request's search with mergeSearch. | index.ts:108 |
mount | string | Base of the mount that owned the pathname. | index.ts:106 |
status | number | Redirect status to answer with (302 today). | index.ts:110 |
Type Literal
{
kind: "notFound";
mount?: string;
}mount is set when a mount owned the pathname but nothing matched (per-mount 404s); absent when no mount matched at all.
| Name | Type | Description | Defined in |
|---|---|---|---|
kind | "notFound" | Discriminates the no-route verdict. | index.ts:115 |
mount? | string | Base of the mount that owned the pathname, when one did. | index.ts:117 |