Added definitions for "cors" and "tea-merge"

This commit is contained in:
mihhail-lapushkin
2014-09-14 00:08:00 +03:00
parent 50dd84eb5d
commit ee872c6334
4 changed files with 50 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
/// <reference path="cors.d.ts" />
import express = require('express');
import cors = require('cors');
var app = express();
app.use(cors());
app.use(cors({
maxAge: 100,
credentials: true
}));
+24
View File
@@ -0,0 +1,24 @@
// Type definitions for cors
// Project: https://github.com/troygoode/node-cors/
// Definitions by: Mihhail Lapushkin <https://github.com/mihhail-lapushkin/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../express/express.d.ts" />
declare module "cors" {
import express = require('express');
module e {
interface CorsOptions {
origin?: any;
methods?: any;
allowedHeaders?: any;
exposedHeaders?: any;
credentials?: boolean;
maxAge?: number;
}
}
function e(options?: e.CorsOptions): express.RequestHandler;
export = e;
}
+6
View File
@@ -0,0 +1,6 @@
/// <reference path="tea-merge.d.ts" />
import merge = require('tea-merge');
merge({ a: 1 }, { b: 2 }, { c: 'hello' });
merge({ a1: true, a2: { b: 'hello' } }, { bca: [], a2: { c: 'world' } });
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for tea-merge
// Project: https://github.com/qualiancy/tea-merge
// Definitions by: Mihhail Lapushkin <https://github.com/mihhail-lapushkin/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "tea-merge" {
function e(destination: Object, ...sources: Object[]): Object;
export = e;
}