# @types/url-state

> TypeScript definitions for url-state

Latest version **3.0.3** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/url-state
pnpm add @types/url-state
yarn add @types/url-state
bun add @types/url-state
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 3.0.3 |
| Published | 2023-11-07 |
| First published | 2021-10-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51439 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/url-state
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/url-state
- npm.io page: https://npm.io/package/@types/url-state

## Dependencies (1)

- [@types/qs](https://npm.io/package/@types/qs.md) *

## Recent versions

- 3.0.3 (latest) — 2023-11-07
- 3.0.1 (ts4.3) — 2023-08-30
- 3.0.0 (ts4.2) — 2023-02-17
- 2.0.0 (ts3.7) — 2021-10-16
- 3.0.2 — 2023-10-18

## README

# Installation
> `npm install --save @types/url-state`

# Summary
This package contains type definitions for url-state (https://github.com/jessetane/url-state).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/url-state.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/url-state/index.d.ts)
````ts
import { parse } from "qs";

interface ReplaceHref {
    pathname?: string;
    query?: string;
    params?: string;
    hash?: string;
}

interface PushHref extends ReplaceHref {
    replace?: boolean;
}

interface UrlState
    extends Pick<URL, "href" | "protocol" | "hostname" | "port" | "pathname" | "search" | "hash" | "host" | "origin">
{
    readonly back: boolean;
    readonly params: ReturnType<typeof parse>;

    push(href: string | PushHref, replace?: boolean): void;
    replace(href: string | ReplaceHref): void;
    pop(): void;
    query(params: Record<string, string | null>, replace?: boolean): void;
}

declare class UrlState extends EventTarget {}
declare const urlState: UrlState;

export default urlState;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: [@types/qs](https://npmjs.com/package/@types/qs)

# Credits
These definitions were written by [tpluscode](https://github.com/tpluscode).

---
_Source: https://npm.io/package/@types/url-state · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
