mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
feat: types for @rdfjs/to-ntriples (#42271)
* feat: types for @rdfjs/to-ntriples * added OTHER_FILES.txt
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
lib/blankNode.d.ts
|
||||
lib/defaultGraph.d.ts
|
||||
lib/literal.d.ts
|
||||
lib/namedNode.d.ts
|
||||
lib/variable.d.ts
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Type definitions for @rdfjs/to-ntriples 1.0
|
||||
// Project: https://github.com/rdfjs-base/to-ntriples
|
||||
// Definitions by: tpluscode <https://github.com/tpluscode>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// Minimum TypeScript Version: 3.0
|
||||
|
||||
import quad = require('./lib/quad');
|
||||
import term = require('./lib/term');
|
||||
|
||||
declare const toNtriples: {
|
||||
quadToNTriples: typeof quad;
|
||||
termToNTriples: typeof term;
|
||||
};
|
||||
|
||||
export = toNtriples;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { BlankNode } from 'rdf-js';
|
||||
|
||||
declare function blankNode(blankNode: BlankNode): string;
|
||||
|
||||
export = blankNode;
|
||||
@@ -0,0 +1,5 @@
|
||||
import { DefaultGraph } from 'rdf-js';
|
||||
|
||||
declare function defaultGraph(defaultGraph?: DefaultGraph): string;
|
||||
|
||||
export = defaultGraph;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { Literal } from 'rdf-js';
|
||||
|
||||
declare function literal(literal: Literal): string;
|
||||
|
||||
export = literal;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { NamedNode } from 'rdf-js';
|
||||
|
||||
declare function namedNode(namedNode: NamedNode): string;
|
||||
|
||||
export = namedNode;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { Quad } from 'rdf-js';
|
||||
|
||||
declare function quad(quad: Quad): string;
|
||||
|
||||
export = quad;
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import { Term } from 'rdf-js';
|
||||
|
||||
declare function term(term: Term): string;
|
||||
declare function term(term: unknown): undefined;
|
||||
|
||||
export = term;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { Variable } from 'rdf-js';
|
||||
|
||||
declare function variable(variable: Variable): string;
|
||||
|
||||
export = variable;
|
||||
@@ -0,0 +1,27 @@
|
||||
import * as RDF from 'rdf-js';
|
||||
import toNtriples = require('@rdfjs/to-ntriples');
|
||||
import blankNode = require('@rdfjs/to-ntriples/lib/blankNode');
|
||||
import defaultGraph = require('@rdfjs/to-ntriples/lib/defaultGraph');
|
||||
import namedNode = require('@rdfjs/to-ntriples/lib/namedNode');
|
||||
import variable = require('@rdfjs/to-ntriples/lib/variable');
|
||||
|
||||
const rdfBlankNode: RDF.BlankNode = <any> {};
|
||||
const rdfDefaultGraph: RDF.DefaultGraph = <any> {};
|
||||
const rdfNamedNode: RDF.NamedNode = <any> {};
|
||||
const rdfVariable: RDF.Variable = <any> {};
|
||||
const rdfQuad: RDF.Quad = <any> {};
|
||||
|
||||
const blankNodeString: string = blankNode(rdfBlankNode);
|
||||
let defaultGraphString: string = defaultGraph();
|
||||
defaultGraphString = defaultGraph(rdfDefaultGraph);
|
||||
const namedNodeString: string = namedNode(rdfNamedNode);
|
||||
const variableString: string = variable(rdfVariable);
|
||||
const quadString: string = toNtriples.quadToNTriples(rdfQuad);
|
||||
|
||||
let termString: string;
|
||||
termString = toNtriples.termToNTriples(rdfBlankNode);
|
||||
termString = toNtriples.termToNTriples(rdfDefaultGraph);
|
||||
termString = toNtriples.termToNTriples(rdfNamedNode);
|
||||
termString = toNtriples.termToNTriples(rdfVariable);
|
||||
|
||||
const notTermString: undefined = toNtriples.termToNTriples({ termType: 'foo' });
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"@rdfjs/to-ntriples": [
|
||||
"rdfjs__to-ntriples"
|
||||
],
|
||||
"@rdfjs/to-ntriples/*": [
|
||||
"rdfjs__to-ntriples/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"rdfjs__to-ntriples-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user