fix: add missing interface (#42525)

This commit is contained in:
Tomasz Pluskiewicz
2020-02-21 11:07:46 -08:00
committed by GitHub
parent b8f4f8a0c8
commit bc2379577e
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -8,6 +8,12 @@ import { Term } from 'rdf-js';
import { URL } from 'url';
declare namespace SparqlHttp {
interface SparqlHttpClient<TResponse extends Response = Response> {
updateQuery(query: string, options?: QueryRequestInit): Promise<Response>;
selectQuery(query: string, options?: QueryRequestInit): Promise<SelectResponse & TResponse>;
constructQuery(query: string, options?: QueryRequestInit): Promise<TResponse>;
}
interface SparqlHttpOptions {
endpointUrl?: string;
updateUrl?: string;
@@ -34,7 +40,7 @@ declare namespace SparqlHttp {
}
}
declare class SparqlHttp<TResponse extends Response = Response> {
declare class SparqlHttp<TResponse extends Response = Response> implements SparqlHttp.SparqlHttpClient<TResponse> {
constructor(options?: SparqlHttp.SparqlClientOptions);
updateQuery(query: string, options?: SparqlHttp.QueryRequestInit): Promise<Response>;
@@ -1,6 +1,6 @@
import * as SparqlHttp from 'sparql-http-client';
const client = new SparqlHttp();
const client: SparqlHttp.SparqlHttpClient = new SparqlHttp();
async function selectQuery() {
const response = await client.selectQuery('...', {