# @geoblink/apidoc-plugin-ts

> A plugin for apidoc leveraging TypeScript interfaces.

Latest version **2.0.4** (published 2022-12-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @geoblink/apidoc-plugin-ts
pnpm add @geoblink/apidoc-plugin-ts
yarn add @geoblink/apidoc-plugin-ts
bun add @geoblink/apidoc-plugin-ts
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.4 |
| Published | 2022-12-02 |
| First published | 2019-04-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 2 |
| Unpacked size | 17.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | geoblink |
| Keywords | apidoc, apidoc plugin, typescript |

## Links

- npm: https://www.npmjs.com/package/@geoblink/apidoc-plugin-ts
- Repository: https://github.com/geoblink/apidoc-plugin-ts
- Issues: https://github.com/geoblink/apidoc-plugin-ts/issues
- npm.io page: https://npm.io/package/@geoblink/apidoc-plugin-ts

## Dependencies (2)

- [ts-morph](https://npm.io/package/ts-morph.md) 3.1.0
- [typescript](https://npm.io/package/typescript.md) 3.5.2

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.0.4 (latest) — 2022-12-02
- 2.0.3 — 2022-12-02
- 2.0.2 — 2022-12-02
- 2.0.1 — 2022-03-14
- 2.0.0 — 2022-02-16
- 1.0.3 — 2019-12-11
- 1.0.2 — 2019-07-03
- 1.0.2-beta.0 — 2019-07-03
- 1.0.1 — 2019-06-27
- 1.0.0 — 2019-04-09

## README

# apidoc-plugin-ts

[![Build Status](https://travis-ci.org/geoblink/apidoc-plugin-ts.svg?branch=master)](https://travis-ci.org/geoblink/apidoc-plugin-ts)
[![npm](https://img.shields.io/npm/v/@geoblink/apidoc-plugin-ts.svg)](https://www.npmjs.com/package/@geoblink/apidoc-plugin-ts) [![Greenkeeper badge](https://badges.greenkeeper.io/geoblink/apidoc-plugin-ts.svg)](https://greenkeeper.io/)

A plugin for [apidoc](https://www.npmjs.com/package/apidoc) that injects params like `@apiSuccess` and `@apiParam` from TypeScript interfaces.
Supports extended and nested interfaces.

## Getting started

```javascript
npm install --save-dev apidoc @geoblink/apidoc-plugin-ts
```

```javascript
yarn add -D apidoc @geoblink/apidoc-plugin-ts
```

The following custom api-doc params are exposed:
- `@apiParamInterface`
- `@apiQueryInterface`
- `@apiBodyInterface`
- `@apiSuccessInterface`

```javascript
@CUSTOM_PARAM (optional path to definitions file) {INTERFACE_NAME}
 ```

## Example

Given the following interface:

```javascript
// filename: ./employers.ts

export interface Employer {
  /**
   * Employer job title
   */
  jobTitle: string;
  /**
   * Employer personal details
   */
  personalDetails: {
    name: string;
    age: number;
  }
}
```

and the following custom param:

```javascript
@apiSuccessInterface (./employers.ts) {Person}
```

under the hood this would transpile to:

```javascript
@apiSuccess {String} jobTitle Job title
@apiSuccess {Object} personalDetails Employer personal details
@apiSuccess {String} personalDetails.name
@apiSuccess {Number} personalDetails.age
```

*Note if the `Person` interface is defined in the same file then you can drop the path:*

```javascript
@apiSuccessInterface {Person}
```

---
_Source: https://npm.io/package/@geoblink/apidoc-plugin-ts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
