diff --git a/types/dockerode/index.d.ts b/types/dockerode/index.d.ts index 6d519472359694..2175b4c071081e 100644 --- a/types/dockerode/index.d.ts +++ b/types/dockerode/index.d.ts @@ -283,8 +283,8 @@ declare namespace Dockerode { modem: any; id: string; - inspect(callback: Callback): void; - inspect(): Promise; + inspect(callback: Callback): void; + inspect(): Promise; remove(options: {}, callback: Callback): void; remove(callback: Callback): void; diff --git a/types/sparql-http-client/index.d.ts b/types/sparql-http-client/index.d.ts index 2fea6e4f4352d1..62cfe04e07cf27 100644 --- a/types/sparql-http-client/index.d.ts +++ b/types/sparql-http-client/index.d.ts @@ -20,16 +20,27 @@ export { StreamStore, }; -export interface QueryOptions { +export interface BaseQueryOptions { headers?: HeadersInit; operation?: "get" | "postUrlencoded" | "postDirect"; + parameters?: { [key: string]: undefined | string | string[] }; +} + +export interface QueryOptions extends BaseQueryOptions { + defaultGraph?: string | string[]; + namedGraph?: string | string[]; +} + +export interface UpdateOptions extends BaseQueryOptions { + usingGraph?: string | string[]; + usingNamedGraph?: string | string[]; } export interface Query { ask(query: string, options?: QueryOptions): RAsk; construct(query: string, options?: QueryOptions): RConstruct; select(query: string, options?: QueryOptions): RSelect; - update(query: string, options?: QueryOptions): RUpdate; + update(query: string, options?: UpdateOptions): RUpdate; } export interface Store { diff --git a/types/sparql-http-client/package.json b/types/sparql-http-client/package.json index 74efa05f8d6a04..88d753bbdcb97a 100644 --- a/types/sparql-http-client/package.json +++ b/types/sparql-http-client/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/sparql-http-client", - "version": "3.0.9999", + "version": "3.1.9999", "type": "module", "projects": [ "https://github.com/bergos/sparql-http-client" @@ -21,6 +21,10 @@ { "name": "Ludovic Muller", "githubUsername": "ludovicm67" + }, + { + "name": "Giacomo Ronconi", + "githubUsername": "giacomoronconiobda" } ] } diff --git a/types/sparql-http-client/sparql-http-client-tests.ts b/types/sparql-http-client/sparql-http-client-tests.ts index 376a79c60b5e85..495fdc1453a4e6 100644 --- a/types/sparql-http-client/sparql-http-client-tests.ts +++ b/types/sparql-http-client/sparql-http-client-tests.ts @@ -14,6 +14,9 @@ interface TestQuad extends Quad { const endpointUrl = ""; const query = ""; +const defaultGraph = ""; +const namedGraph = ""; +const parameters = { key1: "value1", key2: ["value2a", "value2b"] }; const factory: Environment | DatasetCoreFactory> = {}; const headers: HeadersInit = {}; const password: string = {}; @@ -256,3 +259,10 @@ function initFromInstance() { const parsingClient = new ParsingClient(client); const simpleClient = new SimpleClient(client); } + +function testParameters() { + const client = new SimpleClient({ + endpointUrl, + }); + client.query.select(query, { defaultGraph, namedGraph, parameters }); +}