@types/rdfjs__express-handler
TypeScript icon, indicating that this package has built-in type declarations

2.0.6 • Public • Published

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

Credits

These definitions were written by tpluscode.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/rdfjs__express-handler

Weekly Downloads

56

Version

2.0.6

License

MIT

Unpacked Size

5.53 kB

Total Files

5

Last publish

Collaborators

  • types