-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from rdfjs/readme
docs: expand readme before publish
- Loading branch information
Showing
1 changed file
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,39 @@ | ||
# types | ||
Authoritative TypeScript typings for all RDFJS specifications | ||
# RDF/JS Types | ||
|
||
Authoritative TypeScript typings for all RDF/JS specifications | ||
|
||
The types should match the RDF/JS specifications ([Data Model](https://rdf.js.org/data-model-spec/), [Dataset](https://rdf.js.org/dataset-spec/) and [Stream](https://rdf.js.org/stream-spec/)). However, because they also take advantage of TypecScript-specific syntax features, some differences are inevitable. If something does not add up, please open an [issue](#contributing). | ||
|
||
## Usage | ||
|
||
Installed as usual using your favourite package manager. | ||
|
||
``` | ||
yarn add @types/rdf-js | ||
``` | ||
|
||
This package does not provide code, only interafces for the RDF/JS specifications. Import them to strong-type your RDF/JS code. | ||
|
||
```typescript | ||
import type { NamedNode, DatasetCore, Stream } from '@rdfjs/types' | ||
``` | ||
|
||
Or import separaterly from type modules corresponding the specifications. | ||
|
||
```typescript | ||
import type { NamedNode } from '@rdfjs/types/data-model' | ||
import type { DatasetCore } from '@rdfjs/types/dataset' | ||
import type { Stream } from '@rdfjs/types/stream' | ||
`````` | ||
|
||
## Contributing | ||
|
||
Everyone is invited to open issues and pull requests. When you create a PR, please add or update the `rdf-js-tests.ts` file to reflect your changes. | ||
|
||
You may also create a [changeset](https://github.com/atlassian/changesets) file by running `npx run changeset` and following the simple wizard. If you don't do that, such as in the case when editing from your browser, do not worry. A maintainer can also create it for you when you open a PR. | ||
|
||
## What about @types/rdf-js? | ||
|
||
This package replaces typings previously managed in the [DefinitelyTyped repository](https://npm.im/@types/rdf-js). | ||
|
||
The old package wil be deprecated but continue to work for backwards compatibility but library maintainers are encouraged to use `@rdf-js/types` instead. |