# typed-object-interfaces

> Typed object interfaces. Types for plain objects.

Latest version **1.3.0** (published 2017-07-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install typed-object-interfaces
pnpm add typed-object-interfaces
yarn add typed-object-interfaces
bun add typed-object-interfaces
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2017-07-26 |
| First published | 2017-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Anton Korniychuk |
| Maintainers | ankor |

## Links

- npm: https://www.npmjs.com/package/typed-object-interfaces
- Repository: https://github.com/ancor-dev/typed-object-interfaces
- Homepage: https://github.com/ancor-dev/typed-object-interfaces#readme
- Issues: https://github.com/ancor-dev/typed-object-interfaces/issues
- npm.io page: https://npm.io/package/typed-object-interfaces

## Recent versions

- 1.3.0 (latest) — 2017-07-26
- 1.2.0 — 2017-07-22
- 1.1.0 — 2017-04-28
- 1.0.0 — 2017-03-14

## README

# typed-object-interfaces
Typed object interfaces. Types for plain objects.

# Examples

```typescript
import { NumberObject } from 'typed-object-interfaces';
  
/** key is a User ID, value is Age of the User */
let userAges: NumberObject = {};
  
userAges[ 1 ]   = 13;   // ok
userAges[ '2' ] = 45;   // ok
userAges[ 3 ]   = '45'; // error
```

# Source Code
```typescript
export interface NumberObject {
  [name: string]: number;
  [name: number]: number;
}

export interface StringObject {
  [name: string]: string;
  [name: number]: string;
}

export interface BooleanObject {
  [name: string]: boolean;
  [name: number]: boolean;
}

export interface DefaultObject {
  [name: string]: string | number;
  [name: number]: string | number;
}

export interface StdObject {
  [name: string]: string | number | boolean;
  [name: number]: string | number | boolean;
}

export interface AnyObject {
  [name: string]: any;
  [name: number]: any;
}

export interface TypeObject<T> {
  [name: string]: T;
  [name: number]: T;
}

export interface ArrayObject<T> {
  [name: string]: T[];
  [name: number]: T[];
}

export type IObject<T> = {[key in keyof T]?: T[key]};
```

---
_Source: https://npm.io/package/typed-object-interfaces · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
