---
url: >-
  https://lit-ui-router.dev/reference/ui-router-server/index/type-aliases/Verdict.md
---
[ui-router-server](../../index.md) / [ui-router-server](../index.md) / Verdict

# Type Alias: Verdict

```ts
type Verdict = 
  | {
  kind: "shell";
  mount: string;
  status?: number;
}
  | {
  kind: "redirect";
  location: string;
  mount: string;
  status: number;
}
  | {
  delegate: string;
  kind: "delegate";
  mount: string;
  params: RawParams;
  state: string;
  subpath: string;
}
  | {
  kind: "response";
  mount: string;
  params: RawParams;
  state: string;
  subpath: string;
}
  | {
  kind: "notFound";
  mount?: string;
};
```

Defined in: [index.ts:170](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L170)

What the caller should serve for a pathname — the one output of
[ServerRouter.resolve](../interfaces/ServerRouter.md#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

```ts
{
  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:184](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L184) |
| `mount` | `string` | Base of the mount that owned the pathname. | [index.ts:186](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L186) |
| `status?` | `number` | Status to serve the shell as; absent means serve it however you normally would. | [index.ts:188](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L188) |

***

### Type Literal

```ts
{
  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:200](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L200) |
| `location` | `string` | The mount-joined target path; merge the request's search with [mergeSearch](../functions/mergeSearch.md). | [index.ts:204](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L204) |
| `mount` | `string` | Base of the mount that owned the pathname. | [index.ts:202](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L202) |
| `status` | `number` | Redirect status to answer with: the matched state's [RouteDeclaration.redirectStatusCode](../../redirects/interfaces/RouteDeclaration.md#redirectstatuscode), else 302. | [index.ts:206](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L206) |

***

### Type Literal

```ts
{
  delegate: string;
  kind: "delegate";
  mount: string;
  params: RawParams;
  state: string;
  subpath: string;
}
```

Hand the request to the host's handler for `delegate`: the pathname
matched a state that declares [RouteDeclaration.delegate](../../redirects/interfaces/RouteDeclaration.md#delegate). Answer
any method and any Accept with it, not only navigations.

| Name | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| `delegate` | `string` | The key the matched state names; the host maps it to a handler. | [index.ts:221](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L221) |
| `kind` | `"delegate"` | Discriminates the delegate verdict. | [index.ts:215](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L215) |
| `mount` | `string` | Base of the mount that owned the pathname. | [index.ts:217](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L217) |
| `params` | [`RawParams`](https://ui-router.github.io/core/docs/latest/interfaces/_params_interface_.rawparams.html) | The params the pathname alone resolves; search params hold their declared defaults. | [index.ts:225](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L225) |
| `state` | `string` | Name of the matched state. | [index.ts:223](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L223) |
| `subpath` | `string` | The pathname within the mount, its base removed (`''` at the bare base). | [index.ts:219](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L219) |

***

### Type Literal

```ts
{
  kind: "response";
  mount: string;
  params: RawParams;
  state: string;
  subpath: string;
}
```

Answer with the `Response` the handler bound to `state` builds from its
resolves: the pathname matched a state that declares
[RouteDeclaration.response](../../redirects/interfaces/RouteDeclaration.md#response), decided by url matching alone, with
no transition. Never serve the shell for it.

| Name | Type | Description | Defined in |
| ------ | ------ | ------ | ------ |
| `kind` | `"response"` | Discriminates the response verdict. | [index.ts:235](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L235) |
| `mount` | `string` | Base of the mount that owned the pathname. | [index.ts:237](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L237) |
| `params` | [`RawParams`](https://ui-router.github.io/core/docs/latest/interfaces/_params_interface_.rawparams.html) | The params the pathname alone resolves; search params hold their declared defaults. | [index.ts:243](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L243) |
| `state` | `string` | Name of the matched response state; the host maps it to a handler. | [index.ts:241](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L241) |
| `subpath` | `string` | The pathname within the mount, its base removed (`''` at the bare base). | [index.ts:239](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L239) |

***

### Type Literal

```ts
{
  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:248](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L248) |
| `mount?` | `string` | Base of the mount that owned the pathname, when one did. | [index.ts:250](https://github.com/simshanith/lit-ui-router/blob/6e47ef8d8a4b24e99c074fb5c8c9cfaddfdb36a4/packages/ui-router-server/src/index.ts#L250) |
