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

0.2.4 • Public • Published

Installation

npm install --save @types/permit

Summary

This package contains type definitions for permit (https://github.com/ianstormtaylor/permit#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/permit.

index.d.ts

/// <reference types="node" />

import { IncomingMessage, ServerResponse } from "http";

export interface PermitOptions {
    scheme?: string | undefined;
    proxy?: string | undefined;
    realm?: string | undefined;
}

export interface BearerOptions extends PermitOptions {
    basic?: string | undefined;
    header?: string | undefined;
    query?: string | undefined;
}

export class Permit {
    constructor(options: PermitOptions);
    check(req: IncomingMessage): void;
    fail(res: ServerResponse): void;
}

export class Bearer extends Permit {
    constructor(options: BearerOptions);
    check(req: IncomingMessage): string;
}

export class Basic extends Permit {
    check(req: IncomingMessage): [string, string];
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Jannik Keye.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/permit

Weekly Downloads

258

Version

0.2.4

License

MIT

Unpacked Size

4.06 kB

Total Files

5

Last publish

Collaborators

  • types