mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Uncovered by dtslint 0.5.4, which now requires that definitions cannot be by "My Self", which is the default from dts-gen.
36 lines
884 B
TypeScript
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];
|
|
}
|