Detalhes do pacote

@rdfjs/types

rdfjs269kMIT2.0.1

Authoritative TypeScript typings for all RDF/JS specifications

rdf, rdf/js, rdfjs, typescript

readme (leia-me)

RDF/JS Types

Authoritative TypeScript typings for all RDF/JS specifications

The types should match the RDF/JS specifications (Data Model, Dataset and Stream). 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.

Usage

Installed as usual using your favourite package manager.

yarn add @rdfjs/types

This package does not provide code, only interafces for the RDF/JS specifications. Import them to strong-type your RDF/JS code.

import type { NamedNode, DatasetCore, Stream } from '@rdfjs/types'

Or import separately from type modules corresponding the specifications.

import type { NamedNode } from '@rdfjs/types/data-model'
import type { DatasetCore } from '@rdfjs/types/dataset'
import type { Stream } from '@rdfjs/types/stream'
```

Additional Types

Note that some helper types exist that do not exist within the RDF/JS specifications. These include:

import type { TripleTermName, QuadTermName } from '@rdfjs/types'

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 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 and a later proxy package rdf-js.

Both these old packages are deprecated. They will continue to work for backwards compatibility but library maintainers are encouraged to use @rdfjs/types instead.

changelog (log de mudanças)

@rdfjs/types

2.0.1

Patch Changes

  • 6f54811: Remove generic parameters from DataFactory#fromTerm() overloads which caused incompatibility with @rdfjs/types v1

2.0.0

Major Changes

  • 14906cf: Add missing methods fromTerm and fromQuad to the DataFactory interface
  • 8e965db: In some cases, loaders would report an error similar to Could not resolve "./data-model". This is fixed by using export type * but requires TypeScript 5+

Minor Changes

  • 46acfbb: Add optional direction for literals

1.1.2

Patch Changes

  • 7d8ffd1: Version 1.1.1 was inadvertently published empty (fixes #49)

1.1.1

Patch Changes

  • a631541: Only package declaration files

1.1.0

Minor Changes

  • 95f1e31: Dataset: Use correct type of dataset in methods with callbacks
  • 2539ab3: Add queryable interfaces

Patch Changes

  • 8164183: Documentation Fix: Update reference of Quad to BaseQuad in the definition of Term in order to align with the type declaration.
  • a19ed91: Make queryable metadata types configurable

1.1.0-next.1

Patch Changes

  • Make queryable metadata types configurable

1.1.0-next.0

Minor Changes

  • 95f1e31: Dataset: Use correct type of dataset in methods with callbacks
  • bc7163e: Add queryable interfaces

Patch Changes

  • 8164183: Documentation Fix: Update reference of Quad to BaseQuad in the definition of Term in order to align with the type declaration.

1.0.1

Patch Changes

  • 973042f: The package did not work with DefinitelyTyped repository

1.0.0

Major Changes

  • 07692f2: Removed RegExp from match and removeMatches to follow current version of rdfjs streams specification
  • 4ed7993: First release, migrated from @types/rdf-js