Use correct typings for prefix utility function (#41371)

This commit is contained in:
Laurens Rietveld
2020-01-03 20:27:42 +01:00
committed by Ryan Cavanaugh
parent a6ee7419ec
commit 7e9cebb5f4
2 changed files with 2 additions and 1 deletions

2
types/n3/index.d.ts vendored
View File

@@ -18,7 +18,7 @@ export interface Prefixes<I = RDF.NamedNode> {
}
export type Term = NamedNode | BlankNode | Literal | Variable | DefaultGraph;
export type PrefixedToIri = (suffix: string) => RDF.NamedNode;
export type PrefixedToIri = (suffix: string) => NamedNode;
export class NamedNode implements RDF.NamedNode {
readonly termType: "NamedNode";

View File

@@ -239,4 +239,5 @@ function test_doc_utility() {
const prefixes: N3.Prefixes = { rdfs: N3.DataFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#') };
const namedNode1: RDF.NamedNode = N3Util.prefix('http://www.w3.org/2000/01/rdf-schema#')('label');
const namedNode2: RDF.NamedNode = N3Util.prefixes(prefixes)('rdfs')('label');
const namedNode3: N3.NamedNode = N3Util.prefixes(prefixes)('rdfs')('label');
}