Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions types/dockerode/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ declare namespace Dockerode {
modem: any;
id: string;

inspect(callback: Callback<any>): void;
inspect(): Promise<any>;
inspect(callback: Callback<NetworkInspectInfo>): void;
inspect(): Promise<NetworkInspectInfo>;

remove(options: {}, callback: Callback<any>): void;
remove(callback: Callback<any>): void;
Expand Down
15 changes: 13 additions & 2 deletions types/sparql-http-client/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<RAsk = unknown, RConstruct = unknown, RSelect = unknown, RUpdate = unknown> {
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<Q extends BaseQuad> {
Expand Down
6 changes: 5 additions & 1 deletion types/sparql-http-client/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -21,6 +21,10 @@
{
"name": "Ludovic Muller",
"githubUsername": "ludovicm67"
},
{
"name": "Giacomo Ronconi",
"githubUsername": "giacomoronconiobda"
}
]
}
10 changes: 10 additions & 0 deletions types/sparql-http-client/sparql-http-client-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<DataFactory<TestQuad> | DatasetCoreFactory<TestQuad>> = <any> {};
const headers: HeadersInit = <any> {};
const password: string = <any> {};
Expand Down Expand Up @@ -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 });
}