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

# Interface: TypedStateService

Defined in: [registry.ts:321](https://github.com/simshanith/lit-ui-router/blob/ddf02fc88fff5fb67c4114e4f613e773e2b76df2/packages/ui-router-registry/src/registry.ts#L321)

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"`>

## Methods

### go()

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

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

`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:344](https://github.com/simshanith/lit-ui-router/blob/ddf02fc88fff5fb67c4114e4f613e773e2b76df2/packages/ui-router-registry/src/registry.ts#L344)

`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:363](https://github.com/simshanith/lit-ui-router/blob/ddf02fc88fff5fb67c4114e4f613e773e2b76df2/packages/ui-router-registry/src/registry.ts#L363)

`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:369](https://github.com/simshanith/lit-ui-router/blob/ddf02fc88fff5fb67c4114e4f613e773e2b76df2/packages/ui-router-registry/src/registry.ts#L369)

`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:350](https://github.com/simshanith/lit-ui-router/blob/ddf02fc88fff5fb67c4114e4f613e773e2b76df2/packages/ui-router-registry/src/registry.ts#L350)

`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:356](https://github.com/simshanith/lit-ui-router/blob/ddf02fc88fff5fb67c4114e4f613e773e2b76df2/packages/ui-router-registry/src/registry.ts#L356)

`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`

***

### target()

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

Defined in: [registry.ts:338](https://github.com/simshanith/lit-ui-router/blob/ddf02fc88fff5fb67c4114e4f613e773e2b76df2/packages/ui-router-registry/src/registry.ts#L338)

`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:332](https://github.com/simshanith/lit-ui-router/blob/ddf02fc88fff5fb67c4114e4f613e773e2b76df2/packages/ui-router-registry/src/registry.ts#L332)

`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`
