diff --git a/.gitignore b/.gitignore
index 2ea470b9e..2a52c95e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,7 @@
*.map
*.swp
.DS_Store
+npm-debug.log
_Resharper.DefinitelyTyped
bin
diff --git a/.travis.yml b/.travis.yml
index f99663162..48704282a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,6 @@
language: node_js
node_js:
- - "iojs-v2"
+ - 4
sudo: false
diff --git a/README.md b/README.md
index 82833752d..7e1d60d87 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# DefinitelyTyped [](https://travis-ci.org/borisyankov/DefinitelyTyped)
+# DefinitelyTyped [](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped)
[](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
diff --git a/abs/abs-tests.ts b/abs/abs-tests.ts
new file mode 100644
index 000000000..80f52f8ff
--- /dev/null
+++ b/abs/abs-tests.ts
@@ -0,0 +1,5 @@
+///
+
+import Abs from 'abs';
+
+const x: string = Abs('/foo');
diff --git a/abs/abs.d.ts b/abs/abs.d.ts
new file mode 100644
index 000000000..58a533528
--- /dev/null
+++ b/abs/abs.d.ts
@@ -0,0 +1,14 @@
+// Type definitions for abs 1.1.0
+// Project: https://github.com/IonicaBizau/node-abs
+// Definitions by: Aya Morisawa
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare module "abs" {
+ /**
+ * Compute the absolute path of an input.
+ * @param input The input path.
+ */
+ function Abs(input: string): string;
+
+ export default Abs;
+}
diff --git a/absolute/absolute-tests.ts b/absolute/absolute-tests.ts
new file mode 100644
index 000000000..5c2514450
--- /dev/null
+++ b/absolute/absolute-tests.ts
@@ -0,0 +1,5 @@
+///
+
+import absolute from 'absolute';
+
+const x: boolean = absolute('/home/foo');
diff --git a/absolute/absolute.d.ts b/absolute/absolute.d.ts
new file mode 100644
index 000000000..c0e8e9bd6
--- /dev/null
+++ b/absolute/absolute.d.ts
@@ -0,0 +1,13 @@
+// Type definitions for absolute 0.0.1
+// Project: https://github.com/bahamas10/node-absolute
+// Definitions by: Aya Morisawa
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+declare module "absolute" {
+ /**
+ * Test if a path is absolute
+ */
+ function absolute(path: string): boolean;
+
+ export default absolute;
+}
diff --git a/ace/ace.d.ts b/ace/ace.d.ts
index bedcfee54..8fed295f2 100644
--- a/ace/ace.d.ts
+++ b/ace/ace.d.ts
@@ -25,17 +25,17 @@ declare module AceAjax {
export interface CommandManager {
- byName;
+ byName: any;
- commands;
+ commands: any;
platform: string;
- addCommands(commands:EditorCommand[]);
+ addCommands(commands:EditorCommand[]): void;
- addCommand(command:EditorCommand);
+ addCommand(command:EditorCommand): void;
- exec(name: string, editor: Editor, args: any);
+ exec(name: string, editor: Editor, args: any): void;
}
export interface Annotation {
@@ -63,19 +63,19 @@ declare module AceAjax {
export interface KeyBinding {
- setDefaultHandler(kb);
+ setDefaultHandler(kb: any): void;
- setKeyboardHandler(kb);
+ setKeyboardHandler(kb: any): void;
- addKeyboardHandler(kb, pos);
+ addKeyboardHandler(kb: any, pos: any): void;
- removeKeyboardHandler(kb): boolean;
+ removeKeyboardHandler(kb: any): boolean;
getKeyboardHandler(): any;
- onCommandKey(e, hashId, keyCode);
+ onCommandKey(e: any, hashId: any, keyCode: any): void;
- onTextInput(text);
+ onTextInput(text: any): void;
}
var KeyBinding: {
new(editor: Editor): KeyBinding;
@@ -85,19 +85,19 @@ declare module AceAjax {
getTokenizer(): any;
- toggleCommentLines(state, doc, startRow, endRow);
+ toggleCommentLines(state: any, doc: any, startRow: any, endRow: any): void;
- getNextLineIndent (state, line, tab): string;
+ getNextLineIndent (state: any, line: any, tab: any): string;
- checkOutdent(state, line, input): boolean;
+ checkOutdent(state: any, line: any, input: any): boolean;
- autoOutdent(state, doc, row);
+ autoOutdent(state: any, doc: any, row: any): void;
- createWorker(session): any;
+ createWorker(session: any): any;
- createModeDelegates (mapping);
+ createModeDelegates (mapping: any): void;
- transformAction(state, action, editor, session, param): any;
+ transformAction(state: any, action: any, editor: any, session: any, param: any): any;
}
////////////////
@@ -151,7 +151,7 @@ declare module AceAjax {
**/
export interface Anchor {
- on(event: string, fn: (e) => any);
+ on(event: string, fn: (e: any) => any): void;
/**
* Returns an object identifying the `row` and `column` position of the current anchor.
@@ -171,7 +171,7 @@ declare module AceAjax {
* - `old`: An object describing the old Anchor position
* - `value`: An object describing the new Anchor position
**/
- onChange(e: any);
+ onChange(e: any): void;
/**
* Sets the anchor position to the specified row and column. If `noClip` is `true`, the position is not clipped.
@@ -179,12 +179,12 @@ declare module AceAjax {
* @param column The column index to move the anchor to
* @param noClip Identifies if you want the position to be clipped
**/
- setPosition(row: number, column: number, noClip: boolean);
+ setPosition(row: number, column: number, noClip: boolean): void;
/**
* When called, the `'change'` event listener is removed.
**/
- detach();
+ detach(): void;
}
var Anchor: {
/**
@@ -212,31 +212,31 @@ declare module AceAjax {
* Sets a new tokenizer for this object.
* @param tokenizer The new tokenizer to use
**/
- setTokenizer(tokenizer: Tokenizer);
+ setTokenizer(tokenizer: Tokenizer): void;
/**
* Sets a new document to associate with this object.
* @param doc The new document to associate with
**/
- setDocument(doc: Document);
+ setDocument(doc: Document): void;
/**
* Emits the `'update'` event. `firstRow` and `lastRow` are used to define the boundaries of the region to be updated.
* @param firstRow The starting row region
* @param lastRow The final row region
**/
- fireUpdateEvent(firstRow: number, lastRow: number);
+ fireUpdateEvent(firstRow: number, lastRow: number): void;
/**
* Starts tokenizing at the row indicated.
* @param startRow The row to start at
**/
- start(startRow: number);
+ start(startRow: number): void;
/**
* Stops tokenizing.
**/
- stop();
+ stop(): void;
/**
* Gives list of tokens of the row. (tokens are cached)
@@ -269,13 +269,13 @@ declare module AceAjax {
**/
export interface Document {
- on(event: string, fn: (e) => any);
+ on(event: string, fn: (e: any) => any): void;
/**
* Replaces all the lines in the current `Document` with the value of `text`.
* @param text The text to use
**/
- setValue(text: string);
+ setValue(text: string): void;
/**
* Returns all the lines in the document as a single string, split by the new line character.
@@ -287,7 +287,7 @@ declare module AceAjax {
* @param row The row number to use
* @param column The column number to use
**/
- createAnchor(row: number, column: number);
+ createAnchor(row: number, column: number): void;
/**
* Returns the newline character that's being used, depending on the value of `newLineMode`.
@@ -298,7 +298,7 @@ declare module AceAjax {
* [Sets the new line mode.]{: #Document.setNewLineMode.desc}
* @param newLineMode [The newline mode to use; can be either `windows`, `unix`, or `auto`]{: #Document.setNewLineMode.param}
**/
- setNewLineMode(newLineMode: string);
+ setNewLineMode(newLineMode: string): void;
/**
* [Returns the type of newlines being used; either `windows`, `unix`, or `auto`]{: #Document.getNewLineMode}
@@ -392,7 +392,7 @@ declare module AceAjax {
* Removes the new line between `row` and the row immediately following it. This method also triggers the `'change'` event.
* @param row The row to check
**/
- removeNewLine(row: number);
+ removeNewLine(row: number): void;
/**
* Replaces a range in the document with the new `text`.
@@ -404,12 +404,12 @@ declare module AceAjax {
/**
* Applies all the changes previously accumulated. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`.
**/
- applyDeltas(deltas: Delta[]);
+ applyDeltas(deltas: Delta[]): void;
/**
* Reverts any changes previously applied. These can be either `'includeText'`, `'insertLines'`, `'removeText'`, and `'removeLines'`.
**/
- revertDeltas(deltas: Delta[]);
+ revertDeltas(deltas: Delta[]): void;
/**
* Converts an index position in a document to a `{row, column}` object.
@@ -466,33 +466,33 @@ declare module AceAjax {
doc: Document;
- on(event: string, fn: (e) => any);
+ on(event: string, fn: (e: any) => any): void;
- findMatchingBracket(position: Position);
+ findMatchingBracket(position: Position): void;
- addFold(text: string, range: Range);
+ addFold(text: string, range: Range): void;
getFoldAt(row: number, column: number): any;
- removeFold(arg: any);
+ removeFold(arg: any): void;
- expandFold(arg: any);
+ expandFold(arg: any): void;
- unfold(arg1: any, arg2: boolean);
+ unfold(arg1: any, arg2: boolean): void;
- screenToDocumentColumn(row: number, column: number);
+ screenToDocumentColumn(row: number, column: number): void;
getFoldDisplayLine(foldLine: any, docRow: number, docColumn: number): any;
getFoldsInRange(range: Range): any;
- highlight(text: string);
+ highlight(text: string): void;
/**
* Sets the `EditSession` to point to a new `Document`. If a `BackgroundTokenizer` exists, it also points to `doc`.
* @param doc The new `Document` to use
**/
- setDocument(doc: Document);
+ setDocument(doc: Document): void;
/**
* Returns the `Document` associated with this session.
@@ -503,15 +503,15 @@ declare module AceAjax {
* undefined
* @param row The row to work with
**/
- $resetRowCache(row: number);
+ $resetRowCache(row: number): void;
/**
* Sets the session text.
* @param text The new text to place
**/
- setValue(text: string);
+ setValue(text: string): void;
- setMode(mode: string);
+ setMode(mode: string): void;
/**
* Returns the current [[Document `Document`]] as a string.
@@ -546,7 +546,7 @@ declare module AceAjax {
* Sets the undo manager.
* @param undoManager The new undo manager
**/
- setUndoManager(undoManager: UndoManager);
+ setUndoManager(undoManager: UndoManager): void;
/**
* Returns the current undo manager.
@@ -554,7 +554,7 @@ declare module AceAjax {
getUndoManager(): UndoManager;
/**
- * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]); otherwise it's simply `'\t'`.
+ * Returns the current value for tabs. If the user is using soft tabs, this will be a series of spaces (defined by [[EditSession.getTabSize `getTabSize()`]]): void; otherwise it's simply `'\t'`.
**/
getTabString(): string;
@@ -562,7 +562,7 @@ declare module AceAjax {
* Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`).
* @param useSoftTabs Value indicating whether or not to use soft tabs
**/
- setUseSoftTabs(useSoftTabs: boolean);
+ setUseSoftTabs(useSoftTabs: boolean): void;
/**
* Returns `true` if soft tabs are being used, `false` otherwise.
@@ -573,7 +573,7 @@ declare module AceAjax {
* Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event.
* @param tabSize The new tab size
**/
- setTabSize(tabSize: number);
+ setTabSize(tabSize: number): void;
/**
* Returns the current tab size.
@@ -591,7 +591,7 @@ declare module AceAjax {
* If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event.
* @param overwrite Defines wheter or not to set overwrites
**/
- setOverwrite(overwrite: boolean);
+ setOverwrite(overwrite: boolean): void;
/**
* Returns `true` if overwrites are enabled; `false` otherwise.
@@ -601,21 +601,21 @@ declare module AceAjax {
/**
* Sets the value of overwrite to the opposite of whatever it currently is.
**/
- toggleOverwrite();
+ toggleOverwrite(): void;
/**
* Adds `className` to the `row`, to be used for CSS stylings and whatnot.
* @param row The row number
* @param className The class to add
**/
- addGutterDecoration(row: number, className: string);
+ addGutterDecoration(row: number, className: string): void;
/**
* Removes `className` from the `row`.
* @param row The row number
* @param className The class to add
**/
- removeGutterDecoration(row: number, className: string);
+ removeGutterDecoration(row: number, className: string): void;
/**
* Returns an array of numbers, indicating which rows have breakpoints.
@@ -626,25 +626,25 @@ declare module AceAjax {
* Sets a breakpoint on every row number given by `rows`. This function also emites the `'changeBreakpoint'` event.
* @param rows An array of row indices
**/
- setBreakpoints(rows: any[]);
+ setBreakpoints(rows: any[]): void;
/**
* Removes all breakpoints on the rows. This function also emites the `'changeBreakpoint'` event.
**/
- clearBreakpoints();
+ clearBreakpoints(): void;
/**
* Sets a breakpoint on the row number given by `rows`. This function also emites the `'changeBreakpoint'` event.
* @param row A row index
* @param className Class of the breakpoint
**/
- setBreakpoint(row: number, className: string);
+ setBreakpoint(row: number, className: string): void;
/**
* Removes a breakpoint on the row number given by `rows`. This function also emites the `'changeBreakpoint'` event.
* @param row A row index
**/
- clearBreakpoint(row: number);
+ clearBreakpoint(row: number): void;
/**
* Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires.
@@ -653,7 +653,7 @@ declare module AceAjax {
* @param type Identify the type of the marker
* @param inFront Set to `true` to establish a front marker
**/
- addMarker(range: Range, clazz: string, type: Function, inFront: boolean);
+ addMarker(range: Range, clazz: string, type: Function, inFront: boolean): void;
/**
* Adds a new marker to the given `Range`. If `inFront` is `true`, a front marker is defined, and the `'changeFrontMarker'` event fires; otherwise, the `'changeBackMarker'` event fires.
@@ -662,20 +662,20 @@ declare module AceAjax {
* @param type Identify the type of the marker
* @param inFront Set to `true` to establish a front marker
**/
- addMarker(range: Range, clazz: string, type: string, inFront: boolean);
+ addMarker(range: Range, clazz: string, type: string, inFront: boolean): void;
/**
* Adds a dynamic marker to the session.
* @param marker object with update method
* @param inFront Set to `true` to establish a front marker
**/
- addDynamicMarker(marker: any, inFront: boolean);
+ addDynamicMarker(marker: any, inFront: boolean): void;
/**
* Removes the marker with the specified ID. If this marker was in front, the `'changeFrontMarker'` event is emitted. If the marker was in the back, the `'changeBackMarker'` event is emitted.
* @param markerId A number representing a marker
**/
- removeMarker(markerId: number);
+ removeMarker(markerId: number): void;
/**
* Returns an array containing the IDs of all the markers, either front or back.
@@ -687,7 +687,7 @@ declare module AceAjax {
* Sets annotations for the `EditSession`. This functions emits the `'changeAnnotation'` event.
* @param annotations A list of annotations
**/
- setAnnotations(annotations: Annotation[]);
+ setAnnotations(annotations: Annotation[]): void;
/**
* Returns the annotations for the `EditSession`.
@@ -697,13 +697,13 @@ declare module AceAjax {
/**
* Clears all the annotations for this session. This function also triggers the `'changeAnnotation'` event.
**/
- clearAnnotations();
+ clearAnnotations(): void;
/**
* If `text` contains either the newline (`\n`) or carriage-return ('\r') characters, `$autoNewLine` stores that value.
* @param text A block of text
**/
- $detectNewLine(text: string);
+ $detectNewLine(text: string): void;
/**
* Given a starting row and column, this method returns the `Range` of the first word boundary it finds.
@@ -723,7 +723,7 @@ declare module AceAjax {
* {:Document.setNewLineMode.desc}
* @param newLineMode {:Document.setNewLineMode.param}
**/
- setNewLineMode(newLineMode: string);
+ setNewLineMode(newLineMode: string): void;
/**
* Returns the current new line mode.
@@ -734,7 +734,7 @@ declare module AceAjax {
* Identifies if you want to use a worker for the `EditSession`.
* @param useWorker Set to `true` to use a worker
**/
- setUseWorker(useWorker: boolean);
+ setUseWorker(useWorker: boolean): void;
/**
* Returns `true` if workers are being used.
@@ -744,13 +744,13 @@ declare module AceAjax {
/**
* Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event.
**/
- onReloadTokenizer();
+ onReloadTokenizer(): void;
/**
* Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted.
* @param mode Set a new text mode
**/
- $mode(mode: TextMode);
+ $mode(mode: TextMode): void;
/**
* Returns the current text mode.
@@ -761,7 +761,7 @@ declare module AceAjax {
* This function sets the scroll top value. It also emits the `'changeScrollTop'` event.
* @param scrollTop The new scroll top value
**/
- setScrollTop(scrollTop: number);
+ setScrollTop(scrollTop: number): void;
/**
* [Returns the value of the distance between the top of the editor and the topmost part of the visible content.]{: #EditSession.getScrollTop}
@@ -771,7 +771,7 @@ declare module AceAjax {
/**
* [Sets the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.setScrollLeft}
**/
- setScrollLeft();
+ setScrollLeft(): void;
/**
* [Returns the value of the distance between the left of the editor and the leftmost part of the visible content.]{: #EditSession.getScrollLeft}
@@ -838,7 +838,7 @@ declare module AceAjax {
* Enables or disables highlighting of the range where an undo occured.
* @param enable If `true`, selects the range of the reinserted change
**/
- setUndoSelect(enable: boolean);
+ setUndoSelect(enable: boolean): void;
/**
* Replaces a range in the document with the new `text`.
@@ -864,13 +864,13 @@ declare module AceAjax {
* @param endRow Ending row
* @param indentString The indent token
**/
- indentRows(startRow: number, endRow: number, indentString: string);
+ indentRows(startRow: number, endRow: number, indentString: string): void;
/**
* Outdents all the rows defined by the `start` and `end` properties of `range`.
* @param range A range of rows
**/
- outdentRows(range: Range);
+ outdentRows(range: Range): void;
/**
* Shifts all the lines in the document up one, starting from `firstRow` and ending at `lastRow`.
@@ -897,7 +897,7 @@ declare module AceAjax {
* Sets whether or not line wrapping is enabled. If `useWrapMode` is different than the current value, the `'changeWrapMode'` event is emitted.
* @param useWrapMode Enable (or disable) wrap mode
**/
- setUseWrapMode(useWrapMode: boolean);
+ setUseWrapMode(useWrapMode: boolean): void;
/**
* Returns `true` if wrap mode is being used; `false` otherwise.
@@ -909,7 +909,7 @@ declare module AceAjax {
* @param min The minimum wrap value (the left side wrap)
* @param max The maximum wrap value (the right side wrap)
**/
- setWrapLimitRange(min: number, max: number);
+ setWrapLimitRange(min: number, max: number): void;
/**
* This should generally only be called by the renderer when a resize is detected.
@@ -933,7 +933,7 @@ declare module AceAjax {
* @param str The string to check
* @param offset The value to start at
**/
- $getDisplayTokens(str: string, offset: number);
+ $getDisplayTokens(str: string, offset: number): void;
/**
* Calculates the width of the string `str` on the screen while assuming that the string starts at the first column on the screen.
@@ -1006,7 +1006,7 @@ declare module AceAjax {
* @param docRow
* @param docColumn
**/
- documentToScreenRow(docRow: number, docColumn: number);
+ documentToScreenRow(docRow: number, docColumn: number): void;
/**
* Returns the length of the screen.
@@ -1036,17 +1036,17 @@ declare module AceAjax {
* Event sessions dealing with the mouse and keyboard are bubbled up from `Document` to the `Editor`, which decides what to do with them.
**/
export interface Editor {
-
- addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any);
- addEventListener(ev: string, callback: Function);
+
+ addEventListener(ev: 'change', callback: (ev: EditorChangeEvent) => any): void;
+ addEventListener(ev: string, callback: Function): void;
inMultiSelectMode: boolean;
- selectMoreLines(n: number);
+ selectMoreLines(n: number): void;
- onTextInput(text: string);
+ onTextInput(text: string): void;
- onCommandKey(e, hashId, keyCode);
+ onCommandKey(e: any, hashId: any, keyCode: any): void;
commands: CommandManager;
@@ -1060,32 +1060,32 @@ declare module AceAjax {
container: HTMLElement;
- onSelectionChange(e);
+ onSelectionChange(e: any): void;
- onChangeMode(e?);
+ onChangeMode(e?: any): void;
+
+ execCommand(command:string, args?: any): void;
- execCommand(command:string, args?: any);
-
/**
* Sets a Configuration Option
**/
- setOption(optionName: any, optionValue: any);
-
+ setOption(optionName: any, optionValue: any): void;
+
/**
* Sets Configuration Options
**/
- setOptions(keyValueTuples: any);
-
+ setOptions(keyValueTuples: any): void;
+
/**
* Get a Configuration Option
**/
getOption(name: any):any;
-
+
/**
* Get Configuration Options
**/
getOptions():any;
-
+
/**
* Get rid of console warning by setting this to Infinity
**/
@@ -1095,7 +1095,7 @@ declare module AceAjax {
* Sets a new key handler, such as "vim" or "windows".
* @param keyboardHandler The new key handler
**/
- setKeyboardHandler(keyboardHandler: string);
+ setKeyboardHandler(keyboardHandler: string): void;
/**
* Returns the keyboard handler, such as "vim" or "windows".
@@ -1106,7 +1106,7 @@ declare module AceAjax {
* Sets a new editsession to use. This method also emits the `'changeSession'` event.
* @param session The new session to use
**/
- setSession(session: IEditSession);
+ setSession(session: IEditSession): void;
/**
* Returns the current session being used.
@@ -1134,13 +1134,13 @@ declare module AceAjax {
* {:VirtualRenderer.onResize}
* @param force If `true`, recomputes the size, even if the height and width haven't changed
**/
- resize(force?: boolean);
+ resize(force?: boolean): void;
/**
* {:VirtualRenderer.setTheme}
* @param theme The path to a theme
**/
- setTheme(theme: string);
+ setTheme(theme: string): void;
/**
* {:VirtualRenderer.getTheme}
@@ -1151,54 +1151,54 @@ declare module AceAjax {
* {:VirtualRenderer.setStyle}
* @param style A class name
**/
- setStyle(style: string);
+ setStyle(style: string): void;
/**
* {:VirtualRenderer.unsetStyle}
**/
- unsetStyle();
+ unsetStyle(): void;
/**
* Set a new font size (in pixels) for the editor text.
* @param size A font size ( _e.g._ "12px")
**/
- setFontSize(size: string);
+ setFontSize(size: string): void;
/**
* Brings the current `textInput` into focus.
**/
- focus();
+ focus(): void;
/**
* Returns `true` if the current `textInput` is in focus.
**/
- isFocused();
+ isFocused(): void;
/**
* Blurs the current `textInput`.
**/
- blur();
+ blur(): void;
/**
* Emitted once the editor comes into focus.
**/
- onFocus();
+ onFocus(): void;
/**
* Emitted once the editor has been blurred.
**/
- onBlur();
+ onBlur(): void;
/**
* Emitted whenever the document is changed.
* @param e Contains a single property, `data`, which has the delta of changes
**/
- onDocumentChange(e: any);
+ onDocumentChange(e: any): void;
/**
* Emitted when the selection changes.
**/
- onCursorChange();
+ onCursorChange(): void;
/**
* Returns the string of text currently highlighted.
@@ -1208,30 +1208,30 @@ declare module AceAjax {
/**
* Called whenever a text "copy" happens.
**/
- onCopy();
+ onCopy(): void;
/**
* Called whenever a text "cut" happens.
**/
- onCut();
+ onCut(): void;
/**
* Called whenever a text "paste" happens.
* @param text The pasted text
**/
- onPaste(text: string);
+ onPaste(text: string): void;
/**
* Inserts `text` into wherever the cursor is pointing.
* @param text The new text to add
**/
- insert(text: string);
+ insert(text: string): void;
/**
* Pass in `true` to enable overwrites in your session, or `false` to disable. If overwrites is enabled, any text you enter will type over any text after it. If the value of `overwrite` changes, this function also emites the `changeOverwrite` event.
* @param overwrite Defines wheter or not to set overwrites
**/
- setOverwrite(overwrite: boolean);
+ setOverwrite(overwrite: boolean): void;
/**
* Returns `true` if overwrites are enabled; `false` otherwise.
@@ -1241,13 +1241,13 @@ declare module AceAjax {
/**
* Sets the value of overwrite to the opposite of whatever it currently is.
**/
- toggleOverwrite();
+ toggleOverwrite(): void;
/**
* Sets how fast the mouse scrolling should do.
* @param speed A value indicating the new speed (in milliseconds)
**/
- setScrollSpeed(speed: number);
+ setScrollSpeed(speed: number): void;
/**
* Returns the value indicating how fast the mouse scroll speed is (in milliseconds).
@@ -1258,7 +1258,7 @@ declare module AceAjax {
* Sets the delay (in milliseconds) of the mouse drag.
* @param dragDelay A value indicating the new delay
**/
- setDragDelay(dragDelay: number);
+ setDragDelay(dragDelay: number): void;
/**
* Returns the current mouse drag delay.
@@ -1272,7 +1272,7 @@ declare module AceAjax {
* This function also emits the `'changeSelectionStyle'` event.
* @param style The new selection style
**/
- setSelectionStyle(style: string);
+ setSelectionStyle(style: string): void;
/**
* Returns the current selection style.
@@ -1283,18 +1283,18 @@ declare module AceAjax {
* Determines whether or not the current line should be highlighted.
* @param shouldHighlight Set to `true` to highlight the current line
**/
- setHighlightActiveLine(shouldHighlight: boolean);
+ setHighlightActiveLine(shouldHighlight: boolean): void;
/**
* Returns `true` if current lines are always highlighted.
**/
- getHighlightActiveLine();
+ getHighlightActiveLine(): void;
/**
* Determines if the currently selected word should be highlighted.
* @param shouldHighlight Set to `true` to highlight the currently selected word
**/
- setHighlightSelectedWord(shouldHighlight: boolean);
+ setHighlightSelectedWord(shouldHighlight: boolean): void;
/**
* Returns `true` if currently highlighted words are to be highlighted.
@@ -1305,7 +1305,7 @@ declare module AceAjax {
* If `showInvisibiles` is set to `true`, invisible characters—like spaces or new lines—are show in the editor.
* @param showInvisibles Specifies whether or not to show invisible characters
**/
- setShowInvisibles(showInvisibles: boolean);
+ setShowInvisibles(showInvisibles: boolean): void;
/**
* Returns `true` if invisible characters are being shown.
@@ -1316,7 +1316,7 @@ declare module AceAjax {
* If `showPrintMargin` is set to `true`, the print margin is shown in the editor.
* @param showPrintMargin Specifies whether or not to show the print margin
**/
- setShowPrintMargin(showPrintMargin: boolean);
+ setShowPrintMargin(showPrintMargin: boolean): void;
/**
* Returns `true` if the print margin is being shown.
@@ -1327,7 +1327,7 @@ declare module AceAjax {
* Sets the column defining where the print margin should be.
* @param showPrintMargin Specifies the new print margin
**/
- setPrintMarginColumn(showPrintMargin: number);
+ setPrintMarginColumn(showPrintMargin: number): void;
/**
* Returns the column number of where the print margin is.
@@ -1338,7 +1338,7 @@ declare module AceAjax {
* If `readOnly` is true, then the editor is set to read-only mode, and none of the content can change.
* @param readOnly Specifies whether the editor can be modified or not
**/
- setReadOnly(readOnly: boolean);
+ setReadOnly(readOnly: boolean): void;
/**
* Returns `true` if the editor is set to read-only mode.
@@ -1349,7 +1349,7 @@ declare module AceAjax {
* Specifies whether to use behaviors or not. ["Behaviors" in this case is the auto-pairing of special characters, like quotation marks, parenthesis, or brackets.]{: #BehaviorsDef}
* @param enabled Enables or disables behaviors
**/
- setBehavioursEnabled(enabled: boolean);
+ setBehavioursEnabled(enabled: boolean): void;
/**
* Returns `true` if the behaviors are currently enabled. {:BehaviorsDef}
@@ -1361,89 +1361,89 @@ declare module AceAjax {
* when such a character is typed in.
* @param enabled Enables or disables wrapping behaviors
**/
- setWrapBehavioursEnabled(enabled: boolean);
+ setWrapBehavioursEnabled(enabled: boolean): void;
/**
* Returns `true` if the wrapping behaviors are currently enabled.
**/
- getWrapBehavioursEnabled();
+ getWrapBehavioursEnabled(): void;
/**
* Indicates whether the fold widgets are shown or not.
* @param show Specifies whether the fold widgets are shown
**/
- setShowFoldWidgets(show: boolean);
+ setShowFoldWidgets(show: boolean): void;
/**
* Returns `true` if the fold widgets are shown.
**/
- getShowFoldWidgets();
+ getShowFoldWidgets(): void;
/**
* Removes words of text from the editor. A "word" is defined as a string of characters bookended by whitespace.
* @param dir The direction of the deletion to occur, either "left" or "right"
**/
- remove(dir: string);
+ remove(dir: string): void;
/**
* Removes the word directly to the right of the current selection.
**/
- removeWordRight();
+ removeWordRight(): void;
/**
* Removes the word directly to the left of the current selection.
**/
- removeWordLeft();
+ removeWordLeft(): void;
/**
* Removes all the words to the left of the current selection, until the start of the line.
**/
- removeToLineStart();
+ removeToLineStart(): void;
/**
* Removes all the words to the right of the current selection, until the end of the line.
**/
- removeToLineEnd();
+ removeToLineEnd(): void;
/**
* Splits the line at the current selection (by inserting an `'\n'`).
**/
- splitLine();
+ splitLine(): void;
/**
* Transposes current line.
**/
- transposeLetters();
+ transposeLetters(): void;
/**
* Converts the current selection entirely into lowercase.
**/
- toLowerCase();
+ toLowerCase(): void;
/**
* Converts the current selection entirely into uppercase.
**/
- toUpperCase();
+ toUpperCase(): void;
/**
* Inserts an indentation into the current cursor position or indents the selected lines.
**/
- indent();
+ indent(): void;
/**
* Indents the current line.
**/
- blockIndent();
+ blockIndent(): void;
/**
* Outdents the current line.
**/
- blockOutdent(arg?: string);
+ blockOutdent(arg?: string): void;
/**
* Given the currently selected range, this function either comments all the lines, or uncomments all of them.
**/
- toggleCommentLines();
+ toggleCommentLines(): void;
/**
* Works like [[EditSession.getTokenAt]], except it returns a number.
@@ -1454,12 +1454,12 @@ declare module AceAjax {
* If the character before the cursor is a number, this functions changes its value by `amount`.
* @param amount The value to change the numeral by (can be negative to decrease value)
**/
- modifyNumber(amount: number);
+ modifyNumber(amount: number): void;
/**
* Removes all the lines in the current selection
**/
- removeLines();
+ removeLines(): void;
/**
* Shifts all the selected lines down one row.
@@ -1516,37 +1516,37 @@ declare module AceAjax {
/**
* Selects the text from the current position of the document until where a "page down" finishes.
**/
- selectPageDown();
+ selectPageDown(): void;
/**
* Selects the text from the current position of the document until where a "page up" finishes.
**/
- selectPageUp();
+ selectPageUp(): void;
/**
* Shifts the document to wherever "page down" is, as well as moving the cursor position.
**/
- gotoPageDown();
+ gotoPageDown(): void;
/**
* Shifts the document to wherever "page up" is, as well as moving the cursor position.
**/
- gotoPageUp();
+ gotoPageUp(): void;
/**
* Scrolls the document to wherever "page down" is, without changing the cursor position.
**/
- scrollPageDown();
+ scrollPageDown(): void;
/**
* Scrolls the document to wherever "page up" is, without changing the cursor position.
**/
- scrollPageUp();
+ scrollPageUp(): void;
/**
* Moves the editor to the specified row.
**/
- scrollToRow();
+ scrollToRow(): void;
/**
* Scrolls to a line. If `center` is `true`, it puts the line in middle of screen (or attempts to).
@@ -1555,12 +1555,12 @@ declare module AceAjax {
* @param animate If `true` animates scrolling
* @param callback Function to be called when the animation has finished
**/
- scrollToLine(line: number, center: boolean, animate: boolean, callback: Function);
+ scrollToLine(line: number, center: boolean, animate: boolean, callback: Function): void;
/**
* Attempts to center the current selection on the screen.
**/
- centerSelection();
+ centerSelection(): void;
/**
* Gets the current position of the cursor.
@@ -1580,30 +1580,30 @@ declare module AceAjax {
/**
* Selects all the text in editor.
**/
- selectAll();
+ selectAll(): void;
/**
* {:Selection.clearSelection}
**/
- clearSelection();
+ clearSelection(): void;
/**
* Moves the cursor to the specified row and column. Note that this does not de-select the current selection.
* @param row The new row number
* @param column The new column number
**/
- moveCursorTo(row: number, column?: number, animate?:boolean);
+ moveCursorTo(row: number, column?: number, animate?:boolean): void;
/**
* Moves the cursor to the position indicated by `pos.row` and `pos.column`.
* @param position An object with two properties, row and column
**/
- moveCursorToPosition(position: Position);
+ moveCursorToPosition(position: Position): void;
/**
* Moves the cursor's row and column to the next matching bracket.
**/
- jumpToMatching();
+ jumpToMatching(): void;
/**
* Moves the cursor to the specified line number, and also into the indiciated column.
@@ -1611,82 +1611,82 @@ declare module AceAjax {
* @param column A column number to go to
* @param animate If `true` animates scolling
**/
- gotoLine(lineNumber: number, column?: number, animate?: boolean);
+ gotoLine(lineNumber: number, column?: number, animate?: boolean): void;
/**
* Moves the cursor to the specified row and column. Note that this does de-select the current selection.
* @param row The new row number
* @param column The new column number
**/
- navigateTo(row: number, column: number);
+ navigateTo(row: number, column: number): void;
/**
* Moves the cursor up in the document the specified number of times. Note that this does de-select the current selection.
* @param times The number of times to change navigation
**/
- navigateUp(times?: number);
+ navigateUp(times?: number): void;
/**
* Moves the cursor down in the document the specified number of times. Note that this does de-select the current selection.
* @param times The number of times to change navigation
**/
- navigateDown(times?: number);
+ navigateDown(times?: number): void;
/**
* Moves the cursor left in the document the specified number of times. Note that this does de-select the current selection.
* @param times The number of times to change navigation
**/
- navigateLeft(times?: number);
+ navigateLeft(times?: number): void;
/**
* Moves the cursor right in the document the specified number of times. Note that this does de-select the current selection.
* @param times The number of times to change navigation
**/
- navigateRight(times: number);
+ navigateRight(times: number): void;
/**
* Moves the cursor to the start of the current line. Note that this does de-select the current selection.
**/
- navigateLineStart();
+ navigateLineStart(): void;
/**
* Moves the cursor to the end of the current line. Note that this does de-select the current selection.
**/
- navigateLineEnd();
+ navigateLineEnd(): void;
/**
* Moves the cursor to the end of the current file. Note that this does de-select the current selection.
**/
- navigateFileEnd();
+ navigateFileEnd(): void;
/**
* Moves the cursor to the start of the current file. Note that this does de-select the current selection.
**/
- navigateFileStart();
+ navigateFileStart(): void;
/**
* Moves the cursor to the word immediately to the right of the current position. Note that this does de-select the current selection.
**/
- navigateWordRight();
+ navigateWordRight(): void;
/**
* Moves the cursor to the word immediately to the left of the current position. Note that this does de-select the current selection.
**/
- navigateWordLeft();
+ navigateWordLeft(): void;
/**
* Replaces the first occurance of `options.needle` with the value in `replacement`.
* @param replacement The text to replace with
* @param options The [[Search `Search`]] options to use
**/
- replace(replacement: string, options?: any);
+ replace(replacement: string, options?: any): void;
/**
* Replaces all occurances of `options.needle` with the value in `replacement`.
* @param replacement The text to replace with
* @param options The [[Search `Search`]] options to use
**/
- replaceAll(replacement: string, options?: any);
+ replaceAll(replacement: string, options?: any): void;
/**
* {:Search.getOptions} For more information on `options`, see [[Search `Search`]].
@@ -1699,36 +1699,36 @@ declare module AceAjax {
* @param options An object defining various search properties
* @param animate If `true` animate scrolling
**/
- find(needle: string, options?: any, animate?: boolean);
+ find(needle: string, options?: any, animate?: boolean): void;
/**
* Performs another search for `needle` in the document. For more information on `options`, see [[Search `Search`]].
* @param options search options
* @param animate If `true` animate scrolling
**/
- findNext(options?: any, animate?: boolean);
+ findNext(options?: any, animate?: boolean): void;
/**
* Performs a search for `needle` backwards. For more information on `options`, see [[Search `Search`]].
* @param options search options
* @param animate If `true` animate scrolling
**/
- findPrevious(options?: any, animate?: boolean);
+ findPrevious(options?: any, animate?: boolean): void;
/**
* {:UndoManager.undo}
**/
- undo();
+ undo(): void;
/**
* {:UndoManager.redo}
**/
- redo();
+ redo(): void;
/**
* Cleans up the entire editor.
**/
- destroy();
+ destroy(): void;
}
@@ -1740,7 +1740,7 @@ declare module AceAjax {
**/
new(renderer: VirtualRenderer, session?: IEditSession): Editor;
}
-
+
interface EditorChangeEvent {
start: Position;
end: Position;
@@ -1754,49 +1754,49 @@ declare module AceAjax {
export interface PlaceHolder {
- on(event: string, fn: (e) => any);
+ on(event: string, fn: (e: any) => any): void;
/**
* PlaceHolder.setup()
* TODO
**/
- setup();
+ setup(): void;
/**
* PlaceHolder.showOtherMarkers()
* TODO
**/
- showOtherMarkers();
+ showOtherMarkers(): void;
/**
* PlaceHolder.hideOtherMarkers()
* Hides all over markers in the [[EditSession `EditSession`]] that are not the currently selected one.
**/
- hideOtherMarkers();
+ hideOtherMarkers(): void;
/**
* PlaceHolder@onUpdate(e)
* Emitted when the place holder updates.
**/
- onUpdate();
+ onUpdate(): void;
/**
* PlaceHolder@onCursorChange(e)
* Emitted when the cursor changes.
**/
- onCursorChange();
+ onCursorChange(): void;
/**
* PlaceHolder.detach()
* TODO
**/
- detach();
+ detach(): void;
/**
* PlaceHolder.cancel()
* TODO
**/
- cancel();
+ cancel(): void;
}
var PlaceHolder: {
/**
@@ -1819,15 +1819,15 @@ declare module AceAjax {
export interface IRangeList {
ranges: Range[];
- pointIndex(pos: Position, startIndex?: number);
+ pointIndex(pos: Position, startIndex?: number): void;
- addList(ranges: Range[]);
+ addList(ranges: Range[]): void;
- add(ranges: Range);
+ add(ranges: Range): void;
merge(): Range[];
- substractPoint(pos: Position);
+ substractPoint(pos: Position): void;
}
export var RangeList: {
new (): IRangeList;
@@ -1860,7 +1860,7 @@ declare module AceAjax {
* Returns `true` if and only if the starting row and column, and ending row and column, are equivalent to those given by `range`.
* @param range A range to check against
**/
- isEqual(range: Range);
+ isEqual(range: Range): void;
/**
* Returns a string containing the range's row and column information, given like this:
@@ -1868,7 +1868,7 @@ declare module AceAjax {
* [start.row/start.column] -> [end.row/end.column]
* ```
**/
- toString();
+ toString(): void;
/**
* Returns `true` if the `row` and `column` provided are within the given range. This can better be expressed as returning `true` if:
@@ -1924,14 +1924,14 @@ declare module AceAjax {
* @param row A row point to set
* @param column A column point to set
**/
- setStart(row: number, column: number);
+ setStart(row: number, column: number): void;
/**
* Sets the starting row and column for the range.
* @param row A row point to set
* @param column A column point to set
**/
- setEnd(row: number, column: number);
+ setEnd(row: number, column: number): void;
/**
* Returns `true` if the `row` and `column` are within the given range.
@@ -2059,7 +2059,7 @@ declare module AceAjax {
* Emitted when the scroll bar, well, scrolls.
* @param e Contains one property, `"data"`, which indicates the current scroll top position
**/
- onScroll(e: any);
+ onScroll(e: any): void;
/**
* Returns the width of the scroll bar.
@@ -2070,19 +2070,19 @@ declare module AceAjax {
* Sets the height of the scroll bar, in pixels.
* @param height The new height
**/
- setHeight(height: number);
+ setHeight(height: number): void;
/**
* Sets the inner height of the scroll bar, in pixels.
* @param height The new inner height
**/
- setInnerHeight(height: number);
+ setInnerHeight(height: number): void;
/**
* Sets the scroll top of the scroll bar.
* @param scrollTop The new scroll top
**/
- setScrollTop(scrollTop: number);
+ setScrollTop(scrollTop: number): void;
}
var ScrollBar: {
/**
@@ -2116,7 +2116,7 @@ declare module AceAjax {
* Sets the search options via the `options` parameter.
* @param An object containing all the search propertie
**/
- setOptions(An: any);
+ setOptions(An: any): void;
/**
* Searches for `options.needle`. If found, this method returns the [[Range `Range`]] where the text first occurs. If `options.backwards` is `true`, the search goes backwards in the session.
@@ -2165,21 +2165,21 @@ declare module AceAjax {
**/
export interface Selection {
- addEventListener(ev: string, callback: Function);
+ addEventListener(ev: string, callback: Function): void;
- moveCursorWordLeft();
+ moveCursorWordLeft(): void;
- moveCursorWordRight();
+ moveCursorWordRight(): void;
- fromOrientedRange(range: Range);
+ fromOrientedRange(range: Range): void;
- setSelectionRange(match);
+ setSelectionRange(match: any): void;
getAllRanges(): Range[];
- on(event: string, fn: (e) => any);
+ on(event: string, fn: (e: any) => any): void;
- addRange(range: Range);
+ addRange(range: Range): void;
/**
* Returns `true` if the selection is empty.
@@ -2201,7 +2201,7 @@ declare module AceAjax {
* @param row The new row
* @param column The new column
**/
- setSelectionAnchor(row: number, column: number);
+ setSelectionAnchor(row: number, column: number): void;
/**
* Returns an object containing the `row` and `column` of the calling selection anchor.
@@ -2217,7 +2217,7 @@ declare module AceAjax {
* Shifts the selection up (or down, if [[Selection.isBackwards `isBackwards()`]] is true) the given number of columns.
* @param columns The number of columns to shift by
**/
- shiftSelection(columns: number);
+ shiftSelection(columns: number): void;
/**
* Returns `true` if the selection is going backwards in the document.
@@ -2232,165 +2232,165 @@ declare module AceAjax {
/**
* [Empties the selection (by de-selecting it). This function also emits the `'changeSelection'` event.]{: #Selection.clearSelection}
**/
- clearSelection();
+ clearSelection(): void;
/**
* Selects all the text in the document.
**/
- selectAll();
+ selectAll(): void;
/**
* Sets the selection to the provided range.
* @param range The range of text to select
* @param reverse Indicates if the range should go backwards (`true`) or not
**/
- setRange(range: Range, reverse: boolean);
+ setRange(range: Range, reverse: boolean): void;
/**
* Moves the selection cursor to the indicated row and column.
* @param row The row to select to
* @param column The column to select to
**/
- selectTo(row: number, column: number);
+ selectTo(row: number, column: number): void;
/**
* Moves the selection cursor to the row and column indicated by `pos`.
* @param pos An object containing the row and column
**/
- selectToPosition(pos: any);
+ selectToPosition(pos: any): void;
/**
* Moves the selection up one row.
**/
- selectUp();
+ selectUp(): void;
/**
* Moves the selection down one row.
**/
- selectDown();
+ selectDown(): void;
/**
* Moves the selection right one column.
**/
- selectRight();
+ selectRight(): void;
/**
* Moves the selection left one column.
**/
- selectLeft();
+ selectLeft(): void;
/**
* Moves the selection to the beginning of the current line.
**/
- selectLineStart();
+ selectLineStart(): void;
/**
* Moves the selection to the end of the current line.
**/
- selectLineEnd();
+ selectLineEnd(): void;
/**
* Moves the selection to the end of the file.
**/
- selectFileEnd();
+ selectFileEnd(): void;
/**
* Moves the selection to the start of the file.
**/
- selectFileStart();
+ selectFileStart(): void;
/**
* Moves the selection to the first word on the right.
**/
- selectWordRight();
+ selectWordRight(): void;
/**
* Moves the selection to the first word on the left.
**/
- selectWordLeft();
+ selectWordLeft(): void;
/**
* Moves the selection to highlight the entire word.
**/
- getWordRange();
+ getWordRange(): void;
/**
* Selects an entire word boundary.
**/
- selectWord();
+ selectWord(): void;
/**
* Selects a word, including its right whitespace.
**/
- selectAWord();
+ selectAWord(): void;
/**
* Selects the entire line.
**/
- selectLine();
+ selectLine(): void;
/**
* Moves the cursor up one row.
**/
- moveCursorUp();
+ moveCursorUp(): void;
/**
* Moves the cursor down one row.
**/
- moveCursorDown();
+ moveCursorDown(): void;
/**
* Moves the cursor left one column.
**/
- moveCursorLeft();
+ moveCursorLeft(): void;
/**
* Moves the cursor right one column.
**/
- moveCursorRight();
+ moveCursorRight(): void;
/**
* Moves the cursor to the start of the line.
**/
- moveCursorLineStart();
+ moveCursorLineStart(): void;
/**
* Moves the cursor to the end of the line.
**/
- moveCursorLineEnd();
+ moveCursorLineEnd(): void;
/**
* Moves the cursor to the end of the file.
**/
- moveCursorFileEnd();
+ moveCursorFileEnd(): void;
/**
* Moves the cursor to the start of the file.
**/
- moveCursorFileStart();
+ moveCursorFileStart(): void;
/**
* Moves the cursor to the word on the right.
**/
- moveCursorLongWordRight();
+ moveCursorLongWordRight(): void;
/**
* Moves the cursor to the word on the left.
**/
- moveCursorLongWordLeft();
+ moveCursorLongWordLeft(): void;
/**
* Moves the cursor to position indicated by the parameters. Negative numbers move the cursor backwards in the document.
* @param rows The number of rows to move by
* @param chars The number of characters to move by
**/
- moveCursorBy(rows: number, chars: number);
+ moveCursorBy(rows: number, chars: number): void;
/**
* Moves the selection to the position indicated by its `row` and `column`.
* @param position The position to move to
**/
- moveCursorToPosition(position: any);
+ moveCursorToPosition(position: any): void;
/**
* Moves the cursor to the row and column provided. [If `preventUpdateDesiredColumn` is `true`, then the cursor stays in the same column position as its original point.]{: #preventUpdateBoolDesc}
@@ -2398,7 +2398,7 @@ declare module AceAjax {
* @param column The column to move to
* @param keepDesiredColumn [If `true`, the cursor move does not respect the previous column]{: #preventUpdateBool}
**/
- moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean);
+ moveCursorTo(row: number, column: number, keepDesiredColumn?: boolean): void;
/**
* Moves the cursor to the screen position indicated by row and column. {:preventUpdateBoolDesc}
@@ -2406,7 +2406,7 @@ declare module AceAjax {
* @param column The column to move to
* @param keepDesiredColumn {:preventUpdateBool}
**/
- moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean);
+ moveCursorToScreen(row: number, column: number, keepDesiredColumn: boolean): void;
}
var Selection: {
/**
@@ -2431,7 +2431,7 @@ declare module AceAjax {
* Returns the editor identified by the index `idx`.
* @param idx The index of the editor you want
**/
- getEditor(idx: number);
+ getEditor(idx: number): void;
/**
* Returns the current editor.
@@ -2441,44 +2441,44 @@ declare module AceAjax {
/**
* Focuses the current editor.
**/
- focus();
+ focus(): void;
/**
* Blurs the current editor.
**/
- blur();
+ blur(): void;
/**
* Sets a theme for each of the available editors.
* @param theme The name of the theme to set
**/
- setTheme(theme: string);
+ setTheme(theme: string): void;
/**
* Sets the keyboard handler for the editor.
* @param keybinding
**/
- setKeyboardHandler(keybinding: string);
+ setKeyboardHandler(keybinding: string): void;
/**
* Executes `callback` on all of the available editors.
* @param callback A callback function to execute
* @param scope The default scope for the callback
**/
- forEach(callback: Function, scope: string);
+ forEach(callback: Function, scope: string): void;
/**
* Sets the font size, in pixels, for all the available editors.
* @param size The new font size
**/
- setFontSize(size: number);
+ setFontSize(size: number): void;
/**
* Sets a new [[EditSession `EditSession`]] for the indicated editor.
* @param session The new edit session
* @param idx The editor's index you're interested in
**/
- setSession(session: IEditSession, idx: number);
+ setSession(session: IEditSession, idx: number): void;
/**
* Returns the orientation.
@@ -2489,12 +2489,12 @@ declare module AceAjax {
* Sets the orientation.
* @param orientation The new orientation value
**/
- setOrientation(orientation: number);
+ setOrientation(orientation: number): void;
/**
* Resizes the editor.
**/
- resize();
+ resize(): void;
}
var Split: {
new(): Split;
@@ -2583,7 +2583,7 @@ declare module AceAjax {
* - `args[1]` is the document to associate with
* @param options Contains additional properties
**/
- execute(options: any);
+ execute(options: any): void;
/**
* [Perform an undo operation on the document, reverting the last change.]{: #UndoManager.undo}
@@ -2595,12 +2595,12 @@ declare module AceAjax {
* [Perform a redo operation on the document, reimplementing the last change.]{: #UndoManager.redo}
* @param dontSelect {:dontSelect}
**/
- redo(dontSelect: boolean);
+ redo(dontSelect: boolean): void;
/**
* Destroys the stack of undo and redo redo operations.
**/
- reset();
+ reset(): void;
/**
* Returns `true` if there are undo operations left to perform.
@@ -2611,12 +2611,12 @@ declare module AceAjax {
* Returns `true` if there are redo operations left to perform.
**/
hasRedo(): boolean;
-
+
/**
* Returns `true` if the dirty counter is 0
**/
isClean(): boolean;
-
+
/**
* Sets dirty counter to 0
**/
@@ -2645,35 +2645,35 @@ declare module AceAjax {
lineHeight: number;
- screenToTextCoordinates(left: number, top: number);
+ screenToTextCoordinates(left: number, top: number): void;
/**
* Associates the renderer with an [[EditSession `EditSession`]].
**/
- setSession(session: IEditSession);
+ setSession(session: IEditSession): void;
/**
* Triggers a partial update of the text, from the range given by the two parameters.
* @param firstRow The first row to update
* @param lastRow The last row to update
**/
- updateLines(firstRow: number, lastRow: number);
+ updateLines(firstRow: number, lastRow: number): void;
/**
* Triggers a full update of the text, for all the rows.
**/
- updateText();
+ updateText(): void;
/**
* Triggers a full update of all the layers, for all the rows.
* @param force If `true`, forces the changes through
**/
- updateFull(force: boolean);
+ updateFull(force: boolean): void;
/**
* Updates the font size.
**/
- updateFontSize();
+ updateFontSize(): void;
/**
* [Triggers a resize of the editor.]{: #VirtualRenderer.onResize}
@@ -2682,18 +2682,18 @@ declare module AceAjax {
* @param width The width of the editor in pixels
* @param height The hiehgt of the editor, in pixels
**/
- onResize(force: boolean, gutterWidth: number, width: number, height: number);
+ onResize(force: boolean, gutterWidth: number, width: number, height: number): void;
/**
* Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.
**/
- adjustWrapLimit();
+ adjustWrapLimit(): void;
/**
* Identifies whether you want to have an animated scroll or not.
* @param shouldAnimate Set to `true` to show animated scrolls
**/
- setAnimatedScroll(shouldAnimate: boolean);
+ setAnimatedScroll(shouldAnimate: boolean): void;
/**
* Returns whether an animated scroll happens or not.
@@ -2704,7 +2704,7 @@ declare module AceAjax {
* Identifies whether you want to show invisible characters or not.
* @param showInvisibles Set to `true` to show invisibles
**/
- setShowInvisibles(showInvisibles: boolean);
+ setShowInvisibles(showInvisibles: boolean): void;
/**
* Returns whether invisible characters are being shown or not.
@@ -2715,7 +2715,7 @@ declare module AceAjax {
* Identifies whether you want to show the print margin or not.
* @param showPrintMargin Set to `true` to show the print margin
**/
- setShowPrintMargin(showPrintMargin: boolean);
+ setShowPrintMargin(showPrintMargin: boolean): void;
/**
* Returns whether the print margin is being shown or not.
@@ -2726,7 +2726,7 @@ declare module AceAjax {
* Identifies whether you want to show the print margin column or not.
* @param showPrintMargin Set to `true` to show the print margin column
**/
- setPrintMarginColumn(showPrintMargin: boolean);
+ setPrintMarginColumn(showPrintMargin: boolean): void;
/**
* Returns whether the print margin column is being shown or not.
@@ -2742,7 +2742,7 @@ declare module AceAjax {
* Identifies whether you want to show the gutter or not.
* @param show Set to `true` to show the gutter
**/
- setShowGutter(show: boolean);
+ setShowGutter(show: boolean): void;
/**
* Returns the root element containing this renderer.
@@ -2783,7 +2783,7 @@ declare module AceAjax {
* Sets the padding for all the layers.
* @param padding A new padding value (in pixels)
**/
- setPadding(padding: number);
+ setPadding(padding: number): void;
/**
* Returns whether the horizontal scrollbar is set to be always visible.
@@ -2794,58 +2794,58 @@ declare module AceAjax {
* Identifies whether you want to show the horizontal scrollbar or not.
* @param alwaysVisible Set to `true` to make the horizontal scroll bar visible
**/
- setHScrollBarAlwaysVisible(alwaysVisible: boolean);
+ setHScrollBarAlwaysVisible(alwaysVisible: boolean): void;
/**
* Schedules an update to all the front markers in the document.
**/
- updateFrontMarkers();
+ updateFrontMarkers(): void;
/**
* Schedules an update to all the back markers in the document.
**/
- updateBackMarkers();
+ updateBackMarkers(): void;
/**
* Deprecated; (moved to [[EditSession]])
**/
- addGutterDecoration();
+ addGutterDecoration(): void;
/**
* Deprecated; (moved to [[EditSession]])
**/
- removeGutterDecoration();
+ removeGutterDecoration(): void;
/**
* Redraw breakpoints.
**/
- updateBreakpoints();
+ updateBreakpoints(): void;
/**
* Sets annotations for the gutter.
* @param annotations An array containing annotations
**/
- setAnnotations(annotations: any[]);
+ setAnnotations(annotations: any[]): void;
/**
* Updates the cursor icon.
**/
- updateCursor();
+ updateCursor(): void;
/**
* Hides the cursor icon.
**/
- hideCursor();
+ hideCursor(): void;
/**
* Shows the cursor icon.
**/
- showCursor();
+ showCursor(): void;
/**
* Scrolls the cursor into the first visibile area of the editor
**/
- scrollCursorIntoView();
+ scrollCursorIntoView(): void;
/**
* {:EditSession.getScrollTop}
@@ -2871,7 +2871,7 @@ declare module AceAjax {
* Gracefully scrolls from the top of the editor to the row indicated.
* @param row A row id
**/
- scrollToRow(row: number);
+ scrollToRow(row: number): void;
/**
* Gracefully scrolls the editor to the row indicated.
@@ -2880,7 +2880,7 @@ declare module AceAjax {
* @param animate If `true` animates scrolling
* @param callback Function to be called after the animation has finished
**/
- scrollToLine(line: number, center: boolean, animate: boolean, callback: Function);
+ scrollToLine(line: number, center: boolean, animate: boolean, callback: Function): void;
/**
* Scrolls the editor to the y pixel indicated.
@@ -2899,7 +2899,7 @@ declare module AceAjax {
* @param deltaX The x value to scroll by
* @param deltaY The y value to scroll by
**/
- scrollBy(deltaX: number, deltaY: number);
+ scrollBy(deltaX: number, deltaY: number): void;
/**
* Returns `true` if you can still scroll by either parameter; in other words, you haven't reached the end of the file or line.
@@ -2918,35 +2918,35 @@ declare module AceAjax {
/**
* Focuses the current container.
**/
- visualizeFocus();
+ visualizeFocus(): void;
/**
* Blurs the current container.
**/
- visualizeBlur();
+ visualizeBlur(): void;
/**
* undefined
* @param position
**/
- showComposition(position: number);
+ showComposition(position: number): void;
/**
* Sets the inner text of the current composition to `text`.
* @param text A string of text to use
**/
- setCompositionText(text: string);
+ setCompositionText(text: string): void;
/**
* Hides the current composition.
**/
- hideComposition();
+ hideComposition(): void;
/**
* [Sets a new theme for the editor. `theme` should exist, and be a directory path, like `ace/theme/textmate`.]{: #VirtualRenderer.setTheme}
* @param theme The path to a theme
**/
- setTheme(theme: string);
+ setTheme(theme: string): void;
/**
* [Returns the path of the current theme.]{: #VirtualRenderer.getTheme}
@@ -2957,18 +2957,18 @@ declare module AceAjax {
* [Adds a new class, `style`, to the editor.]{: #VirtualRenderer.setStyle}
* @param style A class name
**/
- setStyle(style: string);
+ setStyle(style: string): void;
/**
* [Removes the class `style` from the editor.]{: #VirtualRenderer.unsetStyle}
* @param style A class name
**/
- unsetStyle(style: string);
+ unsetStyle(style: string): void;
/**
* Destroys the text and cursor layers for this renderer.
**/
- destroy();
+ destroy(): void;
}
var VirtualRenderer: {
diff --git a/adm-zip/adm-zip-tests.ts b/adm-zip/adm-zip-tests.ts
index f8583ae61..93f8f2f2d 100644
--- a/adm-zip/adm-zip-tests.ts
+++ b/adm-zip/adm-zip-tests.ts
@@ -1,10 +1,9 @@
///
import AdmZip = require("adm-zip");
-
// reading archives
var zip = new AdmZip("./my_file.zip");
-var zipEntries = zip.getEntries(); // an array of ZipEntry records
+var zipEntries: AdmZip.IZipEntry[] = zip.getEntries(); // an array of ZipEntry records
zipEntries.forEach(function (zipEntry) {
console.log(zipEntry.toString()); // outputs zip entries information
@@ -31,3 +30,32 @@ zip.addLocalFile("/home/me/some_picture.png");
var willSendthis = zip.toBuffer();
// or write everything to disk
zip.writeZip(/*target file name*/"/home/me/files.zip");
+
+function processZipEntry(zipEntry: AdmZip.IZipEntry) {
+ console.log('comment', zipEntry.comment);
+}
+
+//tests taken from examples at https://github.com/cthackers/adm-zip/wiki/ADM-ZIP
+import Zip = require("adm-zip");
+// loads and parses existing zip file local_file.zip
+var zip = new Zip("local_file.zip");
+// creates new in memory zip
+zip = new Zip();
+// loads and parses existing zip file local_file.zip
+zip = new Zip("local_file.zip");
+// get all entries and iterate them
+zip.getEntries().forEach((entry) => {
+ var entryName = entry.entryName;
+ var decompressedData = zip.readFile(entry); // decompressed buffer of the entry
+ console.log(zip.readAsText(entry)); // outputs the decompressed content of the entry
+});
+
+// will extract the file myfile.txt from the archive to /home/user/folder/subfolder/myfile.txt
+zip.extractEntryTo("folder/subfolder/myfile.txt", "/home/user/", true, true);
+
+// will extract the file myfile.txt from the archive to /home/user/myfile.txt
+zip.extractEntryTo("folder/subfolder/myfile.txt", "/home/user/", false, true);
+
+function isAdmZipEntry(obj: any): obj is AdmZip.IZipEntry {
+ return obj !== null && typeof obj === "object" && typeof obj['entryName'] === 'string';
+}
\ No newline at end of file
diff --git a/adm-zip/adm-zip.d.ts b/adm-zip/adm-zip.d.ts
index 9f2eb7dfd..208c13b27 100644
--- a/adm-zip/adm-zip.d.ts
+++ b/adm-zip/adm-zip.d.ts
@@ -5,8 +5,8 @@
///
-declare module AdmZip {
- class ZipFile {
+declare module "adm-zip" {
+ class AdmZip {
/**
* Create a new, empty archive.
*/
@@ -28,7 +28,7 @@ declare module AdmZip {
* @param entry ZipEntry object
* @return Buffer or Null in case of error
*/
- readFile(entry: IZipEntry): Buffer;
+ readFile(entry: AdmZip.IZipEntry): Buffer;
/**
* Asynchronous readFile
* @param entry String with the full path of the entry
@@ -41,7 +41,7 @@ declare module AdmZip {
* @param callback Called with a Buffer or Null in case of error
* @return Buffer or Null in case of error
*/
- readFileAsync(entry: IZipEntry, callback: (data: Buffer, err: string) => any): void;
+ readFileAsync(entry: AdmZip.IZipEntry, callback: (data: Buffer, err: string) => any): void;
/**
* Extracts the given entry from the archive and returns the content as
* plain text in the given encoding
@@ -57,7 +57,7 @@ declare module AdmZip {
* @param encoding Optional. If no encoding is specified utf8 is used
* @return String
*/
- readAsText(fileName: IZipEntry, encoding?: string): string;
+ readAsText(fileName: AdmZip.IZipEntry, encoding?: string): string;
/**
* Asynchronous readAsText
* @param entry String with the full path of the entry
@@ -71,7 +71,7 @@ declare module AdmZip {
* @param callback Called with the resulting string.
* @param encoding Optional. If no encoding is specified utf8 is used
*/
- readAsTextAsync(fileName: IZipEntry, callback: (data: string) => any, encoding?: string): void;
+ readAsTextAsync(fileName: AdmZip.IZipEntry, callback: (data: string) => any, encoding?: string): void;
/**
* Remove the entry from the file or the entry and all its nested directories
* and files if the given entry is a directory
@@ -83,7 +83,7 @@ declare module AdmZip {
* and files if the given entry is a directory
* @param entry A ZipEntry object.
*/
- deleteFile(entry: IZipEntry): void;
+ deleteFile(entry: AdmZip.IZipEntry): void;
/**
* Adds a comment to the zip. The zip must be rewritten after
* adding the comment.
@@ -110,7 +110,7 @@ declare module AdmZip {
* @param entry ZipEntry object.
* @param comment The comment to add to the entry.
*/
- addZipEntryComment(entry: IZipEntry, comment: string): void;
+ addZipEntryComment(entry: AdmZip.IZipEntry, comment: string): void;
/**
* Returns the comment of the specified entry.
* @param entry String with the full path of the entry.
@@ -122,7 +122,7 @@ declare module AdmZip {
* @param entry ZipEntry object.
* @return String The comment of the specified entry.
*/
- getZipEntryComment(entry: IZipEntry): string;
+ getZipEntryComment(entry: AdmZip.IZipEntry): string;
/**
* Updates the content of an existing entry inside the archive. The zip
* must be rewritten after updating the content
@@ -136,7 +136,7 @@ declare module AdmZip {
* @param entry ZipEntry object.
* @param content The entry's new contents.
*/
- updateFile(entry: IZipEntry, content: Buffer): void;
+ updateFile(entry: AdmZip.IZipEntry, content: Buffer): void;
/**
* Adds a file from the disk to the archive.
* @param localPath Path to a file on disk.
@@ -167,14 +167,14 @@ declare module AdmZip {
* Returns an array of ZipEntry objects representing the files and folders
* inside the archive
*/
- getEntries(): IZipEntry[];
+ getEntries(): AdmZip.IZipEntry[];
/**
* Returns a ZipEntry object representing the file or folder specified by
* ``name``.
* @param name Name of the file or folder to retrieve.
* @return ZipEntry The entry corresponding to the name.
*/
- getEntry(name: string): IZipEntry;
+ getEntry(name: string): AdmZip.IZipEntry;
/**
* Extracts the given entry to the given targetPath.
* If the entry is a directory inside the archive, the entire directory and
@@ -203,7 +203,7 @@ declare module AdmZip {
* will be overwriten if this is true. Default is FALSE
* @return Boolean
*/
- extractEntryTo(entryPath: IZipEntry, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean;
+ extractEntryTo(entryPath: AdmZip.IZipEntry, targetPath: string, maintainEntryPath?: boolean, overwrite?: boolean): boolean;
/**
* Extracts the entire archive to the given location
* @param targetPath Target location
@@ -225,76 +225,75 @@ declare module AdmZip {
toBuffer(): Buffer;
}
- /**
- * The ZipEntry is more than a structure representing the entry inside the
- * zip file. Beside the normal attributes and headers a entry can have, the
- * class contains a reference to the part of the file where the compressed
- * data resides and decompresses it when requested. It also compresses the
- * data and creates the headers required to write in the zip file.
- */
- interface IZipEntry {
+ module AdmZip {
/**
- * Represents the full name and path of the file
+ * The ZipEntry is more than a structure representing the entry inside the
+ * zip file. Beside the normal attributes and headers a entry can have, the
+ * class contains a reference to the part of the file where the compressed
+ * data resides and decompresses it when requested. It also compresses the
+ * data and creates the headers required to write in the zip file.
*/
- entryName: string;
- rawEntryName: Buffer;
- /**
- * Extra data associated with this entry.
- */
- extra: Buffer;
- /**
- * Entry comment.
- */
- comment: string;
- name: string;
- /**
- * Read-Only property that indicates the type of the entry.
- */
- isDirectory: boolean;
- /**
- * Get the header associated with this ZipEntry.
- */
- header: Buffer;
- /**
- * Retrieve the compressed data for this entry. Note that this may trigger
- * compression if any properties were modified.
- */
- getCompressedData(): Buffer;
- /**
- * Asynchronously retrieve the compressed data for this entry. Note that
- * this may trigger compression if any properties were modified.
- */
- getCompressedDataAsync(callback: (data: Buffer) => void): void;
- /**
- * Set the (uncompressed) data to be associated with this entry.
- */
- setData(value: string): void;
- /**
- * Set the (uncompressed) data to be associated with this entry.
- */
- setData(value: Buffer): void;
- /**
- * Get the decompressed data associated with this entry.
- */
- getData(): Buffer;
- /**
- * Asynchronously get the decompressed data associated with this entry.
- */
- getDataAsync(callback: (data: Buffer) => void): void;
- /**
- * Returns the CEN Entry Header to be written to the output zip file, plus
- * the extra data and the entry comment.
- */
- packHeader(): Buffer;
- /**
- * Returns a nicely formatted string with the most important properties of
- * the ZipEntry.
- */
- toString(): string;
+ interface IZipEntry {
+ /**
+ * Represents the full name and path of the file
+ */
+ entryName: string;
+ rawEntryName: Buffer;
+ /**
+ * Extra data associated with this entry.
+ */
+ extra: Buffer;
+ /**
+ * Entry comment.
+ */
+ comment: string;
+ name: string;
+ /**
+ * Read-Only property that indicates the type of the entry.
+ */
+ isDirectory: boolean;
+ /**
+ * Get the header associated with this ZipEntry.
+ */
+ header: Buffer;
+ /**
+ * Retrieve the compressed data for this entry. Note that this may trigger
+ * compression if any properties were modified.
+ */
+ getCompressedData(): Buffer;
+ /**
+ * Asynchronously retrieve the compressed data for this entry. Note that
+ * this may trigger compression if any properties were modified.
+ */
+ getCompressedDataAsync(callback: (data: Buffer) => void): void;
+ /**
+ * Set the (uncompressed) data to be associated with this entry.
+ */
+ setData(value: string): void;
+ /**
+ * Set the (uncompressed) data to be associated with this entry.
+ */
+ setData(value: Buffer): void;
+ /**
+ * Get the decompressed data associated with this entry.
+ */
+ getData(): Buffer;
+ /**
+ * Asynchronously get the decompressed data associated with this entry.
+ */
+ getDataAsync(callback: (data: Buffer) => void): void;
+ /**
+ * Returns the CEN Entry Header to be written to the output zip file, plus
+ * the extra data and the entry comment.
+ */
+ packHeader(): Buffer;
+ /**
+ * Returns a nicely formatted string with the most important properties of
+ * the ZipEntry.
+ */
+ toString(): string;
+ }
}
-}
-declare module "adm-zip" {
- import zipFile = AdmZip.ZipFile;
- export = zipFile;
+ export = AdmZip;
}
diff --git a/angular-jwt/angular-jwt.d.ts b/angular-jwt/angular-jwt.d.ts
index 55bb3e4f6..620fcc8e4 100644
--- a/angular-jwt/angular-jwt.d.ts
+++ b/angular-jwt/angular-jwt.d.ts
@@ -25,6 +25,6 @@ declare module angular.jwt {
}
interface IJwtInterceptor {
- tokenGetter(): string;
+ tokenGetter(...params : any[]): string;
}
}
diff --git a/angular-material/angular-material-0.8.3.d.ts b/angular-material/angular-material-0.8.3.d.ts
index 1e3eda18a..10724b812 100644
--- a/angular-material/angular-material-0.8.3.d.ts
+++ b/angular-material/angular-material-0.8.3.d.ts
@@ -59,7 +59,7 @@ declare module angular.material {
show(dialog: MDDialogOptions|MDPresetDialog): angular.IPromise;
confirm(): MDConfirmDialog;
alert(): MDAlertDialog;
- hide(response?: any): void;
+ hide(response?: any): angular.IPromise;
cancel(response?: any): void;
}
diff --git a/angular-material/angular-material-0.9.0.d.ts b/angular-material/angular-material-0.9.0.d.ts
index 1383b0beb..96134f114 100644
--- a/angular-material/angular-material-0.9.0.d.ts
+++ b/angular-material/angular-material-0.9.0.d.ts
@@ -64,7 +64,7 @@ declare module angular.material {
show(dialog: MDDialogOptions|MDAlertDialog|MDConfirmDialog): angular.IPromise;
confirm(): MDConfirmDialog;
alert(): MDAlertDialog;
- hide(response?: any): void;
+ hide(response?: any): angular.IPromise;
cancel(response?: any): void;
}
diff --git a/angular-material/angular-material-tests.ts b/angular-material/angular-material-tests.ts
index a9cd52437..3c70dd27e 100644
--- a/angular-material/angular-material-tests.ts
+++ b/angular-material/angular-material-tests.ts
@@ -96,5 +96,5 @@ myApp.controller('SidenavController', ($scope: ng.IScope, $mdSidenav: ng.materia
});
myApp.controller('ToastController', ($scope: ng.IScope, $mdToast: ng.material.IToastService) => {
- $scope['openToast'] = () => $mdToast.show($mdToast.simple().content('Hello!'));
-});
\ No newline at end of file
+ $scope['openToast'] = () => $mdToast.show($mdToast.simple().textContent('Hello!'));
+});
diff --git a/angular-material/angular-material.d.ts b/angular-material/angular-material.d.ts
index 54ef2507b..7d29e7492 100644
--- a/angular-material/angular-material.d.ts
+++ b/angular-material/angular-material.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for Angular Material 0.10.1-rc1+ (angular.material module)
+// Type definitions for Angular Material 1.0.0-rc5+ (angular.material module)
// Project: https://github.com/angular/material
// Definitions by: Matt Traynham
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -83,7 +83,7 @@ declare module angular.material {
show(dialog: IDialogOptions|IAlertDialog|IConfirmDialog): angular.IPromise;
confirm(): IConfirmDialog;
alert(): IAlertDialog;
- hide(response?: any): void;
+ hide(response?: any): angular.IPromise;
cancel(response?: any): void;
}
@@ -116,7 +116,7 @@ declare module angular.material {
}
interface IToastPreset {
- content(content: string): T;
+ textContent(content: string): T;
action(action: string): T;
highlightAction(highlightAction: boolean): T;
capsule(capsule: boolean): T;
diff --git a/angular-notify/angular-notify.d.ts b/angular-notify/angular-notify.d.ts
index 7e55dc654..f97c94e7a 100644
--- a/angular-notify/angular-notify.d.ts
+++ b/angular-notify/angular-notify.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for angular-notify 2.0.2
+// Type definitions for angular-notify 2.5.0
// Project: https://github.com/cgross/angular-notify
// Definitions by: Suwato
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -51,6 +51,11 @@ declare module angular.cgNotify {
* Optional. Currently center and right are the only acceptable values.
*/
position? : string;
+
+ /**
+ * Optional. The duration (in milliseconds) of the message. A duration of 0 will prevent the message from closing automatically.
+ */
+ duration? : number;
/**
* Optional. Element that contains each notification. Defaults to document.body.
@@ -94,6 +99,11 @@ declare module angular.cgNotify {
* The default element that contains each notification. Defaults to document.body.
*/
container? : any;
+
+ /**
+ * The maximum number of total notifications that can be visible at one time. Older notifications will be closed when the maximum is reached.
+ */
+ maximumOpen? : number;
}):void;
/**
diff --git a/angular-strap/angular-strap-tests.ts b/angular-strap/angular-strap-tests.ts
new file mode 100644
index 000000000..90c7a2bde
--- /dev/null
+++ b/angular-strap/angular-strap-tests.ts
@@ -0,0 +1,378 @@
+///
+///
+
+module angularStrapTests {
+
+ import ngStrap = mgcrea.ngStrap;
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Modal
+ ///////////////////////////////////////////////////////////////////////////
+
+ module modalTests {
+
+ interface IDemoCtrlScope extends ngStrap.modal.IModalScope {
+ showModal: () => void;
+ }
+
+ angular.module('demoApp')
+ .config($modalConfig)
+ .controller('demoCtrl', demoCtrl);
+
+ function demoCtrl($scope: IDemoCtrlScope,
+ $modal: ngStrap.modal.IModalService): void {
+
+ var myModalOptions: ngStrap.modal.IModalOptions = {};
+ myModalOptions.title = 'My Title';
+ myModalOptions.content = 'Hello Modal This is a multiline message!';
+ myModalOptions.show = true;
+
+ var myModal = $modal(myModalOptions);
+
+ var myOtherModalOptions: ngStrap.modal.IModalOptions = {};
+ myOtherModalOptions.scope = $scope;
+ myOtherModalOptions.template = 'modal/docs/modal.demo.tpl.html';
+ myOtherModalOptions.show = false;
+
+ var myOtherModal = $modal(myOtherModalOptions);
+
+ $scope.showModal = (): void => {
+ myOtherModal.$promise.then(myOtherModal.show);
+ };
+ }
+
+ function $modalConfig($modalProvider: ngStrap.modal.IModalProvider): void {
+ var defaults: ngStrap.modal.IModalOptions = {
+ animation: 'am-flip-x'
+ }
+ angular.extend($modalProvider.defaults, defaults);
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Aside
+ ///////////////////////////////////////////////////////////////////////////
+
+ module asideTests {
+
+ angular.module('demoApp')
+ .config($asideConfig)
+ .controller('demoCtrl', demoCtrl);
+
+ function demoCtrl($scope: ngStrap.aside.IAsideScope,
+ $aside: ngStrap.aside.IAsideService): void {
+
+ var myAsideOptions: ngStrap.aside.IAsideOptions = {};
+ myAsideOptions.title = 'My Title';
+ myAsideOptions.content = 'My content';
+ myAsideOptions.show = true;
+
+ var myAside = $aside(myAsideOptions);
+
+ var myOtherAsideOptions: ngStrap.aside.IAsideOptions = {};
+ myOtherAsideOptions.scope = $scope;
+ myOtherAsideOptions.template = 'aside/docs/aside.demo.tpl.html';
+
+ var myOtherAside = $aside();
+
+ myOtherAside.$promise.then(() => {
+ myOtherAside.show();
+ });
+ }
+
+ function $asideConfig($asideProvider: ngStrap.aside.IAsideProvider): void {
+ var defaults: ngStrap.aside.IAsideOptions = {};
+ defaults.animation = 'am-fadeAndSlideLeft';
+ defaults.placement = 'left';
+
+ angular.extend($asideProvider.defaults, defaults);
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Alert
+ ///////////////////////////////////////////////////////////////////////////
+
+ module alertTests {
+
+ angular.module('demoApp')
+ .config($alertConfig)
+ .controller('demoCtrl', demoCtrl);
+
+ function demoCtrl($scope: ngStrap.alert.IAlertScope,
+ $alert: ngStrap.alert.IAlertService): void {
+
+ var options: ngStrap.alert.IAlertOptions = {};
+ options.title = 'Holy guacamole!';
+ options.content = 'Best check yo self, you\'re not looking too good.';
+ options.placement = 'top';
+ options.type = 'info';
+ options.show = true;
+
+ var myAlert = $alert();
+ }
+
+ function $alertConfig($alertProvider: ngStrap.alert.IAlertProvider): void {
+ var defaults: ngStrap.alert.IAlertOptions = {};
+ defaults.animation = 'am-fade-and-slide-top';
+ defaults.placement = 'top';
+
+ angular.extend($alertProvider.defaults, defaults);
+ };
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Tooltip
+ ///////////////////////////////////////////////////////////////////////////
+
+ module tooltipTests {
+
+ angular.module('demoApp')
+ .config($tooltipConfig)
+ .controller('demoDrct', demoDrct);
+
+ function demoDrct($tooltip: ngStrap.tooltip.ITooltipService): ng.IDirective {
+ var drct: ng.IDirective = {};
+ drct.restrict = 'EA';
+ drct.link = link;
+ return drct;
+
+ function link(scope: ng.IScope, elem: ng.IAugmentedJQuery, attrs: ng.IAttributes): void {
+ var options: ngStrap.tooltip.ITooltipOptions = {};
+ options.title = 'My Title';
+ $tooltip(elem, options);
+ }
+ }
+
+ function $tooltipConfig($tooltipProvider: ngStrap.tooltip.ITooltipProvider): void {
+ var defaults: ngStrap.tooltip.ITooltipOptions = {};
+ defaults.animation = 'am-flip-x';
+ defaults.trigger = 'hover';
+
+ angular.extend($tooltipProvider.defaults, defaults);
+ };
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Popover
+ ///////////////////////////////////////////////////////////////////////////
+
+ module popoverTests {
+
+ angular.module('demoApp')
+ .config($popoverConfig)
+ .controller('demoDrct', demoDrct);
+
+ function demoDrct($popover: ngStrap.popover.IPopoverService): ng.IDirective {
+ var drct: ng.IDirective = {};
+ drct.restrict = 'EA';
+ drct.link = link;
+ return drct;
+
+ function link(scope: ng.IScope, elem: ng.IAugmentedJQuery, attrs: ng.IAttributes): void {
+ var options: ngStrap.tooltip.ITooltipOptions = {};
+ options.title = 'My Title';
+
+ $popover(elem, options);
+ }
+ }
+
+ function $popoverConfig($popoverProvider: ngStrap.popover.IPopoverProvider): void {
+ var defaults: ngStrap.tooltip.ITooltipOptions = {}
+ defaults.animation = 'am-flip-x';
+ defaults.trigger = 'hover';
+
+ angular.extend($popoverProvider.defaults, defaults);
+ };
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Typeahead
+ ///////////////////////////////////////////////////////////////////////////
+
+ module typeaheadTests {
+
+ angular.module('myApp')
+ .config($typeaheadConfig);
+
+ function $typeaheadConfig($typeaheadProvider: ngStrap.typeahead.ITypeaheadProvider) {
+ var defaults: ngStrap.typeahead.ITypeaheadOptions = {}
+ defaults.animation = 'am-flip-x';
+ defaults.minLength = 2;
+ defaults.limit = 8;
+
+ angular.extend($typeaheadProvider.defaults, defaults);
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Datepicker
+ ///////////////////////////////////////////////////////////////////////////
+
+ module datepickerTests {
+
+ angular.module('myApp')
+ .config($datepickerConfig);
+
+ function $datepickerConfig($datepickerProvider: ngStrap.datepicker.IDatepickerProvider): void {
+ var defaults: ngStrap.datepicker.IDatepickerOptions = {};
+ defaults.dateFormat = 'dd/MM/yyyy';
+ defaults.startWeek = 1;
+
+ angular.extend($datepickerProvider.defaults, defaults);
+ };
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Timepicker
+ ///////////////////////////////////////////////////////////////////////////
+
+ module timepickerTests {
+
+ angular.module('myApp')
+ .config($timepickerConfig);
+
+ function $timepickerConfig($timepickerProvider: ngStrap.timepicker.ITimepickerProvider): void {
+ var defaults: ngStrap.timepicker.ITimepickerOptions = {};
+ defaults.timeFormat = 'HH:mm';
+ defaults.length = 7;
+
+ angular.extend($timepickerProvider.defaults, defaults);
+ };
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Select
+ ///////////////////////////////////////////////////////////////////////////
+
+ module selectTests {
+
+ angular.module('myApp')
+ .config($selectConfig);
+
+ function $selectConfig($selectProvider: ngStrap.select.ISelectProvider): void {
+ var defaults: ngStrap.select.ISelectOptions = {};
+ defaults.animation = 'am-flip-x';
+ defaults.sort = false;
+
+ angular.extend($selectProvider.defaults, defaults);
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Tabs
+ ///////////////////////////////////////////////////////////////////////////
+
+ module tabTests {
+
+ angular.module('myApp')
+ .config($tabConfig);
+
+ function $tabConfig($tabProvider: ngStrap.tab.ITabProvider) {
+ var defaults: ngStrap.tab.ITabOptions = {};
+ defaults.animation = 'am-flip-x';
+
+ angular.extend($tabProvider.defaults, defaults);
+ }
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Collapse
+ ///////////////////////////////////////////////////////////////////////////
+
+ module collapseTests {
+
+ angular.module('myApp')
+ .config($collapseConfig);
+
+ function $collapseConfig($collapseProvider: ngStrap.collapse.ICollapseProvider):void {
+ var defaults: ngStrap.collapse.ICollapseOptions = {};
+ defaults.animation = 'am-flip-x';
+
+ angular.extend($collapseProvider.defaults, defaults);
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Dropdown
+ ///////////////////////////////////////////////////////////////////////////
+
+ module dropdownTests {
+
+ angular.module('myApp')
+ .config($dropdownConfig);
+
+ function $dropdownConfig($dropdownProvider: ngStrap.dropdown.IDropdownProvider):void {
+ var defaults: ngStrap.dropdown.IDropdownOptions = {};
+ defaults.animation = 'am-flip-x';
+ defaults.trigger = 'hover';
+
+ angular.extend($dropdownProvider.defaults, defaults);
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Navbar
+ ///////////////////////////////////////////////////////////////////////////
+
+ module navbarTests {
+
+ angular.module('myApp')
+ .config($navbarConfig);
+
+ function $navbarConfig($navbarProvider: ngStrap.navbar.INavbarProvider):void {
+ var defaults: ngStrap.navbar.INavbarOptions = {};
+ defaults.activeClass = 'in';
+
+ angular.extend($navbarProvider.defaults, defaults);
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Scrollspy
+ ///////////////////////////////////////////////////////////////////////////
+
+ module scrollspyTests {
+
+ angular.module('myApp')
+ .config($scrollspyConfig);
+
+ function $scrollspyConfig($scrollspyProvider: ngStrap.scrollspy.IScrollspyProvider):void {
+ var defaults: ngStrap.scrollspy.IScrollspyOptions = {};
+ defaults.offset = 0;
+ defaults.target = 'my-selector';
+
+ angular.extend($scrollspyProvider.defaults, defaults);
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Affix
+ ///////////////////////////////////////////////////////////////////////////
+
+ module affixTests {
+
+ angular.module('myApp')
+ .config($affixConfig);
+
+ function $affixConfig($affixProvider: ngStrap.affix.IAffixProvider):void {
+ var defaults: ngStrap.affix.IAffixOptions = {};
+ defaults.offsetTop = 100;
+
+ angular.extend($affixProvider.defaults, defaults);
+ }
+ }
+}
\ No newline at end of file
diff --git a/angular-strap/angular-strap.d.ts b/angular-strap/angular-strap.d.ts
new file mode 100644
index 000000000..10e46bc1c
--- /dev/null
+++ b/angular-strap/angular-strap.d.ts
@@ -0,0 +1,600 @@
+// Type definitions for angular-strap v2.2.x
+// Project: http://mgcrea.github.io/angular-strap/
+// Definitions by: Sam Herrmann
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+
+///
+
+declare module mgcrea.ngStrap {
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Modal
+ // see http://mgcrea.github.io/angular-strap/#/modals
+ ///////////////////////////////////////////////////////////////////////////
+
+ module modal {
+
+ interface IModalService {
+ (config?: IModalOptions): IModal;
+ }
+
+ interface IModalProvider {
+ defaults: IModalOptions;
+ }
+
+ interface IModal {
+ $promise: ng.IPromise;
+ show: () => void;
+ hide: () => void;
+ toggle: () => void;
+ }
+
+ interface IModalOptions {
+ animation?: string;
+ backdropAnimation?: string;
+ placement?: string;
+ title?: string;
+ content?: string;
+ html?: boolean;
+ backdrop?: boolean | string;
+ keyboard?: boolean;
+ show?: boolean;
+ container?: string | boolean;
+ template?: string;
+ contentTemplate?: string;
+ prefixEvent?: string;
+ id?: string;
+ scope?: ng.IScope;
+ }
+
+ interface IModalScope extends ng.IScope {
+ $show: () => void;
+ $hide: () => void;
+ $toggle: () => void;
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Aside
+ // see http://mgcrea.github.io/angular-strap/#/asides
+ ///////////////////////////////////////////////////////////////////////////
+
+ module aside {
+
+ interface IAsideService {
+ (config?: IAsideOptions): IAside;
+ }
+
+ interface IAsideProvider {
+ defaults: IAsideOptions;
+ }
+
+ interface IAside {
+ $promise: ng.IPromise;
+ show: () => void;
+ hide: () => void;
+ toggle: () => void;
+ }
+
+ interface IAsideOptions {
+ animation?: string;
+ placement?: string;
+ title?: string;
+ content?: string;
+ html?: boolean;
+ backdrop?: boolean | string;
+ keyboard?: boolean;
+ show?: boolean;
+ container?: string | boolean;
+ template?: string;
+ contentTemplate?: string;
+ scope?: ng.IScope;
+ }
+
+ interface IAsideScope extends ng.IScope {
+ $show: () => void;
+ $hide: () => void;
+ $toggle: () => void;
+ }
+ }
+
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Alert
+ // see http://mgcrea.github.io/angular-strap/#/alerts
+ ///////////////////////////////////////////////////////////////////////////
+
+ module alert {
+
+ interface IAlertService {
+ (config?: IAlertOptions): IAlert;
+ }
+
+ interface IAlertProvider {
+ defaults: IAlertOptions;
+ }
+
+ interface IAlert {
+ $promise: ng.IPromise;
+ show: () => void;
+ hide: () => void;
+ toggle: () => void;
+ }
+
+ interface IAlertOptions {
+ animation?: string;
+ placement?: string;
+ title?: string;
+ content?: string;
+ type?: string;
+ keyboard?: boolean;
+ show?: boolean;
+ container?: string | boolean;
+ template?: string;
+ duration?: number | boolean;
+ dismissable?: boolean;
+ }
+
+ interface IAlertScope extends ng.IScope {
+ $show: () => void;
+ $hide: () => void;
+ $toggle: () => void;
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Tooltip
+ // see http://mgcrea.github.io/angular-strap/#/tooltips
+ ///////////////////////////////////////////////////////////////////////////
+
+ module tooltip {
+
+ interface ITooltipService {
+ (element: ng.IAugmentedJQuery, config?: ITooltipOptions): ITooltip;
+ }
+
+ interface ITooltipProvider {
+ defaults: ITooltipOptions;
+ }
+
+ interface ITooltip {
+ $promise: ng.IPromise;
+ show: () => void;
+ hide: () => void;
+ toggle: () => void;
+ }
+
+ interface ITooltipOptions {
+ animation?: string;
+ placement?: string;
+ trigger?: string;
+ title?: string;
+ html?: boolean;
+ delay?: number | { show: number; hide: number};
+ container?: string | boolean;
+ target?: string | ng.IAugmentedJQuery | boolean;
+ template?: string;
+ contentTemplate?: string;
+ prefixEvent?: string;
+ id?: string;
+ viewport?: string | { selector: string; padding: string | number };
+ }
+
+ interface ITooltipScope extends ng.IScope {
+ $show: () => void;
+ $hide: () => void;
+ $toggle: () => void;
+ $setEnabled: (isEnabled: boolean) => void;
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Popover
+ // see http://mgcrea.github.io/angular-strap/#/popovers
+ ///////////////////////////////////////////////////////////////////////////
+
+ module popover {
+
+ interface IPopoverService {
+ (element: ng.IAugmentedJQuery, config?: IPopoverOptions): IPopover;
+ }
+
+ interface IPopoverProvider {
+ defaults: IPopoverOptions;
+ }
+
+ interface IPopover {
+ $promise: ng.IPromise;
+ show: () => void;
+ hide: () => void;
+ toggle: () => void;
+ }
+
+ interface IPopoverOptions {
+ animation?: string;
+ placement?: string;
+ trigger?: string;
+ title?: string;
+ content?: string;
+ html?: boolean;
+ delay?: number | { show: number; hide: number };
+ container?: string | boolean;
+ target?: string | ng.IAugmentedJQuery | boolean;
+ template?: string;
+ contentTemplate?: string;
+ autoClose?: boolean;
+ id?: string;
+ viewport?: string | { selector: string; padding: string | number };
+ }
+
+ interface IPopoverScope extends ng.IScope {
+ $show: () => void;
+ $hide: () => void;
+ $toggle: () => void;
+ }
+ }
+
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Typeahead
+ // see http://mgcrea.github.io/angular-strap/#/typeaheads
+ ///////////////////////////////////////////////////////////////////////////
+
+ module typeahead {
+
+ interface ITypeaheadService {
+ (element: ng.IAugmentedJQuery, controller: any, config?: ITypeaheadOptions): ITypeahead;
+ }
+
+ interface ITypeaheadProvider {
+ defaults: ITypeaheadOptions;
+ }
+
+ interface ITypeahead {
+ $promise: ng.IPromise;
+ show: () => void;
+ hide: () => void;
+ toggle: () => void;
+ }
+
+ interface ITypeaheadOptions {
+ animation?: string;
+ placement?: string;
+ trigger?: string;
+ html?: boolean;
+ delay?: number | { show: number; hide: number };
+ container?: string | boolean;
+ template?: string;
+ limit?: number;
+ minLength?: number;
+ autoSelect?: boolean;
+ comparator?: string;
+ id?: string;
+ watchOptions?: boolean;
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Datepicker
+ // see http://mgcrea.github.io/angular-strap/#/datepickers
+ ///////////////////////////////////////////////////////////////////////////
+
+ module datepicker {
+
+ interface IDatepickerService {
+ (element: ng.IAugmentedJQuery, controller: any, config?: IDatepickerOptions): IDatepicker;
+ }
+
+ interface IDatepickerProvider {
+ defaults: IDatepickerOptions;
+ }
+
+ interface IDatepicker {
+ update: (date: Date) => void;
+ updateDisabledDates: (dateRanges: IDatepickerDateRange[]) => void;
+ select: (dateConstructorArg: string | number | number[], keep: boolean) => void;
+ setMode: (mode: any) => void;
+ int: () => void;
+ destroy: () => void;
+ show: () => void;
+ hide: () => void;
+ }
+
+ interface IDatepickerDateRange {
+ start: Date;
+ end: Date;
+ }
+
+ interface IDatepickerOptions {
+ animation?: string;
+ placement?: string;
+ trigger?: string;
+ html?: boolean;
+ delay?: number | { show: number; hide: number };
+ container?: string | boolean;
+ template?: string;
+ dateFormat?: string;
+ modelDateFormat?: string;
+ dateType?: string;
+ timezone?: string;
+ autoclose?: boolean;
+ useNative?: boolean;
+ minDate?: Date;
+ maxDate?: Date;
+ startView?: number;
+ minView?: number;
+ startWeek?: number;
+ startDate?: Date;
+ iconLeft?: string;
+ iconRight?: string;
+ daysOfWeekDisabled?: string;
+ disabledDates?: IDatepickerDateRange[];
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Timepicker
+ // see http://mgcrea.github.io/angular-strap/#/timepickers
+ ///////////////////////////////////////////////////////////////////////////
+
+ module timepicker {
+
+ interface ITimepickerService {
+ (element: ng.IAugmentedJQuery, controller: any, config?: ITimepickerOptions): ITimepicker;
+ }
+
+ interface ITimepickerProvider {
+ defaults: ITimepickerOptions;
+ }
+
+ interface ITimepicker {
+
+ }
+
+ interface ITimepickerOptions {
+ animation?: string;
+ placement?: string;
+ trigger?: string;
+ html?: boolean;
+ delay?: number | { show: number; hide: number; };
+ container?: string | boolean;
+ template?: string;
+ timeFormat?: string;
+ modelTimeFormat?: string;
+ timeType?: string;
+ autoclose?: boolean;
+ useNative?: boolean;
+ minTime?: Date; // TODO
+ maxTime?: Date; // TODO
+ length?: number;
+ hourStep?: number;
+ minuteStep?: number;
+ secondStep?: number;
+ roundDisplay?: boolean;
+ iconUp?: string;
+ iconDown?: string;
+ arrowBehaviour?: string;
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Button
+ // see http://mgcrea.github.io/angular-strap/#/buttons
+ ///////////////////////////////////////////////////////////////////////////
+
+ // No definitions for this module
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Select
+ // see http://mgcrea.github.io/angular-strap/#/selects
+ ///////////////////////////////////////////////////////////////////////////
+
+ module select {
+
+ interface ISelectService {
+ (element: ng.IAugmentedJQuery, controller: any, config: ISelectOptions): ISelect;
+ }
+
+ interface ISelectProvider {
+ defaults: ISelectOptions;
+ }
+
+ interface ISelect {
+ update: (matches: any) => void;
+ active: (index: number) => number;
+ select: (index: number) => void;
+ show: () => void;
+ hide: () => void;
+ }
+
+ interface ISelectOptions {
+ animation?: string;
+ placement?: string;
+ trigger?: string;
+ html?: boolean;
+ delay?: number | { show: number; hide: number; };
+ container?: string | boolean;
+ template?: string;
+ multiple?: boolean;
+ allNoneButtons?: boolean;
+ allText?: string;
+ noneText?: string;
+ maxLength?: number;
+ maxLengthHtml?: string;
+ sort?: boolean;
+ placeholder?: string;
+ iconCheckmark?: string;
+ id?: string;
+ }
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Tabs
+ // see http://mgcrea.github.io/angular-strap/#/tabs
+ ///////////////////////////////////////////////////////////////////////////
+
+ module tab {
+
+ interface ITabProvider {
+ defaults: ITabOptions;
+ }
+
+ interface ITabService {
+ defaults: ITabOptions;
+ controller: any;
+ }
+
+ interface ITabOptions {
+ animation?: string;
+ template?: string;
+ navClass?: string;
+ activeClass?: string;
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Collapses
+ // see http://mgcrea.github.io/angular-strap/#/collapses
+ ///////////////////////////////////////////////////////////////////////////
+
+ module collapse {
+
+ interface ICollapseProvider {
+ defaults: ICollapseOptions;
+ }
+
+ interface ICollapseOptions {
+ animation?: string;
+ activeClass?: string;
+ disallowToggle?: boolean;
+ startCollapsed?: boolean;
+ allowMultiple?: boolean;
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Dropdowsn
+ // see http://mgcrea.github.io/angular-strap/#/dropdowns
+ ///////////////////////////////////////////////////////////////////////////
+
+ module dropdown {
+
+ interface IDropdownProvider {
+ defaults: IDropdownOptions;
+ }
+
+ interface IDropdownService {
+ (element: ng.IAugmentedJQuery, config: IDropdownOptions): IDropdown;
+ }
+
+ interface IDropdown {
+ show: () => void;
+ hide: () => void;
+ destroy: () => void;
+ }
+
+ interface IDropdownOptions {
+ animation?: string;
+ placement?: string;
+ trigger?: string;
+ html?: boolean;
+ delay?: number | { show: number; hide: number; };
+ container?: string | boolean;
+ template?: string;
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Navbar
+ // see http://mgcrea.github.io/angular-strap/#/navbars
+ ///////////////////////////////////////////////////////////////////////////
+
+ module navbar {
+
+ interface INavbarProvider {
+ defaults: INavbarOptions;
+ }
+
+ interface INavbarOptions {
+ activeClass?: string;
+ routeAttr?: string;
+ }
+
+ interface INavbarService {
+ defaults: INavbarOptions;
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Scrollspy
+ // see http://mgcrea.github.io/angular-strap/#/scrollspy
+ ///////////////////////////////////////////////////////////////////////////
+
+ module scrollspy {
+
+ interface IScrollspyProvider {
+ defaults: IScrollspyOptions;
+ }
+
+ interface IScrollspyService {
+ (element: ng.IAugmentedJQuery, options: IScrollspyOptions): IScrollspy;
+ }
+
+ interface IScrollspy {
+ checkOffsets: () => void;
+ trackElement: (target: any, source: any) => void;
+ untrackElement: (target: any, source: any) => void;
+ activate: (index: number) => void;
+ }
+
+ interface IScrollspyOptions {
+ target?: string;
+ offset?: number;
+ }
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ // Affix
+ // see http://mgcrea.github.io/angular-strap/#/affix
+ ///////////////////////////////////////////////////////////////////////////
+
+ module affix {
+
+ interface IAffixProvider {
+ defaults: IAffixOptions;
+ }
+
+ interface IAffixService {
+ (element: ng.IAugmentedJQuery, options: IAffixOptions): IAffix;
+ }
+
+ interface IAffix {
+ init: () => void;
+ destroy: () => void;
+ checkPositionWithEventLoop: () => void;
+ checkPosition: () => void;
+ }
+
+ interface IAffixOptions {
+ offsetTop?: number;
+ offsetBottom?: number;
+ offsetParent?: number;
+ offsetUnpin?: number;
+ }
+ }
+}
diff --git a/angular-translate/angular-translate-tests.ts b/angular-translate/angular-translate-tests.ts
index c60247f42..a19d27ade 100644
--- a/angular-translate/angular-translate-tests.ts
+++ b/angular-translate/angular-translate-tests.ts
@@ -36,4 +36,9 @@ app.controller('Ctrl', ($scope: Scope, $translate: angular.translate.ITranslateS
$scope['changeLanguage'] = function (key: any) {
$translate.use(key);
};
+}).run(($filter: ng.IFilterService) => {
+ var x: string;
+ x = $filter('translate')('something');
+ x = $filter('translate')('something', {});
+ x = $filter('translate')('something', {}, '');
});
diff --git a/angular-translate/angular-translate.d.ts b/angular-translate/angular-translate.d.ts
index e4f69c688..ee855af3d 100644
--- a/angular-translate/angular-translate.d.ts
+++ b/angular-translate/angular-translate.d.ts
@@ -108,3 +108,11 @@ declare module angular.translate {
useLoaderCache(cache?: any): ITranslateProvider;
}
}
+
+declare module angular {
+ interface IFilterService {
+ (name:'translate'): {
+ (translationId: string, interpolateParams?: any, interpolation?: string): string;
+ };
+ }
+}
diff --git a/angular-ui-router/angular-ui-router.d.ts b/angular-ui-router/angular-ui-router.d.ts
index 014baf5ac..257446f69 100644
--- a/angular-ui-router/angular-ui-router.d.ts
+++ b/angular-ui-router/angular-ui-router.d.ts
@@ -5,10 +5,27 @@
///
-// Support for AMD require
+// Support for AMD require and CommonJS
declare module 'angular-ui-router' {
- var _: string;
- export = _;
+ // Since angular-ui-router adds providers for a bunch of
+ // injectable dependencies, it doesn't really return any
+ // actual data except the plain string 'ui.router'.
+ //
+ // As such, I don't think anybody will ever use the actual
+ // default value of the module. So I've only included the
+ // the types. (@xogeny)
+ export type IState = angular.ui.IState;
+ export type IStateProvider = angular.ui.IStateProvider;
+ export type IUrlMatcher = angular.ui.IUrlMatcher;
+ export type IUrlRouterProvider = angular.ui.IUrlRouterProvider;
+ export type IStateOptions = angular.ui.IStateOptions;
+ export type IHrefOptions = angular.ui.IHrefOptions;
+ export type IStateService = angular.ui.IStateService;
+ export type IResolvedState = angular.ui.IResolvedState;
+ export type IStateParamsService = angular.ui.IStateParamsService;
+ export type IUrlRouterService = angular.ui.IUrlRouterService;
+ export type IUiViewScrollProvider = angular.ui.IUiViewScrollProvider;
+ export type IType = angular.ui.IType;
}
declare module angular.ui {
diff --git a/angular-ui-tree/angular-ui-tree-tests.ts b/angular-ui-tree/angular-ui-tree-tests.ts
index e66408814..4e5ef91b9 100644
--- a/angular-ui-tree/angular-ui-tree-tests.ts
+++ b/angular-ui-tree/angular-ui-tree-tests.ts
@@ -11,3 +11,72 @@ var treeNode2: AngularUITree.ITreeNode = {
nodes: [treeNode],
title: "test2"
};
+
+// fake jquery node here so that we can pull a pretend
+// angular scope element out of it
+var dummyJQueryNode: ng.IAugmentedJQuery;
+var fakeScope: (ng.IScope | AngularUITree.IParentTreeNodeScope) = dummyJQueryNode.scope();
+
+( fakeScope).node = treeNode;
+
+var treeNodeScope: AngularUITree.ITreeNodeScope = fakeScope;
+
+( fakeScope).isParent = (nodeScope: AngularUITree.ITreeNodeScope) => {
+ return true;
+};
+
+var parentTreeNodeScope: AngularUITree.IParentTreeNodeScope = fakeScope;
+
+var eventSourceInfo: AngularUITree.IEventSourceInfo = {
+ cloneModel: {},
+ nodeScope: treeNodeScope,
+ index: 0,
+ nodesScope: parentTreeNodeScope
+};
+
+var position: AngularUITree.IPosition = {
+ dirAx: 0,
+ dirX: 0,
+ dirY: 0,
+ distAxX: 0,
+ distAxY: 0,
+ distX: 0,
+ distY: 0,
+ lastDirX: 0,
+ lastDirY: 0,
+ lastX: 0,
+ lastY: 0,
+ moving: true,
+ nowX: 0,
+ nowY: 0,
+ offsetX: 0,
+ offsetY: 0,
+ startX: 0,
+ startY: 0
+
+};
+
+var eventInfo: AngularUITree.IEventInfo = {
+ source: eventSourceInfo,
+ dest: {
+ index: 0,
+ nodesScope: parentTreeNodeScope
+ },
+ elements: {},
+ pos: position
+};
+
+var acceptCallback: AngularUITree.IAcceptCallback = (source: AngularUITree.ITreeNodeScope,
+ destination: AngularUITree.ITreeNodeScope,
+ destinationIndex: number) => {
+ return false;
+};
+
+var droppedCallback: AngularUITree.IDroppedCallback = (eventInfo: AngularUITree.IEventInfo) => {
+ return;
+};
+
+var callbacks: AngularUITree.ICallbacks = {
+ accept: acceptCallback,
+ dropped: droppedCallback
+};
diff --git a/angular-ui-tree/angular-ui-tree.d.ts b/angular-ui-tree/angular-ui-tree.d.ts
index 1017ac11c..62c8899fa 100644
--- a/angular-ui-tree/angular-ui-tree.d.ts
+++ b/angular-ui-tree/angular-ui-tree.d.ts
@@ -3,7 +3,71 @@
// Definitions by: Calvin Fernandez
// Definitions: https://github.com/borisyankov/DefinitelyTyped
+///
+
declare module AngularUITree {
+ interface IEventSourceInfo {
+ cloneModel: any;
+ index: number;
+ nodeScope: ITreeNodeScope;
+ nodesScope: ITreeNodeScope;
+ }
+
+ interface IPosition {
+ dirAx: number;
+ dirX: number;
+ dirY: number;
+ distAxX: number;
+ distAxY: number;
+ distX: number;
+ distY: number;
+ lastDirX: number;
+ lastDirY: number;
+ lastX: number;
+ lastY: number;
+ moving: boolean;
+ nowX: number;
+ nowY: number;
+ offsetX: number;
+ offsetY: number;
+ startX: number;
+ startY: number;
+ }
+
+ interface IEventInfo {
+ dest: {
+ index: number;
+ nodesScope: IParentTreeNodeScope;
+ };
+ elements: any;
+ pos: IPosition;
+ source: IEventSourceInfo;
+ }
+
+ interface IAcceptCallback {
+ (source: ITreeNodeScope, destination: ITreeNodeScope, destinationIndex: number): boolean;
+ }
+
+ interface IDroppedCallback {
+ (eventInfo: IEventInfo): void;
+ }
+
+ interface ICallbacks {
+ accept: IAcceptCallback;
+ dropped: IDroppedCallback;
+ }
+
+ /**
+ * Internal representation of node in the UI
+ */
+ interface ITreeNodeScope extends ng.IScope {
+ node: ITreeNode;
+ }
+
+ interface IParentTreeNodeScope extends ITreeNodeScope {
+ isParent(nodeScope: ITreeNodeScope): boolean;
+ }
+
/**
* Node in list
*/
diff --git a/angularjs/angular-resource-tests.ts b/angularjs/angular-resource-tests.ts
index cfa7712cc..fcf0bd0a9 100644
--- a/angularjs/angular-resource-tests.ts
+++ b/angularjs/angular-resource-tests.ts
@@ -89,6 +89,9 @@ resource = resourceClass.save({ key: 'value' }, { key: 'value' }, function () {
var promise : angular.IPromise;
var arrayPromise : angular.IPromise;
+var json: {
+ [index: string]: any;
+};
promise = resource.$delete();
promise = resource.$delete({ key: 'value' });
@@ -127,6 +130,8 @@ promise = resource.$save(function () { });
promise = resource.$save(function () { }, function () { });
promise = resource.$save({ key: 'value' }, function () { }, function () { });
+json = resource.toJSON();
+
///////////////////////////////////////
// IResourceService
///////////////////////////////////////
diff --git a/angularjs/angular-resource.d.ts b/angularjs/angular-resource.d.ts
index 76930196b..14e8d46fb 100644
--- a/angularjs/angular-resource.d.ts
+++ b/angularjs/angular-resource.d.ts
@@ -136,12 +136,15 @@ declare module angular.resource {
/** the promise of the original server interaction that created this instance. **/
$promise : angular.IPromise;
$resolved : boolean;
+ toJSON: () => {
+ [index: string]: any;
+ }
}
/**
* Really just a regular Array object with $promise and $resolve attached to it
*/
- interface IResourceArray extends Array {
+ interface IResourceArray extends Array> {
/** the promise of the original server interaction that created this collection. **/
$promise : angular.IPromise>;
$resolved : boolean;
diff --git a/angularjs/angular-route.d.ts b/angularjs/angular-route.d.ts
index 662b2c11d..5f426d51c 100644
--- a/angularjs/angular-route.d.ts
+++ b/angularjs/angular-route.d.ts
@@ -35,6 +35,16 @@ declare module angular.route {
// May not always be available. For instance, current will not be available
// to a controller that was not initialized as a result of a route maching.
current?: ICurrentRoute;
+
+ /**
+ * Causes $route service to update the current URL, replacing current route parameters with those specified in newParams.
+ * Provided property names that match the route's path segment definitions will be interpolated into the
+ * location's path, while remaining properties will be treated as query params.
+ *
+ * @param newParams Object. mapping of URL parameter names to values
+ */
+ updateParams(newParams:{[key:string]:string}): void;
+
}
diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts
index 1b54bac2a..a489141d5 100644
--- a/angularjs/angular.d.ts
+++ b/angularjs/angular.d.ts
@@ -165,6 +165,12 @@ declare module angular {
dot: number;
codeName: string;
};
+
+ /**
+ * If window.name contains prefix NG_DEFER_BOOTSTRAP! when angular.bootstrap is called, the bootstrap process will be paused until angular.resumeBootstrap() is called.
+ * @param extraModules An optional array of modules that should be added to the original list of modules that the app was about to be bootstrapped with.
+ */
+ resumeBootstrap?(extraModules?: string[]): ng.auto.IInjectorService;
}
///////////////////////////////////////////////////////////////////////////
@@ -615,7 +621,7 @@ declare module angular {
// see http://docs.angularjs.org/api/ng.$interval
///////////////////////////////////////////////////////////////////////////
interface IIntervalService {
- (func: Function, delay: number, count?: number, invokeApply?: boolean): IPromise;
+ (func: Function, delay: number, count?: number, invokeApply?: boolean, ...args: any[]): IPromise;
cancel(promise: IPromise): boolean;
}
diff --git a/arcgis-js-api/arcgis-js-api.d.ts b/arcgis-js-api/arcgis-js-api.d.ts
index ba5e0fb9f..88d68cb19 100644
--- a/arcgis-js-api/arcgis-js-api.d.ts
+++ b/arcgis-js-api/arcgis-js-api.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for ArcGIS API for JavaScript v3.14
+// Type definitions for ArcGIS API for JavaScript v3.15
// Project: http://js.arcgis.com
// Definitions by: Esri
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -146,7 +146,7 @@ declare module "esri" {
/** Class attribute to set for the layer's node. */
className?: string;
/** Lists which levels to draw. */
- displayLevels?: number;
+ displayLevels?: number[];
/** An array of objects that define areas where a tiled map service should not display tiles. */
exclusionAreas?: any[];
/** Id to assign to the layer. */
@@ -157,7 +157,7 @@ declare module "esri" {
opacity?: number;
/** Refresh interval of the layer in minutes. */
refreshInterval?: number;
- /** When true, tile resampling is enabled. */
+ /** The purpose of resampling is to enlarge the image and fill in at the levels where there are no tiles available. */
resampling?: boolean;
/** Number of levels beyond the last level where tiles are available. */
resamplingTolerance?: number;
@@ -215,6 +215,8 @@ declare module "esri" {
opacity?: number;
/** Specify subDomains where tiles are served to speed up tile retrieval (using subDomains gets around the browser limit of the max number of concurrent requests to a domain). */
subDomains?: string[];
+ /** The URL template used to retrieve the tiles. */
+ templateUrl?: string;
/** Define the tile info for the layer including lods, rows, cols, origin and spatial reference. */
tileInfo?: TileInfo;
/** Define additional tile server domains for the layer. */
@@ -307,19 +309,15 @@ declare module "esri" {
export interface ClassedColorSliderOptions {
/** Data map containing renderer information. */
breakInfos: any;
- /** Classification method. */
+ /** Indicates the classification method used to divide the range of values into bins. */
classificationMethod?: string;
- /** Handles identified by their index values within the stops array. */
+ /** Required: Handles identified by their index values within the stops array. */
handles: number[];
- /** Represents histogram data object. */
+ /** Represents the histogram data object. */
histogram?: any;
/** Width of the histogram in pixels. */
histogramWidth?: number;
- /** Absolute maximum value of the slider. */
- maxValue?: number;
- /** Absolute minimum value of the slider. */
- minValue?: number;
- /** Normalization type. */
+ /** Indicates how data values are normalized. */
normalizationType?: string;
/** Handle identified by its index value within the stops array. */
primaryHandle?: number;
@@ -333,61 +331,51 @@ declare module "esri" {
showLabels?: boolean;
/** Displays ticks on slider when true. */
showTicks?: boolean;
- /** Represents statistics data object. */
+ /** Represents the statistics data object. */
statistics?: any;
}
export interface ClassedSizeSliderOptions {
- /** Data map containing renderer information. */
+ /** The data map containing renderer information. */
breakInfos: any;
- /** Classification method. */
+ /** Optional: Indicates the classification method used to divide the range of values into bins. */
classificationMethod?: string;
- /** Handles identified by their index values within the stops array. */
+ /** Required: Handles identified by their index values within the stops array. */
handles: number[];
- /** Represents histogram data object. */
+ /** Represents the histogram data object. */
histogram?: any;
/** Width of histogram in pixels. */
histogramWidth?: number;
- /** Absolute maximum value of the slider. */
- maxValue?: number;
- /** Absolute minimum value of the slider. */
- minValue?: number;
- /** Normalization type. */
+ /** Indicates how data values are normalized. */
normalizationType?: string;
- /** Handle identified by its index value within the stops array. */
+ /** The handle identified by its index value within the stops array. */
primaryHandle?: number;
/** Width of slider ramp in pixels. */
rampWidth?: number;
/** Displays slider handles when true. */
showHandles?: boolean;
- /** Displays the histogram when true. */
+ /** Indicates whether to display the histogram. */
showHistogram?: boolean;
/** Displays labels when true. */
showLabels?: boolean;
/** Displays slider ticks when true. */
showTicks?: boolean;
- /** Represents statistics data object. */
+ /** Optional: Represents the statistics data object. */
statistics?: any;
- /** Indicates whether to use a circle or line-based ClassedSizeSlider. */
- symbol?: any;
}
export interface ColorInfoSliderOptions {
- /** Classification method. */
- classificationMethod?: string;
- /** Data map containing renderer information. */
+ /** The data map containing renderer information. */
colorInfo: any;
/** Handles identified by their index values within the stops array. */
handles: number[];
- /** Represents histogram data object. */
+ /** Optional: Represents the histogram data object. */
histogram?: any;
/** Width of histogram in pixels. */
histogramWidth?: number;
- /** Absolute maximum value of slider. */
+ /** The absolute maximum value of the slider. */
maxValue?: number;
- /** Absolute minimum value of slider. */
+ /** The absolute minimum value of the slider. */
minValue?: number;
- /** Normalization Type. */
- normalizationType?: string;
- /** Handle identified by its index value within the stops array. */
+ /** The handle identified by its index value within the stops array. */
primaryHandle?: number;
/** Width of widget ramp in pixels. */
rampWidth?: number;
@@ -397,13 +385,15 @@ declare module "esri" {
showHistogram?: boolean;
/** Displays labels when set to true. */
showLabels?: boolean;
- /** Displays ticks when set to true. */
+ /** Indicates whether to display percentage labels. */
+ showRatioLabels?: boolean | string;
+ /** Displays tick marks when set to true. */
showTicks?: boolean;
/** Displays transparent background when set to true. */
showTransparentBackground?: boolean;
- /** Represents statistics data object. */
+ /** Represents a statistics data object. */
statistics?: any;
- /** Object containing additional options. */
+ /** Additional options to customize slider. */
zoomOptions?: any;
}
export interface ColorPickerOptions {
@@ -655,8 +645,6 @@ declare module "esri" {
traffic?: boolean;
/** The traffic layer used for real-time traffic. */
trafficLayer?: ArcGISDynamicMapServiceLayer;
- /** An example of when to use this is when working with a proxied ArcGIS Online route service item with stored credentials. */
- travelModesServiceUrl?: string;
}
export interface DissolveBoundariesOptions {
/** The URL to the GPServer used to execute an analysis job. */
@@ -718,7 +706,7 @@ declare module "esri" {
/** Specifies whether users can add new vertices. */
allowAddVertices?: boolean;
/** Specifies whether users can delete vertices. */
- allowDeletevertices?: boolean;
+ allowDeleteVertices?: boolean;
/** Line symbol used to draw the guild lines, displayed when moving vertices. */
ghostLineSymbol?: LineSymbol;
/** Marker symbol used to display the insertable vertices. */
@@ -859,8 +847,14 @@ declare module "esri" {
cellNavigation?: boolean;
/** Object defining the date options specifically for formatting date and time editors. */
dateOptions?: any;
+ /** Allows selection of a table's row via clicking a feature on the map. */
+ enableLayerClick?: boolean;
+ /** Allows selection of a feature on a map via clicking row in the table. */
+ enableLayerSelection?: boolean;
/** The featureLayer that the table is associated with. */
featureLayer: FeatureLayer;
+ /** Reference to the 'Options' drop-down menu. */
+ gridMenu?: any;
/** Columns to hide by default using the dGrid ColumnHider extension. */
hiddenFields?: string[];
/** A reference to the Map. */
@@ -1173,8 +1167,12 @@ declare module "esri" {
map: Map;
/** Indicates whether to remove underscores from the layer title. */
removeUnderscores?: boolean;
+ /** Indicates whether to display a legend for the layer items. */
+ showLegend?: boolean;
+ /** Indicates whether to display the opacity slider. */
+ showOpacitySlider?: boolean;
/** Indicates whether to show sublayers in the list of layers. */
- subLayers?: boolean;
+ showSubLayers?: boolean;
/** The CSS class selector used to uniquely style the widget. */
theme?: string;
/** Indicates whether to show the LayerList widget. */
@@ -1455,19 +1453,19 @@ declare module "esri" {
export interface OpacitySliderOptions {
/** Handles identified by their index values within the stops array. */
handles: number[];
- /** Represents histogram data object. */
+ /** Represents the histogram data object. */
histogram?: any;
/** Width of histogram in pixels. */
histogramWidth?: number;
- /** Absolute maximum value of the slider. */
+ /** The absolute maximum value of the slider. */
maxValue?: number;
- /** Absolute minimum value of the slider. */
+ /** The absolute minimum value of the slider. */
minValue?: number;
- /** Data map containing renderer information. */
+ /** The data map containing renderer information. */
opacityInfo: any;
- /** Handle identified by its index value within the stops array. */
+ /** The handle identified by its index value within the stops array. */
primaryHandle?: number;
- /** Width of slider ramp in pixels. */
+ /** Represents the width of the SVG ramp in pixels. */
rampWidth?: number;
/** Displays slider handles when true. */
showHandles?: boolean;
@@ -1479,9 +1477,9 @@ declare module "esri" {
showTicks?: boolean;
/** Displays the transparent background when true. */
showTransparentBackground?: boolean;
- /** Represents statistics data object. */
+ /** Represents a statistics data object. */
statistics?: any;
- /** Additional options for slider customization. */
+ /** Additional options to customize slider. */
zoomOptions?: any;
}
export interface OpenStreetMapLayerOptions {
@@ -1699,7 +1697,7 @@ declare module "esri" {
minimum: number;
/** Bottom label for the slider. */
minLabel?: string;
- /** **CHECK THIS: Is it num of dec places? - Accuracy of the data (related to rounding). */
+ /** Accuracy of the data (related to rounding). */
precision?: number;
/** Primary handle identified by its index value within the related infos array (color, size, break). */
primaryHandle?: number;
@@ -1737,9 +1735,11 @@ declare module "esri" {
activeSourceIndex?: number | string;
/** Indicates whether to automatically add all the feature layers from the map. */
addLayersFromMap?: boolean;
+ /** This is the default value used as a hint for input text when searching on multiple sources. */
+ allPlaceholder?: string;
/** Indicates whether to automatically navigate to the selected result. */
autoNavigate?: boolean;
- /** Indicates whether to automatically select the first result. */
+ /** Indicates whether to automatically select the first geocoded result (not the first suggestion). */
autoSelect?: boolean;
/** Indicates whether to enable an option to collapse/expand the search into a button. */
enableButtonMode?: boolean;
@@ -1749,6 +1749,8 @@ declare module "esri" {
enableInfoWindow?: boolean;
/** Indicates whether to enable showing a label for the geometry.The default value is false. */
enableLabel?: boolean;
+ /** Indicates whether to display the option to search "All" sources. */
+ enableSearchingAll?: boolean;
/** Indicates whether to enable the menu for selecting different sources. */
enableSourcesMenu?: boolean;
/** Indicates whether or not to enable suggest on the widget. */
@@ -1765,7 +1767,7 @@ declare module "esri" {
infoTemplate?: InfoTemplate;
/** The text symbol for the label graphic. */
labelSymbol?: TextSymbol;
- /** The default distance specified in meters used to reverse geocode, (if not specified by source).The default value is 1500. */
+ /** The default distance specified in meters used to reverse geocode, (if not specified by source). */
locationToAddressDistance?: number;
/** Reference to the map. */
map?: Map;
@@ -1791,23 +1793,19 @@ declare module "esri" {
zoomScale?: number;
}
export interface SizeInfoSliderOptions {
- /** Classification method. */
- classificationMethod?: string;
/** Handles identified by their index values within the stops array. */
handles: number[];
- /** Represents histogram data object. */
+ /** Represents the histogram data object. */
histogram?: any;
/** Width of the histogram in pixels. */
histogramWidth?: number;
- /** Absolute maximum value of the slider. */
+ /** The absolute maximum value of the slider. */
maxValue?: number;
- /** Absolute minimum value of the slider. */
+ /** The absolute minimum value of the slider. */
minValue?: number;
- /** Normalization type. */
- normalizationType?: string;
- /** Handle identified by its index value within the stops array. */
+ /** The handle identified by its index value within the stops array. */
primaryHandle?: number;
- /** Width of slider ramp in pixels. */
+ /** Represents the width of the SVG ramp in pixels. */
rampWidth?: number;
/** Displays slider handles when true. */
showHandles?: boolean;
@@ -1817,11 +1815,11 @@ declare module "esri" {
showLabels?: boolean;
/** Displays slider ticks when true. */
showTicks?: boolean;
- /** Data map containing renderer information. */
+ /** Defines the size of the symbol where feature size is proportional to data value. */
sizeInfo: any;
- /** Represents statistics data object. */
+ /** Represents the statistics data object. */
statistics?: any;
- /** The symbol used with the widget. */
+ /** The SimpleLineSymbol or SimpleMarkerSymbol used with the widget. */
symbol: Symbol;
/** Additional options to customize slider. */
zoomOptions?: any;
@@ -1969,10 +1967,12 @@ declare module "esri" {
sumWithinLayer: FeatureLayer;
}
export interface SymbolStylerOptions {
+ /** Added at v. */
+ portal?: string | any;
/** Self response of Portal used as symbol provider. */
- portalSelf: string;
+ portalSelf?: any;
/** URL to Portal used as symbol provider. */
- portalUrl: string;
+ portalUrl?: string;
}
export interface TemplatePickerOptions {
/** Number of visible columns. */
@@ -2062,6 +2062,18 @@ declare module "esri" {
/** A predefined style. */
style?: string;
}
+ export interface VectorTileLayerOptions {
+ /** Lists which levels of the layer to draw. */
+ displayLevels?: number[];
+ /** Maximum visible scale for the layer. */
+ maxScale?: number;
+ /** Minimum visible scale for the layer. */
+ minScale?: number;
+ /** Initial opacity or transparency of layer. */
+ opacity?: number;
+ /** Visibility of the layer. */
+ visible?: boolean;
+ }
export interface VisibleScaleRangeSliderOptions {
/** Layer used to determine the suggested scale range and set the minScale, maxScale values. */
layer: FeatureLayer;
@@ -2275,7 +2287,7 @@ declare module "esri/IdentityManager" {
/** Dialog box widget used to challenge the user for their credentials when the application attempts to access a secure resource. */
dialog: any;
/**
- * When accessing secure resources via Oauth2 from ArcGIS.com or one of its sub-domains the IdentityManager redirects the user to the ArcGIS.com or Portal for ArcGIS sign-in page.
+ * When accessing secure resources via OAuth2 from ArcGIS.com or one of its sub-domains the IdentityManager redirects the user to the ArcGIS.com or Portal for ArcGIS sign-in page.
* @param handlerFunction When called, the function passed to setOAuthRedirectionHandler receives an object containing the redirection properties.
*/
setOAuthRedirectionHandler(handlerFunction: Function): void;
@@ -2391,7 +2403,7 @@ declare module "esri/IdentityManagerBase" {
/** Return properties of this object in JSON. */
toJson(): any;
/** Fired when a credential is created. */
- on(type: "credential-create", listener: (event: { target: IdentityManagerBase }) => void): esri.Handle;
+ on(type: "credential-create", listener: (event: { credential: Credential; target: IdentityManagerBase }) => void): esri.Handle;
/** Fired when all credentials are destroyed. */
on(type: "credentials-destroy", listener: (event: { target: IdentityManagerBase }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
@@ -2675,7 +2687,7 @@ declare module "esri/arcgis/OAuthInfo" {
minTimeUntilExpiration: number;
/** Set to true to show the OAuth sign in page in a popup window. */
popup: boolean;
- /** The relative page URL for the user to be sent to from the OAuth sign in page. */
+ /** Applicable if working with the popup user-login workflow. */
popupCallbackUrl: string;
/** The window features passed to window.open(). */
popupWindowFeatures: string;
@@ -2886,7 +2898,7 @@ declare module "esri/arcgis/Portal" {
/** The date the group was last modified. */
modified: Date;
/** The username of the group's owner. */
- owner: Portal;
+ owner: string;
/** The portal for the group. */
portal: Portal;
/** A short summary that describes the group. */
@@ -3062,7 +3074,7 @@ declare module "esri/arcgis/Portal" {
* Retrieve all the items in the specified folder.
* @param folderId The id of the folder that contains the items to retrieve.
*/
- getItems(folderId: string): any;
+ getItems(folderId?: string): any;
/** Get information about any notifications for the portal user. */
getNotifications(): any;
/** Access the tag objects that have been created by the portal user. */
@@ -3087,6 +3099,11 @@ declare module "esri/arcgis/utils" {
* @param itemId The itemId for a publicly shared ArcGIS.com item.
*/
getItem(itemId: string): any;
+ /**
+ * Can be used with LayerList widget to get the layers list to be passed into the constructor.
+ * @param createMapResponse The object created from the resolved promise returned by createMap().
+ */
+ getLayerList(createMapResponse: any): any[];
/**
* Can be used with esri.dijit.Legend to get the layerInfos list to be passed into the Legend constructor.
* @param createMapResponse Object returned by .createMap() in the .then() callback.
@@ -3422,37 +3439,35 @@ declare module "esri/dijit/ClassedColorSlider" {
/** A widget to assist with managing a renderer used for visualizing features by their class and color. */
class ClassedColorSlider extends RendererSlider {
- /** Required */
+ /** Required: The data map containing renderer information. */
breakInfos: any;
- /** Optional */
+ /** Optional: Indicates the classification method used to divide the range of values into bins. */
classificationMethod: string;
/** Required: Handles identified by their index values within the stops array. */
handles: number[];
- /** Optional: Property representing histogram data object. */
+ /** Optional: Represents the histogram data object. */
histogram: any;
- /** Optional */
+ /** Optional: The width of the histogram in pixels. */
histogramWidth: boolean;
- /** Optional */
+ /** Read Only. */
maxValue: number;
- /** Optional */
+ /** Read Only. */
minValue: number;
- /** Optional */
+ /** Optional: Indicates how data values are normalized. */
normalizationType: string;
- /** Optional: Handle identified by its index value within the stops array. */
+ /** Optional: The handle identified by its index value within the stops array. */
primaryHandle: number;
- /** Optional */
+ /** Optional: Width of the widget ramp in pixels. */
rampWidth: number;
- /** Property for showing handles. */
+ /** Optional: Indicates whether to display handles. */
showHandles: boolean;
- /** Optional: Property for displaying the histogram. */
+ /** Optional: Indicates whether to display the histogram. */
showHistogram: boolean;
- /** Property for showing labels. */
+ /** Optional: Indicates whether to display labels. */
showLabels: boolean;
- /** Property for showing ticks. */
+ /** Optional: Indicates whether to display tick marks. */
showTicks: boolean;
- /** Property for displaying the transparent background. */
- showTransparentBackground: boolean;
- /** Optional: Property representing statistics data object. */
+ /** Optional: Represents the statistics data object. */
statistics: any;
/**
* Creates a new ClassedColorSlider widget.
@@ -3464,7 +3479,7 @@ declare module "esri/dijit/ClassedColorSlider" {
startup(): void;
/** Fires when the ClassedColorSlider widget properties change. */
on(type: "change", listener: (event: { breakInfos: any; target: ClassedColorSlider }) => void): esri.Handle;
- /** Fires when minValue or maxValue of ClassedColorSlider changes. */
+ /** Fires when minValue or maxValue of the ClassedColorSlider changes. */
on(type: "data-value-change", listener: (event: { breakInfos: any; maxValue: number; minValue: number; target: ClassedColorSlider }) => void): esri.Handle;
/** Fires when a ClassedColorSlider handle is moved. */
on(type: "handle-value-change", listener: (event: { breakInfos: any; target: ClassedColorSlider }) => void): esri.Handle;
@@ -3479,35 +3494,35 @@ declare module "esri/dijit/ClassedSizeSlider" {
/** A widget to assist with managing a renderer for visualizing features by varying classes and size. */
class ClassedSizeSlider extends RendererSlider {
- /** Required. */
+ /** Required: The data map containing renderer information. */
breakInfos: any;
- /** Optional. */
+ /** Optional: Indicates the classification method used to divide the range of values into bins. */
classificationMethod: string;
- /** Required. */
+ /** Required: Handles identified by their index values within the stops array. */
handles: number[];
- /** Optional. */
+ /** Optional: Represents the histogram data object. */
histogram: any;
- /** Optional. */
- histogramWidth: boolean;
- /** Optional. */
+ /** Optional: Width of histogram in pixels. */
+ histogramWidth: number;
+ /** Read Only. */
maxValue: number;
- /** Optional. */
+ /** Read Only. */
minValue: number;
- /** Optional. */
+ /** Optional: Indicates how data values are normalized. */
normalizationType: string;
- /** Optional. */
+ /** Optional: Handle identified by its index value within the stops array. */
primaryHandle: number;
- /** Optional */
+ /** Optional: Width of the widget ramp in pixels. */
rampWidth: number;
- /** Property for showing handles. */
+ /** Optional: Indicates whether to display handles. */
showHandles: boolean;
- /** Optional. */
+ /** Optional: Indicates whether to display the histogram. */
showHistogram: boolean;
- /** Property for showing labels. */
+ /** Optional: Indicates whether to display labels. */
showLabels: boolean;
- /** Property for showing ticks. */
+ /** Optional: Indicates whether to display ticks marks. */
showTicks: boolean;
- /** Optional. */
+ /** Optional: Represents the statistics data object. */
statistics: any;
/**
* Creates a new ClassedSizeSlider widget within the provided DOM node srcNodeRef.
@@ -3517,7 +3532,7 @@ declare module "esri/dijit/ClassedSizeSlider" {
constructor(params: esri.ClassedSizeSliderOptions, srcNodeRef: Node | string);
/** Fires when ClassedSizeSlider changes. */
on(type: "change", listener: (event: { breakInfos: any; target: ClassedSizeSlider }) => void): esri.Handle;
- /** Fires when minValue or maxValue changes in ClassedSizeSlider. */
+ /** Fires when minValue or maxValue of the ClassedSizeSlider changes. */
on(type: "data-value-change", listener: (event: { breakInfos: any; maxValue: number; minValue: number; target: ClassedSizeSlider }) => void): esri.Handle;
/** Fires when a ClassedSizeSlider handle is moved. */
on(type: "handle-value-change", listener: (event: { breakInfos: any; target: ClassedSizeSlider }) => void): esri.Handle;
@@ -3532,39 +3547,41 @@ declare module "esri/dijit/ColorInfoSlider" {
/** A widget to assist with managing a renderer for visualizing features based upon colors. */
class ColorInfoSlider extends RendererSlider {
- /** Optional */
+ /** The classification method used for the ColorInfoSlider. */
classificationMethod: string;
- /** Required: Example colorInfo: colorRenderer.renderer.visualVariables[0]. */
+ /** Required: The data map containing renderer information. */
colorInfo: any;
/** Required: Handles identified by their index values within the stops array. */
handles: number[];
- /** Optional: Property representing histogram data object. */
+ /** Optional: Represents the histogram data object. */
histogram: any;
- /** Optional */
- histogramWidth: boolean;
- /** Optional */
+ /** Optional: Width of histogram in pixels. */
+ histogramWidth: number;
+ /** Optional: The absolute maximum value of the slider. */
maxValue: number;
- /** Optional */
+ /** Optional: The absolute minimum value of the slider. */
minValue: number;
/** Optional */
normalizationType: string;
- /** Optional: Handle identified by its index value within the stops array. */
+ /** Optional: The handle identified by its index value within the stops array. */
primaryHandle: number;
- /** Optional */
+ /** Optional: Width of the widget ramp in pixels. */
rampWidth: number;
- /** Property for showing handles. */
+ /** Optional: Indicates whether to display handles. */
showHandles: boolean;
- /** Optional: Property for displaying the histogram. */
+ /** Optional: Indicates whether to display the histogram. */
showHistogram: boolean;
- /** Property for showing labels. */
+ /** Optional: Indicates whether to display handles. */
showLabels: boolean;
- /** Property for showing ticks. */
+ /** Indicates whether to display percentage labels. */
+ showRatioLabels: boolean | string;
+ /** Optional: Indicates whether to display ticks marks. */
showTicks: boolean;
- /** Property for displaying the transparent background. */
+ /** Optional: Indicates whether to display a transparent background. */
showTransparentBackground: boolean;
- /** Optional: Property representing statistics data object. */
+ /** Optional: Represents a statistics data object. */
statistics: any;
- /** Optional */
+ /** Optional: Additional options to customize slider. */
zoomOptions: any;
/**
* Creates a new ColorInfoSlider widget within the provided DOM node srcNodeRef.
@@ -3576,10 +3593,12 @@ declare module "esri/dijit/ColorInfoSlider" {
startup(): void;
/** Fires when ColorInfoSlider changes. */
on(type: "change", listener: (event: { colorInfo: any; target: ColorInfoSlider }) => void): esri.Handle;
- /** Fires when minValue or maxValue of ColorInfoSlider changes. */
+ /** Fires when minValue or maxValue of the ColorInfoSlider changes. */
on(type: "data-value-change", listener: (event: { colorInfo: any; maxValue: number; minValue: number; target: ColorInfoSlider }) => void): esri.Handle;
/** Fires when a ColorInfoSlider handle is moved. */
- on(type: "handle-value-change", listener: (event: { target: ColorInfoSlider }) => void): esri.Handle;
+ on(type: "handle-value-change", listener: (event: { colorInfo: any; target: ColorInfoSlider }) => void): esri.Handle;
+ /** Fires when the zoom state changes. */
+ on(type: "zoomed", listener: (event: { zoomed: boolean; target: ColorInfoSlider }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
}
export = ColorInfoSlider;
@@ -3765,6 +3784,8 @@ declare module "esri/dijit/ElevationProfile" {
measureUnits: string;
/** The polyline input geometry used to create the elevation profile. */
profileGeometry: Geometry;
+ /** The title of the resulting elevation profile. */
+ title: string;
/**
* Create a new ElevationProfile widget using the given DOM node.
* @param options See options table below for the full descriptions of the properties needed for this object.
@@ -3781,6 +3802,8 @@ declare module "esri/dijit/ElevationProfile" {
on(type: "clear-profile", listener: (event: { target: ElevationProfile }) => void): esri.Handle;
/** Fires when the widget has fully loaded. */
on(type: "load", listener: (event: { target: ElevationProfile }) => void): esri.Handle;
+ /** Fires when the title of the elevation profile is changed */
+ on(type: "title-changed", listener: (event: { target: ElevationProfile }) => void): esri.Handle;
/** Fires when the elevation profile is updated. */
on(type: "update-profile", listener: (event: { profileResults: any; target: ElevationProfile }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
@@ -3793,7 +3816,7 @@ declare module "esri/dijit/FeatureTable" {
import FeatureLayer = require("esri/layers/FeatureLayer");
import Map = require("esri/map");
- /** (Currently in beta) Creates an instance of the FeatureTable widget within the provided DOM node. */
+ /** Creates an instance of the FeatureTable widget within the provided DOM node. */
class FeatureTable {
/** An optional dGrid property. */
allowSelectAll: boolean;
@@ -3805,10 +3828,16 @@ declare module "esri/dijit/FeatureTable" {
dataStore: any;
/** Object defining the date options specifically for formatting date and time editors. */
dateOptions: any;
+ /** Allows selection of a table's row via clicking a feature on the map. */
+ enableLayerClick: boolean;
+ /** Allows selection of a feature on a map via clicking row in the table. */
+ enableLayerSelection: boolean;
/** The featureLayer that the table is associated with. */
featureLayer: FeatureLayer;
/** Reference to the dGrid. */
grid: any;
+ /** Reference to the 'Options' drop-down menu. */
+ gridMenu: any;
/** Optional columns to hide by default using the dGrid ColumnHider extension. */
hiddenFields: string[];
/** A reference to the primary key used by the dataStore to differentiate columns. */
@@ -4004,15 +4033,15 @@ declare module "esri/dijit/HeatmapSlider" {
import esri = require("esri");
import RendererSlider = require("esri/dijit/RendererSlider");
- /** A widget to assist in managing properties of a HeatmapRenderer. */
+ /** A widget to assist in obtaining values for managing and setting properties on a HeatmapRenderer. */
class HeatmapSlider extends RendererSlider {
/** Required. */
colorStops: any;
/** Required. */
handles: number[];
- /** Optional. */
+ /** Optional, absolute maximum value of the slider.NOTE: This value overrides statistics' max property. */
maxValue: number;
- /** Optional. */
+ /** Optional, absolute minimum value of the slider.NOTE: This value overrides statistics' min property. */
minValue: number;
/** Optional */
rampWidth: number;
@@ -4127,6 +4156,7 @@ declare module "esri/dijit/ImageServiceMeasure" {
import SimpleFillSymbol = require("esri/symbols/SimpleFillSymbol");
import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol");
import SimpleMarkerSymbol = require("esri/symbols/SimpleMarkerSymbol");
+ import ImageServiceMeasureTool = require("esri/toolbars/ImageServiceMeasureTool");
/** This widget allows you to perform measurements on image services. */
class ImageServiceMeasure {
@@ -4136,6 +4166,8 @@ declare module "esri/dijit/ImageServiceMeasure" {
lineSymbol: SimpleLineSymbol;
/** Symbol to be used when drawing a point. */
markerSymbol: SimpleMarkerSymbol;
+ /** The instance of ImageServiceMeasureTool associated with this widget. */
+ measureToolbar: ImageServiceMeasureTool;
/**
* Creates an instance of the ImageServiceMeasure widget.
* @param params An Object containing constructor options.
@@ -4294,8 +4326,12 @@ declare module "esri/dijit/LayerList" {
map: Map;
/** Indicates whether to remove underscores from the layer title */
removeUnderscores: boolean;
+ /** Indicates whether to display a legend for the layer items. */
+ showLegend: boolean;
+ /** Indicates whether to display the opacity slider. */
+ showOpacitySlider: boolean;
/** Indicates whether to show sublayers in the list of layers. */
- sublayers: boolean;
+ showSubLayers: boolean;
/** CSS Class for uniquely styling the widget. */
theme: string;
/** Indicates whether to show the widget. */
@@ -4314,7 +4350,7 @@ declare module "esri/dijit/LayerList" {
startup(): void;
/** Fired when the LayerList widget has fully loaded. */
on(type: "load", listener: (event: { target: LayerList }) => void): esri.Handle;
- /** Fired when refresh is called on the LabelList widget. */
+ /** Fired when refresh() is called on the widget. */
on(type: "refresh", listener: (event: { target: LayerList }) => void): esri.Handle;
/** Fired when the layer is toggled on/off within the widget. */
on(type: "toggle", listener: (event: { layerIndex: number; subLayerIndex: number; visible: boolean; target: LayerList }) => void): esri.Handle;
@@ -4622,33 +4658,35 @@ declare module "esri/dijit/OpacitySlider" {
/** A widget to assist with managing opacity with a renderer. */
class OpacitySlider extends RendererSlider {
- /** Required. */
+ /** Required: Handles identified by their index values within the stops array. */
handles: number[];
- /** Optional. */
+ /** Optional: Represents the histogram data object. */
histogram: any;
- /** Optional: */
- histogramWidth: boolean;
- /** Optional. */
+ /** Optional: Width of histogram in pixels. */
+ histogramWidth: number;
+ /** Optional: The absolute maximum value of the slider. */
maxValue: number;
- /** Optional. */
+ /** Optional: The absolute minimum value of the slider. */
minValue: number;
- /** Required. */
+ /** Required: The data map containing renderer information. */
opacityInfo: any;
- /** Optional */
+ /** Optional: The handle identified by its index value within the stops array. */
+ primaryHandle: number;
+ /** Optional: Represents the width of the SVG ramp in pixels. */
rampWidth: number;
- /** Property for showing handles. */
+ /** Optional: Indicates whether to display slider handles. */
showHandles: boolean;
- /** Optional. */
+ /** Optional: Indicates whether to display the histogram. */
showHistogram: boolean;
- /** Property for showing labels. */
+ /** Optional: Indicates whether to display slider labels. */
showLabels: boolean;
- /** Property for showing ticks. */
+ /** Optional: Indicates whether to display slider tick marks. */
showTicks: boolean;
- /** Property for displaying the transparent background. */
+ /** Optional: Indicates whether to display the transparent background. */
showTransparentBackground: boolean;
- /** Optional. */
+ /** Optional: Represents a statistics data object. */
statistics: any;
- /** Optional. */
+ /** Optional: Additional options to customize slider. */
zoomOptions: any;
/**
* Creates a new OpacitySlider widget within the provided DOM node srcNodeRef.
@@ -4658,10 +4696,12 @@ declare module "esri/dijit/OpacitySlider" {
constructor(params: esri.OpacitySliderOptions, srcNodeRef: Node | string);
/** Fires when OpacitySlider changes. */
on(type: "change", listener: (event: { opacityInfo: any; target: OpacitySlider }) => void): esri.Handle;
- /** Fires when minValue or maxValue of OpacitySlider changes. */
+ /** Fires when minValue or maxValue of the OpacitySlider changes. */
on(type: "data-value-change", listener: (event: { maxValue: number; minValue: number; opacityInfo: any; target: OpacitySlider }) => void): esri.Handle;
/** Fires when an OpacitySlider handle is moved. */
on(type: "handle-value-change", listener: (event: { opacityInfo: any; target: OpacitySlider }) => void): esri.Handle;
+ /** Fires when the zoom state changes. */
+ on(type: "zoomed", listener: (event: { zoomed: boolean; target: OpacitySlider }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
}
export = OpacitySlider;
@@ -4985,7 +5025,7 @@ declare module "esri/dijit/RendererSlider" {
showLabels: boolean | string[];
/** Toggle for showing the horizontal line indicators from the center of the handle. */
showTicks: boolean;
- /** Handle positions represented as numbers that fall between minimum and maximum. */
+ /** Required: Handle positions represented as numbers that fall between minimum and maximum. */
values: number[];
/**
* Creates a new RendererSlider widget.
@@ -5044,10 +5084,14 @@ declare module "esri/dijit/Search" {
activeSourceIndex: number;
/** Indicates whether to automatically add all the feature layers from the map. */
addLayersFromMap: boolean;
+ /** This is the default value used as a hint for input text when searching on multiple sources. */
+ allPlaceholder: string;
/** Indicates whether to automatically navigate to the selected result. */
autoNavigate: boolean;
- /** Indicates whether to automatically select and zoom to the first geocoded result. */
+ /** Indicates whether to automatically select the first geocoded result. */
autoSelect: boolean;
+ /** (Read-only), the default source used for the Search widget. */
+ defaultSource: any;
/** Indicates whether to enable an option to collapse/expand the search into a button. */
enableButtonMode: boolean;
/** Show the selected feature on the map using a default symbol determined by the source's geometry type. */
@@ -5056,6 +5100,8 @@ declare module "esri/dijit/Search" {
enableInfoWindow: boolean;
/** Indicates whether to enable showing a label for the geometry. */
enableLabel: boolean;
+ /** Indicates whether to display the option to search "All" sources. */
+ enableSearchingAll: boolean;
/** Indicates whether to enable the menu for selecting different sources. */
enableSourcesMenu: boolean;
/** Enable suggestions for the widget. */
@@ -5150,8 +5196,8 @@ declare module "esri/dijit/Search" {
/** Finalizes the creation of the Search widget. */
startup(): void;
/**
- * Performs a suggest() request on the active Locator.
- * @param value The string value used to suggest() on an active Locator.
+ * Performs a suggest() request on the active Locator or feature layer.
+ * @param value The string value used to suggest() on an active locator or feature layer.
*/
suggest(value?: string): any;
/** Fired when the widget's text input loses focus. */
@@ -5176,39 +5222,44 @@ declare module "esri/dijit/Search" {
declare module "esri/dijit/SizeInfoSlider" {
import esri = require("esri");
import RendererSlider = require("esri/dijit/RendererSlider");
+ import SimpleMarkerSymbol = require("esri/symbols/SimpleMarkerSymbol");
+ import SimpleLineSymbol = require("esri/symbols/SimpleLineSymbol");
+ /** A widget to assist with managing size with a renderer. */
class SizeInfoSlider extends RendererSlider {
- /** Optional. */
+ /** Optional, the classification method used for the SizeInfoSlider. */
classificationMethod: string;
- /** Required. */
+ /** Required: Handles identified by their index values within the stops array. */
handles: number[];
- /** Optional. */
+ /** Optional: Represents the histogram data object. */
histogram: any;
- /** Optional. */
- histogramWidth: boolean;
- /** Optional. */
+ /** Optional: Width of the histogram in pixels. */
+ histogramWidth: number;
+ /** Optional: The absolute maximum value of the slider. */
maxValue: number;
- /** Optional. */
+ /** Optional: The absolute minimum value of the slider. */
minValue: number;
- /** Optional. */
+ /** Optional, indicates how data values are normalized. */
normalizationType: string;
- /** Optional. */
+ /** Optional: The handle identified by its index value within the stops array. */
primaryHandle: number;
- /** Optional */
+ /** Optional: Represents the width of the SVG ramp in pixels. */
rampWidth: number;
- /** Property for showing handles. */
+ /** Optional: Indicates whether to display slider handles. */
showHandles: boolean;
- /** Optional. */
+ /** Optional: Indicates whether to display the histogram. */
showHistogram: boolean;
- /** Property for showing labels. */
+ /** Optional: Indicates whether to display the slider labels. */
showLabels: boolean;
- /** Property for showing ticks. */
+ /** Optional: Indicates whether to display the slider tick marks. */
showTicks: boolean;
- /** Required. */
+ /** Required: Defines the size of the symbol where feature size is proportional to data value. */
sizeInfo: any;
- /** Optional. */
+ /** Optional: Represents the statistics data object. */
statistics: any;
- /** Optional. */
+ /** Required: The SimpleLineSymbol or SimpleMarkerSymbol used with the widget. */
+ symbol: SimpleMarkerSymbol | SimpleLineSymbol;
+ /** Optional: Additional options to customize slider. */
zoomOptions: any;
/**
* Creates a new SizeInfoSlider widget.
@@ -5220,10 +5271,12 @@ declare module "esri/dijit/SizeInfoSlider" {
startup(): void;
/** Fires when the SizeInfoSlider properties change. */
on(type: "change", listener: (event: { sizeInfo: any; target: SizeInfoSlider }) => void): esri.Handle;
- /** Fires when minValue or maxValue of SizeInfoSlider change. */
+ /** Fires when minValue or maxValue of the SizeInfoSlider changes. */
on(type: "data-value-change", listener: (event: { maxValue: number; minValue: number; sizeInfo: any; target: SizeInfoSlider }) => void): esri.Handle;
/** Fires when a SizeInfoSlider handle is moved. */
on(type: "handle-value-change", listener: (event: { sizeInfo: any; target: SizeInfoSlider }) => void): esri.Handle;
+ /** Fires when the zoom state changes. */
+ on(type: "zoomed", listener: (event: { zoomed: boolean; target: SizeInfoSlider }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
}
export = SizeInfoSlider;
@@ -6730,7 +6783,7 @@ declare module "esri/dijit/geoenrichment/DataBrowser" {
export = DataBrowser;
}
-declare module "esri/dijit/geoenrichment/InfoGraphic" {
+declare module "esri/dijit/geoenrichment/Infographic" {
import esri = require("esri");
import GeometryStudyArea = require("esri/tasks/geoenrichment/GeometryStudyArea");
import RingBuffer = require("esri/tasks/geoenrichment/RingBuffer");
@@ -7451,13 +7504,13 @@ declare module "esri/geometry/geometryEngine" {
import SpatialReference = require("esri/SpatialReference");
import Point = require("esri/geometry/Point");
- /** (Currently in beta) A client-side geometry engine. */
+ /** A client-side geometry engine. */
var geometryEngine: {
/**
* Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries.
* @param geometry The buffer input geometry.
* @param distance The specified distance(s) for buffering.
- * @param unit Unit for the distance(s).
+ * @param unit Measurement unit for the distance(s).
* @param unionResults Whether the output geometries should be unioned into a single polygon.
*/
buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[];
@@ -7495,7 +7548,7 @@ declare module "esri/geometry/geometryEngine" {
* Densify geometries by plotting points between existing vertices.
* @param geometry The geometry to be densified.
* @param maxSegmentLength The maximum segment length allowed.
- * @param maxSegmentLengthUnit Unit for the maximum segment length.
+ * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength.
*/
densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): Geometry;
/**
@@ -7514,7 +7567,7 @@ declare module "esri/geometry/geometryEngine" {
* Calculates the shortest planar distance between two geometries.
* @param geometry1 First input geometry.
* @param geometry2 Second input geometry.
- * @param distanceUnit Units of the return value.
+ * @param distanceUnit Measurement unit of the return value.
*/
distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): number;
/**
@@ -7545,27 +7598,34 @@ declare module "esri/geometry/geometryEngine" {
* @param geometry The geometry to be generalized.
* @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry.
* @param removeDegenerateParts When true, the degenerate parts of the geometry will be removed from the output (may be undesired for drawing).
- * @param maxDeviationUnit A unit for maximum deviation.
+ * @param maxDeviationUnit Measurement unit for maxDeviation.
*/
generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): Geometry;
/**
* Calculates the area of the input geometry.
* @param geometry The input geometry.
- * @param unit Units of the return value.
+ * @param unit Measurement unit of the return value.
*/
geodesicArea(geometry: Geometry, unit: string | number): number;
/**
* Creates geodesic buffer polygons at a specified distance around the input geometries.
* @param geometry The buffer input geometry.
* @param distance The specified distance(s) for buffering.
- * @param unit Unit for the distance(s).
+ * @param unit Measurement unit for the distance(s).
* @param unionResults Whether the output geometries should be unioned into a single polygon.
*/
geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): Polygon | Polygon[];
+ /**
+ * Returns a geodesically densified version of the input geometry.
+ * @param geometry A polyline or polygon geometry to densify.
+ * @param maxSegmentLength The maximum segment length allowed.
+ * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength.
+ */
+ geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit?: number): Geometry;
/**
* Calculates the length of the input geometry.
* @param geometry The input geometry.
- * @param unit Units of the return value.
+ * @param unit Measurement unit of the return value.
*/
geodesicLength(geometry: Geometry, unit: string | number): number;
/**
@@ -7609,7 +7669,7 @@ declare module "esri/geometry/geometryEngine" {
* Creates offset version of the input geometry.
* @param geometry The geometries to offset.
* @param offsetDistance The offset distance for the Geometries.
- * @param offsetUnit Unit for the offset.
+ * @param offsetUnit Measurement unit for the offset.
* @param joinType The join type.
* @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled.
* @param flattenError Applicable to ROUND, flattenError determines the maximum distance of the resulting segments compared to the true circular arc.
@@ -7624,13 +7684,13 @@ declare module "esri/geometry/geometryEngine" {
/**
* Calculates the area of the input geometry.
* @param geometry The input geometry.
- * @param unit Units of the return value.
+ * @param unit Measurement unit of the return value.
*/
planarArea(geometry: Geometry, unit: string | number): number;
/**
* Calculates the length of the input geometry.
* @param geometry The input geometry.
- * @param unit Units of the return value.
+ * @param unit Measurement unit of the return value.
*/
planarLength(geometry: Geometry, unit: string | number): number;
/**
@@ -7685,14 +7745,15 @@ declare module "esri/geometry/geometryEngineAsync" {
import Polyline = require("esri/geometry/Polyline");
import SpatialReference = require("esri/SpatialReference");
import Point = require("esri/geometry/Point");
+ import Polygon = require("esri/geometry/Polygon");
- /** (Currently in beta) A client-side asynchronous geometry engine. */
+ /** A client-side asynchronous geometry engine. */
var geometryEngineAsync: {
/**
* Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries.
* @param geometry The buffer input geometry.
* @param distance The specified distance(s) for buffering.
- * @param unit Unit for the distance(s).
+ * @param unit Measurement unit for the distance(s).
* @param unionResults Whether the output geometries should be unioned into a single polygon.
*/
buffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): any;
@@ -7730,7 +7791,7 @@ declare module "esri/geometry/geometryEngineAsync" {
* Densify geometries by plotting points between existing vertices.
* @param geometry The geometry to be densified.
* @param maxSegmentLength The maximum segment length allowed.
- * @param maxSegmentLengthUnit Defaults to the units of the input geometries.
+ * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength.
*/
densify(geometry: Geometry, maxSegmentLength: number, maxSegmentLengthUnit: string | number): any;
/**
@@ -7749,7 +7810,7 @@ declare module "esri/geometry/geometryEngineAsync" {
* Calculates the shortest planar distance between two geometries.
* @param geometry1 First input geometry.
* @param geometry2 Second input geometry.
- * @param distanceUnit Units of the return value.
+ * @param distanceUnit Measurement unit of the return value.
*/
distance(geometry1: Geometry, geometry2: Geometry, distanceUnit: string | number): any;
/**
@@ -7780,27 +7841,34 @@ declare module "esri/geometry/geometryEngineAsync" {
* @param geometry The geometry to be generalized.
* @param maxDeviation The maximum allowed deviation from the generalized geometry to the original geometry.
* @param removeDegenerateParts When true, the degenerate parts of the geometry will be removed from the output (may be undesired for drawing).
- * @param maxDeviationUnit Defaults to the units of the input geometries.
+ * @param maxDeviationUnit Measurement unit for maxDeviation.
*/
generalize(geometry: Geometry, maxDeviation: number, removeDegenerateParts?: boolean, maxDeviationUnit?: string | number): any;
/**
* Calculates the area of the input geometry.
* @param geometry The input geometry.
- * @param unit Units of the return value.
+ * @param unit Measurement unit of the return value.
*/
geodesicArea(geometry: Geometry, unit: string | number): any;
/**
* Creates geodesic buffer polygons at a specified distance around the input geometries.
* @param geometry The buffer input geometry.
* @param distance The specified distance(s) for buffering.
- * @param unit Unit for the distance(s).
+ * @param unit Measurement unit for the distance(s).
* @param unionResults Whether the output geometries should be unioned into a single polygon.
*/
geodesicBuffer(geometry: Geometry | Geometry[], distance: number | number[], unit: string | number, unionResults?: boolean): any;
+ /**
+ * Resolves to a geodesically densified version of the input geometry.
+ * @param geometry A polyline or polygon geometry to densify.
+ * @param maxSegmentLength The maximum segment length allowed.
+ * @param maxSegmentLengthUnit Measurement unit for maxSegmentLength.
+ */
+ geodesicDensify(geometry: Polyline | Polygon, maxSegmentLength: number, maxSegmentLengthUnit?: number): any;
/**
* Calculates the length of the input geometry.
* @param geometry The input geometry.
- * @param unit Units of the return value.
+ * @param unit Measurement unit of the return value.
*/
geodesicLength(geometry: Geometry, unit: string | number): any;
/**
@@ -7844,7 +7912,7 @@ declare module "esri/geometry/geometryEngineAsync" {
* Creates offset version of the input geometry.
* @param geometry The geometries to offset.
* @param offsetDistance The offset distance for the Geometries.
- * @param offsetUnit Unit for the offset.
+ * @param offsetUnit Measurement unit for the offset.
* @param joinType The join type.
* @param bevelRatio Applicable to MITER, bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled.
* @param flattenError Applicable to ROUND, flattenError determines the maximum distance of the resulting segments compared to the true circular arc.
@@ -7859,13 +7927,13 @@ declare module "esri/geometry/geometryEngineAsync" {
/**
* Calculates the area of the input geometry.
* @param geometry The input geometry.
- * @param unit Units of the return value.
+ * @param unit Measurement unit of the return value.
*/
planarArea(geometry: Geometry, unit: string | number): any;
/**
* Calculates the length of the input geometry.
* @param geometry The input geometry.
- * @param unit Units of the return value.
+ * @param unit Measurement unit of the return value.
*/
planarLength(geometry: Geometry, unit: string | number): any;
/**
@@ -9219,7 +9287,7 @@ declare module "esri/layers/FeatureLayer" {
*/
setAutoGeneralize(enable: boolean): FeatureLayer;
/**
- * Set's the definition expression for the FeatureLayer.
+ * Sets the definition expression for the FeatureLayer.
* @param expression The definition expression to apply.
*/
setDefinitionExpression(expression: string): FeatureLayer;
@@ -9275,7 +9343,7 @@ declare module "esri/layers/FeatureLayer" {
*/
setScaleRange(minScale: number, maxScale: number): void;
/**
- * Set's the selection symbol for the feature layer.
+ * Sets the selection symbol for the feature layer.
* @param symbol Symbol for the current selection.
*/
setSelectionSymbol(symbol: Symbol): FeatureLayer;
@@ -9285,7 +9353,7 @@ declare module "esri/layers/FeatureLayer" {
*/
setShowLabels(showLabels: boolean): void;
/**
- * Set's the time definition for the feature layer.
+ * Sets the time definition for the feature layer.
* @param definition The new time extent used to filter the layer.
*/
setTimeDefinition(definition: TimeExtent): FeatureLayer;
@@ -9458,6 +9526,8 @@ declare module "esri/layers/GeoRSSLayer" {
items: Graphic[];
/** The name of the layer. */
name: string;
+ /** The publicly accessible URL to a GeoRSS file. */
+ url: string;
/**
* Creates a new GeoRSSLayer object.
* @param url URL to the GeoRSS resource.
@@ -9805,10 +9875,14 @@ declare module "esri/layers/LOD" {
declare module "esri/layers/LabelClass" {
import TextSymbol = require("esri/symbols/TextSymbol");
- /** LabelClass defines the styles of labels for ArcGISDynamicMapServiceLayer. */
+ /** Use label classes to restrict labels to certain features or to specify different label fields, symbols, scale ranges, label priorities, and sets of label placement options for different groups of labels. */
class LabelClass {
+ /** An array of objects representing field information to label. */
+ fieldInfos: any[];
/** Adjusts the formatting of labels. */
labelExpression: string;
+ /** Use this when working with FeatureLayer layer types. */
+ labelExpressionInfo: any;
/** The position of the label. */
labelPlacement: string;
/** The maximum scale to show labels. */
@@ -9824,7 +9898,7 @@ declare module "esri/layers/LabelClass" {
/** A where clause determining which features are labeled. */
where: string;
/**
- * Create a LabelClass, in order to be added to layerDrawingOption.labelingInfo.
+ * Creates a label class, used for formatting parameters, symbols, date, etc.
* @param json Various options to configure this LabelClass.
*/
constructor(json?: Object);
@@ -9840,7 +9914,7 @@ declare module "esri/layers/LabelLayer" {
import UniqueValueRenderer = require("esri/renderers/UniqueValueRenderer");
import ClassBreaksRenderer = require("esri/renderers/ClassBreaksRenderer");
- /** The LabelLayer inherits from the graphics layer and can be used to display texts and symbols on map. */
+ /** NOTE: Deprecated as of version 3.14, read below for additional information on the suggested method of labeling. */
class LabelLayer extends GraphicsLayer {
/**
* Creates a new Label layer.
@@ -10248,6 +10322,8 @@ declare module "esri/layers/RasterLayer" {
/** The RasterLayer is used to display image services. */
class RasterLayer extends Layer {
+ /** A function that takes a pixelData object as input, processes it, and returns it. */
+ pixelFilter: Function;
/**
* Creates a new RasterLayer object.
* @param url URL to the ArcGIS Server REST resource that represents a raster layer service.
@@ -10262,6 +10338,11 @@ declare module "esri/layers/RasterLayer" {
* @param doNotRefresh Use true to avoid refreshing the layer; false to refresh it.
*/
setImageFormat(imageFormat: string, doNotRefresh?: boolean): void;
+ /**
+ * Sets a pixelFilter on the layer.
+ * @param pixelFilter The function defining the PixelFilter to set on the layer.
+ */
+ setPixelFilter(pixelFilter: Function): void;
/**
* Determines if the layer will update its content based on the map's current time extent.
* @param use Use true to update the layer's content based on the map's current time extent.
@@ -10495,16 +10576,55 @@ declare module "esri/layers/TimeInfo" {
}
declare module "esri/layers/TimeReference" {
- /** TimeReference contains information about how the time was measured. */
+ /** TimeReference contains read-only information about how the time was captured when the data was created. */
class TimeReference {
- /** Indicates whether the time reference respects daylight savings time. */
+ /** A read-only property that indicates whether the time reference takes into account daylight savings time. */
respectsDaylightSaving: boolean;
- /** The time zone information associated with the time reference. */
+ /** The time zone in which the data was captured. */
timeZone: string;
}
export = TimeReference;
}
+declare module "esri/layers/VectorTileLayer" {
+ import esri = require("esri");
+ import Layer = require("esri/layers/layer");
+ import Extent = require("esri/geometry/Extent");
+ import SpatialReference = require("esri/SpatialReference");
+ import TileInfo = require("esri/layers/TileInfo");
+
+ /** A VectorTileLayer accesses cached tiles of data and renders it in vector format. */
+ class VectorTileLayer extends Layer {
+ /** The full extent of the layer. */
+ fullExtent: Extent;
+ /** The initial extent of the layer. */
+ initialExtent: Extent;
+ /** The spatial reference of the layer. */
+ spatialReference: SpatialReference;
+ /** The style object of the service with fully qualified URLs for glyphs and sprite. */
+ style: any;
+ /** Contains information about the tiling scheme for the layer. */
+ tileInfo: TileInfo;
+ /** The URL to the vector tile service or style JSON that will be used to draw the layer. */
+ url: string;
+ /**
+ * Create a new VectorTileLayer object.
+ * @param url The URL to the vector tile service or style JSON that will be used to draw the layer.
+ * @param options Optional parameters.
+ */
+ constructor(url: string | any, options?: esri.VectorTileLayerOptions);
+ /**
+ * Changes the style properties used to render the layers.
+ * @param styleUrl A url to a JSON file containing the stylesheet information to render the layer.
+ */
+ setStyle(styleUrl: string | any): void;
+ /** Fires when the style is changed on the layer. */
+ on(type: "style-change", listener: (event: { style: any; target: VectorTileLayer }) => void): esri.Handle;
+ on(type: string, listener: (event: any) => void): esri.Handle;
+ }
+ export = VectorTileLayer;
+}
+
declare module "esri/layers/WFSLayer" {
import esri = require("esri");
import Field = require("esri/layers/Field");
@@ -10513,7 +10633,7 @@ declare module "esri/layers/WFSLayer" {
import InfoTemplate = require("esri/InfoTemplate");
import Renderer = require("esri/renderers/Renderer");
- /** (Currently in beta)A layer for OGC Web Feature Services (WFS). */
+ /** (Currently in beta) A layer for OGC Web Feature Services (WFS). */
class WFSLayer {
/** An array of fields in the layer. */
fields: Field[];
@@ -11262,6 +11382,8 @@ declare module "esri/opsdashboard/DataSourceProxy" {
id: string;
/** Read-only: Indicates if the last query failed and the data source is in a broken state. */
isBroken: boolean;
+ /** Read-only: The mapWidgetId of the data source. */
+ mapWidgetId: string;
/** Read-only: The name of the data source. */
name: string;
/** Read-only: The name of the object id field. */
@@ -11279,6 +11401,8 @@ declare module "esri/opsdashboard/DataSourceProxy" {
* @param query The query object to apply.
*/
executeQuery(query: Query): any;
+ /** An object that contains service level metadata about whether or not the layer supports queries using statistics, order by fields, DISTINCT, pagination, query with distance, and returning queries with extents. */
+ getAdvancedQueryCapabilities(): any;
/** Retrieve the associated data source that supports selection. */
getAssociatedSelectionDataSourceProxy(): any;
/** Get the associated popupInfo for the data source if any available. */
@@ -11334,8 +11458,8 @@ declare module "esri/opsdashboard/ExtensionBase" {
static POLYLINE: any;
/** Read-only: Indicates if the host application is the Windows Operations Dashboard. */
isNative: boolean;
- /** Get the collection of data sources from the host application. */
- getDataSourceProxies(): any;
+ /** Read-only: The URL to the ArcGIS.com site or in-house portal that you are currently signed in to. */
+ portalUrl: string;
/** Get the collection of data sources from the host application. */
getDataSourceProxies(): any;
/** Get the data source corresponding to the data source id from the host application. */
@@ -11386,6 +11510,8 @@ declare module "esri/opsdashboard/ExtensionConfigurationBase" {
/** ExtensionConfigurationBase is a base class used by all the extension configuration proxies. */
class ExtensionConfigurationBase extends ExtensionBase {
+ /** The object that will store the Widget/MapTool/FeatureAction configuration. */
+ config: any;
/** Indicates that the configuration is ready to be persisted or not. */
readyToPersistConfig: boolean;
}
@@ -11467,10 +11593,10 @@ declare module "esri/opsdashboard/GraphicsLayerProxy" {
*/
addOrUpdateGraphic(graphic: Graphic): void;
/**
- * Update a graphic in the host graphics layer with a new version.
- * @param graphic The graphic to update in the host graphics layer.
+ * Update graphics in the host graphics layer with a new version.
+ * @param graphics The graphics to update in the host graphics layer.
*/
- addOrUpdateGraphics(graphic: Graphic): void;
+ addOrUpdateGraphics(graphics: Graphic[]): void;
/** Removes all the graphics from the host graphics layer. */
clear(): void;
/**
@@ -11625,8 +11751,6 @@ declare module "esri/opsdashboard/WidgetConfigurationProxy" {
/** WidgetConfigurationProxy is a class used to provide the configuration user experience for an operations dashboard extension widget. */
class WidgetConfigurationProxy extends ExtensionConfigurationBase {
- /** The object that will store the widget configuration. */
- config: any;
/**
* Called by the host application when the user has changed the selected data source in the data source selector.
* @param dataSourceProxy The selected data source.
@@ -11639,7 +11763,7 @@ declare module "esri/opsdashboard/WidgetConfigurationProxy" {
*/
getDataSourceConfig(dataSourceProxyOrDataSourceId: DataSourceProxy | string): any;
/**
- * Called by the host application when the user has changed the slected map widget in the map widget selector.
+ * Called by the host application when the user has changed the selected map widget in the map widget selector.
* @param mapWidgetProxy The selected map widget.
*/
mapWidgetSelectionChanged(mapWidgetProxy: MapWidgetProxy): void;
@@ -11897,7 +12021,7 @@ declare module "esri/renderers/BlendRenderer" {
import esri = require("esri");
import Symbol = require("esri/symbols/Symbol");
- /** (Currently in beta) BlendRenderer allows you to easily identify a predominant attribute among two or more competing attributes in a feature. */
+ /** (Currently in beta) BlendRenderer allows you to easily identify the predominant attribute among two or more competing attributes of a feature and visualizes the strength of that predominance using blended colors. */
class BlendRenderer {
/** This determines how colors are blended together. */
blendMode: string;
@@ -12129,7 +12253,7 @@ declare module "esri/renderers/Renderer" {
import Color = require("esri/Color");
import Symbol = require("esri/symbols/Symbol");
- /** The base class for the renderers - SimpleRenderer, ClassBreaksRenderer, UniqueValueRenderer, DotDensityRenderer, ScaleDependentRenderer, and TemporalRenderer used with a GraphicsLayer and FeatureLayer. */
+ /** The base class for the renderers - SimpleRenderer, ClassBreaksRenderer, UniqueValueRenderer, DotDensityRenderer, ScaleDependentRenderer, TemporalRenderer, HeatmapRenderer, and VectorFieldRenderer used with a GraphicsLayer and FeatureLayer. */
class Renderer {
/** An object defining a color ramp used to render the layer. */
colorInfo: any;
@@ -12188,11 +12312,14 @@ declare module "esri/renderers/Renderer" {
* @param info An object with the same properties as rotationInfo.
*/
setRotationInfo(info: any): Renderer;
- /** Set size info of the renderer to modify the symbol size based on data value. */
- setSizeInfo(): Renderer;
+ /**
+ * Set size info of the renderer to modify the symbol size based on data value.
+ * @param info An object with the same properties as sizeInfo.
+ */
+ setSizeInfo(info: any): Renderer;
/**
* Sets the renderer with the specified visualVariables.
- * @param visualParams The specified visualVariables.
+ * @param visualParams The specified visualVariables.
*/
setVisualVariables(visualParams: any[]): void;
/** Converts object to its ArcGIS Server JSON representation. */
@@ -12503,6 +12630,11 @@ declare module "esri/renderers/smartMapping" {
* @param params See the object specifications table below for the structure of the params object.
*/
createClassedSizeRenderer(params: any): any;
+ /**
+ * Creates an object defining a color ramp used to render a layer.
+ * @param params See the object specifications table below for the structure of the params object.
+ */
+ createColorInfo(params: any): any;
/**
* Creates a renderer for visualizing features using colors.
* @param params See the object specifications table below for the structure of the params object.
@@ -12518,6 +12650,16 @@ declare module "esri/renderers/smartMapping" {
* @param params See the object specifications table below for the structure of the params object.
*/
createOpacityInfo(params: any): any;
+ /**
+ * Creates a renderer for identifying features by their color.
+ * @param params See the Object Specifications table below for the structure of the params object.
+ */
+ createPredominanceRenderer(params: any): any;
+ /**
+ * Defines the size of the symbol where feature size is proportional to data value.
+ * @param params See the object specifications table below for the structure of the params object.
+ */
+ createSizeInfo(params: any): any;
/**
* Creates a renderer for visualizing features by varying their size based on data.
* @param params See the object specifications table below for the structure of the params object.
@@ -13113,6 +13255,10 @@ declare module "esri/symbols/TextSymbol" {
decoration: string;
/** Font for displaying text. */
font: Font;
+ /** The halo color used for the text symbol.Known limitations:IE 9 and below not supported.Sub-pixel halo (i.e. */
+ haloColor: Color;
+ /** The size (in pixel units) used if setting a halo on a text symbol.Known limitations:IE 9 and below not supported.Sub-pixel halo (i.e. */
+ haloSize: number;
/** Horizontal alignment of the text with respect to the graphic. */
horizontalAlignment: string;
/** Determines whether to adjust the spacing between characters in the text string. */
@@ -13164,6 +13310,16 @@ declare module "esri/symbols/TextSymbol" {
* @param font Text font.
*/
setFont(font: Font): TextSymbol;
+ /**
+ * Sets a halo color for the text symbol.NOTE: Known limitations when working with the text symbol halo:IE 9 and below not supported.Sub-pixel halo (i.e.
+ * @param color The color used for the text symbol halo.
+ */
+ setHaloColor(color: Color): TextSymbol;
+ /**
+ * Sets the size of the halo (in pixels) used for the text symbol.NOTE: Known limitations when working with the text symbol halo:IE 9 and below not supported.Sub-pixel halo (i.e.
+ * @param size The size (in pixels) of the text symbol halo.
+ */
+ setHaloSize(size: number): TextSymbol;
/**
* Updates the horizontal alignment of the text symbol.
* @param alignment Horizontal alignment of the text with respect to the graphic.
@@ -13658,6 +13814,8 @@ declare module "esri/tasks/FindParameters" {
contains: boolean;
/** An array of DynamicLayerInfos used to change the layer ordering or redefine the map. */
dynamicLayerInfos: DynamicLayerInfo[];
+ /** Specifies the number of decimal places for the geometries returned by the query operation. */
+ geometryPrecision: number;
/** Array of layer definition expressions that allows you to filter the features of individual layers. */
layerDefinitions: string[];
/** The layers to perform the find operation on. */
@@ -13731,26 +13889,26 @@ declare module "esri/tasks/FindTask" {
declare module "esri/tasks/GPMessage" {
/** Represents a message generated during the execution of a geoprocessing task. */
class GPMessage {
- /** esriJobMessageTypeAbort */
+ /** esriJobMessageTypeAbort - Indicates the job has aborted. */
static TYPE_ABORT: any;
- /** esriGPMessageTypeEmpty */
+ /** esriJobMessageTypeEmpty - Indicates the task returned an empty result. */
static TYPE_EMPTY: any;
- /** esriGPMessageTypeError */
+ /** esriJobMessageTypeError - Indicates an error was returned during the execution of the job. */
static TYPE_ERROR: any;
- /** esriGPMessageTypeInformative */
+ /** esriJobMessageTypeInformative - Indicates the message is informative. */
static TYPE_INFORMATIVE: any;
- /** TBA */
+ /** esriJobMessageTypeProcessDefinition */
static TYPE_PROCESS_DEFINITION: any;
- /** TBA */
+ /** esriJobMessageTypeProcessStart - Indicates the GP process has started. */
static TYPE_PROCESS_START: any;
- /** TBA */
+ /** esriJobMessageTypeProcessStop - Indicates the GP process has stopped. */
static TYPE_PROCESS_STOP: any;
- /** esriGPMessageTypeWarning */
+ /** esriJobMessageTypeWarning - Indicates the message is a warning. */
static TYPE_WARNING: any;
/** A description of the geoprocessing message. */
description: string;
/** The geoprocessing message type. */
- type: number;
+ type: string;
}
export = GPMessage;
}
@@ -14127,7 +14285,7 @@ declare module "esri/tasks/Geoprocessor" {
* @param callback The function to call when the method has completed.
* @param errback An error object is returned if an error occurs on the Server during task execution.
*/
- checkJobStatus(jobId: string, callback?: Function, errback?: Function): void;
+ checkJobStatus(jobId: string, callback?: Function, errback?: Function): any;
/**
* Sends a request to the server to execute a synchronous GP task.
* @param inputParameters The inputParameters argument specifies the input parameters accepted by the task and their corresponding values.
@@ -14187,7 +14345,7 @@ declare module "esri/tasks/Geoprocessor" {
* @param statusCallback Checks the current status of the job.
* @param errback An error object is returned if an error occurs on the Server during task execution.
*/
- submitJob(inputParameters: any, callback?: Function, statusCallback?: Function, errback?: Function): void;
+ submitJob(inputParameters: any, callback?: Function, statusCallback?: Function, errback?: Function): any;
/** Fires when an error occurs when executing the task. */
on(type: "error", listener: (event: { error: Error; target: Geoprocessor }) => void): esri.Handle;
/** Fires when a synchronous GP task is completed. */
@@ -14231,6 +14389,8 @@ declare module "esri/tasks/IdentifyParameters" {
dynamicLayerInfos: DynamicLayerInfo[];
/** The geometry used to select features during Identify. */
geometry: Geometry;
+ /** Specifies the number of decimal places for the geometries returned by the query operation. */
+ geometryPrecision: number;
/** Height of the map currently being viewed in pixels. */
height: number;
/** Array of layer definition expressions that allows you to filter the features of individual layers. */
@@ -14403,6 +14563,28 @@ declare module "esri/tasks/ImageServiceMeasureParameters" {
/** Defines parameters for the ImageServiceMeasureTask. */
class ImageServiceMeasureParameters {
+ /** Calculates the area and perimeter of given geometry. */
+ static OPERATION_AREA_PERIMETER: any;
+ /** Calculates the area and perimeter of the given geometry using the DEM defined by the service to refine the calculation. */
+ static OPERATION_AREA_PERIMETER_3D: any;
+ /** Calculates the height of a structure by measuring from the base of the structure to the top of the structure. */
+ static OPERATION_BASE_TOP: any;
+ /** Calculates the height of a structure by measuring from the base of the structure to the top of the structure's shadow on the ground. */
+ static OPERATION_BASE_TOP_SHADOW: any;
+ /** Calculates the centroid of a given area. */
+ static OPERATION_CENTROID: any;
+ /** Calculates the centroid of a given area, using the DEM defined by the service to refine the calculation. */
+ static OPERATION_CENTROID_3D: any;
+ /** Calculates the distance and azimuth angle between two points. */
+ static OPERATION_DISTANCE_ANGLE: any;
+ /** Calculates the distance and azimuth angle between two points using the DEM defined by the service to refine the calculation. */
+ static OPERATION_DISTANCE_ANGLE_3D: any;
+ /** Measures the location of a given point. */
+ static OPERATION_POINT: any;
+ /** Measures the location of a given point, using the DEM defined by the service to refine the calculation. */
+ static OPERATION_POINT_3D: any;
+ /** Calculates the height of a structure by measuring from the top of the structure to the top of the structure's shadow on the ground. */
+ static OPERATION_TOP_TOP_SHADOW: any;
/** The angular unit in which directions of line segments will be calculated. */
angularUnit: string;
/** The area unit in which areas of polygons will be calculated. */
@@ -14613,6 +14795,8 @@ declare module "esri/tasks/ParameterValue" {
class ParameterValue {
/** Specifies the type of data for the parameter. */
dataType: string;
+ /** The name of the output parameter as defined by the geoprocessing task in the Services Directory. */
+ paramName: string;
/** The value of the parameter. */
value: any;
}
@@ -14707,7 +14891,7 @@ declare module "esri/tasks/ProjectParameters" {
geometries: Geometry[];
/** The spatial reference to which you are projecting the geometries. */
outSR: SpatialReference;
- /** The well-known id {wkid:number} or well-known text {wkt:string} or for the datum transfomation to be applied on the projected geometries. */
+ /** The well-known id {wkid:number} or well-known text {wkt:string} or for the datum transformation to be applied on the projected geometries. */
transformation: any;
/** Indicates whether to transform forward or not. */
transformForward: boolean;
@@ -15331,6 +15515,8 @@ declare module "esri/tasks/datareviewer/BatchValidationTask" {
executeJob(parameters: BatchValidationParameters): any;
/** Retrieves all adhoc jobs from the server and returns an array of BatchValidationJob with the information. */
getAdhocJobsList(): any;
+ /** Returns an array of custom field names defined in a Reviewer workspace. */
+ getCustomFieldNames(): any;
/**
* Fetches Batch Validation Job details.
* @param jobId Job Id of the batch validation job.
@@ -15373,19 +15559,21 @@ declare module "esri/tasks/datareviewer/BatchValidationTask" {
/** Fires when the executeJob method is complete. */
on(type: "execute-job", listener: (event: { jobId: string; target: BatchValidationTask }) => void): esri.Handle;
/** Fires when the getAdhocJobsList method is complete. */
- on(type: "get-adhoc-jobs-list", listener: (event: { adhocJobs: any[]; target: BatchValidationTask }) => void): esri.Handle;
+ on(type: "get-adhoc-jobs-list", listener: (event: { adhocJobs: BatchValidationJob[]; target: BatchValidationTask }) => void): esri.Handle;
+ /** Fires when the getCustomFieldNames method is complete. */
+ on(type: "get-custom-field-names", listener: (event: { customFieldNames: string[]; target: BatchValidationTask }) => void): esri.Handle;
/** Fires when the getJobDetails method is complete. */
on(type: "get-job-details", listener: (event: { jobDetails: BatchValidationJob; target: BatchValidationTask }) => void): esri.Handle;
/** Fires when the getJobExecutionDetails method is complete. */
on(type: "get-job-execution-details", listener: (event: { jobInfo: BatchValidationJobInfo; target: BatchValidationTask }) => void): esri.Handle;
/** Fires when the getJobIds method is complete. */
- on(type: "get-job-ids", listener: (event: { adhocJobs: any[]; scheduledJobs: any[]; target: BatchValidationTask }) => void): esri.Handle;
+ on(type: "get-job-ids", listener: (event: { adhocJobs: string[]; scheduledJobs: string[]; target: BatchValidationTask }) => void): esri.Handle;
/** Fires when the getLifecycleStatusStrings method is complete. */
- on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: any[]; target: BatchValidationTask }) => void): esri.Handle;
+ on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: string[]; target: BatchValidationTask }) => void): esri.Handle;
/** Fires when the getReviewerSessions method is complete. */
- on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: any[]; target: BatchValidationTask }) => void): esri.Handle;
+ on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: ReviewerSession[]; target: BatchValidationTask }) => void): esri.Handle;
/** Fires when the getScheduledJobsList method is complete. */
- on(type: "get-scheduled-jobs-list", listener: (event: { scheduledJobs: any[]; target: BatchValidationTask }) => void): esri.Handle;
+ on(type: "get-scheduled-jobs-list", listener: (event: { scheduledJobs: BatchValidationJob[]; target: BatchValidationTask }) => void): esri.Handle;
/** Fires when the scheduleJob method is complete. */
on(type: "schedule-job", listener: (event: { jobId: string; target: BatchValidationTask }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
@@ -15435,6 +15623,8 @@ declare module "esri/tasks/datareviewer/DashboardTask" {
* @param sessionOptions Session properties to be used to create the session.
*/
createReviewerSession(sessionName: string, sessionOptions: SessionOptions): any;
+ /** Returns an array of custom field names defined in a Reviewer workspace. */
+ getCustomFieldNames(): any;
/** Requests Dashboard results field names. */
getDashboardFieldNames(): any;
/**
@@ -15453,14 +15643,16 @@ declare module "esri/tasks/datareviewer/DashboardTask" {
on(type: "create-reviewer-sessions", listener: (event: { reviewerSession: ReviewerSession; target: DashboardTask }) => void): esri.Handle;
/** Fires when an error occurs during a DashboardTask method execution. */
on(type: "error", listener: (event: { error: Error; target: DashboardTask }) => void): esri.Handle;
+ /** Fires when the getCustomFieldNames method is complete. */
+ on(type: "get-custom-field-names", listener: (event: { customFieldNames: string[]; target: DashboardTask }) => void): esri.Handle;
/** Fires when the getDashboardFieldNames method is complete. */
- on(type: "get-dashboard-field-names", listener: (event: { fieldNames: any[]; target: DashboardTask }) => void): esri.Handle;
+ on(type: "get-dashboard-field-names", listener: (event: { fieldNames: string[]; target: DashboardTask }) => void): esri.Handle;
/** Fires when the getDashboardResults method is complete. */
on(type: "get-dashboard-results", listener: (event: { dashboardResult: DashboardResult; target: DashboardTask }) => void): esri.Handle;
/** Fires when the getLifecycleStatusStrings method is complete. */
- on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: any[]; target: DashboardTask }) => void): esri.Handle;
+ on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: string[]; target: DashboardTask }) => void): esri.Handle;
/** Fires when the getReviewerSessions method is complete. */
- on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: any[]; target: DashboardTask }) => void): esri.Handle;
+ on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: ReviewerSession[]; target: DashboardTask }) => void): esri.Handle;
on(type: string, listener: (event: any) => void): esri.Handle;
}
export = DashboardTask;
@@ -15542,8 +15734,8 @@ declare module "esri/tasks/datareviewer/ReviewerFilters" {
}
declare module "esri/tasks/datareviewer/ReviewerLifecycle" {
- /** The ReviewerLifecycle class specifies constant values for all lifecycle status and lifecycle phase strings within the Reviewer quality control workflow. */
- class ReviewerLifecycle {
+ /** The ReviewerLifecycle object specifies constant values for all lifecycle status and lifecycle phase strings within the Reviewer quality control workflow. */
+ var ReviewerLifecycle: {
/** Acceptable lifecycleStatus code = 4 belongs to Verification Phase. */
ACCEPTABLE: number;
/** Code for Correction Phase. */
@@ -15600,7 +15792,7 @@ declare module "esri/tasks/datareviewer/ReviewerLifecycle" {
* @param lifecycleStatus The lifecycle status code.
*/
toLifecycleStatusString(lifecycleStatus: number): string;
- }
+ };
export = ReviewerLifecycle;
}
@@ -15614,6 +15806,7 @@ declare module "esri/tasks/datareviewer/ReviewerResultsTask" {
import Geometry = require("esri/geometry/Geometry");
import ReviewerSession = require("esri/tasks/datareviewer/ReviewerSession");
import FeatureSet = require("esri/tasks/FeatureSet");
+ import FeatureEditResult = require("esri/layers/FeatureEditResult");
/** ReviewerResults allows access to the reviewer workspace. */
class ReviewerResultsTask {
@@ -15633,6 +15826,8 @@ declare module "esri/tasks/datareviewer/ReviewerResultsTask" {
* @param batchRunIds Array of batchRunIds used to get batch run details.
*/
getBatchRunDetails(batchRunIds: any[]): any;
+ /** Returns an array of custom field names defined in a Reviewer workspace. */
+ getCustomFieldNames(): any;
/**
* Utility operation that returns a where clause given a set of input filters.
* @param filters An instance of ReviewerFilters used to create a layer definition.
@@ -15646,8 +15841,10 @@ declare module "esri/tasks/datareviewer/ReviewerResultsTask" {
* @param filters Instance of ReviewerFilters used to query reviewer results.
*/
getResults(getResultsQueryParameters: GetResultsQueryParameters, filters?: ReviewerFilters): any;
+ /** Retrieves a list of field names that can be used to fetch or query results from reviewer workspace. */
+ getResultsFieldNames(): string[];
/** Extracts the MapServer url from the full ArcGIS Data Reviewer for Server SOE url. */
- getReviewerMapServerUrl(): any;
+ getReviewerMapServerUrl(): string;
/** Returns an array of sessions in a Reviewer workspace. */
getReviewerSessions(): any;
/**
@@ -15676,16 +15873,18 @@ declare module "esri/tasks/datareviewer/ReviewerResultsTask" {
on(type: "error", listener: (event: { error: Error; target: ReviewerResultsTask }) => void): esri.Handle;
/** Fires when the getBatchRunDetails method is complete. */
on(type: "get-batch-run-details", listener: (event: { featureSet: FeatureSet; target: ReviewerResultsTask }) => void): esri.Handle;
+ /** Fires when the getCustomFieldNames method is complete. */
+ on(type: "get-custom-field-names", listener: (event: { customFieldNames: string[]; target: ReviewerResultsTask }) => void): esri.Handle;
/** Fires when the getLayerDefinition method is complete. */
on(type: "get-layer-definition", listener: (event: { whereClause: string; target: ReviewerResultsTask }) => void): esri.Handle;
/** Fires when the getLifecycleStatusStrings method is complete. */
- on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: any[]; target: ReviewerResultsTask }) => void): esri.Handle;
+ on(type: "get-lifecycle-status-strings", listener: (event: { lifecycleStatusStrings: string[]; target: ReviewerResultsTask }) => void): esri.Handle;
/** Fires when the getResults method is complete. */
on(type: "get-results", listener: (event: { featureSet: FeatureSet; target: ReviewerResultsTask }) => void): esri.Handle;
/** Fires when the getReviewerSessions method is complete. */
- on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: any[]; target: ReviewerResultsTask }) => void): esri.Handle;
+ on(type: "get-reviewer-sessions", listener: (event: { reviewerSessions: ReviewerSession[]; target: ReviewerResultsTask }) => void): esri.Handle;
/** Fires when the updateLifecycleStatus method is complete. */
- on(type: "update-lifecycle-status", listener: (event: { featureEditResults: any[]; target: ReviewerResultsTask }) => void): esri.Handle;
+ on(type: "update-lifecycle-status", listener: (event: { featureEditResults: FeatureEditResult[]; target: ReviewerResultsTask }) => void): esri.Handle;
/** Fires when the writeFeatureAsResult method is complete. */
on(type: "write-feature-as-result", listener: (event: { success: boolean; target: ReviewerResultsTask }) => void): esri.Handle;
/** Fires when the writeResult method is complete. */
diff --git a/async-writer/async-writer-tests.ts b/async-writer/async-writer-tests.ts
new file mode 100644
index 000000000..c26e31495
--- /dev/null
+++ b/async-writer/async-writer-tests.ts
@@ -0,0 +1,66 @@
+///
+
+import asyncWriter = require('async-writer');
+import stream = require('stream');
+
+class TestStream extends stream.Writable {
+ constructor(public output: string) {
+ super();
+ }
+ _write(data: string, encoding: string, callback: Function) {
+ this.output += data;
+ callback();
+ }
+}
+
+// Simple usage
+function simpleUsage(callback: () => void) {
+ var output = '';
+ let testStream = new TestStream(output);
+ let out = asyncWriter.create(testStream)
+ .on('error', (err: Error) => {
+ console.error(err);
+ })
+ .on('finish', () => {
+ console.log(testStream.output);
+ callback();
+ })
+
+ out.write('A');
+ out.write('B');
+ out.write('C');
+ out.end();
+}
+
+
+// Asynchronous, out-of-order writing
+function asyncUsage(callback: () => void) {
+ var output = '';
+ let testStream = new TestStream(output);
+ let out = asyncWriter.create(testStream)
+ .on('error', (err: Error) => {
+ console.error(err);
+ })
+ .on('finish', () => {
+ console.log(testStream.output);
+ callback();
+ })
+
+ out.write('A');
+
+ let asyncOut = out.beginAsync();
+ setTimeout(() => {
+ asyncOut.write('B');
+ asyncOut.end();
+ }, 1000);
+
+ out.write('C');
+ out.end();
+}
+
+// run test
+simpleUsage(() => {
+ asyncUsage(() => {
+ console.log('DONE');
+ });
+});
diff --git a/async-writer/async-writer.d.ts b/async-writer/async-writer.d.ts
new file mode 100644
index 000000000..42f82d35c
--- /dev/null
+++ b/async-writer/async-writer.d.ts
@@ -0,0 +1,78 @@
+// Type definitions for async-writer 1.4.1
+// Project: https://github.com/marko-js/async-writer
+// Definitions by: Yuce Tekol
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+
+declare module 'async-writer' {
+ import stream = require('stream');
+ import events = require('events');
+
+ module async_writer {
+ interface EventFunction {
+ (event: string, callback: Function): void;
+ }
+
+ class StringWriter {
+ constructor(events: events.EventEmitter);
+ end(): void;
+ write(what: string): StringWriter;
+ toString(): string;
+ }
+
+ class BufferedWriter {
+ constructor(wrappedStream: stream.Stream);
+ flush(): void;
+ on(event: string, callback: Function): BufferedWriter;
+ once(event: string, callback: Function): BufferedWriter;
+ clear(): void;
+ end(): void;
+ write(what: string): BufferedWriter;
+ }
+
+ interface BeginAsyncOptions {
+ last?: boolean;
+ timeout?: number;
+ name?: string;
+ }
+
+ class AsyncWriter {
+ static enableAsyncStackTrace():void;
+
+ constructor(writer?: any, global?: {[s: string]: any}, async?: boolean, buffer?: boolean);
+ isAsyncWriter: AsyncWriter;
+ sync(): void;
+ getAttributes(): {[s: string]: any};
+ getAttribute(): any;
+ write(str: string): AsyncWriter;
+ getOutput(): string;
+ captureString(func: Function, thisObj: Object): string;
+ swapWriter(newWriter: StringWriter | BufferedWriter, func: Function, thisObj: Object): void;
+ createNestedWriter(writer: StringWriter | BufferedWriter): AsyncWriter;
+ beginAsync(options?: number | BeginAsyncOptions): AsyncWriter;
+ handleBeginAsync(options: number | BeginAsyncOptions, parent: AsyncWriter): void;
+ on(event: string, callback: Function): AsyncWriter;
+ once(event: string, callback: Function): AsyncWriter;
+ onLast(callback: Function): AsyncWriter;
+ emit(arg: any): AsyncWriter;
+ removeListener(): AsyncWriter;
+ pipe(stream: stream.Stream): AsyncWriter;
+ error(e: Error): void;
+ end(data?: any): AsyncWriter;
+ handleEnd(isAsync: boolean): void;
+ _finish(): void;
+ flush(): void;
+ }
+
+ interface AsyncWriterOptions {
+ global?: {[s: string]: any};
+ buffer?: boolean;
+ }
+
+ function create(writer?: any, options?: AsyncWriterOptions): AsyncWriter;
+ function enableAsyncStackTrace(): void;
+ }
+
+ export = async_writer;
+}
diff --git a/auth0.lock/auth0.lock.d.ts b/auth0.lock/auth0.lock.d.ts
index bef269dbc..3269103ab 100644
--- a/auth0.lock/auth0.lock.d.ts
+++ b/auth0.lock/auth0.lock.d.ts
@@ -72,6 +72,8 @@ interface Auth0LockStatic {
hide(callback: () => void): void;
logout(callback: () => void): void;
+
+ getClient(): Auth0Static;
}
declare var Auth0Lock: Auth0LockStatic;
diff --git a/big.js/big.js.d.ts b/big.js/big.js.d.ts
index d4ca239e3..2ad360a56 100644
--- a/big.js/big.js.d.ts
+++ b/big.js/big.js.d.ts
@@ -200,4 +200,9 @@ declare module BigJsLibrary {
}
}
+declare module "big.js" {
+ var bigjs : BigJsLibrary.BigJS;
+ export = bigjs;
+}
+
declare var Big: BigJsLibrary.BigJS;
diff --git a/bluebird/bluebird-1.0.d.ts b/bluebird/bluebird-1.0.d.ts
index 69a4f9152..b8287e57c 100644
--- a/bluebird/bluebird-1.0.d.ts
+++ b/bluebird/bluebird-1.0.d.ts
@@ -131,7 +131,7 @@ declare class Promise implements Promise.Thenable {
* Promises are by default not cancellable. Use `.cancellable()` to mark a promise as cancellable.
*/
// TODO what to do with this?
- cancel(): Promise;
+ cancel(reason?: any): Promise;
/**
* Like `.then()`, but cancellation of the the returned promise or any of its descendant will not propagate cancellation to this promise or this promise's ancestors.
@@ -394,7 +394,7 @@ declare class Promise implements Promise.Thenable {
* Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method.
*/
// TODO how to model promisifyAll?
- static promisifyAll(target: Object): Object;
+ static promisifyAll(target: Object): any;
/**
* Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch.
diff --git a/bluebird/bluebird.d.ts b/bluebird/bluebird.d.ts
index 9f36cf5bc..f3420957a 100644
--- a/bluebird/bluebird.d.ts
+++ b/bluebird/bluebird.d.ts
@@ -20,14 +20,14 @@ declare class Promise implements Promise.Thenable, Promise.Inspection {
/**
* Create a new promise. The passed in function will receive functions `resolve` and `reject` as its arguments which can be called to seal the fate of the created promise.
*/
- constructor(callback: (resolve: (thenableOrResult: R | Promise.Thenable) => void, reject: (error: any) => void) => void);
+ constructor(callback: (resolve: (thenableOrResult?: R | Promise.Thenable) => void, reject: (error: any) => void) => void);
/**
* Promises/A+ `.then()` with progress handler. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.
*/
then(onFulfill: (value: R) => U|Promise.Thenable, onReject?: (error: any) => U|Promise.Thenable, onProgress?: (note: any) => any): Promise;
then(onFulfill: (value: R) => U|Promise.Thenable, onReject?: (error: any) => void|Promise.Thenable, onProgress?: (note: any) => any): Promise;
-
+
/**
* This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler.
*
@@ -117,7 +117,7 @@ declare class Promise implements Promise.Thenable, Promise.Inspection {
* Returns back this promise instead of creating a new one. If the `callback` argument is not a function, this method does not do anything.
*/
nodeify(callback: (err: any, value?: R) => void, options?: Promise.SpreadOption): Promise;
- nodeify(...sink: any[]): void;
+ nodeify(...sink: any[]): Promise;
/**
* Marks this promise as cancellable. Promises by default are not cancellable after v0.11 and must be marked as such for `.cancel()` to have any effect. Marking a promise as cancellable is infectious and you don't need to remark any descendant promise.
@@ -134,7 +134,7 @@ declare class Promise implements Promise.Thenable, Promise.Inspection {
* Promises are by default not cancellable. Use `.cancellable()` to mark a promise as cancellable.
*/
// TODO what to do with this?
- cancel(): Promise;
+ cancel(reason?: any): Promise;
/**
* Like `.then()`, but cancellation of the the returned promise or any of its descendant will not propagate cancellation to this promise or this promise's ancestors.
@@ -421,7 +421,7 @@ declare class Promise implements Promise.Thenable, Promise.Inspection {
* Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method.
*/
// TODO how to model promisifyAll?
- static promisifyAll(target: Object, options?: Promise.PromisifyAllOptions): Object;
+ static promisifyAll(target: Object, options?: Promise.PromisifyAllOptions): any;
/**
diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts
index 6abf38f94..e17b7b10c 100644
--- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts
+++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts
@@ -6,17 +6,17 @@ function test_cases() {
$('#datetimepicker').datetimepicker({
pickDate: false
});
- $('#datetimepicker').datetimepicker({
+ $('#datetimepicker').datetimepicker({
pickTime: false
});
- $('#datetimepicker').datetimepicker({
+ $('#datetimepicker').datetimepicker({
minDate: '2012-12-31'
});
-
- $('#datetimepicker').data("DateTimePicker").setMaxDate('2012-12-31');
-
- var startDate = new Date(2012, 1, 20);
- var endDate = new Date(2012, 1, 25);
+
+ $('#datetimepicker').data("DateTimePicker").maxDate('2012-12-31');
+
+ var startDate = moment(new Date(2012, 1, 20));
+ var endDate = moment(new Date(2012, 1, 25));
$('#datetimepicker2')
.datetimepicker()
.on("dp.change", function (ev) {
diff --git a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts
index 228b7537f..bd8a3ff54 100644
--- a/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts
+++ b/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker.d.ts
@@ -10,15 +10,15 @@
*/
///
+///
declare module BootstrapV3DatetimePicker {
- interface DatetimepickerChangeEventObject extends JQueryEventObject {
- date: any;
- oldDate: any;
+ interface DatetimepickerChangeEventObject extends DatetimepickerEventObject {
+ oldDate: moment.Moment;
}
interface DatetimepickerEventObject extends JQueryEventObject {
- date: any;
+ date: moment.Moment;
}
interface DatetimepickerIcons {
@@ -35,33 +35,39 @@ declare module BootstrapV3DatetimePicker {
useSeconds?: boolean;
useCurrent?: boolean;
minuteStepping?: number;
- minDate?: any;
- maxDate?: any;
+ minDate?: moment.Moment | Date | string;
+ maxDate?: moment.Moment | Date | string;
showToday?: boolean;
collapse?: boolean;
language?: string;
- defaultDate?: string;
- disabledDates?: Array;
- enabledDates?: Array;
+ defaultDate?: moment.Moment | Date | string;
+ disabledDates?: Array;
+ enabledDates?: Array;
icons?: DatetimepickerIcons;
useStrict?: boolean;
direction?: string;
sideBySide?: boolean;
- daysOfWeekDisabled?: Array;
+ daysOfWeekDisabled?: Array;
calendarWeeks?: boolean;
format?: string | boolean;
locale?: string;
showTodayButton?: boolean;
+ viewMode?: string;
+ inline?: boolean;
+ toolbarPlacement?: string;
+ showClear?: boolean;
}
interface Datetimepicker {
- setDate(date: any): void;
- setMinDate(date: any): void;
- setMaxDate(date: any): void;
+ date(date: moment.Moment | Date | string): void;
+ date(): moment.Moment;
+ minDate(date: moment.Moment | Date | string): void;
+ minDate(): moment.Moment | boolean;
+ maxDate(date: moment.Moment | Date | string): void;
+ maxDate(): moment.Moment | boolean;
show(): void;
disable(): void;
enable(): void;
- getDate(): void;
}
}
diff --git a/browser-sync/browser-sync.d.ts b/browser-sync/browser-sync.d.ts
index 00c242942..2276f36e5 100644
--- a/browser-sync/browser-sync.d.ts
+++ b/browser-sync/browser-sync.d.ts
@@ -371,7 +371,7 @@ declare module "browser-sync" {
* The stream method returns a transform stream and can act once or on many files.
* @param opts Configuration for the stream method
*/
- stream(opts: { once: boolean }): NodeJS.ReadWriteStream;
+ stream(opts?: { once: boolean }): NodeJS.ReadWriteStream;
/**
* Helper method for browser notifications
* @param message Can be a simple message such as 'Connected' or HTML
diff --git a/browserify/browserify-tests.ts b/browserify/browserify-tests.ts
index 524901566..b4096a7f9 100644
--- a/browserify/browserify-tests.ts
+++ b/browserify/browserify-tests.ts
@@ -2,11 +2,51 @@
import browserify = require("browserify");
import fs = require("fs");
+import stream = require('stream');
-var b: BrowserifyObject = browserify();
+var bNoArg = browserify();
+
+var b = browserify({
+ baseDir: 'somewhere'
+});
b.add('./browser/main.js');
-b.transform('deamdify');
-b.bundle().pipe(fs.createWriteStream('bundle.js'));
+b.transform('deamdify')
+ .transform(function (file) {
+ return new stream.Transform();
+ }).plugin((b, opts) => { return opts.l; }, {l: 3})
+ .require('foo', { expose: 'bar' })
+ .exclude('baz')
+ .ignore('bat')
+ .reset({ basedir: 'elsewhere' });
-var customBrowsify: Browserify = require("browserify");
+b.on('file', (file) => {
+ file += "";
+});
+
+b.external(bNoArg);
+
+var b2 = new browserify(['/some/File', {file: '/some/file' }, fs.createReadStream('/somewhere')], { builtins: ['buffer']})
+ .reset({
+ builtins: {
+ 'buffer': './customBuffer'
+ }
+ });
+
+var customBrowsify = require("browserify");
customBrowsify({entries: []});
+
+var b = browserify('./browser/main.js', {
+ noParse: ['jquery'],
+ debug: true,
+ foo: 'bar'
+});
+b.add('./browser/other.js');
+b.transform(function(file: string): NodeJS.ReadWriteStream {
+ return new stream.PassThrough();
+});
+
+var record_pipeline = b.pipeline.get('record');
+
+b.bundle().pipe(process.stdout);
+
+
diff --git a/browserify/browserify.d.ts b/browserify/browserify.d.ts
index c301df51e..1ce6b653d 100644
--- a/browserify/browserify.d.ts
+++ b/browserify/browserify.d.ts
@@ -1,41 +1,182 @@
-// Type definitions for Browserify
+// Type definitions for Browserify v12.0.1
// Project: http://browserify.org/
-// Definitions by: Andrew Gaspar
+// Definitions by: Andrew Gaspar , John Vilk
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///
-interface BrowserifyObject extends NodeJS.EventEmitter {
- add(file:string, opts?:any): BrowserifyObject;
- require(file:string, opts?:{
- expose: string;
- }): BrowserifyObject;
- bundle(opts?:{
- insertGlobals?: boolean;
- detectGlobals?: boolean;
- debug?: boolean;
- standalone?: string;
- insertGlobalVars?: any;
- }, cb?:(err:any, src:any) => void): NodeJS.ReadableStream;
+declare module Browserify {
+ /**
+ * Options pertaining to an individual file.
+ */
+ interface FileOptions {
+ // If true, this is considered an entry point to your app.
+ entry?: boolean;
+ // Expose this file under a custom dependency name.
+ // require('./vendor/angular/angular.js', {expose: 'angular'}) enables require('angular')
+ expose?: string;
+ // Basedir to use to resolve this file's path.
+ basedir?: string;
+ // The name/path to the file.
+ file?: string;
+ // Forward file to external() to be externalized.
+ external?: boolean;
+ // Disable transforms on file if set to false.
+ transform?: boolean;
+ // The ID to use for require() statements.
+ id?: string;
+ }
- external(file:string, opts?:any): BrowserifyObject;
- ignore(file:string, opts?:any): BrowserifyObject;
- transform(tr:string, opts?:any): BrowserifyObject;
- transform(tr:Function, opts?:any): BrowserifyObject;
- plugin(plugin:string, opts?:any): BrowserifyObject;
- plugin(plugin:Function, opts?:any): BrowserifyObject;
-}
-interface Browserify {
- (): BrowserifyObject;
- (files:string[]): BrowserifyObject;
- (opts:{
- entries?: string[];
+ // Browserify accepts a filename, an input stream for file inputs, or a FileOptions configuration
+ // for each file in a bundle.
+ type InputFile = string | NodeJS.ReadableStream | FileOptions;
+
+ /**
+ * Options pertaining to a Browserify instance.
+ */
+ interface Options {
+ // Custom properties can be defined on Options.
+ // These options are forwarded along to module-deps and browser-pack directly.
+ [propName: string]: any;
+ // String, file object, or array of those types (they may be mixed) specifying entry file(s).
+ entries?: InputFile | InputFile[];
+ // an array which will skip all require() and global parsing for each file in the array.
+ // Use this for giant libs like jquery or threejs that don't have any requires or node-style globals but take forever to parse.
noParse?: string[];
- }): BrowserifyObject;
+ // an array of optional extra extensions for the module lookup machinery to use when the extension has not been specified.
+ // By default Browserify considers only .js and .json files in such cases.
+ extensions?: string[];
+ // the directory that Browserify starts bundling from for filenames that start with ..
+ basedir?: string;
+ // an array of directories that Browserify searches when looking for modules which are not referenced using relative path.
+ // Can be absolute or relative to basedir. Equivalent of setting NODE_PATH environmental variable when calling Browserify command.
+ paths?: string[];
+ // sets the algorithm used to parse out the common paths. Use false to turn this off, otherwise it uses the commondir module.
+ commondir?: boolean;
+ // disables converting module ids into numerical indexes. This is useful for preserving the original paths that a bundle was generated with.
+ fullPaths?: boolean;
+ // sets the list of built-ins to use, which by default is set in lib/builtins.js in this distribution.
+ builtins?: string[] | {[builtinName: string]: string} | boolean;
+ // set if external modules should be bundled. Defaults to true.
+ bundleExternal?: boolean;
+ // When true, always insert process, global, __filename, and __dirname without analyzing the AST for faster builds but larger output bundles. Default false.
+ insertGlobals?: boolean;
+ // When true, scan all files for process, global, __filename, and __dirname, defining as necessary.
+ // With this option npm modules are more likely to work but bundling takes longer. Default true.
+ detectGlobals?: boolean;
+ // When true, add a source map inline to the end of the bundle. This makes debugging easier because you can see all the original files if you are in a modern enough browser.
+ debug?: boolean;
+ // When a non-empty string, a standalone module is created with that name and a umd wrapper.
+ // You can use namespaces in the standalone global export using a . in the string name as a separator, for example 'A.B.C'.
+ // The global export will be sanitized and camel cased.
+ standalone?: string;
+ // will be passed to insert-module-globals as the opts.vars parameter.
+ insertGlobalVars?: {[globalName: string]: (file: string, basedir: string) => any};
+ // defaults to 'require' in expose mode but you can use another name.
+ externalRequireName?: string;
+ }
+
+ interface BrowserifyConstructor {
+ (files: InputFile[], opts?: Options): BrowserifyObject;
+ (file: InputFile, opts?: Options): BrowserifyObject;
+ (opts: Options): BrowserifyObject;
+ (): BrowserifyObject
+ new(files: InputFile[], opts?: Options): BrowserifyObject;
+ new(file: InputFile, opts?: Options): BrowserifyObject;
+ new(opts: Options): BrowserifyObject;
+ new(): BrowserifyObject
+ }
+
+ interface BrowserifyObject extends NodeJS.EventEmitter {
+ /**
+ * Add an entry file from file that will be executed when the bundle loads.
+ * If file is an array, each item in file will be added as an entry file.
+ */
+ add(file: InputFile[], opts?: FileOptions): BrowserifyObject;
+ add(file: InputFile, opts?: FileOptions): BrowserifyObject;
+ /**
+ * Make file available from outside the bundle with require(file).
+ * The file param is anything that can be resolved by require.resolve().
+ * file can also be a stream, but you should also use opts.basedir so that relative requires will be resolvable.
+ * If file is an array, each item in file will be required. In file array form, you can use a string or object for each item. Object items should have a file property and the rest of the parameters will be used for the opts.
+ * Use the expose property of opts to specify a custom dependency name. require('./vendor/angular/angular.js', {expose: 'angular'}) enables require('angular')
+ */
+ require(file: InputFile, opts?: FileOptions): BrowserifyObject;
+ /**
+ * Bundle the files and their dependencies into a single javascript file.
+ * Return a readable stream with the javascript file contents or optionally specify a cb(err, buf) to get the buffered results.
+ */
+ bundle(cb?: (err: any, src: Buffer) => any): NodeJS.ReadableStream;
+ /**
+ * Prevent file from being loaded into the current bundle, instead referencing from another bundle.
+ * If file is an array, each item in file will be externalized.
+ * If file is another bundle, that bundle's contents will be read and excluded from the current bundle as the bundle in file gets bundled.
+ */
+ external(file: string[], opts?: { basedir?: string }): BrowserifyObject;
+ external(file: string, opts?: { basedir?: string }): BrowserifyObject;
+ external(file: BrowserifyObject): BrowserifyObject;
+ /**
+ * Prevent the module name or file at file from showing up in the output bundle.
+ * Instead you will get a file with module.exports = {}.
+ */
+ ignore(file: string, opts?: { basedir?: string }): BrowserifyObject;
+ /**
+ * Prevent the module name or file at file from showing up in the output bundle.
+ * If your code tries to require() that file it will throw unless you've provided another mechanism for loading it.
+ */
+ exclude(file: string, opts?: { basedir?: string }): BrowserifyObject;
+ /**
+ * Transform source code before parsing it for require() calls with the transform function or module name tr.
+ * If tr is a function, it will be called with tr(file) and it should return a through-stream that takes the raw file contents and produces the transformed source.
+ * If tr is a string, it should be a module name or file path of a transform module
+ */
+ transform(tr: string, opts?: T): BrowserifyObject;
+ transform(tr: (file: string, opts: T) => NodeJS.ReadWriteStream, opts?: T): BrowserifyObject;
+ /**
+ * Register a plugin with opts. Plugins can be a string module name or a function the same as transforms.
+ * plugin(b, opts) is called with the Browserify instance b.
+ */
+ plugin(plugin: string, opts?: T): BrowserifyObject;
+ plugin(plugin: (b: BrowserifyObject, opts: T) => any, opts?: T): BrowserifyObject;
+ /**
+ * Reset the pipeline back to a normal state. This function is called automatically when bundle() is called multiple times.
+ * This function triggers a 'reset' event.
+ */
+ reset(opts?: Options): void;
+
+ /**
+ * When a file is resolved for the bundle, the bundle emits a 'file' event with the full file path, the id string passed to require(), and the parent object used by browser-resolve.
+ * You could use the file event to implement a file watcher to regenerate bundles when files change.
+ */
+ on(event: 'file', listener: (file: string, id: string, parent: any) => any): BrowserifyObject;
+ /**
+ * When a package.json file is read, this event fires with the contents.
+ * The package directory is available at pkg.__dirname.
+ */
+ on(event: 'package', listener: (pkg: any) => any): BrowserifyObject;
+ /**
+ * When .bundle() is called, this event fires with the bundle output stream.
+ */
+ on(event: 'bundle', listener: (bundle: NodeJS.ReadableStream) => any): BrowserifyObject;
+ /**
+ * When the .reset() method is called or implicitly called by another call to .bundle(), this event fires.
+ */
+ on(event: 'reset', listener: () => any): BrowserifyObject;
+ /**
+ * When a transform is applied to a file, the 'transform' event fires on the bundle stream with the transform stream tr and the file that the transform is being applied to.
+ */
+ on(event: 'transform', listener: (tr: NodeJS.ReadWriteStream, file: string) => any): BrowserifyObject;
+ on(event: string, listener: Function): BrowserifyObject;
+
+ /**
+ * Set to any until substack/labeled-stream-splicer is defined
+ */
+ pipeline: any;
+ }
}
declare module "browserify" {
- var browserify: Browserify;
+ var browserify: Browserify.BrowserifyConstructor;
export = browserify;
}
diff --git a/buffer-compare/buffer-compare-tests.ts b/buffer-compare/buffer-compare-tests.ts
new file mode 100644
index 000000000..88e6dddb9
--- /dev/null
+++ b/buffer-compare/buffer-compare-tests.ts
@@ -0,0 +1,27 @@
+///
+///
+
+import compare = require('buffer-compare');
+
+let result: number;
+
+result = compare(new Buffer(''), new Buffer(''));
+result = compare([], []);
+result = compare('', '');
+result = compare(new Buffer(''), []);
+result = compare([], '');
+result = compare('', new Buffer(''));
+
+result = compare(new Buffer(''), new Buffer(''));
+result = compare([], []);
+result = compare('', '');
+result = compare(new Buffer(''), []);
+result = compare([], '');
+result = compare('', new Buffer(''));
+
+result = compare(new Buffer(''), new Buffer(''));
+result = compare([], []);
+result = compare('', '');
+result = compare(new Buffer(''), []);
+result = compare([], '');
+result = compare('', new Buffer(''));
diff --git a/buffer-compare/buffer-compare.d.ts b/buffer-compare/buffer-compare.d.ts
new file mode 100644
index 000000000..58e4004dc
--- /dev/null
+++ b/buffer-compare/buffer-compare.d.ts
@@ -0,0 +1,17 @@
+// Type definitions for buffer-compare
+// Project: https://github.com/soldair/node-buffer-compare
+// Definitions by: Ilya Mochalov
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+declare module "buffer-compare" {
+ interface List {
+ [index: number]: any;
+ length: number
+ }
+
+ function compare(cmp: List, to: List): number;
+ function compare(cmp: T, to: T): number;
+ function compare(cmp: C, to: T): number;
+
+ export = compare;
+}
diff --git a/bull/bull-tests.ts.tscparams b/bull/bull-tests.ts.tscparams
new file mode 100644
index 000000000..6641df12d
--- /dev/null
+++ b/bull/bull-tests.ts.tscparams
@@ -0,0 +1 @@
+--target es5 --noImplicitAny --module commonjs
diff --git a/bull/bull-tests.tsx b/bull/bull-tests.tsx
new file mode 100644
index 000000000..bd25efc0c
--- /dev/null
+++ b/bull/bull-tests.tsx
@@ -0,0 +1,102 @@
+/**
+ * Created by Bruno Grieder
+ */
+
+///
+
+
+import * as Queue from "bull"
+
+var videoQueue = Queue( 'video transcoding', 6379, '127.0.0.1' );
+var audioQueue = Queue( 'audio transcoding', 6379, '127.0.0.1' );
+var imageQueue = Queue( 'image transcoding', 6379, '127.0.0.1' );
+
+videoQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => {
+
+ // job.data contains the custom data passed when the job was created
+ // job.jobId contains id of this job.
+
+ // transcode video asynchronously and report progress
+ job.progress( 42 );
+
+ // call done when finished
+ done();
+
+ // or give a error if error
+ done( Error( 'error transcoding' ) );
+
+ // or pass it a result
+ done( null, { framerate: 29.5 /* etc... */ } );
+
+ // If the job throws an unhandled exception it is also handled correctly
+ throw (Error( 'some unexpected error' ));
+} );
+
+audioQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => {
+ // transcode audio asynchronously and report progress
+ job.progress( 42 );
+
+ // call done when finished
+ done();
+
+ // or give a error if error
+ done( Error( 'error transcoding' ) );
+
+ // or pass it a result
+ done( null, { samplerate: 48000 /* etc... */ } );
+
+ // If the job throws an unhandled exception it is also handled correctly
+ throw (Error( 'some unexpected error' ));
+} );
+
+imageQueue.process( ( job: Queue.Job, done: Queue.DoneCallback ) => {
+ // transcode image asynchronously and report progress
+ job.progress( 42 );
+
+ // call done when finished
+ done();
+
+ // or give a error if error
+ done( Error( 'error transcoding' ) );
+
+ // or pass it a result
+ done( null, { width: 1280, height: 720 /* etc... */ } );
+
+ // If the job throws an unhandled exception it is also handled correctly
+ throw (Error( 'some unexpected error' ));
+} );
+
+videoQueue.add( { video: 'http://example.com/video1.mov' } );
+audioQueue.add( { audio: 'http://example.com/audio1.mp3' } );
+imageQueue.add( { image: 'http://example.com/image1.tiff' } );
+
+
+//////////////////////////////////////////////////////////////////////////////////
+//
+// Using Promises
+//
+//////////////////////////////////////////////////////////////////////////////////
+
+const fetchVideo = ( url: string ): Promise => { return null }
+const transcodeVideo = ( data: any ): Promise => { return null }
+
+interface VideoJob extends Queue.Job {
+ data: {url: string}
+}
+
+
+videoQueue.process( ( job: VideoJob ) => { // don't forget to remove the done callback!
+ // Simply return a promise
+ return fetchVideo( job.data.url ).then( transcodeVideo );
+
+ // Handles promise rejection
+ return Promise.reject( new Error( 'error transcoding' ) );
+
+ // Passes the value the promise is resolved with to the "completed" event
+ return Promise.resolve( { framerate: 29.5 /* etc... */ } );
+
+ // If the job throws an unhandled exception it is also handled correctly
+ throw new Error( 'some unexpected error' );
+ // same as
+ return Promise.reject( new Error( 'some unexpected error' ) );
+} );
diff --git a/bull/bull.d.ts b/bull/bull.d.ts
new file mode 100644
index 000000000..b867c1123
--- /dev/null
+++ b/bull/bull.d.ts
@@ -0,0 +1,311 @@
+// Type definitions for bull 0.7.0
+// Project: https://github.com/OptimalBits/bull
+// Definitions by: Bruno Grieder
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+///
+
+
+declare module "bull" {
+
+ import * as Redis from "redis";
+
+ /**
+ * This is the Queue constructor.
+ * It creates a new Queue that is persisted in Redis.
+ * Everytime the same queue is instantiated it tries to process all the old jobs that may exist from a previous unfinished session.
+ */
+ function Bull(queueName: string, redisPort: number, redisHost: string, redisOpt?: Redis.ClientOpts): Bull.Queue;
+
+ module Bull {
+
+ export interface DoneCallback {
+ (error?: Error, value?: any): void
+ }
+
+ export interface Job {
+
+ id: string
+
+ /**
+ * The custom data passed when the job was created
+ */
+ data: Object;
+
+ /**
+ * Report progress on a job
+ */
+ progress(value: any): Promise;
+
+ /**
+ * Removes a Job from the queue from all the lists where it may be included.
+ * @returns {Promise} A promise that resolves when the job is removed.
+ */
+ remove(): Promise;
+
+ /**
+ * Rerun a Job that has failed.
+ * @returns {Promise} A promise that resolves when the job is scheduled for retry.
+ */
+ retry(): Promise;
+ }
+
+ export interface Backoff {
+
+ /**
+ * Backoff type, which can be either `fixed` or `exponential`
+ */
+ type: string
+
+ /**
+ * Backoff delay, in milliseconds
+ */
+ delay: number;
+ }
+
+ export interface AddOptions {
+ /**
+ * An amount of miliseconds to wait until this job can be processed.
+ * Note that for accurate delays, both server and clients should have their clocks synchronized
+ */
+ delay?: number;
+
+ /**
+ * A number of attempts to retry if the job fails [optional]
+ */
+ attempts?: number;
+
+ /**
+ * Backoff setting for automatic retries if the job fails
+ */
+ backoff?: number | Backoff
+
+ /**
+ * A boolean which, if true, adds the job to the right
+ * of the queue instead of the left (default false)
+ */
+ lifo?: boolean;
+
+ /**
+ * The number of milliseconds after which the job should be fail with a timeout error
+ */
+ timeout?: number;
+ }
+
+ export interface Queue {
+
+ /**
+ * Defines a processing function for the jobs placed into a given Queue.
+ *
+ * The callback is called everytime a job is placed in the queue.
+ * It is passed an instance of the job as first argument.
+ *
+ * The done callback can be called with an Error instance, to signal that the job did not complete successfully,
+ * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful.
+ * Errors will be passed as a second argument to the "failed" event;
+ * results, as a second argument to the "completed" event.
+ *
+ * concurrency: Bull will then call you handler in parallel respecting this max number.
+ */
+ process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void;
+
+ /**
+ * Defines a processing function for the jobs placed into a given Queue.
+ *
+ * The callback is called everytime a job is placed in the queue.
+ * It is passed an instance of the job as first argument.
+ *
+ * The done callback can be called with an Error instance, to signal that the job did not complete successfully,
+ * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful.
+ * Errors will be passed as a second argument to the "failed" event;
+ * results, as a second argument to the "completed" event.
+ */
+ process(callback: (job: Job, done: DoneCallback) => void): void;
+
+ /**
+ * Defines a processing function for the jobs placed into a given Queue.
+ *
+ * The callback is called everytime a job is placed in the queue.
+ * It is passed an instance of the job as first argument.
+ *
+ * A promise must be returned to signal job completion.
+ * If the promise is rejected, the error will be passed as a second argument to the "failed" event.
+ * If it is resolved, its value will be the "completed" event's second argument.
+ *
+ * concurrency: Bull will then call you handler in parallel respecting this max number.
+ */
+ process(concurrency: number, callback: (job: Job) => void): Promise;
+
+ /**
+ * Defines a processing function for the jobs placed into a given Queue.
+ *
+ * The callback is called everytime a job is placed in the queue.
+ * It is passed an instance of the job as first argument.
+ *
+ * A promise must be returned to signal job completion.
+ * If the promise is rejected, the error will be passed as a second argument to the "failed" event.
+ * If it is resolved, its value will be the "completed" event's second argument.
+ */
+ process(callback: (job: Job) => void): Promise;
+
+ // process(callback: (job: Job, done?: DoneCallback) => void): Promise;
+
+ /**
+ * Creates a new job and adds it to the queue.
+ * If the queue is empty the job will be executed directly,
+ * otherwise it will be placed in the queue and executed as soon as possible.
+ */
+ add(data: Object, opts?: AddOptions): Promise;
+
+ /**
+ * Returns a promise that resolves when the queue is paused.
+ * The pause is global, meaning that all workers in all queue instances for a given queue will be paused.
+ * A paused queue will not process new jobs until resumed,
+ * but current jobs being processed will continue until they are finalized.
+ *
+ * Pausing a queue that is already paused does nothing.
+ */
+ pause(): Promise;
+
+ /**
+ * Returns a promise that resolves when the queue is resumed after being paused.
+ * The resume is global, meaning that all workers in all queue instances for a given queue will be resumed.
+ *
+ * Resuming a queue that is not paused does nothing.
+ */
+ resume(): Promise;
+
+ /**
+ * Returns a promise that returns the number of jobs in the queue, waiting or paused.
+ * Since there may be other processes adding or processing jobs, this value may be true only for a very small amount of time.
+ */
+ count(): Promise;
+
+ /**
+ * Empties a queue deleting all the input lists and associated jobs.
+ */
+ empty(): Promise;
+
+ /**
+ * Closes the underlying redis client. Use this to perform a graceful shutdown.
+ *
+ * `close` can be called from anywhere, with one caveat:
+ * if called from within a job handler the queue won't close until after the job has been processed
+ */
+ close(): Promise;
+
+ /**
+ * Returns a promise that will return the job instance associated with the jobId parameter.
+ * If the specified job cannot be located, the promise callback parameter will be set to null.
+ */
+ getJob(jobId: string): Promise;
+
+ /**
+ * Tells the queue remove all jobs created outside of a grace period in milliseconds.
+ * You can clean the jobs with the following states: completed, waiting, active, delayed, and failed.
+ */
+ clean(gracePeriod: number, jobsState?: string): Promise;
+
+ /**
+ * Listens to queue events
+ * 'ready', 'error', 'activ', 'progress', 'completed', 'failed', 'paused', 'resumed', 'cleaned'
+ */
+ on(eventName: string, callback: EventCallback): void;
+ }
+
+ interface EventCallback {
+ (...args: any[]): void
+ }
+
+ interface ReadyEventCallback extends EventCallback {
+ (): void;
+ }
+
+ interface ErrorEventCallback extends EventCallback {
+ (error: Error): void;
+ }
+
+ interface JobPromise {
+ /**
+ * Abort this job
+ */
+ cancel(): void
+ }
+
+ interface ActiveEventCallback extends EventCallback {
+ (job: Job, jobPromise: JobPromise): void;
+ }
+
+ interface ProgressEventCallback extends EventCallback {
+ (job: Job, progress: any): void;
+ }
+
+ interface CompletedEventCallback extends EventCallback {
+ (job: Job, result: Object): void;
+ }
+
+ interface FailedEventCallback extends EventCallback {
+ (job: Job, error: Error): void;
+ }
+
+ interface PausedEventCallback extends EventCallback {
+ (): void;
+ }
+
+ interface ResumedEventCallback extends EventCallback {
+ (job?: Job): void;
+ }
+
+ /**
+ * @see clean() for details
+ */
+ interface CleanedEventCallback extends EventCallback {
+ (jobs: Job[], type: string): void;
+ }
+ }
+
+ export = Bull;
+}
+
+declare module "bull/lib/priority-queue" {
+
+ import * as Bull from "bull";
+ import * as Redis from "redis";
+
+ /**
+ * This is the Queue constructor of priority queue.
+ *
+ * It works same a normal queue, with same function and parameters.
+ * The only difference is that the Queue#add() allow an options opts.priority
+ * that could take ["low", "normal", "medium", "hight", "critical"]. If no options provider, "normal" will be taken.
+ *
+ * The priority queue will process more often highter priority jobs than lower.
+ */
+ function PQueue(queueName: string, redisPort: number, redisHost: string, redisOpt?: Redis.ClientOpts): PQueue.PriorityQueue;
+
+ module PQueue {
+
+ export interface AddOptions extends Bull.AddOptions {
+
+ /**
+ * "low", "normal", "medium", "high", "critical"
+ */
+ priority?: string;
+ }
+
+
+ export interface PriorityQueue extends Bull.Queue {
+
+ /**
+ * Creates a new job and adds it to the queue.
+ * If the queue is empty the job will be executed directly,
+ * otherwise it will be placed in the queue and executed as soon as possible.
+ */
+ add(data: Object, opts?: PQueue.AddOptions): Promise;
+
+ }
+ }
+
+ export = PQueue;
+}
diff --git a/bytebuffer/bytebuffer-tests.ts b/bytebuffer/bytebuffer-tests.ts
new file mode 100644
index 000000000..34db7368d
--- /dev/null
+++ b/bytebuffer/bytebuffer-tests.ts
@@ -0,0 +1,8 @@
+///
+
+import ByteBuffer = require("bytebuffer");
+
+var bb = new ByteBuffer()
+ .writeIString("Hello world!")
+ .flip();
+console.log(bb.readIString()+" from bytebuffer.js");
\ No newline at end of file
diff --git a/bytebuffer/bytebuffer.d.ts b/bytebuffer/bytebuffer.d.ts
new file mode 100644
index 000000000..8f1a800ea
--- /dev/null
+++ b/bytebuffer/bytebuffer.d.ts
@@ -0,0 +1,615 @@
+// Type definitions for bytebuffer.js 5.0.0
+// Project: https://github.com/dcodeIO/bytebuffer.js
+// Definitions by: Denis Cappellin
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+// Definitions by: SINTEF-9012
+
+///
+
+declare class ByteBuffer
+{
+ /**
+ * Constructs a new ByteBuffer.
+ */
+ constructor( capacity?: number, littleEndian?: boolean, noAssert?: boolean );
+
+ /**
+ * Big endian constant that can be used instead of its boolean value. Evaluates to false.
+ */
+ static BIG_ENDIAN: boolean;
+
+ /**
+ * Default initial capacity of 16.
+ */
+ static DEFAULT_CAPACITY: number;
+
+ /**
+ * Default no assertions flag of false.
+ */
+ static DEFAULT_NOASSERT: boolean;
+
+ /**
+ * Little endian constant that can be used instead of its boolean value. Evaluates to true.
+ */
+ static LITTLE_ENDIAN: boolean;
+
+ /**
+ * Maximum number of bytes required to store a 32bit base 128 variable-length integer.
+ */
+ static MAX_VARINT32_BYTES: number;
+
+ /**
+ * Maximum number of bytes required to store a 64bit base 128 variable-length integer.
+ */
+ static MAX_VARINT64_BYTES: number;
+
+ /**
+ * Metrics representing number of bytes.Evaluates to 2.
+ */
+ static METRICS_BYTES: number;
+
+ /**
+ * Metrics representing number of UTF8 characters.Evaluates to 1.
+ */
+ static METRICS_CHARS: number;
+
+ /**
+ * ByteBuffer version.
+ */
+ static VERSION: string;
+
+ /**
+ * Backing buffer.
+ */
+ buffer: ArrayBuffer;
+
+ /**
+ * Absolute limit of the contained data. Set to the backing buffer's capacity upon allocation.
+ */
+ limit: number;
+
+ /**
+ * Whether to use little endian byte order, defaults to false for big endian.
+ */
+ littleEndian: boolean;
+
+ /**
+ * Marked offset.
+ */
+ markedOffset: number;
+
+ /**
+ * Whether to skip assertions of offsets and values, defaults to false.
+ */
+ noAssert: boolean;
+
+ /**
+ * Absolute read/write offset.
+ */
+ offset: number;
+
+ /**
+ * Data view to manipulate the backing buffer. Becomes null if the backing buffer has a capacity of 0.
+ */
+ view: DataView;
+
+ /**
+ * Allocates a new ByteBuffer backed by a buffer of the specified capacity.
+ */
+ static allocate( capacity?: number, littleEndian?: number, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a base64 encoded string to binary like window.atob does.
+ */
+ static atob( b64: string ): string;
+
+ /**
+ * Encodes a binary string to base64 like window.btoa does.
+ */
+ static btoa( str: string ): string;
+
+ /**
+ * Calculates the number of UTF8 bytes of a string.
+ */
+ static calculateUTF8Byte( str: string ): number;
+
+ /**
+ * Calculates the number of UTF8 characters of a string.JavaScript itself uses UTF- 16, so that a string's length property does not reflect its actual UTF8 size if it contains code points larger than 0xFFFF.
+ */
+ static calculateUTF8Char( str: string ): number;
+
+ /**
+ * Calculates the actual number of bytes required to store a 32bit base 128 variable-length integer.
+ */
+ static calculateVariant32( value: number ): number;
+
+ /**
+ * Calculates the actual number of bytes required to store a 64bit base 128 variable-length integer.
+ */
+ static calculateVariant64( value: number | Long ): number;
+
+ /**
+ * Concatenates multiple ByteBuffers into one.
+ */
+ static concat( buffers: Array, encoding?: string | boolean, litteEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a base64 encoded string to a ByteBuffer.
+ */
+ static fromBase64( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a binary encoded string, that is using only characters 0x00-0xFF as bytes, to a ByteBuffer.
+ */
+ static fromBinary( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a hex encoded string with marked offsets to a ByteBuffer.
+ */
+ static fromDebug( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a hex encoded string to a ByteBuffer.
+ */
+ static fromHex( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes an UTF8 encoded string to a ByteBuffer.
+ */
+ static fromUTF8( str: string, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Gets the backing buffer type.
+ */
+ static isByteBuffer( bb: any ): boolean;
+
+ /**
+ * Wraps a buffer or a string. Sets the allocated ByteBuffer's ByteBuffer#offset to 0 and its ByteBuffer#limit to the length of the wrapped data.
+ * @param buffer Anything that can be wrapped
+ * @param encoding String encoding if buffer is a string ("base64", "hex", "binary", defaults to "utf8")
+ * @param littleEndian Whether to use little or big endian byte order. Defaults to ByteBuffer.DEFAULT_ENDIAN.
+ * @param noAssert Whether to skip assertions of offsets and values. Defaults to ByteBuffer.DEFAULT_NOASSERT.
+ */
+ static wrap( buffer: ByteBuffer | ArrayBuffer | Uint8Array | string, enc?: string | boolean, littleEndian?: boolean, noAssert?: boolean ): ByteBuffer;
+
+ /**
+ * Decodes a zigzag encoded signed 32bit integer.
+ */
+ static zigZagDecode32( n: number ): number;
+
+ /**
+ * Decodes a zigzag encoded signed 64bit integer.
+ */
+ static zigZagDecode64( n: number | Long ): Long;
+
+ /**
+ * Zigzag encodes a signed 32bit integer so that it can be effectively used with varint encoding.
+ */
+ static zigZagEncode32( n: number ): number;
+
+ /**
+ * Zigzag encodes a signed 64bit integer so that it can be effectively used with varint encoding.
+ */
+ static zigZagEncode64( n: number | Long ): Long;
+
+ /**
+ * Switches (to) big endian byte order.
+ */
+ BE( bigEndian?: boolean ): ByteBuffer;
+
+ /**
+ * Switches (to) little endian byte order.
+ */
+ LE( bigEndian?: boolean ): ByteBuffer;
+
+ /**
+ * Appends some data to this ByteBuffer. This will overwrite any contents behind the specified offset up to the appended data's length.
+ */
+ append( source: ByteBuffer | ArrayBuffer | Uint8Array | string, encoding?: string | number, offset?: number ): ByteBuffer;
+
+ /**
+ * Appends this ByteBuffer's contents to another ByteBuffer. This will overwrite any contents behind the specified offset up to the length of this ByteBuffer's data.
+ */
+ appendTo( target: ByteBuffer, offset?: number ): ByteBuffer;
+
+ /**
+ * Enables or disables assertions of argument types and offsets. Assertions are enabled by default but you can opt to disable them if your code already makes sure that everything is valid.
+ */
+ assert( assert: boolean ): ByteBuffer;
+
+ /**
+ * Gets the capacity of this ByteBuffer's backing buffer.
+ */
+ capacity(): number;
+
+ /**
+ * Clears this ByteBuffer's offsets by setting ByteBuffer#offset to 0 and
+ * ByteBuffer#limit to the backing buffer's capacity. Discards ByteBuffer#markedOffset.
+ */
+ clear(): ByteBuffer;
+
+ /**
+ * Creates a cloned instance of this ByteBuffer, preset with this ByteBuffer's values for ByteBuffer#offset, ByteBuffer#markedOffset and ByteBuffer#limit.
+ */
+ clone( copy?: boolean ): ByteBuffer;
+
+ /**
+ * Compacts this ByteBuffer to be backed by a ByteBuffer#buffer of its contents' length. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. Will set offset = 0 and limit = capacity and adapt ByteBuffer#markedOffset to the same relative position if set.
+ */
+ compact( begin?: number, end?: number ): ByteBuffer;
+
+ /**
+ * Creates a copy of this ByteBuffer's contents. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit.
+ */
+ copy( begin?: number, end?: number ): ByteBuffer;
+
+ /**
+ * Copies this ByteBuffer's contents to another ByteBuffer. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit.
+ */
+ copyTo( target: ByteBuffer, targetOffset?: number, sourceOffset?: number, sourceLimit?: number ): ByteBuffer;
+
+ /**
+ * Makes sure that this ByteBuffer is backed by a ByteBuffer#buffer of at least the specified capacity. If the current capacity is exceeded, it will be doubled. If double the current capacity is less than the required capacity, the required capacity will be used instead.
+ */
+ ensureCapacity( capacity: number ): ByteBuffer;
+
+ /**
+ * Overwrites this ByteBuffer's contents with the specified value. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit.
+ */
+ fill( value: number | string, begin?: number, end?: number ): ByteBuffer;
+
+ /**
+ * Makes this ByteBuffer ready for a new sequence of write or relative read operations. Sets limit = offset and offset = 0. Make sure always to flip a ByteBuffer when all relative read or write operations are complete.
+ */
+ flip(): ByteBuffer;
+
+ /**
+ * Marks an offset on this ByteBuffer to be used later.
+ */
+ mark( offset?: number ): ByteBuffer;
+
+ /**
+ * Sets the byte order.
+ */
+ order( littleEndian: boolean ): ByteBuffer;
+
+ /**
+ * Prepends some data to this ByteBuffer. This will overwrite any contents before the specified offset up to the prepended data's length. If there is not enough space available before the specified offset, the backing buffer will be resized and its contents moved accordingly.
+ */
+ prepend( source: ByteBuffer | string | ArrayBuffer, encoding?: string | number, offset?: number ): ByteBuffer;
+
+ /**
+ * Prepends this ByteBuffer to another ByteBuffer. This will overwrite any contents before the specified offset up to the prepended data's length. If there is not enough space available before the specified offset, the backing buffer will be resized and its contents moved accordingly.
+ */
+ prependTo( target: ByteBuffer, offset?: number ): ByteBuffer;
+
+ /**
+ * Prints debug information about this ByteBuffer's contents.
+ */
+ printDebug( out?: ( text: string ) => void ): void;
+
+ /**
+ * Reads an 8bit signed integer. This is an alias of ByteBuffer#readInt8.
+ */
+ readByte( offset?: number ): number;
+
+ /**
+ * Reads a NULL-terminated UTF8 encoded string. For this to work the string read must not contain any NULL characters itself.
+ */
+ readCString( offset?: number ): string;
+
+ /**
+ * Reads a 64bit float. This is an alias of ByteBuffer#readFloat64.
+ */
+ readDouble( offset?: number ): number;
+
+ /**
+ * Reads a 32bit float. This is an alias of ByteBuffer#readFloat32.
+ */
+ readFloat( offset?: number ): number;
+
+ /**
+ * Reads a 32bit float.
+ */
+ readFloat32( offset?: number ): number;
+
+ /**
+ * Reads a 64bit float.
+ */
+ readFloat64( offset?: number ): number;
+
+ /**
+ * Reads a length as uint32 prefixed UTF8 encoded string.
+ */
+ readIString( offset?: number ): string;
+
+ /**
+ * Reads a 32bit signed integer.This is an alias of ByteBuffer#readInt32.
+ */
+ readInt( offset?: number ): number;
+
+ /**
+ * Reads a 16bit signed integer.
+ */
+ readInt16( offset?: number ): number;
+
+ /**
+ * Reads a 32bit signed integer.
+ */
+ readInt32( offset?: number ): number;
+
+ /**
+ * Reads a 64bit signed integer.
+ */
+ readInt64( offset?: number ): Long;
+
+ /**
+ * Reads an 8bit signed integer.
+ */
+ readInt8( offset?: number ): number;
+
+ /**
+ * Reads a 64bit signed integer. This is an alias of ByteBuffer#readInt64.
+ */
+ readLong( offset?: number ): Long;
+
+ /**
+ * Reads a 16bit signed integer. This is an alias of ByteBuffer#readInt16.
+ */
+ readShort( offset?: number ): number;
+
+ /**
+ * Reads an UTF8 encoded string. This is an alias of ByteBuffer#readUTF8String.
+ */
+ readString( length: number, metrics?: number, offset?: number ): string;
+
+ /**
+ * Reads an UTF8 encoded string.
+ */
+ readUTF8String( chars: number, offset?: number ): string;
+
+ /**
+ * Reads a 16bit unsigned integer.
+ */
+ readUint16( offset?: number ): number;
+
+ /**
+ * Reads a 32bit unsigned integer.
+ */
+ readUint32( offset?: number ): number;
+
+ /**
+ * Reads a 64bit unsigned integer.
+ */
+ readUint64( offset?: number ): Long;
+ /**
+ * Reads an 8bit unsigned integer.
+ */
+ readUint8( offset?: number ): number;
+
+ /**
+ * Reads a length as varint32 prefixed UTF8 encoded string.
+ */
+ readVString( offset?: number ): string;
+
+ /**
+ * Reads a 32bit base 128 variable-length integer.
+ */
+ readVarint32( offset?: number ): number;
+
+ /**
+ * Reads a zig-zag encoded 32bit base 128 variable-length integer.
+ */
+ readVarint32ZiZag( offset?: number ): number;
+
+ /**
+ * Reads a 64bit base 128 variable-length integer. Requires Long.js.
+ */
+ readVarint64( offset?: number ): Long;
+
+ /**
+ * Reads a zig-zag encoded 64bit base 128 variable-length integer. Requires Long.js.
+ */
+ readVarint64ZigZag( offset?: number ): Long;
+
+ /**
+ * Gets the number of remaining readable bytes. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit, so this returns limit - offset.
+ */
+ remaining(): number;
+
+ /**
+ * Resets this ByteBuffer's ByteBuffer#offset. If an offset has been marked through ByteBuffer#mark before, offset will be set to ByteBuffer#markedOffset, which will then be discarded. If no offset has been marked, sets offset = 0.
+ */
+ reset(): ByteBuffer;
+
+ /**
+ * Resizes this ByteBuffer to be backed by a buffer of at least the given capacity. Will do nothing if already that large or larger.
+ */
+ resize( capacity: number ): ByteBuffer;
+
+ /**
+ * Reverses this ByteBuffer's contents
+ */
+ reverse( begin?: number, end?: number ): ByteBuffer;
+
+ /**
+ * Skips the next length bytes. This will just advance
+ */
+ skip( length: number ): ByteBuffer;
+
+ /**
+ * Slices this ByteBuffer by creating a cloned instance with offset = begin and limit = end.
+ */
+ slice( begin?: number, end?: number ): ByteBuffer;
+
+ /**
+ * Returns a raw buffer compacted to contain this ByteBuffer's contents. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. Will transparently ByteBuffer#flip this ByteBuffer if offset > limit but the actual offsets remain untouched. This is an alias of ByteBuffer#toBuffer.
+ */
+ toArrayBuffer( forceCopy?: boolean ): ArrayBuffer;
+
+ /**
+ * Encodes this ByteBuffer's contents to a base64 encoded string.
+ */
+ toBase64( begin?: number, end?: number ): string;
+
+ /**
+ * Encodes this ByteBuffer to a binary encoded string, that is using only characters 0x00-0xFF as bytes.
+ */
+ toBinary( begin?: number, end?: number ): string;
+
+ /**
+ * Returns a copy of the backing buffer that contains this ByteBuffer's contents. Contents are the bytes between ByteBuffer#offset and ByteBuffer#limit. Will transparently ByteBuffer#flip this ByteBuffer if offset > limit but the actual offsets remain untouched.
+ */
+ toBuffer( forceCopy?: boolean ): ArrayBuffer;
+
+ /**
+ *Encodes this ByteBuffer to a hex encoded string with marked offsets. Offset symbols are:
+ * < : offset,
+ * ' : markedOffset,
+ * > : limit,
+ * | : offset and limit,
+ * [ : offset and markedOffset,
+ * ] : markedOffset and limit,
+ * ! : offset, markedOffset and limit
+ */
+ toDebug( columns?: boolean ): string | Array
+
+ /**
+ * Encodes this ByteBuffer's contents to a hex encoded string.
+ */
+ toHex( begin?: number, end?: number ): string;
+
+ /**
+ * Converts the ByteBuffer's contents to a string.
+ */
+ toString( encoding?: string ): string;
+
+ /**
+ * Encodes this ByteBuffer's contents between ByteBuffer#offset and ByteBuffer#limit to an UTF8 encoded string.
+ */
+ toUTF8(): string;
+
+ /**
+ * Writes an 8bit signed integer. This is an alias of ByteBuffer#writeInt8.
+ */
+ writeByte( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a NULL-terminated UTF8 encoded string. For this to work the specified string must not contain any NULL characters itself.
+ */
+ writeCString( str: string, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 64bit float. This is an alias of ByteBuffer#writeFloat64.
+ */
+ writeDouble( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 32bit float. This is an alias of ByteBuffer#writeFloat32.
+ */
+ writeFloat( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 32bit float.
+ */
+ writeFloat32( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 64bit float.
+ */
+ writeFloat64( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a length as uint32 prefixed UTF8 encoded string.
+ */
+ writeIString( str: string, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 32bit signed integer. This is an alias of ByteBuffer#writeInt32.
+ */
+ writeInt( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 16bit signed integer.
+ */
+ writeInt16( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 32bit signed integer.
+ */
+ writeInt32( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 64bit signed integer.
+ */
+ writeInt64( value: number | Long, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes an 8bit signed integer.
+ */
+ writeInt8( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 16bit signed integer. This is an alias of ByteBuffer#writeInt16.
+ */
+ writeShort( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes an UTF8 encoded string.This is an alias of ByteBuffer#writeUTF8String.
+ */
+ WriteString( str: string, offset?: number ): ByteBuffer | number;
+
+ /**
+ * Writes an UTF8 encoded string.
+ */
+ writeUTF8String( str: string, offset?: number ): ByteBuffer | number;
+
+ /**
+ * Writes a 16bit unsigned integer.
+ */
+ writeUint16( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 32bit unsigned integer.
+ */
+ writeUint32( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a 64bit unsigned integer.
+ */
+ writeUint64( value: number | Long, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes an 8bit unsigned integer.
+ */
+ writeUint8( value: number, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a length as varint32 prefixed UTF8 encoded string.
+ */
+ writeVString( str: string, offset?: number ): ByteBuffer | number;
+
+ /**
+ * Writes a 32bit base 128 variable-length integer.
+ */
+ writeVarint32( value: number, offset?: number ): ByteBuffer | number;
+
+ /**
+ * Writes a zig-zag encoded 32bit base 128 variable-length integer.
+ */
+ writeVarint32ZigZag( value: number, offset?: number ): ByteBuffer | number;
+
+ /**
+ * Writes a 64bit base 128 variable-length integer.
+ */
+ writeVarint64( value: number | Long, offset?: number ): ByteBuffer;
+
+ /**
+ * Writes a zig-zag encoded 64bit base 128 variable-length integer.
+ */
+ writeVarint64ZigZag( value: number | Long, offset?: number ): ByteBuffer | number;
+}
+
+declare module 'bytebuffer' {
+ export = ByteBuffer;
+}
diff --git a/cal-heatmap/cal-heatmap-tests.ts b/cal-heatmap/cal-heatmap-tests.ts
new file mode 100644
index 000000000..4a7b0cb94
--- /dev/null
+++ b/cal-heatmap/cal-heatmap-tests.ts
@@ -0,0 +1,723 @@
+///
+///
+///
+
+var cal = new CalHeatMap();
+cal.init();
+cal.init({});
+
+cal.init({ itemSelector: "div" });
+cal.init({ itemSelector: "#id" });
+cal.init({ itemSelector: ".class" });
+cal.init({ itemSelector: "[title=hi]" });
+cal.init({ itemSelector: "div > span + b" });
+
+cal.init({ itemSelector: document.getElementById("myId") });
+cal.init({ itemSelector: document.getElementsByClassName(".class")[0] });
+cal.init({ itemSelector: document.querySelector(".class") });
+cal.init({ itemSelector: $(".class")[0] });
+cal.init({ itemSelector: d3.select(".class")[0][0] });
+
+cal.init({
+ itemSelector: "#domain-a",
+ domain: "month",
+ subDomain: "day",
+ cellSize: 20,
+ subDomainTextFormat: "%d",
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#domain-b",
+ domain: "month",
+ subDomain: "x_day",
+ cellSize: 20, subDomainTextFormat: "%d",
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#cellSize-a",
+ domain: "day",
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#cellSize-b",
+ domain: "day",
+ range: 1,
+ cellSize: 15,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#cellPadding-a",
+ domain: "day",
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#cellPadding-b",
+ domain: "day",
+ range: 1,
+ cellPadding: 5,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#cellRadius-a",
+ cellSize: 15,
+ domain: "day",
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#cellRadius-b",
+ cellSize: 15,
+ domain: "day",
+ range: 1,
+ cellRadius: 10,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#domainGutter-a",
+ domain: "day",
+ range: 2,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#domainGutter-b",
+ domain: "day",
+ range: 2,
+ domainGutter: 10,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#domainMargin-a",
+ domain: "day",
+ range: 2,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#domainMargin-b",
+ domain: "day",
+ range: 2,
+ displayLegend: false,
+ domainMargin: 10
+});
+
+cal.init({
+ itemSelector: "#domainDynamicDimension-a",
+ domain: "month",
+ range: 5,
+ cellSize: 8,
+ displayLegend: false,
+ nextSelector: "#domainDynamicDimension-next",
+ previousSelector: "#domainDynamicDimension-previous"
+});
+
+cal.init({
+ itemSelector: "#domainDynamicDimension-b",
+ domain: "month",
+ range: 5,
+ cellSize: 8,
+ displayLegend: false,
+ domainDynamicDimension: false,
+ nextSelector: "#domainDynamicDimension-next",
+ previousSelector: "#domainDynamicDimension-previous",
+ itemNamespace: "domainDynamicDimension"
+});
+
+cal.init({
+ itemSelector: "#verticalOrientation-a",
+ domain: "day",
+ range: 2,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#verticalOrientation-b",
+ domain: "day",
+ range: 2,
+ displayLegend: false,
+ verticalOrientation: true
+});
+
+cal.init({
+ itemSelector: "#label-a",
+ domain: "day",
+ range: 2,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#label-b",
+ domain: "day",
+ range: 2,
+ displayLegend: false,
+ label: {
+ position: "top"
+ }
+});
+
+cal.init({
+ itemSelector: "#label-c",
+ domain: "day",
+ range: 2,
+ displayLegend: false,
+ label: {
+ position: "left",
+ width: 46
+ }
+});
+
+cal.init({
+ itemSelector: "#label-d",
+ domain: "day",
+ range: 2,
+ displayLegend: false,
+ label: {
+ position: "right",
+ width: 46,
+ offset: { x: 10, y: 30 }
+ }
+});
+
+cal.init({
+ itemSelector: "#label-e",
+ domain: "day",
+ range: 2,
+ displayLegend: false,
+ label: {
+ position: "left",
+ width: 46,
+ rotate: "left"
+ }
+});
+
+cal.init({
+ itemSelector: "#label-f",
+ domain: "day",
+ range: 2,
+ displayLegend: false,
+ label: {
+ position: "right",
+ width: 150,
+ rotate: "left"
+ }
+});
+
+cal.init({
+ itemSelector: "#label-g",
+ domain: "day",
+ range: 2,
+ displayLegend: false,
+ label: {
+ position: "right",
+ width: 46,
+ rotate: "left"
+ }
+});
+
+cal.init({
+ itemSelector: "#label-h",
+ domain: "day",
+ range: 2,
+ displayLegend: false,
+ label: {
+ position: "right",
+ width: 46,
+ rotate: "right",
+ align: "right"
+ }
+});
+
+cal.init({
+ itemSelector: "#colLimit-a",
+ domain: "day",
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#colLimit-b",
+ domain: "day",
+ colLimit: 24,
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#rowLimit-a",
+ domain: "month",
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#rowLimit-b",
+ domain: "month",
+ rowLimit: 10,
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#tooltip-a",
+ domain: "month",
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#tooltip-b",
+ domain: "month",
+ range: 1,
+ displayLegend: false,
+ tooltip: true
+});
+
+cal.init({
+ itemSelector: "#start-a",
+ domain: "day",
+ range: 2,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#start-b",
+ domain: "day",
+ range: 2,
+ start: new Date(2000, 0, 15),
+ displayLegend: false
+});
+
+cal.init({
+ start: new Date(2000, 0), // January, 1st 2000
+ range: 12,
+ domain: "year",
+ subDomain: "month",
+ data: "http://localhost/api?start={{d:start}}&stop={{d:end}}"
+});
+
+cal.init({
+ data: "http://localhost/datas.csv",
+ dataType: "csv"
+});
+
+var dt = new Date();
+dt.setDate(dt.getDate() + 1);
+cal.init({
+ itemSelector: "#highlight-a",
+ domain: "day",
+ range: 2,
+ displayLegend: false,
+ highlight: ["now", dt]
+});
+
+cal.init({
+ itemSelector: "#weekStartOnMonday-a",
+ domain: "month",
+ subDomain: "x_day",
+ cellSize: 20,
+ subDomainTextFormat: "%d",
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#weekStartOnMonday-b",
+ domain: "month",
+ subDomain: "x_day",
+ cellSize: 20,
+ subDomainTextFormat: "%d",
+ range: 1,
+ weekStartOnMonday: false,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#minDate-a",
+ domain: "month",
+ start: new Date(2000, 4),
+ minDate: new Date(2000, 1),
+ maxDate: new Date(2000, 8),
+ subDomain: "day",
+ range: 4,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#legend-a",
+ domain: "day",
+ range: 2
+});
+
+cal.init({
+ itemSelector: "#legend-b",
+ domain: "day",
+ range: 2, legend: [-2.5, 0, 2.5]
+});
+
+cal.init({
+ itemSelector: "#displayLegend-a",
+ domain: "day",
+ range: 2
+});
+
+cal.init({
+ itemSelector: "#displayLegend-b",
+ domain: "day",
+ range: 2,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#legendCellSize-a",
+ domain: "day",
+ range: 2
+});
+
+cal.init({
+ itemSelector: "#legendCellSize-b",
+ domain: "day",
+ range: 2, legendCellSize: 5
+});
+
+cal.init({
+ itemSelector: "#legendCellPadding-a",
+ domain: "day",
+ range: 3
+});
+
+cal.init({
+ itemSelector: "#legendCellPadding-b",
+ domain: "day",
+ range: 3, legendCellPadding: 5
+});
+
+cal.init({
+ itemSelector: "#legendMargin-a",
+ domain: "day",
+ range: 3
+});
+
+cal.init({
+ itemSelector: "#legendMargin-b",
+ domain: "day",
+ range: 3,
+ legendMargin: [50, 0, 0, 50]
+});
+
+cal.init({
+ itemSelector: "#legendVerticalPosition-a",
+ domain: "day",
+ range: 2
+});
+
+cal.init({
+ itemSelector: "#legendVerticalPosition-b",
+ domain: "day",
+ range: 2,
+ legendVerticalPosition: "top",
+ legendMargin: [0, 0, 10, 0]
+});
+
+cal.init({
+ itemSelector: "#legendVerticalPosition-c",
+ domain: "day",
+ range: 2,
+ legendVerticalPosition: "center",
+ legendMargin: [0, 10, 0, 0]
+});
+
+cal.init({
+ itemSelector: "#legendVerticalPosition-d",
+ domain: "day",
+ range: 2,
+ legendVerticalPosition: "center",
+ legendHorizontalPosition: "right",
+ legendMargin: [0, 0, 0, 10]
+});
+
+cal.init({
+ itemSelector: "#legendHorizontalPosition-a",
+ domain: "day",
+ range: 3
+});
+
+cal.init({
+ itemSelector: "#legendHorizontalPosition-b",
+ domain: "day",
+ range: 3,
+ legendHorizontalPosition: "right"
+});
+
+cal.init({
+ itemSelector: "#legendOrientation-a",
+ domain: "day",
+ range: 3,
+ legendVerticalPosition: "center",
+ legendOrientation: "vertical",
+ legendMargin: [0, 10, 0, 0]
+});
+
+cal.init({
+ itemSelector: "#legendOrientation-b",
+ domain: "month",
+ subDomain: "x_day",
+ range: 3,
+ verticalOrientation: true,
+ legendVerticalPosition: "center",
+ legendHorizontalPosition: "right",
+ legendOrientation: "vertical",
+ legendMargin: [0, 0, 0, 20]
+});
+
+cal.init({
+ legendColors: {
+ min: "#efefef",
+ max: "steelblue",
+ empty: "white"
+ // Will use the CSS for the missing keys
+ }
+});
+
+cal.init({
+ legendColors: ["#efefef", "steelblue"]
+});
+
+cal.init({
+ itemName: ["cat", "cats"]
+});
+cal.init({
+ itemName: "cat"
+});
+cal.init({
+ itemName: ["cat"]
+});
+
+cal.init({
+ subDomainDateFormat: function(date: Date): string
+ {
+ return date.toString();
+ }
+});
+
+cal.init({
+ itemSelector: "#subDomainTextFormat-a",
+ start: new Date(2000, 0, 1, 1),
+ domain: "month",
+ subDomain: "x_day",
+ cellSize: 20,
+ range: 1,
+ displayLegend: false,
+ subDomainTextFormat: "%d"
+});
+
+cal.init({
+ itemSelector: "#subDomainTextFormat-b",
+ start: new Date(2000, 0, 1, 1),
+ data: "datas-years.json",
+ domain: "month",
+ subDomain: "x_day",
+ cellSize: 20,
+ range: 1,
+ displayLegend: false,
+ subDomainTextFormat: function(date: Date, value: number): number
+ {
+ return value;
+ }
+});
+
+cal.init({
+ itemSelector: "#domainLabelFormat-a",
+ domain: "month",
+ subDomain: "day",
+ range: 1,
+ displayLegend: false
+});
+
+cal.init({
+ itemSelector: "#domainLabelFormat-b",
+ domain: "month",
+ subDomain: "day",
+ range: 1,
+ displayLegend: false,
+ domainLabelFormat: "%m-%Y"
+});
+
+cal.init({
+ itemSelector: "#legendTitleFormat-a",
+ domain: "day",
+ range: 3
+});
+
+cal.init({
+ itemSelector: "#animationDuration-a",
+ domain: "day",
+ range: 4,
+ previousSelector: "#animationDuration-previous",
+ nextSelector: "#animationDuration-next",
+ itemNamespace: "animationDuration-a"
+});
+
+cal.init({
+ itemSelector: "#animationDuration-b",
+ domain: "day",
+ range: 4, animationDuration: 1500,
+ previousSelector: "#animationDuration-previous",
+ nextSelector: "#animationDuration-next",
+ itemNamespace: "animationDuration-b"
+});
+
+cal.init({
+ itemSelector: "#previousSelector-a",
+ domain: "day",
+ range: 4,
+ previousSelector: "#previousSelector-a-previous",
+ nextSelector: "#previousSelector-a-next"
+});
+
+cal.init({
+ itemSelector: "#previousSelector-b",
+ domain: "day",
+ range: 4,
+ previousSelector: "#example-previousSelector ul + p > em",
+ nextSelector: "#example-previousSelector [title=next] li"
+});
+
+cal.init({
+ nextSelector: "#next" // Attach #next onClick event to cal.next()
+});
+
+cal.init({
+ nextSelector: "#next",
+ // Attach #next.cal onClick event to cal.next()
+ itemNamespace: "cal"
+});
+
+
+cal.previous();
+cal.previous(5);
+
+cal.next();
+cal.next(5);
+
+cal.jumpTo(new Date(2000, 4));
+cal.jumpTo(new Date(2000, 4), true);
+
+cal.rewind();
+
+var randomData = {};
+cal.update(randomData);
+cal.update(randomData, () => { }, cal.RESET_ALL_ON_UPDATE);
+cal.update(randomData, false, cal.APPEND_ON_UPDATE);
+cal.update(randomData, false, cal.RESET_SINGLE_ON_UPDATE);
+
+cal.highlight(new Date(2000, 0, 2));
+
+// Add January 5th to already highlighted dates
+cal.options.highlight.push(new Date(2000, 0, 5));
+cal.highlight(cal.options.highlight);
+
+var svg: string = cal.getSVG();
+
+
+cal.options.legendVerticalPosition = "center";
+cal.options.legendHorizontalPosition = "right";
+cal.options.legendOrientation = "vertical";
+
+
+cal.setLegend();
+
+cal.removeLegend();
+
+cal.showLegend();
+
+cal = cal.destroy();
+
+
+cal.init({
+ itemSelector: "#onClick-a",
+ domain: "day",
+ range: 5, data: "datas-years.json",
+ start: new Date(2000, 0),
+ onClick: function(date: Date, nb: number)
+ {
+ $("#onClick-placeholder").html("You just clicked on " +
+ date + " with " +
+ (nb === null ? "unknown" : nb) + " items"
+ );
+ }
+});
+
+cal.init({
+ itemSelector: "#afterLoad-a",
+ domain: "day",
+ range: 5,
+ afterLoad: function() { },
+ onComplete: function() { }
+});
+
+cal.init({
+ itemSelector: "#afterLoadPreviousDomain-a",
+ domain: "day",
+ range: 5, afterLoadPreviousDomain: function(date: Date) { },
+ previousSelector: "#afterLoadPreviousDomain-selector"
+});
+
+cal.init({
+ itemSelector: "#afterLoadNextDomain-a",
+ domain: "day",
+ range: 5, afterLoadNextDomain: function(date: Date) { },
+ nextSelector: "#afterLoadNextDomain-selector"
+});
+
+cal.init({
+ itemSelector: "#onComplete-a",
+ domain: "day",
+ range: 5,
+ onComplete: function() { }
+});
+
+var datas = [
+ { date: 946702811, value: 15 },
+ { date: 946702812, value: 25 },
+ { date: 946702813, value: 10 }
+]
+
+cal.init({
+ data: datas,
+ afterLoadData: (data: any) =>
+ {
+ var stats: CalHeatMap.DataFormat = {};
+ for (var d in data)
+ {
+ stats[data[d].date] = data[d].value;
+ }
+ return stats;
+ }
+});
+
+cal.init({
+ itemSelector: "#onMinDomainReached-a",
+ domain: "month",
+ range: 5,
+ start: new Date(2000, 4),
+ minDate: new Date(2000, 3),
+ maxDate: new Date(2000, 11),
+ onMinDomainReached: function(hit: boolean) { },
+ onMaxDomainReached: function(hit: boolean) { },
+ nextSelector: "#onMinDomainReached-next",
+ previousSelector: "#onMinDomainReached-previous",
+ displayLegend: false
+});
diff --git a/cal-heatmap/cal-heatmap.d.ts b/cal-heatmap/cal-heatmap.d.ts
new file mode 100644
index 000000000..b54e3a5bf
--- /dev/null
+++ b/cal-heatmap/cal-heatmap.d.ts
@@ -0,0 +1,514 @@
+// Type definitions for cal-heatmap v3.5.4
+// Project: https://github.com/wa0x6e/cal-heatmap
+// Definitions by: Chris Baker
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+
+declare module CalHeatMap
+{
+ interface CalHeatMapStatic
+ {
+ new (): CalHeatMap;
+ }
+
+ interface CalHeatMap
+ {
+ /**
+ * Initialise the CalHeatMap with the specified options
+ * @param {InitOptions} options The CalHeatMap options
+ */
+ init(options?: InitOptions): void;
+
+ options: RuntimeOptions;
+
+ // Various update mode when using the update() API
+ /** Reset the whole calendar data before inserting the new data. */
+ RESET_ALL_ON_UPDATE: number;
+ /**
+ * Update only the dates (subDomain) you pass in the data argument, replace their value by the new ones.
+ * All other dates are leaved untouched.
+ */
+ RESET_SINGLE_ON_UPDATE: number;
+ /**
+ * Instead of replacing a date's value by a new one, increment it by the new value. All other dates are leaved untouched.
+ * That's the one you want to use of you're populating the calendar in realtime!
+ */
+ APPEND_ON_UPDATE: number;
+
+ /**
+ * Shift the calendar n domains back
+ * @param {number} n The number of domains to shift back. The default is 1.
+ */
+ previous(n?: number): void;
+ /**
+ * Shift the calendar n domains forward
+ * @param {number} n The number of domains to shift forward. The default is 1.
+ */
+ next(n?: number): void;
+ /**
+ * Jump the calendar to the specified date
+ * This method will shift the calendar backward or forward, until the domain containing the specified date is visible.
+ * @param {Date} date The date to jump to.
+ * @param {boolean} reset Whether to set the domain with the specified as the calendar's first domain.
+ */
+ jumpTo(date: Date, reset?: boolean): void;
+ /** Reset the calendar back to the start date */
+ rewind(): void;
+ /**
+ * Update the calendar with new data
+ * Use update() when you want to refresh the calendar with a new set of data.
+ * Particularly useful if you're filling the calendar in realtime, or if you want to display a subset of the current data.
+ * @param {string|Object} data Accept the same format as the data option.
+ * @param {} afterLoad Whether to execute the afterLoad() callback to convert your data into the json object, expected by cal-heatmap.
+ * It can also directly takes a function, in case your data can not be converted with the afterLoad() function you defined.
+ * @param {} updateMode Define how to insert the new data into the calendar.
+ * Accepted values are:
+ * Instance.RESET_ALL_ON_UPDATE (default) Reset the whole calendar data before inserting the new data.
+ * Instance.RESET_SINGLE_ON_UPDATE Update only the dates (subDomain) you pass in the data argument,
+ * replace their value by the new ones. All other dates are leaved untouched.
+ * Instance.APPEND_ON_UPDATE Instead of replacing a date's value by a new one, increment it by the new value.
+ * All other dates are leaved untouched. That's the one you want to use of you're
+ * populating the calendar in realtime!
+ */
+ update(data: string | Object, afterLoad?: boolean | Function, updateMode?: number): void;
+ /**
+ * Change the highlighted dates.
+ * Takes an array of Date object. Can also accepts the now string, equivalent to Date.now().
+ * @param {string|Date|Date[]} dates The date or dates to highlight.
+ */
+ highlight(dates: string | Date | Date[]): void;
+ /**
+ * Return the SVG source code with the appropriate CSS
+ * The returned string code is valid and ready to be placed in a .svg file.
+ * @returns SVG source code with the appropriate CSS.
+ */
+ getSVG(): string;
+ /**
+ * Change the legend settings and/or threshold
+ * When called without arguments, setLegend() will just redraw the legend.
+ * @param {} legend Same as legend : an array of thresholds
+ * @param {} legendColor Same as legendColors : an object with the heatmap's colors, or an array of 2 colors
+ */
+ setLegend(legend?: number[], legendColors?: LegendColor | string[]): void;
+ /**
+ * Remove the legend from the calendar
+ * Settings are kept and you can re-add the legend with the same settings using showLegend().
+ */
+ removeLegend(): void;
+ /** Display the legend, if not already shown. */
+ showLegend(): void;
+ /**
+ * Remove the calendar from the DOM
+ * Remember to self-assign the result of destroy() to your calendar instance, or it'll lead to a memory leak.
+ * @param {Function} callback function that will be executed when the calendar is removed from the DOM, at the end of the animation.
+ * @returns always returns null.
+ */
+ destroy(callback?: Function): CalHeatMap;
+ }
+
+ interface LegendColor
+ {
+ /** Color of the smallest value on the legend */
+ min: string;
+ /** Color of the highest value on the legend */
+ max: string;
+ /** Color for the dates with value == 0 */
+ empty?: string;
+ /** Base color of the date cells */
+ base?: string;
+ /** Color for the special value */
+ overflow?: string;
+ }
+
+ interface InitOptions
+ {
+ // ================================================
+ // Presentation
+ // ================================================
+
+ /** DOM node to insert the calendar in. Default: "#cal-heatmap" */
+ itemSelector?: string | HTMLElement | Element | EventTarget;
+
+ /**
+ * Type of domain. Default: "hour"
+ * Valid domains: {"hour", "day", "week", "month", "year"}
+ */
+ domain?: string;
+
+ /**
+ * Type of subDomain. Default: "min"
+ * Valid subDomains: {"min", "x_min", "hour", "x_hour", "day", "x_day", "week", "x_week", "month", "x_month"}
+ */
+ subDomain?: string;
+
+ /** Number of domain to display. Default: 12 */
+ range?: number;
+
+ /** Size of each subDomain cell, in pixels. Default: 10 */
+ cellSize?: number;
+
+ /** Space between each subDomain cell, in pixel. Default: 2 */
+ cellPadding?: number;
+
+ /** subDomain cell's border radius, for rounder corner, in pixel. Default: 0 */
+ cellRadius?: number;
+
+ /** Space between each domain, in pixel. Default: 2 */
+ domainGutter?: number;
+
+ /**
+ * Margin around each domain, in pixel. Default: [0,0,0,0]
+ * Ordered like in CSS (top, right, bottom, left), it also accepts CSS like values
+ */
+ domainMargin?: number | number[];
+
+ /**
+ * Whether to enable domain dynamic width and height. Default: true
+ * Some domain>subdomain couple, like month>days, doesn't always have the same number of
+ * subDomain cells. Some months have 6 weeks, some only 4.
+ * With dynamic dimension enabled, the domain width and height will be adjusted to fit the
+ * domain content, whereas when it's disabled, all domains will have the same dimension : the biggest.
+ */
+ domainDynamicDimension?: boolean;
+
+ /** To display the calendar vertically, with each domain one under the other. Default: false */
+ verticalOrientation?: boolean;
+
+ /** Position and alignment of the domain label. */
+ label?: Label;
+
+ /**
+ * Control the number of columns to split the domain dates into. Default: null
+ * Each domain is split into an arbitrary number of columns (or rows depending on the
+ * reading direction). You can overwrite that number with colLimit, and force all dates on the
+ * same line, or split them into more columns.
+ * That setting limit the maximum number of columns, and doesn't necessary means that each rows will
+ * contains that number of columns.
+ */
+ colLimit?: number;
+
+ /** Control the number of rows to split the domain dates into. Default: null
+ * If rowLimit and colLimit are both used, rowLimit will be ignored. */
+ rowLimit?: number;
+
+ /** Whether to display a tooltip when hovering over a date. Default: false */
+ tooltip?: boolean;
+
+ // ================================================
+ // Data
+ // ================================================
+
+ /**
+ * Starting date of the calendar. Default: new Date()
+ * It doesn't have to be precise, the calendar will not start at that date, but at the first domain containing that date.
+ */
+ start?: Date;
+ /**
+ * Data used to fill the calendar. Default: ""
+ * String is interpreted as a URL to an API, which should be returning the data used to fill the calendar.
+ */
+
+ data?: string | Object;
+
+ /**
+ * Engine used to parse the data. Default: json
+ * Valid values:
+ * "json" - Interpret the data as json.
+ * "csv" - Interpret the data as csv.
+ * "tsv" - Interpret the data exactly like csv, but are delimited with a tab character, instead of comma.
+ * "txt" - Just return the data as a string.
+ */
+ dataType?: string;
+
+ /**
+ * Highlight selected subDomain cells. Default: false
+ * Takes an array of Date object. Can also accepts the now string, equivalent to Date.now().
+ */
+ highlight?: string | string[] | Date[] | any[];
+
+ /** Whether to start the week on Monday, instead of Sunday. Default: true */
+ weekStartOnMonday?: boolean;
+
+ /**
+ * Lower limit of the domain navigation, preventing navigating beyond a certain date. Default: null
+ * When set, calling previous() will only work only until the leftmost domain containing minDate.
+ * Like with start, minDate does not have to be precise, and just have to be a date inside the domain.
+ * previous() will always return true, unless the domain containing minDate is reached, in which case, it'll return false.
+ */
+ minDate?: Date;
+
+ /** Upper limit of the domain navigation, preventing navigating beyond a certain date. Default: null */
+ maxDate?: Date;
+
+ /**
+ * Whether to consider missing date:value couple in the data source as equal to 0. Default: false
+ * By default, when the a date is not associated to a value, it's considered as null, and rendered as a no value cell.
+ * You should ask yourself, if the API is not returning result for a date, is it because there is really no value
+ * associated to this date, or because it's supposed to be equal to 0, and it's skipped in order to save bandwidth ?
+ */
+ considerMissingDataAsZero?: boolean;
+
+ // ================================================
+ // Legend
+ // ================================================
+
+ /** Assign each range of values to a color. Default: [10, 20, 30, 40] */
+ legend?: number[];
+
+ /** Whether to display the legend. Default: true */
+ displayLegend?: boolean;
+
+ /** Size of the legend cells, in pixels. Default: 10 */
+ legendCellSize?: number;
+
+ /** Padding between each legend cell, in pixels. Default: 2 */
+ legendCellPadding?: number;
+
+ /** Margin around the legend, in pixels. Default: [10, 0, 0, 0] */
+ legendMargin?: number | number[];
+
+ /**
+ * Vertical position of the legend. Default: "bottom"
+ * Valid values:
+ * "top" - Place the legend above the calendar
+ * "center" - Place the legend on the calendar's side
+ * Use with legendHorizontalPosition, to position the legend on the left (default) or on the right.
+ * "bottom" - Place the legend on below the calendar
+ */
+ legendVerticalPosition?: string;
+
+ /**
+ * Horizontal position of the legend. Default: "left"
+ * Valid values:
+ * "left" - Align the legend to the left
+ * "center" - Center the legend
+ * "right" - Align the legend to the right
+ */
+ legendHorizontalPosition?: string;
+
+ /**
+ * Orientation of the legend. Default: "horizontal"
+ * legendOrientation is best used together with legendHorizontalPosition when the legend is positioned on the side.
+ * Valid values:
+ * "horizontal" - Legend is displayed horizontally, from left to right
+ * "vertical" - Legend is displayed vertically, from top to bottom
+ */
+ legendOrientation?: string;
+
+ /**
+ * Set of colors to automagically compute the heatmap colors.
+ * Instead of relying on the CSS for your heatmap's colors, you can also set the heatmap's colors directly with
+ * cal-heatmap on initialization, or even dynamically change them after.
+ * All legend settings can be changed dynamically after calendar initialisation, with setLegend().
+ */
+ legendColors?: LegendColor | string[];
+
+ // ================================================
+ // i18n
+ // ================================================
+
+ /**
+ * Name of the entity you're representing on the calendar.
+ * Takes an array of string, with the first index as the singular form, and the second index the plural form.
+ * For the lazy, you can also pass a simple string, ar a single element array, and it'll automatically guess
+ * the plural form, as long as it's the singular form plus the "s" suffix.
+ */
+ itemName?: string | string[];
+ /**
+ * Format of the title displayed when hovering a subDomain.
+ * Some template strings are available, and enclosed in braces.
+ * {name} Name of the entity represented in the calendar (see itemName)
+ * {count} The value associated to the date.
+ * {date} The date of the cell. It's automatically formatted according to the type of subDomain.
+ * See subDomainDateFormat to further customize that date formatting.
+ * {connector} An English preposition placed before a datetime (on Monday, at 15:00, etc.). Each subDomain
+ * have their own default connector, corresponding to the default date format.
+ */
+ subDomainTitleFormat?: SubDomainFormatTemplates;
+ /**
+ * Format of the {date} template string inside subDomainTitleFormat.
+ * {date} is by default formatted according to the subDomain type.
+ * subDomainFormat can accept any string with directive accepted by d3.time.format(), like "%Y-%m-%d".
+ * As d3.time.format() will only output English dates, subDomainDateFormat can also accept a function,
+ * with the subDomain date as the argument.
+ */
+ subDomainDateFormat?: string | Function;
+ /**
+ * Format of the text inside a subDomain cell.
+ * Disabled by default, you can display a text inside each subDomain cell.
+ * Works exactly like subDomainDateFormat, except that the function takes the cell value as second argument.
+ */
+ subDomainTextFormat?: string | Function;
+ /**
+ * Format of the domain label.
+ * Works exactly like subDomainDateFormat, and will format the domain label with any string accepted by d3.time.format(), or a function.
+ * To not display the domain label, set domainLabelFormat to "" (empty string).
+ */
+ domainLabelFormat?: string | Function;
+ /**
+ * Formatting of the legend title, displayed when hovering a legend cell.
+ * Some template strings are available, and enclosed in braces.
+ * {name} Name of the entity represented in the calendar (see itemName)
+ * {min} The first value of the legend array.
+ * {max} The last value of the legend array.
+ * {down} The lower bound of a color
+ * {up} The upper bound of a color
+ */
+ legendTitleFormat?: LegendTitleTemplates;
+
+ // ================================================
+ // Other
+ // ================================================
+
+ /** Animation duration, in milliseconds. Default value: 500 */
+ animationDuration?: number;
+ /**
+ * Will attach the previous() event to the specified element, on a mouse click, shifting the calendar one domain back. Default value: false
+ * If you want to shift by more than one domain, see the previous() method.
+ */
+ previousSelector?: string | HTMLElement;
+ /**
+ * Will attach the next() event to the specified element, on a mouse click, shifting the calendar one domain forward. Default value: false
+ * If you want to shift by more than one domain, see the next() method.
+ */
+ nextSelector?: string | HTMLElement;
+ /**
+ * The calendar instance namespace.
+ * If you have more than one instance of Cal-Heatmap, you should assign each instance its own namespace, in order to isolate each instance event handler.
+ */
+ itemNamespace?: string;
+
+ // ================================================
+ // Events
+ // ================================================
+
+ /** Called after a mouse click event on a subDomain cell. */
+ onClick?: (date: Date, value: number) => void;
+ /** Called after drawing the empty calendar, and before filling it with data. */
+ afterLoad?: () => void;
+ /**
+ * Called after shifting the calendar one domain back.
+ * The date argument is the start date of the domain that was added.
+ */
+ afterLoadPreviousDomain?: (date: Date) => void;
+ /**
+ * Called after shifting the calendar one domain forward.
+ * The date argument is the start date of the domain that was added.
+ */
+ afterLoadNextDomain?: (date: Date) => void;
+ /**
+ * Called after drawing and filling the calendar.
+ * Useful in case you're loading data via ajax, as it's loading data asynchronously. This event will wait for the ajax
+ * request to complete before triggering.
+ * This event will only trigger once, on the initial setup. See afterLoadPreviousDomain and afterLoadNextDomain for
+ * callback events after a domain navigation.
+ */
+ onComplete?: () => void;
+ /**
+ * Called after getting the data from source, but before filling the calendar.
+ * This callback must return a json object formatted in the expected data format.
+ * afterLoadData() is used to do some works on the data, especially when the data source is not returning data in the expected format.
+ */
+ afterLoadData?: (data: any) => DataFormat;
+ /**
+ * Triggered after previous(), when the incoming domain is containing minDate.
+ * When the leftmost domain set by minDate is loaded into the calendar, onMinDomainReached() will be triggered with true as argument.
+ * This event is useful if you want to disable your previous button, since there is no more previous domains to load.
+ * In order to reverse the action, onMinDomainReached() will be called with false as argument afer next(), only once, and only if the
+ * leftmost domain is not the lower limit domain anymore.
+ */
+ onMinDomainReached?: (reached: boolean) => void;
+ /**
+ * Triggered after next(), when the incoming domain is containing maxDate.
+ * See onMinDomainReached().
+ */
+ onMaxDomainReached?: (reached: boolean) => void;
+ }
+
+ interface RuntimeOptions extends InitOptions
+ {
+ /** Margin around each domain, in pixels. Ordered like in CSS (top, right, bottom, left) */
+ domainMargin: number[];
+ /** Margin around the legend, in pixels. Ordered like in CSS (top, right, bottom, left) */
+ legendMargin: number[];
+ /** List of dates to highlight */
+ highlight: Date[];
+ /**
+ * Name of the items to represent in the calendar.
+ * First index is singular form, and the second index, the plural form.
+ */
+ itemName: string[];
+ }
+
+ interface LegendTitleTemplates
+ {
+ /** Formatting of the smallest (leftmost) value of the legend. Default value: "less than {min} {name}" */
+ lower?: string;
+ /** Formatting of all the value but the first and the last. Default value: "between {down} and {up} {name}" */
+ inner?: string;
+ /** Formatting of the biggest (rightmost) value of the legend. Default value: "more than {max} {name}" */
+ upper?: string;
+ }
+
+ interface SubDomainFormatTemplates
+ {
+ /** Format of the title when there is no value associated to the date. Default value: "{date}" */
+ empty?: string;
+ /** Format of the title when it's associated to a value. Default value: "{count} {name} {connector} {date}" */
+ filled?: string;
+ }
+
+ interface DataFormat
+ {
+ /** timestamp are in seconds, value can be any number (integer or float) */
+ [timestamp: string]: number;
+ }
+
+ interface LabelOffset
+ {
+ x: number;
+ y: number;
+ }
+
+ /** Position and alignment of the domain label. */
+ interface Label
+ {
+ /**
+ * Position of the label, relative to the domain. Default: "bottom"
+ * Valid values: {"top", "right", "bottom", "left"}
+ */
+ position?: string;
+
+ /**
+ * Horizontal align of the domain. Default: "center"
+ * Valid values: {"left", "center", "right"}
+ */
+ align?: string;
+ /**
+ * Rotation for a vertical label. Default: null
+ * Valid values: {null, "left", "right"}
+ */
+ rotate?: string;
+ /**
+ * Only used when label is rotated, defines the width of the label. Default: 100
+ * Valid values: any intger
+ */
+ width?: number;
+ /**
+ * More control about label positioning, if the default value does not fit your need,
+ * especially when label is rotated, or when using a big font-size. Default: {x:0, y:0}
+ */
+ offset?: LabelOffset;
+ /**
+ * Height of the domain label in pixels.
+ * By leaving it to null, the label will be set to 2 times the height of the subDomain cell.
+ * If you want to remove the label, set domainLabelFormat to "" (empty string), instead
+ * of setting the label height to 0. Default: null
+ * Valid values: any integer
+ */
+ height?: number;
+ }
+}
+
+declare var CalHeatMap: CalHeatMap.CalHeatMapStatic;
diff --git a/chai-string/chai-string-tests.ts b/chai-string/chai-string-tests.ts
new file mode 100644
index 000000000..f5380b076
--- /dev/null
+++ b/chai-string/chai-string-tests.ts
@@ -0,0 +1,128 @@
+///
+///
+///
+
+var should = chai.should();
+var assert = chai.assert;
+var expect = chai.expect;
+
+var chai_string = require('chai-string');
+chai.use(chai_string);
+
+describe('chai-string', function() {
+
+ describe('#startsWith', function() {
+
+ it('check that', function() {
+ var obj = { foo: 'hello world' };
+ expect(obj).to.have.property('foo').that.startsWith('hello');
+ });
+
+ });
+
+ describe('#startWith', function() {
+
+ it('should return true', function() {
+ var str = 'abcdef',
+ prefix = 'abc';
+ str.should.startWith(prefix);
+ });
+
+ it('should return false', function() {
+ var str = 'abcdef',
+ prefix = 'cba';
+ str.should.not.startWith(prefix);
+ });
+
+ });
+
+ describe('#endWith', function() {
+
+ it('should return true', function() {
+ var str = 'abcdef',
+ suffix = 'def';
+ str.should.endWith(suffix);
+ });
+
+ it('should return false', function() {
+ var str = 'abcdef',
+ suffix = 'fed';
+ str.should.not.endWith(suffix);
+ });
+
+ });
+
+ describe('tdd alias', function() {
+
+ beforeEach(function() {
+ this.str = 'abcdef';
+ this.str2 = 'a\nb\tc\r d ef';
+ });
+
+ it('.startsWith', function() {
+ assert.startsWith(this.str, 'abc');
+ });
+
+ it('.notStartsWith', function() {
+ assert.notStartsWith(this.str, 'cba');
+ });
+
+ it('.endsWith', function() {
+ assert.endsWith(this.str, 'def');
+ });
+
+ it('.notEndsWith', function() {
+ assert.notEndsWith(this.str, 'fed');
+ });
+
+ it('.equalIgnoreCase', function() {
+ assert.equalIgnoreCase(this.str, 'AbCdEf');
+ });
+
+ it('.notEqualIgnoreCase', function() {
+ assert.notEqualIgnoreCase(this.str, 'abDDD');
+ });
+
+ it('.equalIgnoreSpaces', function() {
+ assert.equalIgnoreSpaces(this.str, this.str2);
+ });
+
+ it('.notEqualIgnoreSpaces', function() {
+ assert.notEqualIgnoreSpaces(this.str, this.str2 + 'g');
+ });
+
+ it('.singleLine', function() {
+ assert.singleLine(this.str);
+ });
+
+ it('.notSingleLine', function() {
+ assert.notSingleLine("abc\ndef");
+ });
+
+ it('.reverseOf', function() {
+ assert.reverseOf(this.str, 'fedcba');
+ });
+
+ it('.notReverseOf', function() {
+ assert.notReverseOf(this.str, 'aaaaa');
+ });
+
+ it('.palindrome', function() {
+ assert.palindrome('abcba');
+ assert.palindrome('abccba');
+ assert.palindrome('');
+ });
+
+ it('.notPalindrome', function() {
+ assert.notPalindrome(this.str);
+ });
+
+ it('.entriesCount', function() {
+ assert.entriesCount('abcabd', 'ab', 2);
+ assert.entriesCount('ababd', 'ab', 2);
+ assert.entriesCount('abab', 'ab', 2);
+ assert.entriesCount('', 'ab', 0);
+ });
+
+ });
+});
diff --git a/chai-string/chai-string.d.ts b/chai-string/chai-string.d.ts
new file mode 100644
index 000000000..fd1766523
--- /dev/null
+++ b/chai-string/chai-string.d.ts
@@ -0,0 +1,45 @@
+// Type definitions for chai-string 1.1.4
+// Project: https://github.com/onechiporenko/chai-string
+// Definitions by: Nick Malaguti
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+///
+
+declare module Chai {
+ interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
+ startsWith(expected: string, message?: string): Assertion;
+ startWith(expected: string, message?: string): Assertion;
+ endsWith(expected: string, message?: string): Assertion;
+ endWith(expected: string, message?: string): Assertion;
+ equalIgnoreCase(expected: string, message?: string): Assertion;
+ equalIgnoreSpaces(expected: string, message?: string): Assertion;
+ singleLine(message?: string): Assertion;
+ reverseOf(message?: string): Assertion;
+ palindrome(message?: string): Assertion;
+ entriesCount(substr: string, expected: number, message?: string): Assertion;
+ }
+
+ export interface Assert {
+ startsWith(val: string, exp: string, msg?: string): void;
+ notStartsWith(val: string, exp: string, msg?: string): void;
+ endsWith(val: string, exp: string, msg?: string): void;
+ notEndsWith(val: string, exp: string, msg?: string): void;
+ equalIgnoreCase(val: string, exp: string, msg?: string): void;
+ notEqualIgnoreCase(val: string, exp: string, msg?: string): void;
+ equalIgnoreSpaces(val: string, exp: string, msg?: string): void;
+ notEqualIgnoreSpaces(val: string, exp: string, msg?: string): void;
+ singleLine(val: string, msg?: string): void;
+ notSingleLine(val: string, msg?: string): void;
+ reverseOf(val: string, exp: string, msg?: string): void;
+ notReverseOf(val: string, exp: string, msg?: string): void;
+ palindrome(val: string, msg?: string): void;
+ notPalindrome(val: string, msg?: string): void;
+ entriesCount(str: string, substr: string, count: number, msg?: string): void;
+ }
+}
+
+declare module 'chai-string' {
+ function chaiString(chai: any, utils: any): void;
+ namespace chaiString {}
+ export = chaiString;
+}
diff --git a/chai-things/chai-things-tests.ts b/chai-things/chai-things-tests.ts
new file mode 100644
index 000000000..de6a4c3ff
--- /dev/null
+++ b/chai-things/chai-things-tests.ts
@@ -0,0 +1,59 @@
+///
+
+import chai = require('chai');
+import chaiThings = require('chai-things');
+
+chai.use(chaiThings);
+
+function test_somethingSyntax() {
+ [].should.not.include.something();
+ [].should.not.include.something.that.equals(1);
+
+ var array = [{ a: 1 }, { b: 2 }];
+ array.should.include.something();
+ array.should.include.something.that.deep.equals({ b: 2 });
+ array.should.include.something.that.not.deep.equals({ b: 2 });
+ array.should.not.include.something.that.deep.equals({ c: 3 });
+ array.should.include.something.that.not.deep.equals({ c: 3 });
+ array.should.include.something.with.property('b', 2);
+ array.should.not.include.something.with.property('b', 3);
+
+ var array2 = [{ a: 'b' }, { a: 'b' }];
+ array2.should.include.something.that.have.property("a");
+ array2.should.include.something.that.have.property("a").not.equal("d");
+}
+
+function test_somethingVariantsSyntax() {
+ [].should.not.include.any();
+ [].should.not.include.any.that.deep.equal({ b: 2 });
+
+ var array = [{ a: 1 }, { b: 2 }];
+ array.should.include.a.thing();
+ array.should.include.a.thing.that.deep.equals({ b: 2 });
+ array.should.include.an.item();
+ array.should.include.an.item.that.deep.equals({ b: 2 });
+ array.should.include.one.that.deep.equals({ b: 2 });
+ array.should.include.some();
+ array.should.include.some.that.deep.equal({ b: 2 });
+}
+
+function test_allSyntax() {
+ [].should.all.equal(1);
+ [].should.all.not.equal(1);
+
+ var array = [1, 1];
+ array.should.all.equal(1);
+ array.should.all.not.equal(2);
+ array.should.not.all.equal(2);
+ array.should.not.all.not.equal(1);
+
+ var array2 = [1, 2];
+ array2.should.not.all.equal(1);
+ array2.should.not.all.equal(2);
+ array2.should.not.all.not.equal(1);
+ array2.should.not.all.not.equal(2);
+
+ var array3 = [{ a: 'b' }, { a: 'c' }];
+ array3.should.all.have.property("a");
+ array3.should.all.have.property("a").not.equal("d");
+}
\ No newline at end of file
diff --git a/chai-things/chai-things.d.ts b/chai-things/chai-things.d.ts
new file mode 100644
index 000000000..bc2b89c46
--- /dev/null
+++ b/chai-things/chai-things.d.ts
@@ -0,0 +1,55 @@
+// Type definitions for chai-things
+// Project: https://github.com/chaijs/chai-things
+// Definitions by: David Broder-Rodgers
+// Definitions: https://github.com/DavidBR-SW/DefinitelyTyped
+
+///
+
+declare module Chai {
+ interface ArrayAssertion {
+ include: ArrayInclude;
+ contain: ArrayInclude;
+ not: ArrayAssertion;
+ all: Assertion;
+ }
+
+ interface ArrayInclude {
+ (item: any): any;
+ a: Item;
+ an: Item;
+ one: Something;
+ some: Something;
+ something: Something;
+ any: Anything;
+ }
+
+ interface Anything extends Assertion {
+ (): any;
+ that: Assertion
+ with: Assertion
+ }
+
+ interface Something extends Assertion {
+ (): any;
+ that: Assertion
+ with: Assertion
+ }
+
+ interface Item {
+ item: Something;
+ thing: Something;
+ }
+
+ interface Deep {
+ equals: Equal;
+ }
+}
+
+interface Array {
+ should: Chai.ArrayAssertion;
+}
+
+declare module "chai-things" {
+ function chaiThings(chai: any, utils: any): void;
+ export = chaiThings;
+}
diff --git a/chai/chai.d.ts b/chai/chai.d.ts
index 28aaf48c2..e68e6fa3b 100644
--- a/chai/chai.d.ts
+++ b/chai/chai.d.ts
@@ -19,7 +19,7 @@ declare module Chai {
use(fn: (chai: any, utils: any) => void): any;
assert: AssertStatic;
config: Config;
- AssertionError: AssertionError;
+ AssertionError: typeof AssertionError;
}
export interface ExpectStatic extends AssertionStatic {
diff --git a/chartjs/chart-tests.ts b/chartjs/chart-tests.ts
index 4bd8820c6..452ddbf62 100644
--- a/chartjs/chart-tests.ts
+++ b/chartjs/chart-tests.ts
@@ -325,7 +325,7 @@ var myDoughnutChart = new Chart(ctx).Doughnut(pieData, {
animateRotate: true,
animateScale: false,
legendTemplate: "