Installation
npm install --save @types/rdfjs__express-handler
Summary
This package contains type definitions for @rdfjs/express-handler (https://github.com/rdfjs-base/express-handler).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rdfjs__express-handler.
index.d.ts
import { SinkMap } from "@rdfjs/sink-map";
import { DatasetCore, DatasetCoreFactory, Stream } from "@rdfjs/types";
import { EventEmitter } from "events";
import { Request, RequestHandler, Response } from "express";
declare module "express-serve-static-core" {
interface Request {
dataset?(parserOptions?: any): Promise<DatasetCore>;
quadStream?(parserOptions?: any): Stream;
}
interface Response {
dataset(dataset: DatasetCore): Promise<void>;
quadStream(stream: Stream): Promise<void>;
}
}
interface BaseIriFromRequest {
(req: Request): Promise<string> | string;
}
interface Formats {
parsers: SinkMap<EventEmitter, Stream>;
serializers: SinkMap<Stream, EventEmitter>;
}
interface RdfHandlerOptions {
factory?: DatasetCoreFactory | undefined;
formats?: Formats | undefined;
defaultMediaType?: string | undefined;
baseIriFromRequest?: boolean | BaseIriFromRequest | undefined;
sendTriples?: boolean | undefined;
}
interface RdfHandler {
(options?: RdfHandlerOptions): RequestHandler;
attach(req: Request, res: Response, options?: RdfHandlerOptions): Promise<void>;
}
declare const init: RdfHandler;
export default init;
Additional Details
- Last updated: Fri, 23 Feb 2024 17:35:19 GMT
- Dependencies: @rdfjs/types, @types/express, @types/express-serve-static-core, @types/rdfjs__sink-map
Credits
These definitions were written by tpluscode.