---
url: >-
  https://lit-ui-router.dev/api/ui-router-registry/index/interfaces/TypedStateService.md
---
[ui-router-registry](../../index.md) / [ui-router-registry](../index.md) / TypedStateService

# Interface: TypedStateService

Defined in: [registry.ts:326](https://github.com/simshanith/lit-ui-router/blob/251586fb2ad2b81ffe14422bb417dff339b69e07/packages/ui-router-registry/src/registry.ts#L326)

A typed view of core's `StateService`. Core's own class is assignable to it,
so a typed getter or field needs no cast and emits nothing.

## Extends

* `Omit`<[`StateService`](https://ui-router.github.io/core/docs/latest/classes/_state_stateservice_.stateservice.html), `"go"` | `"transitionTo"` | `"target"` | `"href"` | `"is"` | `"includes"` | `"reload"`>

## Methods

### go()

```ts
go<T>(to, ...args): TransitionPromise;
```

Defined in: [registry.ts:331](https://github.com/simshanith/lit-ui-router/blob/251586fb2ad2b81ffe14422bb417dff339b69e07/packages/ui-router-registry/src/registry.ts#L331)

`StateService.go`, with a registered name's params required as declared.

#### Type Parameters

| Type Parameter |
| ------ |
|  `T` *extends* | `string` | [`UncheckedRef`](../type-aliases/UncheckedRef.md) | [`StateDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration.html) | `StateObject` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `to` | `T` & `CheckRelative`<`T`> |
| ...`args` | [`TargetArgs`](../type-aliases/TargetArgs.md)<`T`, [`TransitionOptions`](https://ui-router.github.io/core/docs/latest/interfaces/_transition_interface_.transitionoptions.html)> |

#### Returns

`TransitionPromise`

***

### href()

```ts
href<T>(stateOrName, ...args): string;
```

Defined in: [registry.ts:349](https://github.com/simshanith/lit-ui-router/blob/251586fb2ad2b81ffe14422bb417dff339b69e07/packages/ui-router-registry/src/registry.ts#L349)

`StateService.href`, typed as for `go`.

#### Type Parameters

| Type Parameter |
| ------ |
|  `T` *extends* | `string` | [`UncheckedRef`](../type-aliases/UncheckedRef.md) | [`StateDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration.html) | `StateObject` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `stateOrName` | `T` & `CheckRelative`<`T`> |
| ...`args` | [`TargetArgs`](../type-aliases/TargetArgs.md)<`T`, `HrefOptions`> |

#### Returns

`string`

***

### includes()

#### Call Signature

```ts
includes<N>(
   stateOrName, 
   params?, 
   options?
): boolean;
```

Defined in: [registry.ts:373](https://github.com/simshanith/lit-ui-router/blob/251586fb2ad2b81ffe14422bb417dff339b69e07/packages/ui-router-registry/src/registry.ts#L373)

`StateService.includes`, over registered names, globs and their params.

##### Type Parameters

| Type Parameter |
| ------ |
|  `N` *extends* `string` |

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `stateOrName` | `string` | `N` |
| `params?` | `Partial`<[`RawParams`](https://ui-router.github.io/core/docs/latest/interfaces/_params_interface_.rawparams.html)> |
| `options?` | [`TransitionOptions`](https://ui-router.github.io/core/docs/latest/interfaces/_transition_interface_.transitionoptions.html) |

##### Returns

`boolean`

#### Call Signature

```ts
includes(
   stateOrName, 
   params?, 
   options?
): boolean;
```

Defined in: [registry.ts:379](https://github.com/simshanith/lit-ui-router/blob/251586fb2ad2b81ffe14422bb417dff339b69e07/packages/ui-router-registry/src/registry.ts#L379)

`StateService.includes` for an [UncheckedRef](../type-aliases/UncheckedRef.md) or an object target, with loose params.

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `stateOrName` | | [`UncheckedRef`](../type-aliases/UncheckedRef.md) | [`StateDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration.html) | `StateObject` |
| `params?` | [`RawParams`](https://ui-router.github.io/core/docs/latest/interfaces/_params_interface_.rawparams.html) |
| `options?` | [`TransitionOptions`](https://ui-router.github.io/core/docs/latest/interfaces/_transition_interface_.transitionoptions.html) |

##### Returns

`boolean`

***

### is()

#### Call Signature

```ts
is<N>(
   stateOrName, 
   params?, 
   options?
): boolean;
```

Defined in: [registry.ts:360](https://github.com/simshanith/lit-ui-router/blob/251586fb2ad2b81ffe14422bb417dff339b69e07/packages/ui-router-registry/src/registry.ts#L360)

`StateService.is`, over registered names and their params.

##### Type Parameters

| Type Parameter |
| ------ |
|  `N` *extends* `string` |

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `stateOrName` | `N` |
| `params?` | `Partial`<[`RawParams`](https://ui-router.github.io/core/docs/latest/interfaces/_params_interface_.rawparams.html)> |
| `options?` | { `relative?`: | `string` | [`StateDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration.html) | `StateObject`; } |
| `options.relative?` | | `string` | [`StateDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration.html) | `StateObject` |

##### Returns

`boolean`

#### Call Signature

```ts
is(
   stateOrName, 
   params?, 
   options?
): boolean;
```

Defined in: [registry.ts:366](https://github.com/simshanith/lit-ui-router/blob/251586fb2ad2b81ffe14422bb417dff339b69e07/packages/ui-router-registry/src/registry.ts#L366)

`StateService.is` for an [UncheckedRef](../type-aliases/UncheckedRef.md) or an object target, with loose params.

##### Parameters

| Parameter | Type |
| ------ | ------ |
| `stateOrName` | | [`UncheckedRef`](../type-aliases/UncheckedRef.md) | [`StateDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration.html) | `StateObject` |
| `params?` | [`RawParams`](https://ui-router.github.io/core/docs/latest/interfaces/_params_interface_.rawparams.html) |
| `options?` | { `relative?`: | `string` | [`StateDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration.html) | `StateObject`; } |
| `options.relative?` | | `string` | [`StateDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration.html) | `StateObject` |

##### Returns

`boolean`

***

### reload()

```ts
reload(reloadState?): Promise<StateObject>;
```

Defined in: [registry.ts:355](https://github.com/simshanith/lit-ui-router/blob/251586fb2ad2b81ffe14422bb417dff339b69e07/packages/ui-router-registry/src/registry.ts#L355)

`StateService.reload`: a registered name, or an object target or [UncheckedRef](../type-aliases/UncheckedRef.md).

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `reloadState?` | | `string` | [`UncheckedRef`](../type-aliases/UncheckedRef.md) | [`StateDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration.html) | `StateObject` |

#### Returns

`Promise`<`StateObject`>

***

### target()

```ts
target<T>(identifier, ...args): TargetState;
```

Defined in: [registry.ts:343](https://github.com/simshanith/lit-ui-router/blob/251586fb2ad2b81ffe14422bb417dff339b69e07/packages/ui-router-registry/src/registry.ts#L343)

`StateService.target`, typed as for `go`.

#### Type Parameters

| Type Parameter |
| ------ |
|  `T` *extends* | `string` | [`UncheckedRef`](../type-aliases/UncheckedRef.md) | [`StateDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration.html) | `StateObject` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `identifier` | `T` & `CheckRelative`<`T`> |
| ...`args` | [`TargetArgs`](../type-aliases/TargetArgs.md)<`T`, [`TransitionOptions`](https://ui-router.github.io/core/docs/latest/interfaces/_transition_interface_.transitionoptions.html)> |

#### Returns

[`TargetState`](https://ui-router.github.io/core/docs/latest/classes/_state_targetstate_.targetstate.html)

***

### transitionTo()

```ts
transitionTo<T>(to, ...args): TransitionPromise;
```

Defined in: [registry.ts:337](https://github.com/simshanith/lit-ui-router/blob/251586fb2ad2b81ffe14422bb417dff339b69e07/packages/ui-router-registry/src/registry.ts#L337)

`StateService.transitionTo`, typed as for `go`.

#### Type Parameters

| Type Parameter |
| ------ |
|  `T` *extends* | `string` | [`UncheckedRef`](../type-aliases/UncheckedRef.md) | [`StateDeclaration`](https://ui-router.github.io/core/docs/latest/interfaces/_state_interface_.statedeclaration.html) | `StateObject` |

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `to` | `T` & `CheckRelative`<`T`> |
| ...`args` | [`TargetArgs`](../type-aliases/TargetArgs.md)<`T`, [`TransitionOptions`](https://ui-router.github.io/core/docs/latest/interfaces/_transition_interface_.transitionoptions.html)> |

#### Returns

`TransitionPromise`
