-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from DefinitelyTyped/master
Merge upstream
- Loading branch information
Showing
250 changed files
with
15,292 additions
and
4,315 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[{*.json,*.yml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
types/babel-plugin-syntax-jsx/babel-plugin-syntax-jsx-tests.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import jsx from "babel-plugin-syntax-jsx"; | ||
|
||
// Example taken from the babel plugin handbook: | ||
// https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#-enabling-syntax-in-plugins | ||
export default function myBabelPlugin() { | ||
return { | ||
visitor: {}, | ||
inherits: jsx, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Type definitions for babel-plugin-syntax-jsx 6.18 | ||
// Project: https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-jsx | ||
// Definitions by: Marvin Hagemeister <https://github.com/marvinhagemeister> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
||
// NB: This export doesn't match the handbook example, where `jsx` is the default export. | ||
// But it does match the runtime behaviour (at least at the time of this writing). For some reason, | ||
// babel-plugin-syntax-jsx/lib/index.js has this line at the bottom: module.exports = exports["default"]; | ||
declare function jsx(): { | ||
manipulateOptions(opts: any, parserOpts: { plugins: string[] }): void; | ||
}; | ||
|
||
export default jsx; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": [ | ||
"es6" | ||
], | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"strictNullChecks": false, | ||
"baseUrl": "../", | ||
"typeRoots": [ | ||
"../" | ||
], | ||
"types": [], | ||
"noEmit": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"files": [ | ||
"index.d.ts", | ||
"babel-plugin-syntax-jsx-tests.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": "dtslint/dt.json" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": "dtslint/dt.json" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": "dtslint/dt.json" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,50 @@ | ||
/// <reference types="mocha" /> | ||
/// <reference types="node" /> | ||
import assert = require('assert'); | ||
import { BinTree, RBTree } from 'bintrees'; | ||
|
||
let treeA = new RBTree((a:number, b:number) => a - b); | ||
describe('bintrees', () => { | ||
it('builds a simple tree', () => { | ||
let treeA = new RBTree((a: number, b: number) => a - b); | ||
|
||
treeA.insert(5); | ||
treeA.insert(3); | ||
treeA.remove(3); | ||
treeA.insert(5); | ||
treeA.insert(3); | ||
treeA.remove(3); | ||
|
||
let treeB = new BinTree((a:string, b:string) => a.length - b.length); | ||
assert.equal(treeA.size, 1); | ||
}); | ||
|
||
it('builds a tree of strings', () => { | ||
let treeB = new BinTree((a:string, b:string) => a.length - b.length); | ||
|
||
treeB.insert('hi'); | ||
treeB.insert('there'); | ||
treeB.insert('how'); | ||
treeB.insert('are'); // ignored | ||
treeB.remove('how'); | ||
|
||
assert.equal(treeB.size, 2); | ||
assert.equal(treeB.min(), 'hi'); | ||
}); | ||
|
||
it('maintains a tree of objects', () => { | ||
|
||
interface C { | ||
id: number | ||
} | ||
|
||
let treeC = new BinTree<C>((a: C, b: C) => a.id - b.id); | ||
|
||
treeC.insert({ id: 100 }); | ||
treeC.insert({ id: 110 }); | ||
treeC.insert({ id: 105 }); | ||
|
||
let ids: number[] = []; | ||
treeC.each((val: C) => { | ||
ids.push(val.id); | ||
}); | ||
|
||
assert.deepEqual(ids, [100, 105, 110]); | ||
}); | ||
}); | ||
|
||
treeB.insert('hi'); | ||
treeB.insert('there'); | ||
treeB.insert('how'); | ||
treeB.insert('are'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Catbox = require("catbox"); | ||
|
||
const Memory: Catbox.EnginePrototypeOrObject = { | ||
start(callback: Catbox.CallBackNoResult) {}, | ||
stop() {}, | ||
get() {}, | ||
set() {}, | ||
drop() {}, | ||
isReady(): boolean { return true; }, | ||
validateSegmentName(segment: string): null { return null; }, | ||
}; | ||
|
||
const client = new Catbox.Client(Memory, { partition: 'cache' }); | ||
|
||
const cache = new Catbox.Policy({ | ||
expiresIn: 5000, | ||
}, client, 'cache'); | ||
|
||
cache.set('foo', 'bar', 5000, () => {}); | ||
|
||
cache.get('foo', () => {}); | ||
|
||
cache.drop('foo', () => {}); | ||
|
||
cache.isReady(); | ||
|
||
cache.stats(); |
Oops, something went wrong.