## Route · interface

The class for the global `route` object.

### route.path · member

The current path of the URL as a string. For instance `"/"` or `"/users/123/feed"`. Paths are normalized to always start with a `/` and never end with a `/` (unless it's the root path).

**Type:** `string`

### route.p · member

An convenience array containing path segments, mapping to `path`. For instance `[]` (for `"/"`) or `['users', '123', 'feed']` (for `"/users/123/feed"`).

**Type:** `string[]`

### route.hash · member

The hash fragment including the leading `#`, or an empty string. For instance `"#my_section"` or `""`.

**Type:** `string`

### route.search · member

The query string interpreted as search parameters. So `"a=x&b=y"` becomes `{a: "x", b: "y"}`.

**Type:** `Record<string, string>`

### route.state · member

An object to be used for any additional data you want to associate with the current page. Data should be JSON-compatible.

**Type:** `Record<string, any>`

### route.depth · member

The navigation depth of the current session. Starts at 1. Writing to this property has no effect.

**Type:** `number`

### route.nav · member

The navigation action that got us to this page. Writing to this property has no effect.
- `"load"`: An initial page load.
- `"back"` or `"forward"`: When we navigated backwards or forwards in the stack.
- `"go"`: When we added a new page on top of the stack.
- `"push"`: When we added a new page on top of the stack, merging with the current page.
Mostly useful for page transition animations. Writing to this property has no effect.

**Type:** `NavType`
