@types/rdf-js
Advanced tools
Comparing version 1.0.1 to 2.0.0
@@ -1,5 +0,7 @@ | ||
// Type definitions for the RDFJS specification 1.0 | ||
// Type definitions for the RDFJS specification 2.0 | ||
// Project: https://github.com/rdfjs/representation-task-force | ||
// Definitions by: Ruben Taelman <https://github.com/rubensworks> | ||
// Laurens Rietveld <https://github.com/LaurensRietveld> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.3 | ||
@@ -15,28 +17,15 @@ /// <reference types="node" /> | ||
/** | ||
* Abstract interface for RDF terms (subject, predicate, object or graph). | ||
* Contains an Iri, RDF blank Node, RDF literal, variable name, or a default graph | ||
* @see NamedNode | ||
* @see BlankNode | ||
* @see Literal | ||
* @see Variable | ||
* @see DefaultGraph | ||
*/ | ||
export interface Term { | ||
/** | ||
* Contains a value that identifies the concrete interface of the term, | ||
* since Term itself is not directly instantiated. | ||
* | ||
* Possible values include "NamedNode", "BlankNode", "Literal", "Variable" and "DefaultGraph". | ||
*/ | ||
termType: "NamedNode" | "BlankNode" | "Literal" | "Variable" | "DefaultGraph"; | ||
/** | ||
* Refined by each interface which extends Term | ||
*/ | ||
value: string; | ||
export type Term = NamedNode | BlankNode | Literal | Variable | DefaultGraph; | ||
/** | ||
* @param other The term to compare with. | ||
* @return If the termType is equal and the contents are equal (as defined by concrete subclasses). | ||
*/ | ||
equals(other: Term): boolean; | ||
} | ||
/** | ||
* Contains an IRI. | ||
*/ | ||
export interface NamedNode extends Term { | ||
export interface NamedNode { | ||
/** | ||
@@ -61,3 +50,3 @@ * Contains the constant "NamedNode". | ||
*/ | ||
export interface BlankNode extends Term { | ||
export interface BlankNode { | ||
/** | ||
@@ -85,3 +74,3 @@ * Contains the constant "BlankNode". | ||
*/ | ||
export interface Literal extends Term { | ||
export interface Literal { | ||
/** | ||
@@ -117,3 +106,3 @@ * Contains the constant "Literal". | ||
*/ | ||
export interface Variable extends Term { | ||
export interface Variable { | ||
/** | ||
@@ -139,3 +128,3 @@ * Contains the constant "Variable". | ||
*/ | ||
export interface DefaultGraph extends Term { | ||
export interface DefaultGraph { | ||
/** | ||
@@ -158,34 +147,90 @@ * Contains the constant "DefaultGraph". | ||
/** | ||
* The subject, which is a NamedNode, BlankNode or Variable. | ||
* @see NamedNode | ||
* @see BlankNode | ||
* @see Variable | ||
*/ | ||
export type Quad_Subject = NamedNode | BlankNode | Variable; | ||
/** | ||
* The predicate, which is a NamedNode or Variable. | ||
* @see NamedNode | ||
* @see Variable | ||
*/ | ||
export type Quad_Predicate = NamedNode | Variable; | ||
/** | ||
* The object, which is a NamedNode, Literal, BlankNode or Variable. | ||
* @see NamedNode | ||
* @see Literal | ||
* @see BlankNode | ||
* @see Variable | ||
*/ | ||
export type Quad_Object = NamedNode | Literal | BlankNode | Variable; | ||
/** | ||
* The named graph, which is a DefaultGraph, NamedNode, BlankNode or Variable. | ||
* @see DefaultGraph | ||
* @see NamedNode | ||
* @see BlankNode | ||
* @see Variable | ||
*/ | ||
export type Quad_Graph = DefaultGraph | NamedNode | BlankNode | Variable; | ||
/** | ||
* An RDF quad, taking any Term in its positions, containing the subject, predicate, object and graph terms. | ||
*/ | ||
export interface BaseQuad { | ||
/** | ||
* The subject. | ||
* @see Quad_Subject | ||
*/ | ||
subject: Term; | ||
/** | ||
* The predicate. | ||
* @see Quad_Predicate | ||
*/ | ||
predicate: Term; | ||
/** | ||
* The object. | ||
* @see Quad_Object | ||
*/ | ||
object: Term; | ||
/** | ||
* The named graph. | ||
* @see Quad_Graph | ||
*/ | ||
graph: Term; | ||
/** | ||
* @param other The term to compare with. | ||
* @return True if and only if the argument is a) of the same type b) has all components equal. | ||
*/ | ||
equals(other: BaseQuad): boolean; | ||
} | ||
/** | ||
* An RDF quad, containing the subject, predicate, object and graph terms. | ||
*/ | ||
export interface Quad { | ||
export interface Quad extends BaseQuad { | ||
/** | ||
* The subject, which is a NamedNode, BlankNode or Variable. | ||
* @see NamedNode | ||
* @see BlankNode | ||
* @see Variable | ||
* The subject. | ||
* @see Quad_Subject | ||
*/ | ||
subject: Term; | ||
subject: Quad_Subject; | ||
/** | ||
* The predicate, which is a NamedNode or Variable. | ||
* @see NamedNode | ||
* @see Variable | ||
* The predicate. | ||
* @see Quad_Predicate | ||
*/ | ||
predicate: Term; | ||
predicate: Quad_Predicate; | ||
/** | ||
* The object, which is a NamedNode, Literal, BlankNode or Variable. | ||
* @see NamedNode | ||
* @see Literal | ||
* @see BlankNode | ||
* @see Variable | ||
* The object. | ||
* @see Quad_Object | ||
*/ | ||
object: Term; | ||
object: Quad_Object; | ||
/** | ||
* The named graph, which is a DefaultGraph, NamedNode, BlankNode or Variable. | ||
* @see DefaultGraph | ||
* @see NamedNode | ||
* @see BlankNode | ||
* @see Variable | ||
* The named graph. | ||
* @see Quad_Graph | ||
*/ | ||
graph: Term; | ||
graph: Quad_Graph; | ||
@@ -196,3 +241,3 @@ /** | ||
*/ | ||
equals(other: Quad): boolean; | ||
equals(other: BaseQuad): boolean; | ||
} | ||
@@ -262,3 +307,3 @@ | ||
*/ | ||
triple(subject: Term, predicate: Term, object: Term): Quad; | ||
triple<Q_In extends BaseQuad = Quad, Q_Out extends BaseQuad = Quad>(subject: Q_In['subject'], predicate: Q_In['predicate'], object: Q_In['object']): Q_Out; | ||
@@ -273,3 +318,3 @@ /** | ||
*/ | ||
quad(subject: Term, predicate: Term, object: Term, graph?: Term): Quad; | ||
quad<Q_In extends BaseQuad = Quad, Q_Out extends BaseQuad = Quad>(subject: Q_In['subject'], predicate: Q_In['predicate'], object: Q_In['object'], graph?: Q_In['graph']): Q_Out; | ||
} | ||
@@ -293,3 +338,3 @@ | ||
*/ | ||
export interface Stream extends EventEmitter { | ||
export interface Stream<Q extends BaseQuad = Quad> extends EventEmitter { | ||
/** | ||
@@ -301,3 +346,3 @@ * This method pulls a quad out of the internal buffer and returns it. | ||
*/ | ||
read(): Quad; | ||
read(): Q; | ||
} | ||
@@ -312,3 +357,3 @@ | ||
*/ | ||
export interface Source { | ||
export interface Source<Q extends BaseQuad = Quad> { | ||
/** | ||
@@ -323,4 +368,3 @@ * Returns a stream that processes all quads matching the pattern. | ||
*/ | ||
match(subject?: Term | RegExp, predicate?: Term | RegExp, object?: Term | RegExp, graph?: Term | RegExp) | ||
: Stream; | ||
match(subject?: Term | RegExp, predicate?: Term | RegExp, object?: Term | RegExp, graph?: Term | RegExp): Stream<Q>; | ||
} | ||
@@ -335,3 +379,3 @@ | ||
*/ | ||
export interface Sink { | ||
export interface Sink<Q extends BaseQuad = Quad> { | ||
/** | ||
@@ -347,3 +391,3 @@ * Consumes the given stream. | ||
*/ | ||
import(stream: Stream): EventEmitter; | ||
import(stream: Stream<Q>): EventEmitter; | ||
} | ||
@@ -359,3 +403,3 @@ | ||
*/ | ||
export interface Store extends Source, Sink { | ||
export interface Store<Q extends BaseQuad = Quad> extends Source, Sink { | ||
/** | ||
@@ -370,3 +414,3 @@ * Removes all streamed quads. | ||
*/ | ||
remove(stream: Stream): EventEmitter; | ||
remove(stream: Stream<Q>): EventEmitter; | ||
@@ -397,3 +441,3 @@ /** | ||
*/ | ||
deleteGraph(graph: Term | string): EventEmitter; | ||
deleteGraph(graph: Q['graph'] | string): EventEmitter; | ||
} |
{ | ||
"name": "@types/rdf-js", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "TypeScript definitions for the RDFJS specification", | ||
@@ -11,8 +11,14 @@ "license": "MIT", | ||
"githubUsername": "rubensworks" | ||
}, | ||
{ | ||
"name": "Laurens Rietveld", | ||
"url": "https://github.com/LaurensRietveld", | ||
"githubUsername": "LaurensRietveld" | ||
} | ||
], | ||
"main": "", | ||
"types": "", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
}, | ||
@@ -23,4 +29,4 @@ "scripts": {}, | ||
}, | ||
"typesPublisherContentHash": "18b2a6ab4428a81970902dcf26949259f02c0720ab9f3982a4183441a785e777", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "452e50f2a7adefbb29f71f36d5ee5e7495cba200c5404f962778f32b31806d4e", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -8,10 +8,10 @@ # Installation | ||
# Details | ||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rdf-js | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rdf-js | ||
Additional Details | ||
* Last updated: Wed, 25 Oct 2017 16:18:55 GMT | ||
* Dependencies: stream, events, node | ||
* Last updated: Tue, 30 Oct 2018 20:03:34 GMT | ||
* Dependencies: node | ||
* Global values: none | ||
# Credits | ||
These definitions were written by Ruben Taelman <https://github.com/rubensworks>. | ||
These definitions were written by Ruben Taelman <https://github.com/rubensworks>, Laurens Rietveld <https://github.com/LaurensRietveld>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15505
388