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

1.0.1 • Public • Published

Installation

npm install --save @types/express-preconditions

Summary

This package contains type definitions for express-preconditions (https://richardschneider.github/express-conditional-request).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-preconditions.

index.d.ts

// Type definitions for express-preconditions 1.0
// Project: https://richardschneider.github/express-conditional-request
// Definitions by: tpluscode <https://github.com/tpluscode>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import type { RequestHandler, Request, Response } from 'express';

declare namespace preconditions {
    interface ResourceState {
        etag?: string;
        lastModified?: string;
    }

    interface StateProvider {
        (req: Request): Promise<ResourceState>;
    }

    interface ErrorCallback {
        (statusCode: number, message: string, req: Request, res: Response): void;
    }

    interface Options {
        stateAsync?: StateProvider;
        error?: ErrorCallback;
        requiredWith?: string[];
    }
}

declare function preconditions(options?: preconditions.Options): RequestHandler;

export = preconditions;

Additional Details

  • Last updated: Sun, 25 Sep 2022 18:02:59 GMT
  • Dependencies: @types/express
  • Global values: none

Credits

These definitions were written by tpluscode.

Keywords

none

Install

npm i @types/express-preconditions

DownloadsWeekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

4.53 kB

Total Files

5

Last publish

Collaborators

  • types