# siren-types

> A bunch of Siren types defined in TypeScript plus some useful functions

Latest version **1.0.0-rc13** (published 2022-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install siren-types
pnpm add siren-types
yarn add siren-types
bun add siren-types
```

## 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.0.0-rc13 |
| Published | 2022-02-21 |
| First published | 2016-05-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Michael M. Tiller |
| Maintainers | mtiller |
| Keywords | Siren |

## Links

- npm: https://www.npmjs.com/package/siren-types
- Repository: https://github.com/xogeny/siren-types
- Homepage: https://github.com/xogeny/siren-types#readme
- Issues: https://github.com/xogeny/siren-types/issues
- npm.io page: https://npm.io/package/siren-types

## Recent versions

- 1.0.0-rc13 (latest) — 2022-02-21
- 1.0.0-rc12 — 2022-02-21
- 1.0.0-rc11 — 2022-02-19
- 1.0.0-rc10 — 2020-01-16
- 1.0.0-rc9 — 2020-01-16
- 1.0.0-rc8 — 2019-11-29
- 1.0.0-rc7 — 2019-05-18
- 1.0.0-rc6 — 2019-05-14
- 1.0.0-rc5 — 2019-05-14
- 1.0.0-rc4 — 2018-11-03
- 1.0.0-rc3 — 2018-11-02
- 1.0.0-rc2 — 2018-11-02
- 1.0.0-rc1 — 2018-11-02
- 0.2.3 — 2016-07-19
- 0.2.2 — 2016-07-19
- … 8 more at https://npm.io/package/siren-types/versions

## README

# Siren Types for TypeScript

The goal of this project is to create TypeScript types that properly map to the
[Siren](https://github.com/kevinswiber/siren) specification.  My goal is to
adhere to the [JSON Schema for
Siren](https://github.com/kevinswiber/siren/blob/master/siren.schema.json).

If you are interested in this, you might also be interested in my TypeScript
Siren API navigation package, [`siren-nav`](https://github.com/xogeny/siren-nav).

## Caveats

### Generics

I use generics in this library primarily to represent the type of proeprties.

### Property Types

From a typing standpoint, the `properties` field must be specified in literals
but the type of `properties` can be `undefined`.  I know it seems odd, but the
goal here is to force users to specify the type of `properties` (yes, even if
that type is `undefined`).

### Aliases

The JSON Schema for Siren gives names to various constructs.  I have included
TypeScript definitions for all of those.  However, some of the names are a bit
verbose (*e.g.,* `EmbeddedRepresentationSubEntity` vs. `EmbeddedLinkSubEntity`).  So
I've also established aliases for those (`EmbeddedEntity` and `LinkEntity`
respectively).  Given the naming in Siren, you might expect the shorthands to be
`EmbeddedRepresentation` and `EmbeddedLink`.  The point is that there are two types of `entities`
(unfortunately...).  I only use the `EmbeddedEntity` type of entity, but the
library supports both.

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