Merge pull request #2815 from mihhail-lapushkin/master

Added definitions for "cors" and "tea-merge"
This commit is contained in:
Masahiro Wakame
2015-08-13 23:28:35 +09:00
5 changed files with 51 additions and 1 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ interface Contacts {
*/
find(fields: string[],
onSuccess: (contacts: Contact[]) => void,
onError: (error: ContactError) => void,
onError?: (error: ContactError) => void,
options?: ContactFindOptions): void;
/**
* The navigator.contacts.pickContact method launches the Contact Picker to select a single contact.
+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;
}