# @types/negative-index

> TypeScript definitions for negative-index

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

## Install

```sh
npm install @types/negative-index
pnpm add @types/negative-index
yarn add @types/negative-index
bun add @types/negative-index
```

## 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 | 1.0.2 |
| Published | 2023-11-07 |
| First published | 2022-11-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51438 |
| Maintainers | types |

## Links

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

## Recent versions

- 1.0.2 (latest) — 2023-11-07
- 1.0.0 (ts4.1) — 2022-11-14
- 1.0.1 — 2023-10-18

## README

# Installation
> `npm install --save @types/negative-index`

# Summary
This package contains type definitions for negative-index (https://github.com/dy/negative-index#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/negative-index.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/negative-index/index.d.ts)
````ts
export = negativeIndex;

/**
 * Convert negative index to positive starting from the end. Same way
 * [Array.slice](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice)
 * arguments work.
 *
 * @example
 * import idx = require('negative-index');
 *
 * idx(-5, 8); // 3
 * idx(5, 8); // 5
 *
 * @example
 * // Works well for normalizing real numbers offset, like time etc:
 *
 * import normOffset = require('negative-index');
 *
 * const time = -.15, duration = 2.45;
 *
 * normOffset(time, duration); // 2.3
 */
declare function negativeIndex(index: number, length: number): number;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by [BendingBender](https://github.com/BendingBender).

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