mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #2815 from mihhail-lapushkin/master
Added definitions for "cors" and "tea-merge"
This commit is contained in:
Vendored
+1
-1
@@ -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.
|
||||
|
||||
@@ -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
|
||||
}));
|
||||
Vendored
+24
@@ -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;
|
||||
}
|
||||
@@ -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' } });
|
||||
Vendored
+9
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user