# @types/web-locks-api

> TypeScript definitions for web-locks-api

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

## Install

```sh
npm install @types/web-locks-api
pnpm add @types/web-locks-api
yarn add @types/web-locks-api
bun add @types/web-locks-api
```

## 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; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2023-11-07 |
| First published | 2020-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

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

## Recent versions

- 0.0.5 (latest) — 2023-11-07
- 0.0.2 (ts3.8) — 2022-01-31
- 0.0.1 (ts3.6) — 2021-07-02
- 0.0.0 (ts2.8) — 2020-04-01
- 0.0.4 — 2023-10-18
- 0.0.3 — 2023-09-25

## README

# Installation
> `npm install --save @types/web-locks-api`

# Summary
This package contains type definitions for web-locks-api (https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_API).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/web-locks-api.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/web-locks-api/index.d.ts)
````ts
interface Lock {
    readonly mode: "exclusive" | "shared";
    readonly name: string;
}

interface LockInfo {
    clientId?: string;
    mode?: "exclusive" | "shared";
    name?: string;
}

interface LockManagerSnapshot {
    held?: LockInfo[] | undefined;
    pending?: LockInfo[] | undefined;
}

interface LockManagerRequestOptions {
    mode?: "exclusive" | "shared" | undefined;
    ifAvailable?: boolean | undefined;
    steal?: boolean | undefined;
    signal?: AbortSignal | undefined;
}

interface LockManager {
    request(name: string, callback: (lock: Lock) => Promise<any>): Promise<undefined>;
    request<T extends LockManagerRequestOptions>(
        name: string,
        options: T,
        callback: (lock: T["ifAvailable"] extends true ? Lock | null : Lock) => Promise<any>,
    ): Promise<undefined>;
    query(): Promise<LockManagerSnapshot>;
}

interface Navigator {
    locks: LockManager;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [Joël Charles](https://github.com/magne4000).

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