DefinitelyTyped/types/permit/index.d.ts
Nathan Shively-Sanders f0e6c97928 Add missing authors.
Uncovered by dtslint 0.5.4, which now requires that definitions cannot
be by "My Self", which is the default from dts-gen.
2019-03-11 09:09:21 -07:00

36 lines
884 B
TypeScript

// Type definitions for permit 0.2
// Project: https://github.com/ianstormtaylor/permit#readme
// Definitions by: Jannik Keye <https://github.com/jannikkeye>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import { IncomingMessage, ServerResponse } from "http";
export interface PermitOptions {
scheme?: string;
proxy?: string;
realm?: string;
}
export interface BearerOptions extends PermitOptions {
basic?: string;
header?: string;
query?: string;
}
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];
}