diff --git a/package.json b/package.json
index 853a0922e7..4c29e47861 100644
--- a/package.json
+++ b/package.json
@@ -16,12 +16,19 @@
"office",
"generate",
"document",
- "doc"
+ "doc",
+ "officegen",
+ "clippy"
],
"dependencies": {
+ "@types/archiver": "^0.15.37",
+ "@types/express": "^4.0.35",
+ "@types/lodash": "^4.14.54",
"app-root-path": "^2.0.1",
"archiver": "^1.3.0",
+ "install": "^0.8.7",
"lodash": "^4.6.1",
+ "npm": "^4.3.0",
"xml": "^1.0.1"
},
"typescript": {
@@ -34,6 +41,8 @@
},
"homepage": "https://github.com/dolanmiu/docx#readme",
"devDependencies": {
+ "@types/chai": "^3.4.35",
+ "@types/mocha": "^2.2.39",
"chai": "^3.5.0",
"mocha": "^3.2.0",
"rimraf": "^2.5.2",
diff --git a/ts/tests/_testTemplate.ts b/ts/tests/_testTemplate.ts
index 44081f71a4..c7f727e661 100644
--- a/ts/tests/_testTemplate.ts
+++ b/ts/tests/_testTemplate.ts
@@ -1,7 +1,4 @@
-///
-///
-
-import {assert} from "chai";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
@@ -11,7 +8,7 @@ function jsonify(obj: Object) {
describe("", () => {
beforeEach(() => {
-
+
});
describe("#methodName()", () => {
diff --git a/ts/tests/docx/document/bodyTest.ts b/ts/tests/docx/document/bodyTest.ts
index 22bcfce941..6fb47558fd 100644
--- a/ts/tests/docx/document/bodyTest.ts
+++ b/ts/tests/docx/document/bodyTest.ts
@@ -1,12 +1,10 @@
-///
-///
-import {Body} from "../../../docx/document/body";
-import {assert} from "chai";
-import {SectionProperties} from "../../../docx/document/body/section-properties";
-import {PageSize} from "../../../docx/document/body/page-size";
-import {PageMargin} from "../../../docx/document/body/page-margin";
-import {Columns} from "../../../docx/document/body/columns";
-import {DocumentGrid} from "../../../docx/document/body/doc-grid";
+import { Body } from "../../../docx/document/body";
+import { assert } from "chai";
+import { SectionProperties } from "../../../docx/document/body/section-properties";
+import { PageSize } from "../../../docx/document/body/page-size";
+import { PageMargin } from "../../../docx/document/body/page-margin";
+import { Columns } from "../../../docx/document/body/columns";
+import { DocumentGrid } from "../../../docx/document/body/doc-grid";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/document/documentTest.ts b/ts/tests/docx/document/documentTest.ts
index 11e2828510..02e67e71e2 100644
--- a/ts/tests/docx/document/documentTest.ts
+++ b/ts/tests/docx/document/documentTest.ts
@@ -1,8 +1,5 @@
-///
-///
-
import * as docx from "../../../docx";
-import {assert} from "chai";
+import { assert } from "chai";
describe("Document", () => {
let document: docx.Document;
diff --git a/ts/tests/docx/paragraph/borderTest.ts b/ts/tests/docx/paragraph/borderTest.ts
index c2fff70f69..761a066c2d 100644
--- a/ts/tests/docx/paragraph/borderTest.ts
+++ b/ts/tests/docx/paragraph/borderTest.ts
@@ -1,8 +1,5 @@
-///
-///
-
-import {ThematicBreak} from "../../../docx/paragraph/border";
-import {assert} from "chai";
+import { ThematicBreak } from "../../../docx/paragraph/border";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/paragraph/pageBreakTests.ts b/ts/tests/docx/paragraph/pageBreakTests.ts
index 5278fcd9f2..b142a6f314 100644
--- a/ts/tests/docx/paragraph/pageBreakTests.ts
+++ b/ts/tests/docx/paragraph/pageBreakTests.ts
@@ -1,5 +1,5 @@
-import {PageBreak} from "../../../docx/paragraph/page-break";
-import {assert} from "chai";
+import { PageBreak } from "../../../docx/paragraph/page-break";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
@@ -26,7 +26,7 @@ describe("PageBreak", () => {
let newJson = jsonify(pageBreak);
assert.equal(newJson.rootKey, "w:r");
});
-
+
it("should create a Page Break with a Break inside", () => {
let newJson = jsonify(pageBreak);
assert.equal(newJson.root[1].rootKey, "w:br");
diff --git a/ts/tests/docx/paragraph/paragraphStyleTest.ts b/ts/tests/docx/paragraph/paragraphStyleTest.ts
index a9543d39f6..af05ac460a 100644
--- a/ts/tests/docx/paragraph/paragraphStyleTest.ts
+++ b/ts/tests/docx/paragraph/paragraphStyleTest.ts
@@ -1,8 +1,5 @@
-///
-///
-
-import {Style} from "../../../docx/paragraph/style";
-import {assert} from "chai";
+import { Style } from "../../../docx/paragraph/style";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/paragraph/paragraphTests.ts b/ts/tests/docx/paragraph/paragraphTests.ts
index 0a2c0f69a7..cda3632e33 100644
--- a/ts/tests/docx/paragraph/paragraphTests.ts
+++ b/ts/tests/docx/paragraph/paragraphTests.ts
@@ -1,8 +1,5 @@
-///
-///
-
import * as docx from "../../../docx";
-import {assert} from "chai";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/paragraph/tabStopTests.ts b/ts/tests/docx/paragraph/tabStopTests.ts
index 0db10d2468..2d2703138f 100644
--- a/ts/tests/docx/paragraph/tabStopTests.ts
+++ b/ts/tests/docx/paragraph/tabStopTests.ts
@@ -1,5 +1,5 @@
-import {LeftTabStop, MaxRightTabStop} from "../../../docx/paragraph/tab-stop";
-import {assert} from "chai";
+import { LeftTabStop, MaxRightTabStop } from "../../../docx/paragraph/tab-stop";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/paragraph/unorderedListTests.ts b/ts/tests/docx/paragraph/unorderedListTests.ts
index 3ecc676796..6a94ee4d6c 100644
--- a/ts/tests/docx/paragraph/unorderedListTests.ts
+++ b/ts/tests/docx/paragraph/unorderedListTests.ts
@@ -1,5 +1,5 @@
-import {NumberProperties} from "../../../docx/paragraph/unordered-list";
-import {assert} from "chai";
+import { NumberProperties } from "../../../docx/paragraph/unordered-list";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/run/breakTests.ts b/ts/tests/docx/run/breakTests.ts
index 8233316ddc..b71b44fd37 100644
--- a/ts/tests/docx/run/breakTests.ts
+++ b/ts/tests/docx/run/breakTests.ts
@@ -1,5 +1,5 @@
-import {Break} from "../../../docx/run/break";
-import {assert} from "chai";
+import { Break } from "../../../docx/run/break";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/run/runTest.ts b/ts/tests/docx/run/runTest.ts
index 182be2b8f0..fdec45c51d 100644
--- a/ts/tests/docx/run/runTest.ts
+++ b/ts/tests/docx/run/runTest.ts
@@ -1,6 +1,6 @@
-import {Run} from "../../../docx/run";
-import {TextRun} from "../../../docx/run/text-run";
-import {assert} from "chai";
+import { Run } from "../../../docx/run";
+import { TextRun } from "../../../docx/run/text-run";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/run/scriptTests.ts b/ts/tests/docx/run/scriptTests.ts
index 9f09fd79eb..2f8c779b73 100644
--- a/ts/tests/docx/run/scriptTests.ts
+++ b/ts/tests/docx/run/scriptTests.ts
@@ -1,5 +1,5 @@
-import {SubScript, SuperScript} from "../../../docx/run/script";
-import {assert} from "chai";
+import { SubScript, SuperScript } from "../../../docx/run/script";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/run/strikeTests.ts b/ts/tests/docx/run/strikeTests.ts
index e1a0d6d880..128c08fc6f 100644
--- a/ts/tests/docx/run/strikeTests.ts
+++ b/ts/tests/docx/run/strikeTests.ts
@@ -1,5 +1,5 @@
-import {Strike, DoubleStrike} from "../../../docx/run/strike";
-import {assert} from "chai";
+import { Strike, DoubleStrike } from "../../../docx/run/strike";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/run/tabTests.ts b/ts/tests/docx/run/tabTests.ts
index 86a0b3e2be..7ae300ef8a 100644
--- a/ts/tests/docx/run/tabTests.ts
+++ b/ts/tests/docx/run/tabTests.ts
@@ -1,5 +1,5 @@
-import {Tab} from "../../../docx/run/tab";
-import {assert} from "chai";
+import { Tab } from "../../../docx/run/tab";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/run/textRunTests.ts b/ts/tests/docx/run/textRunTests.ts
index a38789f37d..353df5dcc9 100644
--- a/ts/tests/docx/run/textRunTests.ts
+++ b/ts/tests/docx/run/textRunTests.ts
@@ -1,5 +1,5 @@
-import {TextRun} from "../../../docx/run/text-run";
-import {assert} from "chai";
+import { TextRun } from "../../../docx/run/text-run";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/run/underlineTests.ts b/ts/tests/docx/run/underlineTests.ts
index 92d21601a7..4a6e931598 100644
--- a/ts/tests/docx/run/underlineTests.ts
+++ b/ts/tests/docx/run/underlineTests.ts
@@ -1,6 +1,6 @@
import * as u from "../../../docx/run/underline";
-import {TextRun} from "../../../docx/run/text-run";
-import {assert} from "chai";
+import { TextRun } from "../../../docx/run/text-run";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/xml-components/attributeTest.ts b/ts/tests/docx/xml-components/attributeTest.ts
index d0be2f2e71..27e8ffdfe6 100644
--- a/ts/tests/docx/xml-components/attributeTest.ts
+++ b/ts/tests/docx/xml-components/attributeTest.ts
@@ -1,5 +1,5 @@
-import {Attributes} from "../../../docx/xml-components";
-import {assert} from "chai";
+import { Attributes } from "../../../docx/xml-components";
+import { assert } from "chai";
describe("Attribute", () => {
let attributes: Attributes;
diff --git a/ts/tests/docx/xml-components/xmlComponentTests.ts b/ts/tests/docx/xml-components/xmlComponentTests.ts
index 2e8fc57215..28f389e4f4 100644
--- a/ts/tests/docx/xml-components/xmlComponentTests.ts
+++ b/ts/tests/docx/xml-components/xmlComponentTests.ts
@@ -1,5 +1,5 @@
-import {XmlComponent} from "../../../docx/xml-components";
-import {assert} from "chai";
+import { XmlComponent } from "../../../docx/xml-components";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/docx/xml-components/xmlUnitTests.ts b/ts/tests/docx/xml-components/xmlUnitTests.ts
index a3e35f6bb9..313d8916d2 100644
--- a/ts/tests/docx/xml-components/xmlUnitTests.ts
+++ b/ts/tests/docx/xml-components/xmlUnitTests.ts
@@ -1,5 +1,5 @@
-import {XmlUnitComponent} from "../../../docx/xml-components";
-import {assert} from "chai";
+import { XmlUnitComponent } from "../../../docx/xml-components";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/export/formatterTest.ts b/ts/tests/export/formatterTest.ts
index 4a85bf68d5..8986c2472c 100644
--- a/ts/tests/export/formatterTest.ts
+++ b/ts/tests/export/formatterTest.ts
@@ -1,12 +1,8 @@
-///
-///
-///
-
-import {Formatter} from "../../export/formatter";
+import { Formatter } from "../../export/formatter";
import * as docx from "../../docx";
-import {Attributes} from "../../docx/xml-components";
-import {Properties} from "../../properties";
-import {assert} from "chai";
+import { Attributes } from "../../docx/xml-components";
+import { Properties } from "../../properties";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/export/localPackerTest.ts b/ts/tests/export/localPackerTest.ts
index af034e6653..4387472cf6 100644
--- a/ts/tests/export/localPackerTest.ts
+++ b/ts/tests/export/localPackerTest.ts
@@ -1,16 +1,11 @@
-///
-///
-///
-///
-
import * as fs from "fs";
-import {LocalPacker} from "../../export/packer/local";
-import {assert} from "chai";
-import {Document} from "../../docx/document";
-import {Properties} from "../../properties";
-import {DefaultStyle} from "../../styles/sample";
-import {Paragraph} from "../../docx/paragraph";
-import {DefaultStylesFactory} from "../../styles/factory";
+import { LocalPacker } from "../../export/packer/local";
+import { Document } from "../../docx/document";
+import { Properties } from "../../properties";
+import { DefaultStyle } from "../../styles/sample";
+import { Paragraph } from "../../docx/paragraph";
+import { DefaultStylesFactory } from "../../styles/factory";
+import { assert } from "chai";
describe("Packer", () => {
let packer: LocalPacker;
@@ -49,7 +44,7 @@ describe("Packer", () => {
clearInterval(int);
try {
assert(false, 'did not create a file within the alloted time');
- } catch (e){
+ } catch (e) {
done(e);
}
}, 2000);
diff --git a/ts/tests/numberingTest.ts b/ts/tests/numberingTest.ts
index 4587ad233b..404460133a 100644
--- a/ts/tests/numberingTest.ts
+++ b/ts/tests/numberingTest.ts
@@ -1,8 +1,5 @@
-///
-///
-
-import {assert} from "chai";
-import {Numbering} from "../numbering";
+import { assert } from "chai";
+import { Numbering } from "../numbering";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
@@ -10,7 +7,7 @@ function jsonify(obj: Object) {
}
describe("", () => {
-
+
let numbering = new Numbering;
beforeEach(() => {
numbering = new Numbering();
diff --git a/ts/tests/propertiesTest.ts b/ts/tests/propertiesTest.ts
index 9888da7859..0c56ccd13c 100644
--- a/ts/tests/propertiesTest.ts
+++ b/ts/tests/propertiesTest.ts
@@ -1,7 +1,5 @@
-///
-///
-import {Properties} from "../properties";
-import {assert} from "chai";
+import { Properties } from "../properties";
+import { assert } from "chai";
function jsonify(obj: Object) {
let stringifiedJson = JSON.stringify(obj);
diff --git a/ts/tests/stylesTest.ts b/ts/tests/stylesTest.ts
index 72ecd15d04..bc3015c009 100644
--- a/ts/tests/stylesTest.ts
+++ b/ts/tests/stylesTest.ts
@@ -1,8 +1,5 @@
-///
-///
-
-import {Styles} from "../styles";
-import {assert} from "chai";
+import { Styles } from "../styles";
+import { assert } from "chai";
describe("Styles", () => {
let styles: Styles;
diff --git a/ts/tsd.json b/ts/tsd.json
deleted file mode 100644
index 616afb14dd..0000000000
--- a/ts/tsd.json
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "version": "v4",
- "repo": "borisyankov/DefinitelyTyped",
- "ref": "master",
- "path": "typings",
- "bundle": "typings/tsd.d.ts",
- "installed": {
- "mocha/mocha.d.ts": {
- "commit": "299b5caa22876ef27dc8e9a5b7fd7bf93457b6f4"
- },
- "lodash/lodash.d.ts": {
- "commit": "299b5caa22876ef27dc8e9a5b7fd7bf93457b6f4"
- },
- "chai/chai.d.ts": {
- "commit": "80057d687aefa736511e434cd2a6c0e9a6bb02bc"
- },
- "assertion-error/assertion-error.d.ts": {
- "commit": "80057d687aefa736511e434cd2a6c0e9a6bb02bc"
- },
- "archiver/archiver.d.ts": {
- "commit": "e937b3e64af586d19f2ea29fdf771e9dc4feecc8"
- },
- "node/node.d.ts": {
- "commit": "e937b3e64af586d19f2ea29fdf771e9dc4feecc8"
- },
- "express/express.d.ts": {
- "commit": "e937b3e64af586d19f2ea29fdf771e9dc4feecc8"
- },
- "express-serve-static-core/express-serve-static-core.d.ts": {
- "commit": "e937b3e64af586d19f2ea29fdf771e9dc4feecc8"
- },
- "serve-static/serve-static.d.ts": {
- "commit": "e937b3e64af586d19f2ea29fdf771e9dc4feecc8"
- },
- "mime/mime.d.ts": {
- "commit": "e937b3e64af586d19f2ea29fdf771e9dc4feecc8"
- }
- }
-}
diff --git a/ts/typings/archiver/archiver.d.ts b/ts/typings/archiver/archiver.d.ts
deleted file mode 100644
index d5133555a4..0000000000
--- a/ts/typings/archiver/archiver.d.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-// Type definitions for archiver v0.15.0
-// Project: https://github.com/archiverjs/node-archiver
-// Definitions by: Esri
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-/* =================== USAGE ===================
-
- import Archiver = require('archiver);
- var archiver = Archiver.create('zip');
- archiver.pipe(FS.createWriteStream('xxx'));
- archiver.append(FS.createReadStream('xxx'));
- archiver.finalize();
-
- =============================================== */
-
-///
-declare module "archiver" {
- import * as FS from 'fs';
- import * as STREAM from 'stream';
-
- interface nameInterface {
- name?: string;
- }
-
- interface Archiver extends STREAM.Transform {
- pipe(writeStream: FS.WriteStream): void;
- append(readStream: FS.ReadStream, name: nameInterface): void;
- finalize(): void;
- }
-
- interface Options {
-
- }
-
- function archiver(format: string, options?: Options): Archiver;
-
- namespace archiver {
- function create(format: string, options?: Options): Archiver;
- }
-
- export = archiver;
-}
diff --git a/ts/typings/assertion-error/assertion-error.d.ts b/ts/typings/assertion-error/assertion-error.d.ts
deleted file mode 100644
index a0295bd8b3..0000000000
--- a/ts/typings/assertion-error/assertion-error.d.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-// Type definitions for assertion-error 1.0.0
-// Project: https://github.com/chaijs/assertion-error
-// Definitions by: Bart van der Schoor
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-declare module 'assertion-error' {
- class AssertionError implements Error {
- constructor(message: string, props?: any, ssf?: Function);
- name: string;
- message: string;
- showDiff: boolean;
- stack: string;
- }
- export = AssertionError;
-}
diff --git a/ts/typings/chai/chai.d.ts b/ts/typings/chai/chai.d.ts
deleted file mode 100644
index 0ebc855022..0000000000
--- a/ts/typings/chai/chai.d.ts
+++ /dev/null
@@ -1,401 +0,0 @@
-// Type definitions for chai 3.4.0
-// Project: http://chaijs.com/
-// Definitions by: Jed Mao ,
-// Bart van der Schoor ,
-// Andrew Brown ,
-// Olivier Chevet ,
-// Matt Wistrand
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-//
-
-declare namespace Chai {
-
- interface ChaiStatic {
- expect: ExpectStatic;
- should(): Should;
- /**
- * Provides a way to extend the internals of Chai
- */
- use(fn: (chai: any, utils: any) => void): ChaiStatic;
- assert: AssertStatic;
- config: Config;
- AssertionError: typeof AssertionError;
- }
-
- export interface ExpectStatic extends AssertionStatic {
- fail(actual?: any, expected?: any, message?: string, operator?: string): void;
- }
-
- export interface AssertStatic extends Assert {
- }
-
- export interface AssertionStatic {
- (target: any, message?: string): Assertion;
- }
-
- interface ShouldAssertion {
- equal(value1: any, value2: any, message?: string): void;
- Throw: ShouldThrow;
- throw: ShouldThrow;
- exist(value: any, message?: string): void;
- }
-
- interface Should extends ShouldAssertion {
- not: ShouldAssertion;
- fail(actual: any, expected: any, message?: string, operator?: string): void;
- }
-
- interface ShouldThrow {
- (actual: Function): void;
- (actual: Function, expected: string|RegExp, message?: string): void;
- (actual: Function, constructor: Error|Function, expected?: string|RegExp, message?: string): void;
- }
-
- interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
- not: Assertion;
- deep: Deep;
- any: KeyFilter;
- all: KeyFilter;
- a: TypeComparison;
- an: TypeComparison;
- include: Include;
- includes: Include;
- contain: Include;
- contains: Include;
- ok: Assertion;
- true: Assertion;
- false: Assertion;
- null: Assertion;
- undefined: Assertion;
- NaN: Assertion;
- exist: Assertion;
- empty: Assertion;
- arguments: Assertion;
- Arguments: Assertion;
- equal: Equal;
- equals: Equal;
- eq: Equal;
- eql: Equal;
- eqls: Equal;
- property: Property;
- ownProperty: OwnProperty;
- haveOwnProperty: OwnProperty;
- ownPropertyDescriptor: OwnPropertyDescriptor;
- haveOwnPropertyDescriptor: OwnPropertyDescriptor;
- length: Length;
- lengthOf: Length;
- match: Match;
- matches: Match;
- string(string: string, message?: string): Assertion;
- keys: Keys;
- key(string: string): Assertion;
- throw: Throw;
- throws: Throw;
- Throw: Throw;
- respondTo: RespondTo;
- respondsTo: RespondTo;
- itself: Assertion;
- satisfy: Satisfy;
- satisfies: Satisfy;
- closeTo: CloseTo;
- approximately: CloseTo;
- members: Members;
- increase: PropertyChange;
- increases: PropertyChange;
- decrease: PropertyChange;
- decreases: PropertyChange;
- change: PropertyChange;
- changes: PropertyChange;
- extensible: Assertion;
- sealed: Assertion;
- frozen: Assertion;
- oneOf(list: any[], message?: string): Assertion;
- }
-
- interface LanguageChains {
- to: Assertion;
- be: Assertion;
- been: Assertion;
- is: Assertion;
- that: Assertion;
- which: Assertion;
- and: Assertion;
- has: Assertion;
- have: Assertion;
- with: Assertion;
- at: Assertion;
- of: Assertion;
- same: Assertion;
- }
-
- interface NumericComparison {
- above: NumberComparer;
- gt: NumberComparer;
- greaterThan: NumberComparer;
- least: NumberComparer;
- gte: NumberComparer;
- below: NumberComparer;
- lt: NumberComparer;
- lessThan: NumberComparer;
- most: NumberComparer;
- lte: NumberComparer;
- within(start: number, finish: number, message?: string): Assertion;
- }
-
- interface NumberComparer {
- (value: number, message?: string): Assertion;
- }
-
- interface TypeComparison {
- (type: string, message?: string): Assertion;
- instanceof: InstanceOf;
- instanceOf: InstanceOf;
- }
-
- interface InstanceOf {
- (constructor: Object, message?: string): Assertion;
- }
-
- interface CloseTo {
- (expected: number, delta: number, message?: string): Assertion;
- }
-
- interface Deep {
- equal: Equal;
- include: Include;
- property: Property;
- members: Members;
- }
-
- interface KeyFilter {
- keys: Keys;
- }
-
- interface Equal {
- (value: any, message?: string): Assertion;
- }
-
- interface Property {
- (name: string, value?: any, message?: string): Assertion;
- }
-
- interface OwnProperty {
- (name: string, message?: string): Assertion;
- }
-
- interface OwnPropertyDescriptor {
- (name: string, descriptor: PropertyDescriptor, message?: string): Assertion;
- (name: string, message?: string): Assertion;
- }
-
- interface Length extends LanguageChains, NumericComparison {
- (length: number, message?: string): Assertion;
- }
-
- interface Include {
- (value: Object, message?: string): Assertion;
- (value: string, message?: string): Assertion;
- (value: number, message?: string): Assertion;
- keys: Keys;
- members: Members;
- any: KeyFilter;
- all: KeyFilter;
- }
-
- interface Match {
- (regexp: RegExp|string, message?: string): Assertion;
- }
-
- interface Keys {
- (...keys: string[]): Assertion;
- (keys: any[]): Assertion;
- (keys: Object): Assertion;
- }
-
- interface Throw {
- (): Assertion;
- (expected: string, message?: string): Assertion;
- (expected: RegExp, message?: string): Assertion;
- (constructor: Error, expected?: string, message?: string): Assertion;
- (constructor: Error, expected?: RegExp, message?: string): Assertion;
- (constructor: Function, expected?: string, message?: string): Assertion;
- (constructor: Function, expected?: RegExp, message?: string): Assertion;
- }
-
- interface RespondTo {
- (method: string, message?: string): Assertion;
- }
-
- interface Satisfy {
- (matcher: Function, message?: string): Assertion;
- }
-
- interface Members {
- (set: any[], message?: string): Assertion;
- }
-
- interface PropertyChange {
- (object: Object, prop: string, msg?: string): Assertion;
- }
-
- export interface Assert {
- /**
- * @param expression Expression to test for truthiness.
- * @param message Message to display on error.
- */
- (expression: any, message?: string): void;
-
- fail(actual?: any, expected?: any, msg?: string, operator?: string): void;
-
- ok(val: any, msg?: string): void;
- isOk(val: any, msg?: string): void;
- notOk(val: any, msg?: string): void;
- isNotOk(val: any, msg?: string): void;
-
- equal(act: any, exp: any, msg?: string): void;
- notEqual(act: any, exp: any, msg?: string): void;
-
- strictEqual(act: any, exp: any, msg?: string): void;
- notStrictEqual(act: any, exp: any, msg?: string): void;
-
- deepEqual(act: any, exp: any, msg?: string): void;
- notDeepEqual(act: any, exp: any, msg?: string): void;
-
- isTrue(val: any, msg?: string): void;
- isFalse(val: any, msg?: string): void;
-
- isNotTrue(val: any, msg?: string): void;
- isNotFalse(val: any, msg?: string): void;
-
- isNull(val: any, msg?: string): void;
- isNotNull(val: any, msg?: string): void;
-
- isUndefined(val: any, msg?: string): void;
- isDefined(val: any, msg?: string): void;
-
- isNaN(val: any, msg?: string): void;
- isNotNaN(val: any, msg?: string): void;
-
- isAbove(val: number, abv: number, msg?: string): void;
- isBelow(val: number, blw: number, msg?: string): void;
-
- isAtLeast(val: number, atlst: number, msg?: string): void;
- isAtMost(val: number, atmst: number, msg?: string): void;
-
- isFunction(val: any, msg?: string): void;
- isNotFunction(val: any, msg?: string): void;
-
- isObject(val: any, msg?: string): void;
- isNotObject(val: any, msg?: string): void;
-
- isArray(val: any, msg?: string): void;
- isNotArray(val: any, msg?: string): void;
-
- isString(val: any, msg?: string): void;
- isNotString(val: any, msg?: string): void;
-
- isNumber(val: any, msg?: string): void;
- isNotNumber(val: any, msg?: string): void;
-
- isBoolean(val: any, msg?: string): void;
- isNotBoolean(val: any, msg?: string): void;
-
- typeOf(val: any, type: string, msg?: string): void;
- notTypeOf(val: any, type: string, msg?: string): void;
-
- instanceOf(val: any, type: Function, msg?: string): void;
- notInstanceOf(val: any, type: Function, msg?: string): void;
-
- include(exp: string, inc: any, msg?: string): void;
- include(exp: any[], inc: any, msg?: string): void;
-
- notInclude(exp: string, inc: any, msg?: string): void;
- notInclude(exp: any[], inc: any, msg?: string): void;
-
- match(exp: any, re: RegExp, msg?: string): void;
- notMatch(exp: any, re: RegExp, msg?: string): void;
-
- property(obj: Object, prop: string, msg?: string): void;
- notProperty(obj: Object, prop: string, msg?: string): void;
- deepProperty(obj: Object, prop: string, msg?: string): void;
- notDeepProperty(obj: Object, prop: string, msg?: string): void;
-
- propertyVal(obj: Object, prop: string, val: any, msg?: string): void;
- propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
-
- deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void;
- deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
-
- lengthOf(exp: any, len: number, msg?: string): void;
- //alias frenzy
- throw(fn: Function, msg?: string): void;
- throw(fn: Function, regExp: RegExp): void;
- throw(fn: Function, errType: Function, msg?: string): void;
- throw(fn: Function, errType: Function, regExp: RegExp): void;
-
- throws(fn: Function, msg?: string): void;
- throws(fn: Function, regExp: RegExp): void;
- throws(fn: Function, errType: Function, msg?: string): void;
- throws(fn: Function, errType: Function, regExp: RegExp): void;
-
- Throw(fn: Function, msg?: string): void;
- Throw(fn: Function, regExp: RegExp): void;
- Throw(fn: Function, errType: Function, msg?: string): void;
- Throw(fn: Function, errType: Function, regExp: RegExp): void;
-
- doesNotThrow(fn: Function, msg?: string): void;
- doesNotThrow(fn: Function, regExp: RegExp): void;
- doesNotThrow(fn: Function, errType: Function, msg?: string): void;
- doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void;
-
- operator(val: any, operator: string, val2: any, msg?: string): void;
- closeTo(act: number, exp: number, delta: number, msg?: string): void;
- approximately(act: number, exp: number, delta: number, msg?: string): void;
-
- sameMembers(set1: any[], set2: any[], msg?: string): void;
- sameDeepMembers(set1: any[], set2: any[], msg?: string): void;
- includeMembers(superset: any[], subset: any[], msg?: string): void;
-
- ifError(val: any, msg?: string): void;
-
- isExtensible(obj: {}, msg?: string): void;
- extensible(obj: {}, msg?: string): void;
- isNotExtensible(obj: {}, msg?: string): void;
- notExtensible(obj: {}, msg?: string): void;
-
- isSealed(obj: {}, msg?: string): void;
- sealed(obj: {}, msg?: string): void;
- isNotSealed(obj: {}, msg?: string): void;
- notSealed(obj: {}, msg?: string): void;
-
- isFrozen(obj: Object, msg?: string): void;
- frozen(obj: Object, msg?: string): void;
- isNotFrozen(obj: Object, msg?: string): void;
- notFrozen(obj: Object, msg?: string): void;
-
- oneOf(inList: any, list: any[], msg?: string): void;
- }
-
- export interface Config {
- includeStack: boolean;
- }
-
- export class AssertionError {
- constructor(message: string, _props?: any, ssf?: Function);
- name: string;
- message: string;
- showDiff: boolean;
- stack: string;
- }
-}
-
-declare var chai: Chai.ChaiStatic;
-
-declare module "chai" {
- export = chai;
-}
-
-interface Object {
- should: Chai.Assertion;
-}
diff --git a/ts/typings/express-serve-static-core/express-serve-static-core.d.ts b/ts/typings/express-serve-static-core/express-serve-static-core.d.ts
deleted file mode 100644
index 70817018a9..0000000000
--- a/ts/typings/express-serve-static-core/express-serve-static-core.d.ts
+++ /dev/null
@@ -1,1062 +0,0 @@
-// Type definitions for Express 4.x
-// Project: http://expressjs.com
-// Definitions by: Boris Yankov
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-// This extracts the core definitions from express to prevent a circular dependency between express and serve-static
-///
-
-declare namespace Express {
-
- // These open interfaces may be extended in an application-specific manner via declaration merging.
- // See for example method-override.d.ts (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/method-override/method-override.d.ts)
- export interface Request { }
- export interface Response { }
- export interface Application { }
-}
-
-declare module "express-serve-static-core" {
- import * as http from "http";
-
- interface IRoute {
- path: string;
- stack: any;
- all(...handler: RequestHandler[]): IRoute;
- get(...handler: RequestHandler[]): IRoute;
- post(...handler: RequestHandler[]): IRoute;
- put(...handler: RequestHandler[]): IRoute;
- delete(...handler: RequestHandler[]): IRoute;
- patch(...handler: RequestHandler[]): IRoute;
- options(...handler: RequestHandler[]): IRoute;
- head(...handler: RequestHandler[]): IRoute;
- }
-
- interface IRouterMatcher {
- (name: string | RegExp, ...handlers: RequestHandler[]): T;
- }
-
- interface IRouter extends RequestHandler {
- /**
- * Map the given param placeholder `name`(s) to the given callback(s).
- *
- * Parameter mapping is used to provide pre-conditions to routes
- * which use normalized placeholders. For example a _:user_id_ parameter
- * could automatically load a user's information from the database without
- * any additional code,
- *
- * The callback uses the samesignature as middleware, the only differencing
- * being that the value of the placeholder is passed, in this case the _id_
- * of the user. Once the `next()` function is invoked, just like middleware
- * it will continue on to execute the route, or subsequent parameter functions.
- *
- * app.param('user_id', function(req, res, next, id){
- * User.find(id, function(err, user){
- * if (err) {
- * next(err);
- * } else if (user) {
- * req.user = user;
- * next();
- * } else {
- * next(new Error('failed to load user'));
- * }
- * });
- * });
- *
- * @param name
- * @param fn
- */
- param(name: string, handler: RequestParamHandler): T;
- param(name: string, matcher: RegExp): T;
- param(name: string, mapper: (param: any) => any): T;
- // Alternatively, you can pass only a callback, in which case you have the opportunity to alter the app.param() API
- param(callback: (name: string, matcher: RegExp) => RequestParamHandler): T;
-
- /**
- * Special-cased "all" method, applying the given route `path`,
- * middleware, and callback to _every_ HTTP method.
- *
- * @param path
- * @param fn
- */
- all: IRouterMatcher;
- get: IRouterMatcher;
- post: IRouterMatcher;
- put: IRouterMatcher;
- delete: IRouterMatcher;
- patch: IRouterMatcher;
- options: IRouterMatcher;
- head: IRouterMatcher;
-
- route(path: string): IRoute;
-
- use(...handler: RequestHandler[]): T;
- use(handler: ErrorRequestHandler | RequestHandler): T;
- use(path: string, ...handler: RequestHandler[]): T;
- use(path: string, handler: ErrorRequestHandler | RequestHandler): T;
- use(path: string[], ...handler: RequestHandler[]): T;
- use(path: string[], handler: ErrorRequestHandler): T;
- use(path: RegExp, ...handler: RequestHandler[]): T;
- use(path: RegExp, handler: ErrorRequestHandler): T;
- use(path: string, router: Router): T;
- }
-
-
- export interface Router extends IRouter { }
-
- interface CookieOptions {
- maxAge?: number;
- signed?: boolean;
- expires?: Date;
- httpOnly?: boolean;
- path?: string;
- domain?: string;
- secure?: boolean;
- }
-
- interface Errback { (err: Error): void; }
-
- interface Request extends http.ServerRequest, Express.Request {
-
- /**
- * Return request header.
- *
- * The `Referrer` header field is special-cased,
- * both `Referrer` and `Referer` are interchangeable.
- *
- * Examples:
- *
- * req.get('Content-Type');
- * // => "text/plain"
- *
- * req.get('content-type');
- * // => "text/plain"
- *
- * req.get('Something');
- * // => undefined
- *
- * Aliased as `req.header()`.
- *
- * @param name
- */
- get(name: string): string;
-
- header(name: string): string;
-
- headers: { [key: string]: string; };
-
- /**
- * Check if the given `type(s)` is acceptable, returning
- * the best match when true, otherwise `undefined`, in which
- * case you should respond with 406 "Not Acceptable".
- *
- * The `type` value may be a single mime type string
- * such as "application/json", the extension name
- * such as "json", a comma-delimted list such as "json, html, text/plain",
- * or an array `["json", "html", "text/plain"]`. When a list
- * or array is given the _best_ match, if any is returned.
- *
- * Examples:
- *
- * // Accept: text/html
- * req.accepts('html');
- * // => "html"
- *
- * // Accept: text/*, application/json
- * req.accepts('html');
- * // => "html"
- * req.accepts('text/html');
- * // => "text/html"
- * req.accepts('json, text');
- * // => "json"
- * req.accepts('application/json');
- * // => "application/json"
- *
- * // Accept: text/*, application/json
- * req.accepts('image/png');
- * req.accepts('png');
- * // => undefined
- *
- * // Accept: text/*;q=.5, application/json
- * req.accepts(['html', 'json']);
- * req.accepts('html, json');
- * // => "json"
- */
- accepts(type: string): string;
-
- accepts(type: string[]): string;
-
- /**
- * Returns the first accepted charset of the specified character sets,
- * based on the request’s Accept-Charset HTTP header field.
- * If none of the specified charsets is accepted, returns false.
- *
- * For more information, or if you have issues or concerns, see accepts.
- * @param charset
- */
- acceptsCharsets(charset?: string | string[]): string[];
-
- /**
- * Returns the first accepted encoding of the specified encodings,
- * based on the request’s Accept-Encoding HTTP header field.
- * If none of the specified encodings is accepted, returns false.
- *
- * For more information, or if you have issues or concerns, see accepts.
- * @param encoding
- */
- acceptsEncodings(encoding?: string | string[]): string[];
-
- /**
- * Returns the first accepted language of the specified languages,
- * based on the request’s Accept-Language HTTP header field.
- * If none of the specified languages is accepted, returns false.
- *
- * For more information, or if you have issues or concerns, see accepts.
- *
- * @param lang
- */
- acceptsLanguages(lang?: string | string[]): string[];
-
- /**
- * Parse Range header field,
- * capping to the given `size`.
- *
- * Unspecified ranges such as "0-" require
- * knowledge of your resource length. In
- * the case of a byte range this is of course
- * the total number of bytes. If the Range
- * header field is not given `null` is returned,
- * `-1` when unsatisfiable, `-2` when syntactically invalid.
- *
- * NOTE: remember that ranges are inclusive, so
- * for example "Range: users=0-3" should respond
- * with 4 users when available, not 3.
- *
- * @param size
- */
- range(size: number): any[];
-
- /**
- * Return an array of Accepted media types
- * ordered from highest quality to lowest.
- */
- accepted: MediaType[];
-
- /**
- * Return the value of param `name` when present or `defaultValue`.
- *
- * - Checks route placeholders, ex: _/user/:id_
- * - Checks body params, ex: id=12, {"id":12}
- * - Checks query string params, ex: ?id=12
- *
- * To utilize request bodies, `req.body`
- * should be an object. This can be done by using
- * the `connect.bodyParser()` middleware.
- *
- * @param name
- * @param defaultValue
- */
- param(name: string, defaultValue?: any): string;
-
- /**
- * Check if the incoming request contains the "Content-Type"
- * header field, and it contains the give mime `type`.
- *
- * Examples:
- *
- * // With Content-Type: text/html; charset=utf-8
- * req.is('html');
- * req.is('text/html');
- * req.is('text/*');
- * // => true
- *
- * // When Content-Type is application/json
- * req.is('json');
- * req.is('application/json');
- * req.is('application/*');
- * // => true
- *
- * req.is('html');
- * // => false
- *
- * @param type
- */
- is(type: string): boolean;
-
- /**
- * Return the protocol string "http" or "https"
- * when requested with TLS. When the "trust proxy"
- * setting is enabled the "X-Forwarded-Proto" header
- * field will be trusted. If you're running behind
- * a reverse proxy that supplies https for you this
- * may be enabled.
- */
- protocol: string;
-
- /**
- * Short-hand for:
- *
- * req.protocol == 'https'
- */
- secure: boolean;
-
- /**
- * Return the remote address, or when
- * "trust proxy" is `true` return
- * the upstream addr.
- */
- ip: string;
-
- /**
- * When "trust proxy" is `true`, parse
- * the "X-Forwarded-For" ip address list.
- *
- * For example if the value were "client, proxy1, proxy2"
- * you would receive the array `["client", "proxy1", "proxy2"]`
- * where "proxy2" is the furthest down-stream.
- */
- ips: string[];
-
- /**
- * Return subdomains as an array.
- *
- * Subdomains are the dot-separated parts of the host before the main domain of
- * the app. By default, the domain of the app is assumed to be the last two
- * parts of the host. This can be changed by setting "subdomain offset".
- *
- * For example, if the domain is "tobi.ferrets.example.com":
- * If "subdomain offset" is not set, req.subdomains is `["ferrets", "tobi"]`.
- * If "subdomain offset" is 3, req.subdomains is `["tobi"]`.
- */
- subdomains: string[];
-
- /**
- * Short-hand for `url.parse(req.url).pathname`.
- */
- path: string;
-
- /**
- * Parse the "Host" header field hostname.
- */
- hostname: string;
-
- /**
- * @deprecated Use hostname instead.
- */
- host: string;
-
- /**
- * Check if the request is fresh, aka
- * Last-Modified and/or the ETag
- * still match.
- */
- fresh: boolean;
-
- /**
- * Check if the request is stale, aka
- * "Last-Modified" and / or the "ETag" for the
- * resource has changed.
- */
- stale: boolean;
-
- /**
- * Check if the request was an _XMLHttpRequest_.
- */
- xhr: boolean;
-
- //body: { username: string; password: string; remember: boolean; title: string; };
- body: any;
-
- //cookies: { string; remember: boolean; };
- cookies: any;
-
- method: string;
-
- params: any;
-
- user: any;
-
- authenticatedUser: any;
-
- /**
- * Clear cookie `name`.
- *
- * @param name
- * @param options
- */
- clearCookie(name: string, options?: any): Response;
-
- query: any;
-
- route: any;
-
- signedCookies: any;
-
- originalUrl: string;
-
- url: string;
-
- baseUrl: string;
-
- app: Application;
- }
-
- interface MediaType {
- value: string;
- quality: number;
- type: string;
- subtype: string;
- }
-
- interface Send {
- (status: number, body?: any): Response;
- (body: any): Response;
- }
-
- interface Response extends http.ServerResponse, Express.Response {
- /**
- * Set status `code`.
- *
- * @param code
- */
- status(code: number): Response;
-
- /**
- * Set the response HTTP status code to `statusCode` and send its string representation as the response body.
- * @link http://expressjs.com/4x/api.html#res.sendStatus
- *
- * Examples:
- *
- * res.sendStatus(200); // equivalent to res.status(200).send('OK')
- * res.sendStatus(403); // equivalent to res.status(403).send('Forbidden')
- * res.sendStatus(404); // equivalent to res.status(404).send('Not Found')
- * res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error')
- *
- * @param code
- */
- sendStatus(code: number): Response;
-
- /**
- * Set Link header field with the given `links`.
- *
- * Examples:
- *
- * res.links({
- * next: 'http://api.example.com/users?page=2',
- * last: 'http://api.example.com/users?page=5'
- * });
- *
- * @param links
- */
- links(links: any): Response;
-
- /**
- * Send a response.
- *
- * Examples:
- *
- * res.send(new Buffer('wahoo'));
- * res.send({ some: 'json' });
- * res.send('some html
');
- * res.send(404, 'Sorry, cant find that');
- * res.send(404);
- */
- send: Send;
-
- /**
- * Send JSON response.
- *
- * Examples:
- *
- * res.json(null);
- * res.json({ user: 'tj' });
- * res.json(500, 'oh noes!');
- * res.json(404, 'I dont have that');
- */
- json: Send;
-
- /**
- * Send JSON response with JSONP callback support.
- *
- * Examples:
- *
- * res.jsonp(null);
- * res.jsonp({ user: 'tj' });
- * res.jsonp(500, 'oh noes!');
- * res.jsonp(404, 'I dont have that');
- */
- jsonp: Send;
-
- /**
- * Transfer the file at the given `path`.
- *
- * Automatically sets the _Content-Type_ response header field.
- * The callback `fn(err)` is invoked when the transfer is complete
- * or when an error occurs. Be sure to check `res.sentHeader`
- * if you wish to attempt responding, as the header and some data
- * may have already been transferred.
- *
- * Options:
- *
- * - `maxAge` defaulting to 0 (can be string converted by `ms`)
- * - `root` root directory for relative filenames
- * - `headers` object of headers to serve with file
- * - `dotfiles` serve dotfiles, defaulting to false; can be `"allow"` to send them
- *
- * Other options are passed along to `send`.
- *
- * Examples:
- *
- * The following example illustrates how `res.sendFile()` may
- * be used as an alternative for the `static()` middleware for
- * dynamic situations. The code backing `res.sendFile()` is actually
- * the same code, so HTTP cache support etc is identical.
- *
- * app.get('/user/:uid/photos/:file', function(req, res){
- * var uid = req.params.uid
- * , file = req.params.file;
- *
- * req.user.mayViewFilesFrom(uid, function(yes){
- * if (yes) {
- * res.sendFile('/uploads/' + uid + '/' + file);
- * } else {
- * res.send(403, 'Sorry! you cant see that.');
- * }
- * });
- * });
- *
- * @api public
- */
- sendFile(path: string): void;
- sendFile(path: string, options: any): void;
- sendFile(path: string, fn: Errback): void;
- sendFile(path: string, options: any, fn: Errback): void;
-
- /**
- * @deprecated Use sendFile instead.
- */
- sendfile(path: string): void;
- /**
- * @deprecated Use sendFile instead.
- */
- sendfile(path: string, options: any): void;
- /**
- * @deprecated Use sendFile instead.
- */
- sendfile(path: string, fn: Errback): void;
- /**
- * @deprecated Use sendFile instead.
- */
- sendfile(path: string, options: any, fn: Errback): void;
-
- /**
- * Transfer the file at the given `path` as an attachment.
- *
- * Optionally providing an alternate attachment `filename`,
- * and optional callback `fn(err)`. The callback is invoked
- * when the data transfer is complete, or when an error has
- * ocurred. Be sure to check `res.headerSent` if you plan to respond.
- *
- * This method uses `res.sendfile()`.
- */
- download(path: string): void;
- download(path: string, filename: string): void;
- download(path: string, fn: Errback): void;
- download(path: string, filename: string, fn: Errback): void;
-
- /**
- * Set _Content-Type_ response header with `type` through `mime.lookup()`
- * when it does not contain "/", or set the Content-Type to `type` otherwise.
- *
- * Examples:
- *
- * res.type('.html');
- * res.type('html');
- * res.type('json');
- * res.type('application/json');
- * res.type('png');
- *
- * @param type
- */
- contentType(type: string): Response;
-
- /**
- * Set _Content-Type_ response header with `type` through `mime.lookup()`
- * when it does not contain "/", or set the Content-Type to `type` otherwise.
- *
- * Examples:
- *
- * res.type('.html');
- * res.type('html');
- * res.type('json');
- * res.type('application/json');
- * res.type('png');
- *
- * @param type
- */
- type(type: string): Response;
-
- /**
- * Respond to the Acceptable formats using an `obj`
- * of mime-type callbacks.
- *
- * This method uses `req.accepted`, an array of
- * acceptable types ordered by their quality values.
- * When "Accept" is not present the _first_ callback
- * is invoked, otherwise the first match is used. When
- * no match is performed the server responds with
- * 406 "Not Acceptable".
- *
- * Content-Type is set for you, however if you choose
- * you may alter this within the callback using `res.type()`
- * or `res.set('Content-Type', ...)`.
- *
- * res.format({
- * 'text/plain': function(){
- * res.send('hey');
- * },
- *
- * 'text/html': function(){
- * res.send('hey
');
- * },
- *
- * 'appliation/json': function(){
- * res.send({ message: 'hey' });
- * }
- * });
- *
- * In addition to canonicalized MIME types you may
- * also use extnames mapped to these types:
- *
- * res.format({
- * text: function(){
- * res.send('hey');
- * },
- *
- * html: function(){
- * res.send('hey
');
- * },
- *
- * json: function(){
- * res.send({ message: 'hey' });
- * }
- * });
- *
- * By default Express passes an `Error`
- * with a `.status` of 406 to `next(err)`
- * if a match is not made. If you provide
- * a `.default` callback it will be invoked
- * instead.
- *
- * @param obj
- */
- format(obj: any): Response;
-
- /**
- * Set _Content-Disposition_ header to _attachment_ with optional `filename`.
- *
- * @param filename
- */
- attachment(filename?: string): Response;
-
- /**
- * Set header `field` to `val`, or pass
- * an object of header fields.
- *
- * Examples:
- *
- * res.set('Foo', ['bar', 'baz']);
- * res.set('Accept', 'application/json');
- * res.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });
- *
- * Aliased as `res.header()`.
- */
- set(field: any): Response;
- set(field: string, value?: string): Response;
-
- header(field: any): Response;
- header(field: string, value?: string): Response;
-
- // Property indicating if HTTP headers has been sent for the response.
- headersSent: boolean;
-
- /**
- * Get value for header `field`.
- *
- * @param field
- */
- get(field: string): string;
-
- /**
- * Clear cookie `name`.
- *
- * @param name
- * @param options
- */
- clearCookie(name: string, options?: any): Response;
-
- /**
- * Set cookie `name` to `val`, with the given `options`.
- *
- * Options:
- *
- * - `maxAge` max-age in milliseconds, converted to `expires`
- * - `signed` sign the cookie
- * - `path` defaults to "/"
- *
- * Examples:
- *
- * // "Remember Me" for 15 minutes
- * res.cookie('rememberme', '1', { expires: new Date(Date.now() + 900000), httpOnly: true });
- *
- * // save as above
- * res.cookie('rememberme', '1', { maxAge: 900000, httpOnly: true })
- */
- cookie(name: string, val: string, options: CookieOptions): Response;
- cookie(name: string, val: any, options: CookieOptions): Response;
- cookie(name: string, val: any): Response;
-
- /**
- * Set the location header to `url`.
- *
- * The given `url` can also be the name of a mapped url, for
- * example by default express supports "back" which redirects
- * to the _Referrer_ or _Referer_ headers or "/".
- *
- * Examples:
- *
- * res.location('/foo/bar').;
- * res.location('http://example.com');
- * res.location('../login'); // /blog/post/1 -> /blog/login
- *
- * Mounting:
- *
- * When an application is mounted and `res.location()`
- * is given a path that does _not_ lead with "/" it becomes
- * relative to the mount-point. For example if the application
- * is mounted at "/blog", the following would become "/blog/login".
- *
- * res.location('login');
- *
- * While the leading slash would result in a location of "/login":
- *
- * res.location('/login');
- *
- * @param url
- */
- location(url: string): Response;
-
- /**
- * Redirect to the given `url` with optional response `status`
- * defaulting to 302.
- *
- * The resulting `url` is determined by `res.location()`, so
- * it will play nicely with mounted apps, relative paths,
- * `"back"` etc.
- *
- * Examples:
- *
- * res.redirect('/foo/bar');
- * res.redirect('http://example.com');
- * res.redirect(301, 'http://example.com');
- * res.redirect('http://example.com', 301);
- * res.redirect('../login'); // /blog/post/1 -> /blog/login
- */
- redirect(url: string): void;
- redirect(status: number, url: string): void;
- redirect(url: string, status: number): void;
-
- /**
- * Render `view` with the given `options` and optional callback `fn`.
- * When a callback function is given a response will _not_ be made
- * automatically, otherwise a response of _200_ and _text/html_ is given.
- *
- * Options:
- *
- * - `cache` boolean hinting to the engine it should cache
- * - `filename` filename of the view being rendered
- */
- render(view: string, options?: Object, callback?: (err: Error, html: string) => void): void;
- render(view: string, callback?: (err: Error, html: string) => void): void;
-
- locals: any;
-
- charset: string;
- }
-
- interface NextFunction {
- (err?: any): void;
- }
-
- interface ErrorRequestHandler {
- (err: any, req: Request, res: Response, next: NextFunction): any;
- }
-
-
- interface Handler extends RequestHandler { }
-
- interface RequestParamHandler {
- (req: Request, res: Response, next: NextFunction, param: any): any;
- }
-
- interface Application extends IRouter, Express.Application {
- /**
- * Initialize the server.
- *
- * - setup default configuration
- * - setup default middleware
- * - setup route reflection methods
- */
- init(): void;
-
- /**
- * Initialize application configuration.
- */
- defaultConfiguration(): void;
-
- /**
- * Register the given template engine callback `fn`
- * as `ext`.
- *
- * By default will `require()` the engine based on the
- * file extension. For example if you try to render
- * a "foo.jade" file Express will invoke the following internally:
- *
- * app.engine('jade', require('jade').__express);
- *
- * For engines that do not provide `.__express` out of the box,
- * or if you wish to "map" a different extension to the template engine
- * you may use this method. For example mapping the EJS template engine to
- * ".html" files:
- *
- * app.engine('html', require('ejs').renderFile);
- *
- * In this case EJS provides a `.renderFile()` method with
- * the same signature that Express expects: `(path, options, callback)`,
- * though note that it aliases this method as `ejs.__express` internally
- * so if you're using ".ejs" extensions you dont need to do anything.
- *
- * Some template engines do not follow this convention, the
- * [Consolidate.js](https://github.com/visionmedia/consolidate.js)
- * library was created to map all of node's popular template
- * engines to follow this convention, thus allowing them to
- * work seamlessly within Express.
- */
- engine(ext: string, fn: Function): Application;
-
- /**
- * Assign `setting` to `val`, or return `setting`'s value.
- *
- * app.set('foo', 'bar');
- * app.get('foo');
- * // => "bar"
- * app.set('foo', ['bar', 'baz']);
- * app.get('foo');
- * // => ["bar", "baz"]
- *
- * Mounted servers inherit their parent server's settings.
- *
- * @param setting
- * @param val
- */
- set(setting: string, val: any): Application;
- get: {
- (name: string): any; // Getter
- (name: string | RegExp, ...handlers: RequestHandler[]): Application;
- };
-
- /**
- * Return the app's absolute pathname
- * based on the parent(s) that have
- * mounted it.
- *
- * For example if the application was
- * mounted as "/admin", which itself
- * was mounted as "/blog" then the
- * return value would be "/blog/admin".
- */
- path(): string;
-
- /**
- * Check if `setting` is enabled (truthy).
- *
- * app.enabled('foo')
- * // => false
- *
- * app.enable('foo')
- * app.enabled('foo')
- * // => true
- */
- enabled(setting: string): boolean;
-
- /**
- * Check if `setting` is disabled.
- *
- * app.disabled('foo')
- * // => true
- *
- * app.enable('foo')
- * app.disabled('foo')
- * // => false
- *
- * @param setting
- */
- disabled(setting: string): boolean;
-
- /**
- * Enable `setting`.
- *
- * @param setting
- */
- enable(setting: string): Application;
-
- /**
- * Disable `setting`.
- *
- * @param setting
- */
- disable(setting: string): Application;
-
- /**
- * Configure callback for zero or more envs,
- * when no `env` is specified that callback will
- * be invoked for all environments. Any combination
- * can be used multiple times, in any order desired.
- *
- * Examples:
- *
- * app.configure(function(){
- * // executed for all envs
- * });
- *
- * app.configure('stage', function(){
- * // executed staging env
- * });
- *
- * app.configure('stage', 'production', function(){
- * // executed for stage and production
- * });
- *
- * Note:
- *
- * These callbacks are invoked immediately, and
- * are effectively sugar for the following:
- *
- * var env = process.env.NODE_ENV || 'development';
- *
- * switch (env) {
- * case 'development':
- * ...
- * break;
- * case 'stage':
- * ...
- * break;
- * case 'production':
- * ...
- * break;
- * }
- *
- * @param env
- * @param fn
- */
- configure(fn: Function): Application;
- configure(env0: string, fn: Function): Application;
- configure(env0: string, env1: string, fn: Function): Application;
- configure(env0: string, env1: string, env2: string, fn: Function): Application;
- configure(env0: string, env1: string, env2: string, env3: string, fn: Function): Application;
- configure(env0: string, env1: string, env2: string, env3: string, env4: string, fn: Function): Application;
-
- /**
- * Render the given view `name` name with `options`
- * and a callback accepting an error and the
- * rendered template string.
- *
- * Example:
- *
- * app.render('email', { name: 'Tobi' }, function(err, html){
- * // ...
- * })
- *
- * @param name
- * @param options or fn
- * @param fn
- */
- render(name: string, options?: Object, callback?: (err: Error, html: string) => void): void;
- render(name: string, callback: (err: Error, html: string) => void): void;
-
-
- /**
- * Listen for connections.
- *
- * A node `http.Server` is returned, with this
- * application (which is a `Function`) as its
- * callback. If you wish to create both an HTTP
- * and HTTPS server you may do so with the "http"
- * and "https" modules as shown here:
- *
- * var http = require('http')
- * , https = require('https')
- * , express = require('express')
- * , app = express();
- *
- * http.createServer(app).listen(80);
- * https.createServer({ ... }, app).listen(443);
- */
- listen(port: number, hostname: string, backlog: number, callback?: Function): http.Server;
- listen(port: number, hostname: string, callback?: Function): http.Server;
- listen(port: number, callback?: Function): http.Server;
- listen(path: string, callback?: Function): http.Server;
- listen(handle: any, listeningListener?: Function): http.Server;
-
- route(path: string): IRoute;
-
- router: string;
-
- settings: any;
-
- resource: any;
-
- map: any;
-
- locals: any;
-
- /**
- * The app.routes object houses all of the routes defined mapped by the
- * associated HTTP verb. This object may be used for introspection
- * capabilities, for example Express uses this internally not only for
- * routing but to provide default OPTIONS behaviour unless app.options()
- * is used. Your application or framework may also remove routes by
- * simply by removing them from this object.
- */
- routes: any;
- }
-
- interface Express extends Application {
- /**
- * Framework version.
- */
- version: string;
-
- /**
- * Expose mime.
- */
- mime: string;
-
- (): Application;
-
- /**
- * Create an express application.
- */
- createApplication(): Application;
-
- createServer(): Application;
-
- application: any;
-
- request: Request;
-
- response: Response;
- }
-
- interface RequestHandler {
- (req: Request, res: Response, next: NextFunction): any;
- }
-}
diff --git a/ts/typings/express/express.d.ts b/ts/typings/express/express.d.ts
deleted file mode 100644
index 4ab7eb1c90..0000000000
--- a/ts/typings/express/express.d.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-// Type definitions for Express 4.x
-// Project: http://expressjs.com
-// Definitions by: Boris Yankov
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-/* =================== USAGE ===================
-
- import * as express from "express";
- var app = express();
-
- =============================================== */
-
-///
-///
-
-declare module "express" {
- import * as serveStatic from "serve-static";
- import * as core from "express-serve-static-core";
-
- /**
- * Creates an Express application. The express() function is a top-level function exported by the express module.
- */
- function e(): core.Express;
-
- namespace e {
-
- /**
- * This is the only built-in middleware function in Express. It serves static files and is based on serve-static.
- */
- var static: typeof serveStatic;
-
- export function Router(options?: any): core.Router;
-
- interface Application extends core.Application { }
- interface CookieOptions extends core.CookieOptions { }
- interface Errback extends core.Errback { }
- interface ErrorRequestHandler extends core.ErrorRequestHandler { }
- interface Express extends core.Express { }
- interface Handler extends core.Handler { }
- interface IRoute extends core.IRoute { }
- interface IRouter extends core.IRouter { }
- interface IRouterMatcher extends core.IRouterMatcher { }
- interface MediaType extends core.MediaType { }
- interface NextFunction extends core.NextFunction { }
- interface Request extends core.Request { }
- interface RequestHandler extends core.RequestHandler { }
- interface RequestParamHandler extends core.RequestParamHandler { }
- export interface Response extends core.Response { }
- interface Router extends core.Router { }
- interface Send extends core.Send { }
- }
-
- export = e;
-}
diff --git a/ts/typings/lodash/lodash.d.ts b/ts/typings/lodash/lodash.d.ts
deleted file mode 100644
index 6d0e85d774..0000000000
--- a/ts/typings/lodash/lodash.d.ts
+++ /dev/null
@@ -1,19172 +0,0 @@
-// Type definitions for Lo-Dash
-// Project: http://lodash.com/
-// Definitions by: Brian Zengel , Ilya Mochalov
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-
-/**
-### 4.0.0 Changelog (https://github.com/lodash/lodash/wiki/Changelog)
-
-#### TODO:
-removed:
-- [x] Removed _.support
-- [x] Removed _.findWhere in favor of _.find with iteratee shorthand
-- [x] Removed _.where in favor of _.filter with iteratee shorthand
-- [x] Removed _.pluck in favor of _.map with iteratee shorthand
-
-renamed:
-- [x] Renamed _.first to _.head
-- [x] Renamed _.indexBy to _.keyBy
-- [x] Renamed _.invoke to _.invokeMap
-- [x] Renamed _.overArgs to _.overArgs
-- [x] Renamed _.padLeft & _.padRight to _.padStart & _.padEnd
-- [x] Renamed _.pairs to _.toPairs
-- [x] Renamed _.rest to _.tail
-- [x] Renamed _.restParam to _.rest
-- [x] Renamed _.sortByOrder to _.orderBy
-- [x] Renamed _.trimLeft & _.trimRight to _.trimStart & _.trimEnd
-- [x] Renamed _.trunc to _.truncate
-
-split:
-- [x] Split _.indexOf & _.lastIndexOf into _.sortedIndexOf & _.sortedLastIndexOf
-- [x] Split _.max & _.min into _.maxBy & _.minBy
-- [x] Split _.omit & _.pick into _.omitBy & _.pickBy
-- [x] Split _.sample into _.sampleSize
-- [x] Split _.sortedIndex into _.sortedIndexBy
-- [x] Split _.sortedLastIndex into _.sortedLastIndexBy
-- [x] Split _.uniq into _.sortedUniq, _.sortedUniqBy, & _.uniqBy
-
-changes:
-- [x] Absorbed _.sortByAll into _.sortBy
-- [x] Changed the category of _.at to “Object”
-- [x] Changed the category of _.bindAll to “Utility”
-- [x] Made _.capitalize uppercase the first character & lowercase the rest
-- [x] Made _.functions return only own method names
-
-
-added 23 array methods:
-- [x] _.concat
-- [x] _.differenceBy
-- [x] _.differenceWith
-- [x] _.flatMap
-- [x] _.fromPairs
-- [x] _.intersectionBy
-- [x] _.intersectionWith
-- [x] _.join
-- [x] _.pullAll
-- [x] _.pullAllBy
-- [x] _.reverse
-- [x] _.sortedIndexBy
-- [x] _.sortedIndexOf
-- [x] _.sortedLastIndexBy
-- [x] _.sortedLastIndexOf
-- [x] _.sortedUniq
-- [x] _.sortedUniqBy
-- [x] _.unionBy
-- [x] _.unionWith
-- [x] _.uniqBy
-- [x] _.uniqWith
-- [x] _.xorBy
-- [x] _.xorWith
-
-added 18 lang methods:
-- [x] _.cloneDeepWith
-- [x] _.cloneWith
-- [x] _.eq
-- [x] _.isArrayLike
-- [x] _.isArrayLikeObject
-- [x] _.isEqualWith
-- [x] _.isInteger
-- [x] _.isLength
-- [x] _.isMatchWith
-- [x] _.isNil
-- [x] _.isObjectLike
-- [x] _.isSafeInteger
-- [x] _.isSymbol
-- [x] _.toInteger
-- [x] _.toLength
-- [x] _.toNumber
-- [x] _.toSafeInteger
-- [x] _.toString
-
-added 13 object methods:
-- [x] _.assignIn
-- [x] _.assignInWith
-- [x] _.assignWith
-- [x] _.functionsIn
-- [x] _.hasIn
-- [x] _.mergeWith
-- [x] _.omitBy
-- [x] _.pickBy
-
-
-added 8 string methods:
-- [x] _.lowerCase
-- [x] _.lowerFirst
-- [x] _.upperCase
-- [x] _.upperFirst
-- [x] _.toLower
-- [x] _.toUpper
-
-added 8 utility methods:
-- [x] _.toPath
-
-added 4 math methods:
-- [x] _.maxBy
-- [x] _.mean
-- [x] _.minBy
-- [x] _.sumBy
-
-added 2 function methods:
-- [x] _.flip
-- [x] _.unary
-
-added 2 number methods:
-- [x] _.clamp
-- [x] _.subtract
-
-added collection method:
-- [x] _.sampleSize
-
-Added 3 aliases
-
-- [x] _.first as an alias of _.head
-
-Removed 17 aliases
-- [x] Removed aliase _.all
-- [x] Removed aliase _.any
-- [x] Removed aliase _.backflow
-- [x] Removed aliase _.callback
-- [x] Removed aliase _.collect
-- [x] Removed aliase _.compose
-- [x] Removed aliase _.contains
-- [x] Removed aliase _.detect
-- [x] Removed aliase _.foldl
-- [x] Removed aliase _.foldr
-- [x] Removed aliase _.include
-- [x] Removed aliase _.inject
-- [x] Removed aliase _.methods
-- [x] Removed aliase _.object
-- [x] Removed aliase _.run
-- [x] Removed aliase _.select
-- [x] Removed aliase _.unique
-
-Other changes
-- [x] Added support for array buffers to _.isEqual
-- [x] Added support for converting iterators to _.toArray
-- [x] Added support for deep paths to _.zipObject
-- [x] Changed UMD to export to window or self when available regardless of other exports
-- [x] Ensured debounce cancel clears args & thisArg references
-- [x] Ensured _.add, _.subtract, & _.sum don’t skip NaN values
-- [x] Ensured _.clone treats generators like functions
-- [x] Ensured _.clone produces clones with the source’s [[Prototype]]
-- [x] Ensured _.defaults assigns properties that shadow Object.prototype
-- [x] Ensured _.defaultsDeep doesn’t merge a string into an array
-- [x] Ensured _.defaultsDeep & _.merge don’t modify sources
-- [x] Ensured _.defaultsDeep works with circular references
-- [x] Ensured _.keys skips “length” on strict mode arguments objects in Safari 9
-- [x] Ensured _.merge doesn’t convert strings to arrays
-- [x] Ensured _.merge merges plain-objects onto non plain-objects
-- [x] Ensured _#plant resets iterator data of cloned sequences
-- [x] Ensured _.random swaps min & max if min is greater than max
-- [x] Ensured _.range preserves the sign of start of -0
-- [x] Ensured _.reduce & _.reduceRight use getIteratee in their array branch
-- [x] Fixed rounding issue with the precision param of _.floor
-
-** LATER **
-Misc:
-- [ ] Made _.forEach, _.forIn, _.forOwn, & _.times implicitly end a chain sequence
-- [ ] Removed thisArg params from most methods
-- [ ] Made “By” methods provide a single param to iteratees
-- [ ] Made _.words chainable by default
-- [ ] Removed isDeep params from _.clone & _.flatten
-- [ ] Removed _.bindAll support for binding all methods when no names are provided
-- [ ] Removed func-first param signature from _.before & _.after
-- [ ] _.extend as an alias of _.assignIn
-- [ ] _.extendWith as an alias of _.assignInWith
-- [ ] Added clear method to _.memoize.Cache
-- [ ] Added flush method to debounced & throttled functions
-- [ ] Added support for ES6 maps, sets, & symbols to _.clone, _.isEqual, & _.toArray
-- [ ] Enabled _.flow & _.flowRight to accept an array of functions
-- [ ] Ensured “Collection” methods treat functions as objects
-- [ ] Ensured _.assign, _.defaults, & _.merge coerce object values to objects
-- [ ] Ensured _.bindKey bound functions call object[key] when called with the new operator
-- [ ] Ensured _.isFunction returns true for generator functions
-- [ ] Ensured _.merge assigns typed arrays directly
-- [ ] Made _(...) an iterator & iterable
-- [ ] Made _.drop, _.take, & right forms coerce n of undefined to 0
-
-Methods:
-- [ ] _.concat
-- [ ] _.differenceBy
-- [ ] _.differenceWith
-- [ ] _.flatMap
-- [ ] _.fromPairs
-- [ ] _.intersectionBy
-- [ ] _.intersectionWith
-- [ ] _.join
-- [ ] _.pullAll
-- [ ] _.pullAllBy
-- [ ] _.reverse
-- [ ] _.sortedLastIndexOf
-- [ ] _.unionBy
-- [ ] _.unionWith
-- [ ] _.uniqWith
-- [ ] _.xorBy
-- [ ] _.xorWith
-- [ ] _.toString
-
-- [ ] _.invoke
-- [ ] _.setWith
-- [ ] _.toPairs
-- [ ] _.toPairsIn
-- [ ] _.unset
-
-- [ ] _.replace
-- [ ] _.split
-
-- [ ] _.cond
-- [ ] _.conforms
-- [ ] _.nthArg
-- [ ] _.over
-- [ ] _.overEvery
-- [ ] _.overSome
-- [ ] _.rangeRight
-
-- [ ] _.next
-*/
-
-declare var _: _.LoDashStatic;
-
-declare module _ {
- interface LoDashStatic {
- /**
- * Creates a lodash object which wraps the given value to enable intuitive method chaining.
- *
- * In addition to Lo-Dash methods, wrappers also have the following Array methods:
- * concat, join, pop, push, reverse, shift, slice, sort, splice, and unshift
- *
- * Chaining is supported in custom builds as long as the value method is implicitly or
- * explicitly included in the build.
- *
- * The chainable wrapper functions are:
- * after, assign, bind, bindAll, bindKey, chain, chunk, compact, compose, concat, countBy,
- * createCallback, curry, debounce, defaults, defer, delay, difference, filter, flatten,
- * forEach, forEachRight, forIn, forInRight, forOwn, forOwnRight, functions, groupBy,
- * keyBy, initial, intersection, invert, invoke, keys, map, max, memoize, merge, min,
- * object, omit, once, pairs, partial, partialRight, pick, pluck, pull, push, range, reject,
- * remove, rest, reverse, sample, shuffle, slice, sort, sortBy, splice, tap, throttle, times,
- * toArray, transform, union, uniq, unset, unshift, unzip, values, where, without, wrap, and zip
- *
- * The non-chainable wrapper functions are:
- * clone, cloneDeep, contains, escape, every, find, findIndex, findKey, findLast,
- * findLastIndex, findLastKey, has, identity, indexOf, isArguments, isArray, isBoolean,
- * isDate, isElement, isEmpty, isEqual, isFinite, isFunction, isNaN, isNull, isNumber,
- * isObject, isPlainObject, isRegExp, isString, isUndefined, join, lastIndexOf, mixin,
- * noConflict, parseInt, pop, random, reduce, reduceRight, result, shift, size, some,
- * sortedIndex, runInContext, template, unescape, uniqueId, and value
- *
- * The wrapper functions first and last return wrapped values when n is provided, otherwise
- * they return unwrapped values.
- *
- * Explicit chaining can be enabled by using the _.chain method.
- **/
- (value: number): LoDashImplicitWrapper;
- (value: string): LoDashImplicitStringWrapper;
- (value: boolean): LoDashImplicitWrapper;
- (value: Array): LoDashImplicitNumberArrayWrapper;
- (value: Array): LoDashImplicitArrayWrapper;
- (value: T): LoDashImplicitObjectWrapper;
- (value: any): LoDashImplicitWrapper;
-
- /**
- * The semantic version number.
- **/
- VERSION: string;
-
- /**
- * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby
- * (ERB). Change the following template settings to use alternative delimiters.
- **/
- templateSettings: TemplateSettings;
- }
-
- /**
- * By default, the template delimiters used by Lo-Dash are similar to those in embedded Ruby
- * (ERB). Change the following template settings to use alternative delimiters.
- **/
- interface TemplateSettings {
- /**
- * The "escape" delimiter.
- **/
- escape?: RegExp;
-
- /**
- * The "evaluate" delimiter.
- **/
- evaluate?: RegExp;
-
- /**
- * An object to import into the template as local variables.
- **/
- imports?: Dictionary;
-
- /**
- * The "interpolate" delimiter.
- **/
- interpolate?: RegExp;
-
- /**
- * Used to reference the data object in the template text.
- **/
- variable?: string;
- }
-
- /**
- * Creates a cache object to store key/value pairs.
- */
- interface MapCache {
- /**
- * Removes `key` and its value from the cache.
- * @param key The key of the value to remove.
- * @return Returns `true` if the entry was removed successfully, else `false`.
- */
- delete(key: string): boolean;
-
- /**
- * Gets the cached value for `key`.
- * @param key The key of the value to get.
- * @return Returns the cached value.
- */
- get(key: string): any;
-
- /**
- * Checks if a cached value for `key` exists.
- * @param key The key of the entry to check.
- * @return Returns `true` if an entry for `key` exists, else `false`.
- */
- has(key: string): boolean;
-
- /**
- * Sets `value` to `key` of the cache.
- * @param key The key of the value to cache.
- * @param value The value to cache.
- * @return Returns the cache object.
- */
- set(key: string, value: any): _.Dictionary;
- }
-
- interface LoDashWrapperBase { }
-
- interface LoDashImplicitWrapperBase extends LoDashWrapperBase { }
-
- interface LoDashExplicitWrapperBase extends LoDashWrapperBase { }
-
- interface LoDashImplicitWrapper extends LoDashImplicitWrapperBase> { }
-
- interface LoDashExplicitWrapper extends LoDashExplicitWrapperBase> { }
-
- interface LoDashImplicitStringWrapper extends LoDashImplicitWrapper { }
-
- interface LoDashExplicitStringWrapper extends LoDashExplicitWrapper { }
-
- interface LoDashImplicitObjectWrapper extends LoDashImplicitWrapperBase> { }
-
- interface LoDashExplicitObjectWrapper extends LoDashExplicitWrapperBase> { }
-
- interface LoDashImplicitArrayWrapper extends LoDashImplicitWrapperBase> {
- pop(): T;
- push(...items: T[]): LoDashImplicitArrayWrapper;
- shift(): T;
- sort(compareFn?: (a: T, b: T) => number): LoDashImplicitArrayWrapper;
- splice(start: number): LoDashImplicitArrayWrapper;
- splice(start: number, deleteCount: number, ...items: any[]): LoDashImplicitArrayWrapper;
- unshift(...items: T[]): LoDashImplicitArrayWrapper;
- }
-
- interface LoDashExplicitArrayWrapper extends LoDashExplicitWrapperBase> { }
-
- interface LoDashImplicitNumberArrayWrapper extends LoDashImplicitArrayWrapper { }
-
- interface LoDashExplicitNumberArrayWrapper extends LoDashExplicitArrayWrapper { }
-
- /*********
- * Array *
- *********/
-
- //_.chunk
- interface LoDashStatic {
- /**
- * Creates an array of elements split into groups the length of size. If collection can’t be split evenly, the
- * final chunk will be the remaining elements.
- *
- * @param array The array to process.
- * @param size The length of each chunk.
- * @return Returns the new array containing chunks.
- */
- chunk(
- array: List,
- size?: number
- ): T[][];
- }
-
- interface LoDashImplicitArrayWrapper {
- /**
- * @see _.chunk
- */
- chunk(size?: number): LoDashImplicitArrayWrapper;
- }
-
- interface LoDashImplicitObjectWrapper {
- /**
- * @see _.chunk
- */
- chunk(size?: number): LoDashImplicitArrayWrapper;
- }
-
- interface LoDashExplicitArrayWrapper {
- /**
- * @see _.chunk
- */
- chunk(size?: number): LoDashExplicitArrayWrapper;
- }
-
- interface LoDashExplicitObjectWrapper {
- /**
- * @see _.chunk
- */
- chunk(size?: number): LoDashExplicitArrayWrapper;
- }
-
- //_.compact
- interface LoDashStatic {
- /**
- * Creates an array with all falsey values removed. The values false, null, 0, "", undefined, and NaN are
- * falsey.
- *
- * @param array The array to compact.
- * @return (Array) Returns the new array of filtered values.
- */
- compact(array?: List): T[];
- }
-
- interface LoDashImplicitArrayWrapper {
- /**
- * @see _.compact
- */
- compact(): LoDashImplicitArrayWrapper;
- }
-
- interface LoDashImplicitObjectWrapper {
- /**
- * @see _.compact
- */
- compact(): LoDashImplicitArrayWrapper;
- }
-
- interface LoDashExplicitArrayWrapper {
- /**
- * @see _.compact
- */
- compact(): LoDashExplicitArrayWrapper;
- }
-
- interface LoDashExplicitObjectWrapper {
- /**
- * @see _.compact
- */
- compact(): LoDashExplicitArrayWrapper;
- }
-
- //_.concat DUMMY
- interface LoDashStatic {
- /**
- * Creates a new array concatenating `array` with any additional arrays
- * and/or values.
- *
- * @static
- * @memberOf _
- * @category Array
- * @param {Array} array The array to concatenate.
- * @param {...*} [values] The values to concatenate.
- * @returns {Array} Returns the new concatenated array.
- * @example
- *
- * var array = [1];
- * var other = _.concat(array, 2, [3], [[4]]);
- *
- * console.log(other);
- * // => [1, 2, 3, [4]]
- *
- * console.log(array);
- * // => [1]
- */
- concat(...values: (T[]|List)[]) : T[];
- }
-
- //_.difference
- interface LoDashStatic {
- /**
- * Creates an array of unique array values not included in the other provided arrays using SameValueZero for
- * equality comparisons.
- *
- * @param array The array to inspect.
- * @param values The arrays of values to exclude.
- * @return Returns the new array of filtered values.
- */
- difference(
- array: T[]|List,
- ...values: Array>
- ): T[];
- }
-
- interface LoDashImplicitArrayWrapper {
- /**
- * @see _.difference
- */
- difference(...values: (T[]|List)[]): LoDashImplicitArrayWrapper;
- }
-
- interface LoDashImplicitObjectWrapper {
- /**
- * @see _.difference
- */
- difference(...values: (TValue[]|List)[]): LoDashImplicitArrayWrapper;
- }
-
- interface LoDashExplicitArrayWrapper {
- /**
- * @see _.difference
- */
- difference(...values: (T[]|List)[]): LoDashExplicitArrayWrapper;
- }
-
- interface LoDashExplicitObjectWrapper {
- /**
- * @see _.difference
- */
- difference(...values: (TValue[]|List)[]): LoDashExplicitArrayWrapper;
- }
-
- //_.differenceBy
- interface LoDashStatic {
- /**
- * This method is like _.difference except that it accepts iteratee which is invoked for each element of array
- * and values to generate the criterion by which uniqueness is computed. The iteratee is invoked with one
- * argument: (value).
- *
- * @param array The array to inspect.
- * @param values The values to exclude.
- * @param iteratee The iteratee invoked per element.
- * @returns Returns the new array of filtered values.
- */
- differenceBy(
- array: T[]|List,
- values?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): T[];
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- array: T[]|List,
- values?: T[]|List,
- iteratee?: W
- ): T[];
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- array: T[]|List,
- values1?: T[]|List,
- values2?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): T[];
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- array: T[]|List,
- values1?: T[]|List,
- values2?: T[]|List,
- iteratee?: W
- ): T[];
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- array: T[]|List,
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): T[];
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- array: T[]|List,
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- iteratee?: W
- ): T[];
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- array: T[]|List,
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- values4?: T[]|List,
- iteratee?: W
- ): T[];
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- array: T[]|List,
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- values4?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): T[];
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- array: T[]|List,
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- values4?: T[]|List,
- values5?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): T[];
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- array: T[]|List,
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- values4?: T[]|List,
- values5?: T[]|List,
- iteratee?: W
- ): T[];
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- array: T[]|List,
- ...values: any[]
- ): T[];
- }
-
- interface LoDashImplicitArrayWrapper {
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values?: T[]|List,
- iteratee?: W
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- iteratee?: W
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- iteratee?: W
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- values4?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- values4?: T[]|List,
- iteratee?: W
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- values4?: T[]|List,
- values5?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- values4?: T[]|List,
- values5?: T[]|List,
- iteratee?: W
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- ...values: any[]
- ): LoDashImplicitArrayWrapper;
- }
-
- interface LoDashImplicitObjectWrapper {
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values?: T[]|List,
- iteratee?: W
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- iteratee?: W
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- iteratee?: W
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- values4?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- values4?: T[]|List,
- iteratee?: W
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List,
- values2?: T[]|List,
- values3?: T[]|List,
- values4?: T[]|List,
- values5?: T[]|List,
- iteratee?: ((value: T) => any)|string
- ): LoDashImplicitArrayWrapper;
-
- /**
- * @see _.differenceBy
- */
- differenceBy(
- values1?: T[]|List