mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
fix: add missing interface (#42525)
This commit is contained in:
Vendored
+7
-1
@@ -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('...', {
|
||||
|
||||
Reference in New Issue
Block a user