diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index 1e766a1ce8..71113ee828 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -326,8 +326,15 @@ declare module CodeMirror { /** Fires every time the content of the editor is changed. */ on(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void ): void; off(eventName: 'change', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList) => void ): void; - - /** This event is fired before a change is applied, and its handler may choose to modify or cancel the change. + + /** Like the "change" event, but batched per operation, passing an + * array containing all the changes that happened in the operation. + * This event is fired after the operation finished, and display + * changes it makes will trigger a new operation. */ + on(eventName: 'changes', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList[]) => void ): void; + off(eventName: 'changes', handler: (instance: CodeMirror.Editor, change: CodeMirror.EditorChangeLinkedList[]) => void ): void; + + /** This event is fired before a change is applied, and its handler may choose to modify or cancel the change. The changeObj never has a next property, since this is fired for each individual change, and not batched per operation. Note: you may not do anything from a "beforeChange" handler that would cause changes to the document or its visualization. Doing so will, since this handler is called directly from the bowels of the CodeMirror implementation, @@ -605,7 +612,7 @@ declare module CodeMirror { /** Array of strings representing the text that replaced the changed range (split by line). */ text: string[]; /** Text that used to be between from and to, which is overwritten by this change. */ - removed: string; + removed: string[]; /** String representing the origin of the change event and wether it can be merged with history */ origin: string; } diff --git a/data-driven/data-driven-tests.ts b/data-driven/data-driven-tests.ts new file mode 100644 index 0000000000..b91c8361a2 --- /dev/null +++ b/data-driven/data-driven-tests.ts @@ -0,0 +1,8 @@ +/// + +import data_driven = require('data-driven'); + +data_driven([ + {key:"value"}, + {key:"foobar"} + ],() => {}); diff --git a/data-driven/data-driven.d.ts b/data-driven/data-driven.d.ts new file mode 100644 index 0000000000..79bb80b315 --- /dev/null +++ b/data-driven/data-driven.d.ts @@ -0,0 +1,9 @@ +// Type definitions for data-driven.js +// Project: https://github.com/fluentsoftware/data-driven +// Definitions by: Adam Babcock +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "data-driven" { + function data_driven(data:T[], callback:()=>any):any; + export = data_driven +} diff --git a/pascal-case/pascal-case-tests.ts b/pascal-case/pascal-case-tests.ts new file mode 100644 index 0000000000..b13ed26657 --- /dev/null +++ b/pascal-case/pascal-case-tests.ts @@ -0,0 +1,9 @@ +/// + +import pascalCase = require('pascal-case'); + +console.log(pascalCase('string')); // => "String" +console.log(pascalCase('camelCase')); // => "CamelCase" +console.log(pascalCase('sentence case')); // => "SentenceCase" + +console.log(pascalCase('MY STRING', 'tr')); // => "MyStrıng" diff --git a/pascal-case/pascal-case.d.ts b/pascal-case/pascal-case.d.ts new file mode 100644 index 0000000000..9e52ed3e01 --- /dev/null +++ b/pascal-case/pascal-case.d.ts @@ -0,0 +1,9 @@ +// Type definitions for pascal-case +// Project: https://github.com/blakeembrey/pascal-case +// Definitions by: Sam Saint-Pettersen +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "pascal-case" { + function pascalCase(string: string, locale?: string): string; + export = pascalCase; +}