Skip to content

Commit

Permalink
Add export of Contributor type
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 24, 2023
1 parent 10c6430 commit 3490124
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* @typedef {import('remark-contributors').Contributor} Contributor
* @typedef {import('./lib/index.js').Options} Options
*/

Expand Down
20 changes: 18 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* [Use](#use)
* [API](#api)
* [`unified().use(remarkGitContributors[, options])`](#unifieduseremarkgitcontributors-options)
* [`Contributor`](#contributor)
* [`Options`](#options)
* [Examples](#examples)
* [Example: CLI](#example-cli)
Expand Down Expand Up @@ -146,6 +147,17 @@ In short, this plugin:

Transform ([`Transformer`][unified-transformer]).

### `Contributor`

Contributor in string form (`name <email> (url)`) or as object (TypeScript
type).

###### Type

```ts
type Contributor = Record<string, unknown> | string
```
### `Options`
Configuration (TypeScript type).
Expand All @@ -154,7 +166,8 @@ Configuration (TypeScript type).
* `appendIfMissing` (`boolean`, default: `false`)
— inject the section if there is none
* `contributors` (`Array<Contributor>` or `string`, optional)
* `contributors` ([`Array<Contributor>`][api-contributor] or `string`,
optional)
— list of contributors to inject;
defaults to the `contributors` field in the closest `package.json` upwards
from the processed file, if there is one;
Expand Down Expand Up @@ -371,7 +384,8 @@ export default contributors
## Types

This package is fully typed with [TypeScript][].
It exports the additional type [`Options`][api-options].
It exports the additional types [`Contributor`][api-contributor] and
[`Options`][api-options].

## Compatibility

Expand Down Expand Up @@ -495,6 +509,8 @@ abide by its terms.

[file-package-json]: package.json

[api-contributor]: #contributor

[api-options]: #options

[api-remark-git-contributors]: #unifieduseremarkgitcontributors-options

0 comments on commit 3490124

Please sign in to comment.