import { BaseQuad, Quad, DataFactory, Stream } from 'rdf-js'; import BaseClient = require('./BaseClient'); import StreamQuery = require('./StreamQuery'); import StreamStore = require('./StreamStore'); import { Endpoint, EndpointOptions } from './Endpoint'; interface Constructor { new (options: { endpoint: Endpoint; factory: DataFactory; }): T; } declare namespace StreamClient { interface QueryOptions { headers?: HeadersInit; operation?: 'get' | 'postUrlencoded' | 'postDirect'; } interface QueryInit { endpoint: Endpoint; } interface SelectQuery { select(query: string, options?: QueryOptions): Promise; } interface ConstructQuery { construct(query: string, options?: QueryOptions): Promise; } interface AskQuery { ask(query: string, options?: QueryOptions): Promise; } interface UpdateQuery { update(query: string, options?: QueryOptions): Promise; } interface Query extends AskQuery, SelectQuery, ConstructQuery, UpdateQuery { endpoint: Endpoint; } interface Store { endpoint: Endpoint; get(graph: Quad['graph']): Promise>; post(stream: Stream): Promise; put(stream: Stream): Promise; } interface ClientOptions = never> { endpoint: Endpoint; factory?: DataFactory; Query?: Constructor; Store?: Constructor; } type StreamClientOptions = EndpointOptions & Pick>, 'factory'>; type StreamClient = Client, Q, StreamStore>; interface Client = never> { query: TQuery; store: TStore; } } declare class StreamClient extends BaseClient, Q, StreamStore> implements StreamClient.StreamClient { constructor(options: StreamClient.StreamClientOptions) } export = StreamClient;