diff --git a/angularjs/angular.d.ts b/angularjs/angular.d.ts index 64a9d0652b..febd17873a 100755 --- a/angularjs/angular.d.ts +++ b/angularjs/angular.d.ts @@ -926,7 +926,7 @@ declare module ng { * * @param reason Constant, message, exception or an object representing the rejection reason. */ - reject(reason?: any): IPromise; + reject(reason?: any): IPromise; /** * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise. This is useful when you are dealing with an object that might or might not be a promise, or if the promise comes from a source that can't be trusted. * diff --git a/breeze/breeze.d.ts b/breeze/breeze.d.ts index 6e04c123a2..f8f9c851ad 100644 --- a/breeze/breeze.d.ts +++ b/breeze/breeze.d.ts @@ -654,7 +654,7 @@ declare module breeze { getEntityTypes(): IStructuralType[]; hasMetadataFor(serviceName: string): boolean; static importMetadata(exportedString: string): MetadataStore; - importMetadata(exportedString: string): MetadataStore; + importMetadata(exportedString: string, allowMerge?: boolean): MetadataStore; isEmpty(): boolean; registerEntityTypeCtor(entityTypeName: string, entityCtor: Function, initializationFn?: (entity: Entity) =>void ): void; trackUnmappedType(entityCtor: Function, interceptor?: Function): void; diff --git a/clone/clone-tests.ts b/clone/clone-tests.ts index 12a8535349..6a25fb7c30 100644 --- a/clone/clone-tests.ts +++ b/clone/clone-tests.ts @@ -6,4 +6,5 @@ var original = { var copy = clone(original); copy = clone(original, false); -copy = clone(original, true); +copy = clone(original, true, 1); +copy = clone.clonePrototype(original); diff --git a/clone/clone.d.ts b/clone/clone.d.ts index 061c93c4d6..08acc62e42 100644 --- a/clone/clone.d.ts +++ b/clone/clone.d.ts @@ -8,10 +8,18 @@ */ declare module "clone" { /** - * @param parent - * @param circular If not given, defaults to true in JS lib. + * @param val the value that you want to clone, any type allowed + * @param circular Call clone with circular set to false if you are certain that obj contains no circular references. This will give better performance if needed. There is no error if undefined or null is passed as obj. + * @param depth to wich the object is to be cloned (optional, defaults to infinity) */ - function clone(parent: Object, circular?: boolean): Object + function clone(val: T, circular?: boolean, depth?: number): T; + + module clone { + /** + * @param obj the object that you want to clone + */ + function clonePrototype(obj: T): T; + } export = clone } diff --git a/each/each-tests.ts b/each/each-tests.ts new file mode 100644 index 0000000000..370e6ac396 --- /dev/null +++ b/each/each-tests.ts @@ -0,0 +1,41 @@ +/// +/// + +function testEach() { + var EachStaticClass: EachStatic = function (array: any[]) { + return { + paused: true, + readable: false, + started: true, + done: true, + total: true, + on: function (eventName: string, cb: (a: any, b?: () => void) => void) { + return EachStaticClass([]); + }, + parallel: function (mode: any) { + return EachStaticClass([]); + }, + shift: function (items: any[]) {}, + write: function (items: any[]) {}, + unshift: function (items: any[]) {}, + end: function () { + return EachStaticClass([]); + }, + times: function () { + return EachStaticClass([]); + }, + repeat: function () { + return EachStaticClass([]); + }, + sync: function () { + return EachStaticClass([]); + }, + files: function (a: any, glob?: any) {} + }; + }; + + var each: Each = EachStaticClass([1, 2, 3]); + + var EachReq: EachStatic = require("each"); + var each: Each = EachReq([4, 5, 6]); +} diff --git a/each/each.d.ts b/each/each.d.ts new file mode 100644 index 0000000000..65d0a3f9d2 --- /dev/null +++ b/each/each.d.ts @@ -0,0 +1,39 @@ +// Type definitions for NodeEach v0.4.9 +// Project: http://www.adaltas.com/projects/node-each/ +// Definitions by: Michael Zabka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface Each { + paused: boolean; + readable: boolean; + started: boolean; + done: boolean; + total: boolean; + on(eventName: string, onCallback: Function): Each; + on(eventName: "item", onItem: (item: any, next: (error?: Error) => void) => void): Each; + on(eventName: "error", onError: (error: Error[]) => void): Each; + on(eventName: "error", onError: (error: Error) => void): Each; + on(eventName: "both", onBoth: (error?: Error[]) => void): Each; + on(eventName: "end", onEnd: () => void): Each; + parallel(mode: number): Each; + parallel(mode: boolean): Each; + shift(items: any[]): void; + write(items: any[]): void; + unshift(items: any[]): void; + end(): Each; + times(): Each; + repeat(): Each; + sync(): Each; + files(glob: any): void; + files(base: any, glob: any): void; +} + +interface EachStatic { + (array: any[]): Each; +} + +declare var each: EachStatic; + +declare module "each" { + export = each; +} \ No newline at end of file diff --git a/jscrollpane/jscrollpane.d.ts b/jscrollpane/jscrollpane.d.ts index 2bb348bb47..652a3a3731 100644 --- a/jscrollpane/jscrollpane.d.ts +++ b/jscrollpane/jscrollpane.d.ts @@ -295,7 +295,7 @@ interface JScrollPaneApi { * @param animate Should an animation occur. If you don't provide this argument then the animateScroll value from the settings object is used instead. */ - scrollToBottom(animate?: boolean); + scrollToBottom(animate?: boolean): void; /** * Hijacks the links on the page which link to content inside the scrollpane. If you have changed the content of * your page (e.g. via AJAX) and want to make sure any new anchor links to the contents of your scroll pane will @@ -312,5 +312,5 @@ interface JQuery { /** * Initialises the jScrollPane on the JQuery object. */ - jScrollPane(options?: JScrollPaneSettings); + jScrollPane(options?: JScrollPaneSettings): JQuery; } diff --git a/lazy.js/lazy.js-tests.ts b/lazy.js/lazy.js-tests.ts index 7689bcaf78..f719a90a90 100644 --- a/lazy.js/lazy.js-tests.ts +++ b/lazy.js/lazy.js-tests.ts @@ -3,10 +3,10 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - interface Foo { - foo(): string; + foo(): string; } interface Bar { - bar(): string; + bar(): string; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -51,38 +51,38 @@ function fnValueCallback(value: Foo): void { } function fnGetKeyCallback(value: Foo): string { - return str; + return str; } function fnTestCallback(value: Foo): boolean { - return bool; + return bool; } function fnMapCallback(value: Foo): Bar { - return bar; + return bar; } function fnMapStringCallback(value: string): string { - return str; + return str; } function fnNumberCallback(value: Foo): number { - return num; + return num; } function fnMemoCallback(memo: Bar, value: Foo): Bar { - return bar; + return bar; } function fnGeneratorCallback(index: number): Foo { - return foo; + return foo; } // Lazy fooArraySeq = Lazy(fooArr); -fooObjectSeq = Lazy({a:foo, b:foo}); -anyObjectSeq = Lazy({a:num, b:str}); +fooObjectSeq = Lazy({a: foo, b: foo}); +anyObjectSeq = Lazy({a: num, b: str}); stringSeq = Lazy(str); // Strict diff --git a/lazy.js/lazy.js.d.ts b/lazy.js/lazy.js.d.ts index ca19aed983..0470929d6d 100644 --- a/lazy.js/lazy.js.d.ts +++ b/lazy.js/lazy.js.d.ts @@ -5,243 +5,244 @@ declare module LazyJS { - interface LazyStatic { + interface LazyStatic { - (value: string):StringLikeSequence; - (value: T[]):ArrayLikeSequence; - (value: any[]):ArrayLikeSequence; - (value: Object):ObjectLikeSequence; - (value: Object):ObjectLikeSequence; + (value: string): StringLikeSequence; + (value: T[]): ArrayLikeSequence; + (value: any[]): ArrayLikeSequence; + (value: Object): ObjectLikeSequence; + (value: Object): ObjectLikeSequence; - strict():LazyStatic; + strict(): LazyStatic; - generate(generatorFn: GeneratorCallback, length?: number):GeneratedSequence; + generate(generatorFn: GeneratorCallback, length?: number): GeneratedSequence; - range(to: number):GeneratedSequence; - range(from: number, to: number, step?: number):GeneratedSequence; + range(to: number): GeneratedSequence; + range(from: number, to: number, step?: number): GeneratedSequence; - repeat(value: T, count?: number):GeneratedSequence; + repeat(value: T, count?: number): GeneratedSequence; - on(eventType: string):Sequence; + on(eventType: string): Sequence; - readFile(path: string):StringLikeSequence; - makeHttpRequest(path: string):StringLikeSequence; - } + readFile(path: string): StringLikeSequence; + makeHttpRequest(path: string): StringLikeSequence; + } - interface ArrayLike { - length:number; - [index:number]:T; - } + interface ArrayLike { + length: number; + [index: number]: T; + } - interface Callback { - ():void; - } + interface Callback { + (): void; + } - interface ErrorCallback { - (error: any):void; - } + interface ErrorCallback { + (error: any): void; + } - interface ValueCallback { - (value: T):void; - } + interface ValueCallback { + (value: T): void; + } - interface GetKeyCallback { - (value: T):string; - } + interface GetKeyCallback { + (value: T): string; + } - interface TestCallback { - (value: T):boolean; - } + interface TestCallback { + (value: T): boolean; + } - interface MapCallback { - (value: T):U; - } + interface MapCallback { + (value: T): U; + } - interface MapStringCallback { - (value: string):string; - } + interface MapStringCallback { + (value: string): string; + } - interface NumberCallback { - (value: T):number; - } + interface NumberCallback { + (value: T): number; + } - interface MemoCallback { - (memo: U, value: T):U; - } + interface MemoCallback { + (memo: U, value: T): U; + } - interface GeneratorCallback { - (index: number):T; - } + interface GeneratorCallback { + (index: number): T; + } - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - interface Iterator { - new (sequence: Sequence):Iterator; - current():T; - moveNext():boolean; - } + interface Iterator { + new (sequence: Sequence): Iterator; + current(): T; + moveNext(): boolean; + } - interface GeneratedSequence extends Sequence { - new(generatorFn: GeneratorCallback, length: number):GeneratedSequence; - length():number; - } + interface GeneratedSequence extends Sequence { + new(generatorFn: GeneratorCallback, length: number): GeneratedSequence; + length(): number; + } - interface AsyncSequence extends SequenceBase { - each(callback: ValueCallback):AsyncHandle; - } + interface AsyncSequence extends SequenceBase { + each(callback: ValueCallback): AsyncHandle; + } - interface AsyncHandle { - cancel():void; - onComplete(callback: Callback):void; - onError(callback: ErrorCallback):void; - } + interface AsyncHandle { + cancel(): void; + onComplete(callback: Callback): void; + onError(callback: ErrorCallback): void; + } - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - module Sequence { - function define(methodName: string[], overrides: Object): Function; - } + module Sequence { + function define(methodName: string[], overrides: Object): Function; + } - interface Sequence extends SequenceBase { - each(eachFn: ValueCallback):Sequence; - } + interface Sequence extends SequenceBase { + each(eachFn: ValueCallback): Sequence; + } - interface SequenceBase extends SequenceBaser { - first():any; - first(count: number):Sequence; - indexOf(value: any, startIndex?: number):Sequence; + interface SequenceBase extends SequenceBaser { + first(): any; + first(count: number): Sequence; + indexOf(value: any, startIndex?: number): Sequence; - last():any; - last(count: number):Sequence; - lastIndexOf(value: any):Sequence; + last(): any; + last(count: number): Sequence; + lastIndexOf(value: any): Sequence; - reverse():Sequence; - } + reverse(): Sequence; + } - interface SequenceBaser { - // TODO improve define() (needs ugly overload) - async(interval: number):AsyncSequence; - chunk(size: number):Sequence; - compact():Sequence; - concat(var_args: T[]):Sequence; - consecutive(length: number):Sequence; - contains(value: T):boolean; - countBy(keyFn: GetKeyCallback): ObjectLikeSequence; - countBy(propertyName: string): ObjectLikeSequence; - dropWhile(predicateFn: TestCallback): Sequence; - every(predicateFn: TestCallback): boolean; - filter(predicateFn: TestCallback): Sequence; - find(predicateFn: TestCallback): Sequence; - findWhere(properties: Object): Sequence; + interface SequenceBaser { + // TODO improve define() (needs ugly overload) + async(interval: number): AsyncSequence; + chunk(size: number): Sequence; + compact(): Sequence; + concat(var_args: T[]): Sequence; + consecutive(length: number): Sequence; + contains(value: T): boolean; + countBy(keyFn: GetKeyCallback): ObjectLikeSequence; + countBy(propertyName: string): ObjectLikeSequence; + dropWhile(predicateFn: TestCallback): Sequence; + every(predicateFn: TestCallback): boolean; + filter(predicateFn: TestCallback): Sequence; + find(predicateFn: TestCallback): Sequence; + findWhere(properties: Object): Sequence; - flatten(): Sequence; - groupBy(keyFn: GetKeyCallback): ObjectLikeSequence; - initial(count?: number): Sequence; - intersection(var_args: T[]): Sequence; - invoke(methodName: string): Sequence; - isEmpty(): boolean; - join(delimiter?: string): string; - map(mapFn: MapCallback): Sequence; + flatten(): Sequence; + groupBy(keyFn: GetKeyCallback): ObjectLikeSequence; + initial(count?: number): Sequence; + intersection(var_args: T[]): Sequence; + invoke(methodName: string): Sequence; + isEmpty(): boolean; + join(delimiter?: string): string; + map(mapFn: MapCallback): Sequence; - max(valueFn?: NumberCallback): T; - min(valueFn?: NumberCallback): T; - pluck(propertyName: string): Sequence; - reduce(aggregatorFn: MemoCallback, memo?: U): U; - reduceRight(aggregatorFn: MemoCallback, memo: U): U; - reject(predicateFn: TestCallback): Sequence; - rest(count?: number): Sequence; - shuffle(): Sequence; - some(predicateFn?: TestCallback): boolean; - sortBy(sortFn: NumberCallback): Sequence; - sortedIndex(value: T): Sequence; - sum(valueFn?: NumberCallback): Sequence; - takeWhile(predicateFn: TestCallback): Sequence; - union(var_args: T[]): Sequence; - uniq(): Sequence; - where(properties: Object): Sequence; - without(var_args: T[]): Sequence; - zip(var_args: T[]): Sequence; + max(valueFn?: NumberCallback): T; + min(valueFn?: NumberCallback): T; + pluck(propertyName: string): Sequence; + reduce(aggregatorFn: MemoCallback, memo?: U): U; + reduceRight(aggregatorFn: MemoCallback, memo: U): U; + reject(predicateFn: TestCallback): Sequence; + rest(count?: number): Sequence; + shuffle(): Sequence; + some(predicateFn?: TestCallback): boolean; + sortBy(sortFn: NumberCallback): Sequence; + sortedIndex(value: T): Sequence; + size(): number; + sum(valueFn?: NumberCallback): Sequence; + takeWhile(predicateFn: TestCallback): Sequence; + union(var_args: T[]): Sequence; + uniq(): Sequence; + where(properties: Object): Sequence; + without(var_args: T[]): Sequence; + zip(var_args: T[]): Sequence; - toArray(): T[]; - toObject(): Object; - } + toArray(): T[]; + toObject(): Object; + } - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - module ArrayLikeSequence { - function define(methodName: string[], overrides: Object): Function; - } + module ArrayLikeSequence { + function define(methodName: string[], overrides: Object): Function; + } - interface ArrayLikeSequence extends Sequence { - // define()X; - concat(): ArrayLikeSequence; - first(count?: number): ArrayLikeSequence; - get(index: number): T; - length(): number; - map(mapFn: MapCallback): ArrayLikeSequence; - pop(): ArrayLikeSequence; - rest(count?: number): ArrayLikeSequence; - reverse(): ArrayLikeSequence; - shift(): ArrayLikeSequence; - slice(begin: number, end?: number): ArrayLikeSequence; - } + interface ArrayLikeSequence extends Sequence { + // define()X; + concat(): ArrayLikeSequence; + first(count?: number): ArrayLikeSequence; + get(index: number): T; + length(): number; + map(mapFn: MapCallback): ArrayLikeSequence; + pop(): ArrayLikeSequence; + rest(count?: number): ArrayLikeSequence; + reverse(): ArrayLikeSequence; + shift(): ArrayLikeSequence; + slice(begin: number, end?: number): ArrayLikeSequence; + } - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - module ObjectLikeSequence { - function define(methodName: string[], overrides: Object): Function; - } + module ObjectLikeSequence { + function define(methodName: string[], overrides: Object): Function; + } - interface ObjectLikeSequence extends Sequence { - assign(other: Object): ObjectLikeSequence; - // throws error - //async(): X; - defaults(defaults: Object): ObjectLikeSequence; - functions(): Sequence; - get(property: string): ObjectLikeSequence; - invert(): ObjectLikeSequence; - keys(): Sequence; - omit(properties: string[]): ObjectLikeSequence; - pairs(): Sequence; - pick(properties: string[]): ObjectLikeSequence; - toArray(): T[]; - toObject(): Object; - values(): Sequence; - } + interface ObjectLikeSequence extends Sequence { + assign(other: Object): ObjectLikeSequence; + // throws error + //async(): X; + defaults(defaults: Object): ObjectLikeSequence; + functions(): Sequence; + get(property: string): ObjectLikeSequence; + invert(): ObjectLikeSequence; + keys(): Sequence; + omit(properties: string[]): ObjectLikeSequence; + pairs(): Sequence; + pick(properties: string[]): ObjectLikeSequence; + toArray(): T[]; + toObject(): Object; + values(): Sequence; + } - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - module StringLikeSequence { - function define(methodName: string[], overrides: Object): Function; - } + module StringLikeSequence { + function define(methodName: string[], overrides: Object): Function; + } - interface StringLikeSequence extends SequenceBaser { - charAt(index: number): string; - charCodeAt(index: number): number; - contains(value: string): boolean; - endsWith(suffix: string): boolean; + interface StringLikeSequence extends SequenceBaser { + charAt(index: number): string; + charCodeAt(index: number): number; + contains(value: string): boolean; + endsWith(suffix: string): boolean; - first(): string; - first(count: number): StringLikeSequence; + first(): string; + first(count: number): StringLikeSequence; - indexOf(substring: string, startIndex?: number): number; + indexOf(substring: string, startIndex?: number): number; - last(): string; - last(count: number): StringLikeSequence; + last(): string; + last(count: number): StringLikeSequence; - lastIndexOf(substring: string, startIndex?: number): number; - mapString(mapFn: MapStringCallback): StringLikeSequence; - match(pattern: RegExp): StringLikeSequence; - reverse(): StringLikeSequence; + lastIndexOf(substring: string, startIndex?: number): number; + mapString(mapFn: MapStringCallback): StringLikeSequence; + match(pattern: RegExp): StringLikeSequence; + reverse(): StringLikeSequence; - split(delimiter: string): StringLikeSequence; - split(delimiter: RegExp): StringLikeSequence; + split(delimiter: string): StringLikeSequence; + split(delimiter: RegExp): StringLikeSequence; - startsWith(prefix: string): boolean; - substring(start: number, stop?: number): StringLikeSequence; - toLowerCase(): StringLikeSequence; - toUpperCase(): StringLikeSequence; - } + startsWith(prefix: string): boolean; + substring(start: number, stop?: number): StringLikeSequence; + toLowerCase(): StringLikeSequence; + toUpperCase(): StringLikeSequence; + } } declare var Lazy: LazyJS.LazyStatic; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 93c6b6ee44..dfa5e2e6a0 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -6179,6 +6179,18 @@ declare module _ { **/ parseInt(value: string): number; } + + + //_.property + interface LoDashStatic { + /** + * # Ⓢ + * Creates a "_.pluck" style function, which returns the key value of a given object. + * @param key (string) + * @return the value of that key on the object + **/ + property(key: string): (obj: T) => RT; + } //_.random interface LoDashStatic { diff --git a/marionette/marionette.d.ts b/marionette/marionette.d.ts index cee7b18451..719b3012b0 100644 --- a/marionette/marionette.d.ts +++ b/marionette/marionette.d.ts @@ -213,7 +213,7 @@ declare module Marionette { modelEvents: any; collectionEvents: any; - ui: any; + ui(): any; getTemplate(): any; mixinTemplateHelpers(target?: any): any; @@ -232,7 +232,7 @@ declare module Marionette { constructor(options?: any); - ui: any; + ui(): any; serializeData(): any; render(): ItemView; diff --git a/node/node.d.ts b/node/node.d.ts index 2405b4408d..f2b5eee24c 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -631,7 +631,11 @@ declare module "child_process" { killSignal?: string; }, callback: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; export function exec(command: string, callback: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; - export function execFile(file: string, args: string[], options: { + export function execFile(file: string, + callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], + callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + export function execFile(file: string, args?: string[], options?: { cwd?: string; stdio?: any; customFds?: any; @@ -640,7 +644,7 @@ declare module "child_process" { timeout?: number; maxBuffer?: string; killSignal?: string; - }, callback: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; + }, callback?: (error: Error, stdout: Buffer, stderr: Buffer) =>void ): ChildProcess; export function fork(modulePath: string, args?: string[], options?: { cwd?: string; env?: any; diff --git a/sigmajs/sigmajs-tests.ts b/sigmajs/sigmajs-tests.ts index 7163471a68..26b75d8265 100644 --- a/sigmajs/sigmajs-tests.ts +++ b/sigmajs/sigmajs-tests.ts @@ -62,4 +62,11 @@ module SigmaJsTests { s.killForceAtlas2(); s.startForceAtlas2(); s.stopForceAtlas2(); + + s.cameras[0].goTo({ + angle: 0, + x: 100, + y: 100, + ratio: 1 + }); } diff --git a/sigmajs/sigmajs.d.ts b/sigmajs/sigmajs.d.ts index dae23464f6..8a7a6503dc 100644 --- a/sigmajs/sigmajs.d.ts +++ b/sigmajs/sigmajs.d.ts @@ -5,6 +5,21 @@ /// declare module SigmaJs{ + interface Animation { + camera(camera: Camera, target: { [index: string]: any }, options: { [index: string]: any }): number; + } + + interface Camera { + angle: number; + cameraPosition(x: number, y:number): {x: number; y: number}; + goTo(settings: { [index: string]: any }): void; + graphPosition(x: number, y:number): {x: number; y: number}; + ratio: number; + readPrefix: string; + x: number; + y: number; + } + interface Classes { configurable: Configurable; graph: Graph; @@ -56,6 +71,10 @@ declare module SigmaJs{ nodes(ids: string[]): Node[]; } + interface Miscellaneous { + animation: Animation; + } + interface Node { color?: string; id: string; @@ -75,9 +94,12 @@ declare module SigmaJs{ } interface Renderer { + container: Element; refresh(): Sigma; render(): Sigma; resize(): Sigma; + settings(settings: { [index: string]: any }): void; + settings(settings: { [index: string]: any }): void; } interface RendererConfigs{ @@ -90,12 +112,14 @@ declare module SigmaJs{ addRenderer(): Renderer; addRenderer(configs: RendererConfigs): Renderer; bind(event: string, callback: (e: any) => void): void; + cameras: Camera[]; graph: Graph; killRenderer(renderer: string): Sigma; killRenderer(renderer: Renderer): Sigma; kill(): void; refresh(): void; renderers: Renderer[]; + settings(key: string): any; // forceAtlas2 layout configForceAtlas2(configs: { [key: string]: any }): void; @@ -121,6 +145,7 @@ declare module SigmaJs{ new(container: Element): Sigma; new(configuration: SigmaConfigs): Sigma; classes:Classes; + misc: Miscellaneous; parsers: Parsers; plugins: Plugins; } diff --git a/sipml/sipml.d.ts b/sipml/sipml.d.ts index a4fe327842..84a6944548 100644 --- a/sipml/sipml.d.ts +++ b/sipml/sipml.d.ts @@ -19,7 +19,7 @@ declare module SIPml { public removeEventListener(type: any): void; } - class Session { + class Session extends EventTarget { public accept(configuration?: Session.Configuration): number; public getId(): number; public getRemoteFriendlyName(): string; @@ -30,14 +30,14 @@ declare module SIPml { export module Session { interface Configuration { - audio_remote?: HTMLAudioElement; + audio_remote?: HTMLElement; bandwidth?: Object; expires?: number; from?: string; sip_caps?: Object[]; sip_headers?: Object[]; - video_local?: HTMLVideoElement; - video_remote?: HTMLVideoElement; + video_local?: HTMLElement; + video_remote?: HTMLElement; video_size?: Object; } @@ -83,9 +83,9 @@ declare module SIPml { class Stack extends EventTarget { public constructor(configuration?: Stack.Configuration); public setConfiguration(configuration: Stack.Configuration): number; - public newSession(type: string, configuration: Stack.Configuration): any; + public newSession(type: string, configuration?: Session.Configuration): any; public start(): number; - public stop(timeout: number): number; + public stop(timeout?: number): number; } export module Stack { @@ -147,3 +147,4 @@ declare module SIPml { function setWebRtcType(type: string): boolean; } + diff --git a/svg-pan-zoom/svg-pan-zoom.d.ts b/svg-pan-zoom/svg-pan-zoom.d.ts index 75f223d7e2..4ff1000e4f 100644 --- a/svg-pan-zoom/svg-pan-zoom.d.ts +++ b/svg-pan-zoom/svg-pan-zoom.d.ts @@ -18,7 +18,7 @@ declare module SvgPanZoom { beforeZoom?: (scale:number) => void; onZoom?: (scale:number) => void; beforePan?: (point:IPoint) => void; - onPan?: (point:IPoint) => void; + onPan?: (x:number, y:number) => void; refreshRate?: any; // in hz } @@ -55,7 +55,7 @@ declare module SvgPanZoom { setBeforePan(fn: (point:IPoint)=> void): void; - setOnPan(fn: (point:IPoint)=> void): void; + setOnPan(fn: (x:number, y:number)=> void): void; enableZoom(): void; diff --git a/threejs/detector.d.ts b/threejs/detector.d.ts index b024780618..6cf8a2ca66 100644 --- a/threejs/detector.d.ts +++ b/threejs/detector.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Detector.js +// Type definitions for three.js (Detector.js) // Project: https://github.com/mrdoob/three.js/blob/master/examples/js/Detector.js // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/threejs/three-canvasrenderer.d.ts b/threejs/three-canvasrenderer.d.ts index c751d87228..62f66fc996 100644 --- a/threejs/three-canvasrenderer.d.ts +++ b/threejs/three-canvasrenderer.d.ts @@ -1,4 +1,4 @@ -// Type definitions for CanvasRenderer.js +// Type definitions for three.js (CanvasRenderer.js) // Project: https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CanvasRenderer.js // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/threejs/three-copyshader.d.ts b/threejs/three-copyshader.d.ts index 5eb92ae2bc..0699717a92 100644 --- a/threejs/three-copyshader.d.ts +++ b/threejs/three-copyshader.d.ts @@ -1,4 +1,4 @@ -// Type definitions for CopyShader.js +// Type definitions for three.js (CopyShader.js) // Project: https://github.com/mrdoob/three.js/blob/r68/examples/js/shaders/CopyShader.js // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/threejs/three-css3drenderer.d.ts b/threejs/three-css3drenderer.d.ts index 6f8a3679de..ed218a4c45 100644 --- a/threejs/three-css3drenderer.d.ts +++ b/threejs/three-css3drenderer.d.ts @@ -1,4 +1,4 @@ -// Type definitions for CSS3DRenderer.js +// Type definitions for three.js (CSS3DRenderer.js) // Project: https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/CSS3DRenderer.js // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/threejs/three-effectcomposer.d.ts b/threejs/three-effectcomposer.d.ts index 2066e6f00a..25ada71d5d 100644 --- a/threejs/three-effectcomposer.d.ts +++ b/threejs/three-effectcomposer.d.ts @@ -1,4 +1,4 @@ -// Type definitions for EffectComposer.js +// Type definitions for three.js (EffectComposer.js) // Project: https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/EffectComposer.js // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/threejs/three-maskpass.d.ts b/threejs/three-maskpass.d.ts index 9576b35697..5b36cde828 100644 --- a/threejs/three-maskpass.d.ts +++ b/threejs/three-maskpass.d.ts @@ -1,4 +1,4 @@ -// Type definitions for MaskPass.js +// Type definitions for three.js (MaskPass.js) // Project: https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/MaskPass.js // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/threejs/three-orbitcontrols.d.ts b/threejs/three-orbitcontrols.d.ts index 099f68754d..4f905caa5d 100644 --- a/threejs/three-orbitcontrols.d.ts +++ b/threejs/three-orbitcontrols.d.ts @@ -1,4 +1,4 @@ -// Type definitions for OrbitControls.js +// Type definitions for three.js (OrbitControls.js) // Project: https://github.com/mrdoob/three.js/blob/master/examples/js/controls/OrbitControls.js // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/threejs/three-projector.d.ts b/threejs/three-projector.d.ts index 11d674188f..05b6f678e5 100644 --- a/threejs/three-projector.d.ts +++ b/threejs/three-projector.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Projector.js +// Type definitions for three.js (Projector.js) // Project: https://github.com/mrdoob/three.js/blob/master/examples/js/renderers/Projector.js // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/threejs/three-renderpass.d.ts b/threejs/three-renderpass.d.ts index 4d94c575e5..54d7e42834 100644 --- a/threejs/three-renderpass.d.ts +++ b/threejs/three-renderpass.d.ts @@ -1,4 +1,4 @@ -// Type definitions for RenderPass.js +// Type definitions for three.js (RenderPass.js) // Project: https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/RenderPass.js // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/threejs/three-shaderpass.d.ts b/threejs/three-shaderpass.d.ts index 470aa46d7c..2896f34d8f 100644 --- a/threejs/three-shaderpass.d.ts +++ b/threejs/three-shaderpass.d.ts @@ -1,4 +1,4 @@ -// Type definitions for ShaderPass.js +// Type definitions for three.js (ShaderPass.js) // Project: https://github.com/mrdoob/three.js/blob/r68/examples/js/postprocessing/ShaderPass.js // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/threejs/three-trackballcontrols.d.ts b/threejs/three-trackballcontrols.d.ts index ad6ffa9c36..21d0968125 100644 --- a/threejs/three-trackballcontrols.d.ts +++ b/threejs/three-trackballcontrols.d.ts @@ -1,4 +1,4 @@ -// Type definitions for TrackballControls.js +// Type definitions for three.js (TrackballControls.js) // Project: https://github.com/mrdoob/three.js/blob/master/examples/js/controls/TrackballControls.js // Definitions by: Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/threejs/three.d.ts b/threejs/three.d.ts index 2a5535cbb5..02179ff158 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -1,4 +1,4 @@ -// Type definitions for three.js r68 +// Type definitions for three.js r69 // Project: http://mrdoob.github.com/three.js/ // Definitions by: Kon , Satoru Kimura // Definitions: https://github.com/borisyankov/DefinitelyTyped diff --git a/traceback/traceback-tests.ts b/traceback/traceback-tests.ts new file mode 100644 index 0000000000..d0772b5972 --- /dev/null +++ b/traceback/traceback-tests.ts @@ -0,0 +1,29 @@ +/// +/// + +function testTraceback() { + var TracebackStaticClass: TracebackStatic = function () { + return [{ + name: 'some', + path: 'nice', + file: 'good', + line: 113, + col: 32, + pos: 43, + fun: {'x-x': 'any'}, + method: 'like', + this: { no: "thing"}, + type: 'goal', + origin: ['bad'], + is_top: true, + is_eval: false, + is_native: true, + is_ctor: true + }]; + }; + + var traceback: Traceback[] = TracebackStaticClass(); + + var TBReq: TracebackStatic = require('traceback'); + var traceback: Traceback[] = TBReq(); +} diff --git a/traceback/traceback.d.ts b/traceback/traceback.d.ts new file mode 100644 index 0000000000..4ea2992ecd --- /dev/null +++ b/traceback/traceback.d.ts @@ -0,0 +1,32 @@ +// Type definitions for Traceback v0.3.1 +// Project: http://github.com/iriscouch/traceback +// Definitions by: Michael Zabka +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface Traceback { + name: string; // | The function name + path: string; // | The absolute path of the file defining the function + file: string; // | The basename of the path file ("example.js") + line: number; // | The line number in the file + col: number; // | The column number in the file + pos: number; // | The byte position in the file + fun: any; // | The function itself + method: string; // | If this function was called as a method, the name it is stored as + this: any; // | The object bound to the label this in the function + type: string; // | The type of this; the name of the constructor function (Object, ReadStream, etc.) + origin: any; // | The CallSite that ran eval(), if this frame is an eval + is_top: boolean; // | Boolean indicating whether the function was called with a global this + is_eval: boolean; // | Boolean indicating whether the function comes from an eval() call + is_native: boolean; // | Boolean indicating whether the function is native + is_ctor: boolean; // | Boolean indicating whether this is a constructor (new) call +} + +interface TracebackStatic { + (): Traceback[]; +} + +declare var traceback: TracebackStatic; + +declare module "traceback" { + export = traceback; +}