DefinitelyTyped/types/express-debug/index.d.ts

84 lines
1.9 KiB
TypeScript
Raw Permalink Normal View History

// Type definitions for express-debug 1.1.1
2015-04-09 05:53:01 +00:00
// Project: https://github.com/devoidfury/express-debug
2017-08-20 22:37:53 +00:00
// Definitions by: Federico Bond <https://github.com/federicobond>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
2015-04-09 05:53:01 +00:00
/* =================== USAGE ===================
import debug = require('express-debug');
debug(app, options);
=============================================== */
2016-04-27 17:24:01 +00:00
2015-04-09 05:53:01 +00:00
import express = require('express');
2015-04-09 05:53:01 +00:00
interface CustomPanel {
name: string;
2015-04-09 05:53:01 +00:00
template: string;
2015-04-09 05:53:01 +00:00
process(locals: any): any;
2015-04-09 05:53:01 +00:00
standalone?: boolean;
2015-04-09 05:53:01 +00:00
initialize?(req: express.Request): void;
2015-04-09 05:53:01 +00:00
finalize?(req: express.Request): void;
2015-04-09 05:53:01 +00:00
pre_render?(req: express.Request): void;
2015-04-09 05:53:01 +00:00
post_render?(req: express.Request): void;
2015-04-09 05:53:01 +00:00
options?: any;
}
/**
* Node.js middleware for serving a favicon.
*/
declare function debug(app: express.Application, settings?: {
2015-04-09 05:53:01 +00:00
/**
* How deep to recurse through printed objects. This is the default unless the
* print_obj function is passed an options object with a 'depth' property.
2015-04-09 05:53:01 +00:00
*/
depth?: number;
/**
* Absolute path to a css file to include and override EDT's default css.
*/
theme?: string;
/**
* Additional panels to show.
*/
extra_panels?: CustomPanel[];
/**
* Allows changing the default panel.
*/
panels?: string[];
/**
* Path to render standalone express-debug.
*/
path?: string;
/**
* If you need to add arbitrary attributes to the containing element of EDT,
* this allows you to.
*/
extra_attrs?: string;
/**
* Global option to determine sort order of printed object values. false for
* default order, true for basic default sort, or a function to use for sort.
*/
sort?: boolean | ((a: number, b: number) => number);
}): void;
export = debug;