@rdfjs/types
Advanced tools
Comparing version 1.1.2 to 2.0.0
@@ -77,2 +77,6 @@ /* Data Model Interfaces */ | ||
/** | ||
* the direction of the language-tagged string. | ||
*/ | ||
direction?: 'ltr' | 'rtl' | '' | null; | ||
/** | ||
* A NamedNode whose IRI represents the datatype of the literal. | ||
@@ -85,3 +89,3 @@ */ | ||
* @return True if and only if other has termType "Literal" | ||
* and the same `value`, `language`, and `datatype`. | ||
* and the same `value`, `language`, `direction`, and `datatype`. | ||
*/ | ||
@@ -259,12 +263,15 @@ equals(other: Term | null | undefined): boolean; | ||
/** | ||
* @param value The literal value. | ||
* @param languageOrDatatype The optional language or datatype. | ||
* If `languageOrDatatype` is a NamedNode, | ||
* then it is used for the value of `NamedNode.datatype`. | ||
* Otherwise `languageOrDatatype` is used for the value | ||
* of `NamedNode.language`. | ||
* @param value The literal value. | ||
* @param languageOrDatatype The optional language, datatype, or directional language. | ||
* If `languageOrDatatype` is a NamedNode, | ||
* then it is used for the value of `NamedNode.datatype`. | ||
* If `languageOrDatatype` is a NamedNode, it is used for the value | ||
* of `NamedNode.language`. | ||
* Otherwise, it is used as a directional language, | ||
* from which the language is set to `languageOrDatatype.language` | ||
* and the direction to `languageOrDatatype.direction`. | ||
* @return A new instance of Literal. | ||
* @see Literal | ||
*/ | ||
literal(value: string, languageOrDatatype?: string | NamedNode): Literal; | ||
literal(value: string, languageOrDatatype?: string | NamedNode | DirectionalLanguage): Literal; | ||
@@ -293,2 +300,27 @@ /** | ||
quad(subject: InQuad['subject'], predicate: InQuad['predicate'], object: InQuad['object'], graph?: InQuad['graph']): OutQuad; | ||
/** | ||
* @param original The original term. | ||
* @return A new instance of the term such that newTermInstance.equals(original) returns true. | ||
* @see Term | ||
*/ | ||
fromTerm<T extends NamedNode>(original: T): NamedNode; | ||
fromTerm<T extends BlankNode>(original: T): BlankNode; | ||
fromTerm<T extends Literal>(original: T): Literal; | ||
fromTerm<T extends Variable>(original: T): Variable; | ||
fromTerm<T extends DefaultGraph>(original: T): DefaultGraph; | ||
fromTerm<T extends BaseQuad>(original: T): OutQuad; | ||
fromTerm<T extends Term>(original: T): T; | ||
/** | ||
* @param original The original quad. | ||
* @return A new instance of the quad such that newQuadInstance.equals(original) returns true. | ||
* @see Quad | ||
*/ | ||
fromQuad(original: InQuad): OutQuad; | ||
} | ||
export interface DirectionalLanguage { | ||
language: string; | ||
direction?: 'ltr' | 'rtl' | '' | null; | ||
} |
/// <reference types="node" /> | ||
export * from './data-model'; | ||
export * from './stream'; | ||
export * from './dataset'; | ||
export * from './query'; | ||
export type * from './data-model'; | ||
export type * from './stream'; | ||
export type * from './dataset'; | ||
export type * from './query'; |
{ | ||
"name": "@rdfjs/types", | ||
"version": "1.1.2", | ||
"version": "2.0.0", | ||
"license": "MIT", | ||
@@ -27,3 +27,3 @@ "types": "index.d.ts", | ||
"eslint": "^7.12.0", | ||
"typescript": "^4.0.3" | ||
"typescript": "^5.7.2" | ||
}, | ||
@@ -30,0 +30,0 @@ "bugs": { |
@@ -8,5 +8,10 @@ /* Query Interfaces - Common */ | ||
/** | ||
* Helper union type for triple term names. | ||
*/ | ||
export type TripleTermName = 'subject' | 'predicate' | 'object'; | ||
/** | ||
* Helper union type for quad term names. | ||
*/ | ||
export type QuadTermName = 'subject' | 'predicate' | 'object' | 'graph'; | ||
export type QuadTermName = TripleTermName | 'graph'; | ||
@@ -13,0 +18,0 @@ // TODO: merge this with Stream upon the next major change |
@@ -29,2 +29,10 @@ # RDF/JS Types | ||
## Additional Types | ||
Note that some helper types exist that do not exist within the RDF/JS specifications. These include: | ||
```typescript | ||
import type { TripleTermName, QuadTermName } from '@rdfjs/types' | ||
``` | ||
## Contributing | ||
@@ -31,0 +39,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
41725
1006
48
0