diff --git a/dustjs-linkedin/dustjs-linkedin.d.ts b/dustjs-linkedin/dustjs-linkedin.d.ts index fd6558332..9c7f63630 100644 --- a/dustjs-linkedin/dustjs-linkedin.d.ts +++ b/dustjs-linkedin/dustjs-linkedin.d.ts @@ -158,11 +158,11 @@ declare module "dustjs-linkedin" { export function escapeHtml(html: string): string; export function escapeJs(js: string): string; - declare var helpers: { + var helpers: { [key: string]: (chk: Chunk, ctx: Context, bodies?: any, params?: any) => any; }; - declare var filters: { + var filters: { [key: string]: (value: string) => string; }; } \ No newline at end of file diff --git a/fabricjs/fabricjs.d.ts b/fabricjs/fabricjs.d.ts index e3f8da18b..26261abb4 100644 --- a/fabricjs/fabricjs.d.ts +++ b/fabricjs/fabricjs.d.ts @@ -149,6 +149,7 @@ declare module fabric { ry: number; complexity(): number; + initialize(options: any); initialize(points: number[], options: any): IRect; toObject(propertiesToInclude: any[]): any; toSVG(): string; @@ -172,6 +173,7 @@ declare module fabric { type: string; useNative: Boolean; + initialize(options: any); initialize(text: string, options: any): IText; toString(): string; render(ctx: CanvasRenderingContext2D, noTransform: bool); @@ -387,15 +389,16 @@ declare module fabric { destroy(): IGroup; getObjects(): IObject[]; hasMoved(): bool; + initialize(options: any); initialize(objects, options): any; item(index): IObject; - remove(object): IGroup; + remove(object?): IGroup; removeWithUpdate(object): IGroup; render(ctx, noTransform): void; saveCoords(): IGroup; setObjectsCoords(): IGroup; size(): number; - toGrayscale(): void; + toGrayscale(): IGroup; toObject(propertiesToInclude: any[]): any; tostring(): string; toSVG(): string; @@ -409,6 +412,7 @@ declare module fabric { y2: number; complexity(): number; + initialize(options: any); initialize(points: number[], options: any): ILine; toObject(propertiesToInclude: any[]): any; toSVG(): string; @@ -424,11 +428,13 @@ declare module fabric { filters: any; applyFilters(callback); + clone(callback?, propertiesToInclude?): IObject; clone(propertiesToInclude, callback); complexity(): number; getElement(): HTMLImageElement; getOriginalSize(): { width: number; height: number; }; getSrc(): string; + initialize(options: any); initialize(element: string, options: any); initialize(element: HTMLImageElement, options: any); render(ctx: CanvasRenderingContext2D, noTransform: bool); @@ -453,6 +459,7 @@ declare module fabric { export interface IPath extends IObject { complexity(): number; + initialize(options: any); initialize(path, options); render(ctx: CanvasRenderingContext2D, noTransform: bool); toDatalessObject(propertiesToInclude): any; @@ -463,6 +470,7 @@ declare module fabric { export interface IPolygon extends IObject { complexity(): number; + initialize(options: any); initialize(points, options); toObject(propertiesToInclude): any; toSVG(): string; @@ -470,6 +478,7 @@ declare module fabric { export interface IPolyline extends IObject { complexity(): number; + initialize(options: any); initialize(points, options); toObject(propertiesToInclude): any; toSVG(): string; @@ -477,11 +486,12 @@ declare module fabric { export interface IPathGroup extends IObject { complexity(): number; + initialize(options: any); initialize(paths, options); isSameColor(): bool; render(ctx: CanvasRenderingContext2D); toDatalessObject(propertiesToInclude): any; - toGrayscale(); + toGrayscale(): IPathGroup; toObject(propertiesToInclude): any; tostring(): string; toSVG(): string; @@ -660,18 +670,18 @@ declare module fabric { export interface ITriangleOptions extends IObjectOptions { } - declare var Rect: { + var Rect: { fromElement(element: SVGElement, options: IRectOptions): IRect; fromObject(object): IRect; new (options?: IRectOptions): IRect; prototype: any; } - declare var Triangle: { + var Triangle: { new (options?: ITriangleOptions): ITriangle; } - declare var Canvas: { + var Canvas: { new (element: HTMLCanvasElement, options?: ICanvasOptions): ICanvas; new (element: string, options?: ICanvasOptions): ICanvas; @@ -680,7 +690,7 @@ declare module fabric { prototype: any; } - declare var StaticCanvas: { + var StaticCanvas: { new (element: HTMLCanvasElement, options?: ICanvasOptions): ICanvas; new (element: string, options?: ICanvasOptions): ICanvas; @@ -689,7 +699,7 @@ declare module fabric { prototype: any; } - declare var Circle: { + var Circle: { ATTRIBUTE_NAMES: string[]; fromElement(element: SVGElement, options: ICircleOptions): ICircle; fromObject(object): ICircle; @@ -697,11 +707,11 @@ declare module fabric { prototype: any; } - declare var Group: { + var Group: { new (items?: any[], options?: IObjectOptions): IGroup; } - declare var Line: { + var Line: { ATTRIBUTE_NAMES: string[]; fromElement(element: SVGElement, options): ILine; fromObject(object): ILine; @@ -709,53 +719,53 @@ declare module fabric { new (points: number[], objObjects?: IObjectOptions): ILine; } - declare var Intersection: { + var Intersection: { intersectLineLine(a1, a2, b1, b2); intersectLinePolygon(a1, a2, points); intersectPolygonPolygon(points1, points2); intersectPolygonRectangle(points, r1, r2); } - declare var Path: { + var Path: { fromElement(element: SVGElement, options): IPath; fromObject(object): IPath; new (): IPath; } - declare var PathGroup: { + var PathGroup: { fromObject(object): IPathGroup; new (): IPathGroup; prototype: any; } - declare var Point: { + var Point: { new (x, y): IPoint; prototype: any; } - declare var Object: { + var Object: { prototype: any; } - declare var Polygon: { + var Polygon: { fromObject(object): IPolygon; fromElement(element: SVGElement, options): IPolygon; new (): IPolygon; prototype: any; } - declare var Polyline: { + var Polyline: { fromObject(object): IPolyline; fromElement(element: SVGElement, options): IPolyline; new (): IPolyline; prototype: any; } - declare var Text: { + var Text: { new (text: string, options?: ITextOptions): IText; } - declare var Image: { + var Image: { fromURL(url: string): IImage; fromURL(url: string, callback: (image: IImage) => any): IImage; fromURL(url: string, callback: (image: IImage) => any, objObjects: IObjectOptions): IImage; @@ -809,7 +819,7 @@ declare module fabric { } - declare var util: { + var util: { addClass(element: HTMLElement, className: string); addListener(element, eventName: string, handler); animate(options: { @@ -846,5 +856,4 @@ declare module fabric { toFixed(number, fractionDigits); wrapElement(element: HTMLElement, wrapper, attributes); } -}; - +} diff --git a/fabricjs/tests/sample1.ts b/fabricjs/sample1-tests.ts similarity index 94% rename from fabricjs/tests/sample1.ts rename to fabricjs/sample1-tests.ts index f494d84ce..08a80048f 100644 --- a/fabricjs/tests/sample1.ts +++ b/fabricjs/sample1-tests.ts @@ -1,4 +1,4 @@ -/// +/// var canvas = new fabric.Canvas('c', { hoverCursor: 'pointer', diff --git a/fabricjs/tests/sample2.ts b/fabricjs/sample2-tests.ts similarity index 97% rename from fabricjs/tests/sample2.ts rename to fabricjs/sample2-tests.ts index a04f2d1b8..0cf220d34 100644 --- a/fabricjs/tests/sample2.ts +++ b/fabricjs/sample2-tests.ts @@ -1,4 +1,4 @@ -/// +/// var dot, i, t1, t2, diff --git a/fabricjs/tests/sample3.ts b/fabricjs/sample3-tests.ts similarity index 97% rename from fabricjs/tests/sample3.ts rename to fabricjs/sample3-tests.ts index 5393f6c64..1d5ceab28 100644 --- a/fabricjs/tests/sample3.ts +++ b/fabricjs/sample3-tests.ts @@ -1,4 +1,4 @@ -/// +/// var $ = function(id){return document.getElementById(id)}; @@ -28,7 +28,7 @@ canvas.on({ for (var i = 0; i < filters.length; i++) { var checkBox = $(filters[i]); - var image = canvas.getActiveObject(); + var image = canvas.getActiveObject(); checkBox.checked = !!image.filters[i]; } }, diff --git a/fabricjs/tests/sample4.ts b/fabricjs/sample4-tests.ts similarity index 96% rename from fabricjs/tests/sample4.ts rename to fabricjs/sample4-tests.ts index a1cfd0e4c..18db919aa 100644 --- a/fabricjs/tests/sample4.ts +++ b/fabricjs/sample4-tests.ts @@ -1,4 +1,4 @@ -/// +/// var canvas = new fabric.Canvas('c'); var $ = function (id) { return document.getElementById(id); }; diff --git a/fabricjs/tests/sample5.ts b/fabricjs/sample5-tests.ts similarity index 97% rename from fabricjs/tests/sample5.ts rename to fabricjs/sample5-tests.ts index 399f32ad9..e3f2a6a5c 100644 --- a/fabricjs/tests/sample5.ts +++ b/fabricjs/sample5-tests.ts @@ -1,4 +1,4 @@ -/// +/// module fabric { export interface CircleWithLineInfos extends ICircle { diff --git a/fabricjs/tests/sample6.ts b/fabricjs/sample6-tests.ts similarity index 94% rename from fabricjs/tests/sample6.ts rename to fabricjs/sample6-tests.ts index 48123ce62..bd87ffec8 100644 --- a/fabricjs/tests/sample6.ts +++ b/fabricjs/sample6-tests.ts @@ -1,4 +1,4 @@ -/// +/// var canvas = new fabric.Canvas('c'); fabric.loadSVGFromURL('../assets/135.svg', function (objects) { diff --git a/fabricjs/tests/sample7.ts b/fabricjs/sample7-tests.ts similarity index 95% rename from fabricjs/tests/sample7.ts rename to fabricjs/sample7-tests.ts index 2fe0c74ba..892f47730 100644 --- a/fabricjs/tests/sample7.ts +++ b/fabricjs/sample7-tests.ts @@ -1,4 +1,4 @@ -/// +/// module fabric { export interface ImageWithInfo extends IImage { diff --git a/fabricjs/tests/sample8.ts b/fabricjs/sample8-tests.ts similarity index 94% rename from fabricjs/tests/sample8.ts rename to fabricjs/sample8-tests.ts index a8d8ef481..7e5f2e296 100644 --- a/fabricjs/tests/sample8.ts +++ b/fabricjs/sample8-tests.ts @@ -1,4 +1,4 @@ -/// +/// module fabric { export interface ImageWithInfo extends IImage { @@ -41,7 +41,7 @@ function updateComplexity() { }, 100); } -document.getElementById('commands').onclick = function (ev) { +document.getElementById('commands').onclick = function (ev: any) { var ev: any = ev || window.event; if (ev.preventDefault) { @@ -450,8 +450,8 @@ if (supportsColorpicker()) { }, 100); if (document.location.search.indexOf('guidelines') > -1) { - initCenteringGuidelines(canvas); - initAligningGuidelines(canvas); + //initCenteringGuidelines(canvas); + //initAligningGuidelines(canvas); } gradientifyBtn.onclick = function() { @@ -475,7 +475,7 @@ if (supportsColorpicker()) { var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { - this.value = (activeObject).text; + this.value = (activeObject).text; } }; textEl.onkeyup = function(e) { @@ -485,7 +485,7 @@ if (supportsColorpicker()) { canvas.discardActiveObject(); } else { - (activeObject).text = this.value; + (activeObject).text = this.value; } canvas.renderAll(); } @@ -497,7 +497,7 @@ if (supportsColorpicker()) { activeObjectButtons.push(cmdUnderlineBtn); cmdUnderlineBtn.disabled = true; cmdUnderlineBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textDecoration = (activeObject.textDecoration == 'underline' ? '' : 'underline'); this.className = activeObject.textDecoration ? 'selected' : ''; @@ -511,7 +511,7 @@ if (supportsColorpicker()) { activeObjectButtons.push(cmdLinethroughBtn); cmdLinethroughBtn.disabled = true; cmdLinethroughBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textDecoration = (activeObject.textDecoration == 'line-through' ? '' : 'line-through'); this.className = activeObject.textDecoration ? 'selected' : ''; @@ -525,7 +525,7 @@ if (supportsColorpicker()) { activeObjectButtons.push(cmdOverlineBtn); cmdOverlineBtn.disabled = true; cmdOverlineBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textDecoration = (activeObject.textDecoration == 'overline' ? '' : 'overline'); this.className = activeObject.textDecoration ? 'selected' : ''; @@ -539,7 +539,7 @@ if (supportsColorpicker()) { activeObjectButtons.push(cmdBoldBtn); cmdBoldBtn.disabled = true; cmdBoldBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.fontWeight = (activeObject.fontWeight == 'bold' ? '' : 'bold'); this.className = activeObject.fontWeight ? 'selected' : ''; @@ -553,7 +553,7 @@ if (supportsColorpicker()) { activeObjectButtons.push(cmdItalicBtn); cmdItalicBtn.disabled = true; cmdItalicBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.fontStyle = (activeObject.fontStyle == 'italic' ? '' : 'italic'); this.className = activeObject.fontStyle ? 'selected' : ''; @@ -567,7 +567,7 @@ if (supportsColorpicker()) { activeObjectButtons.push(cmdShadowBtn); cmdShadowBtn.disabled = true; cmdShadowBtn.onclick = function() { - var activeObject = canvas.getActiveObject(); + var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textShadow = !activeObject.textShadow ? 'rgba(0,0,0,0.2) 2px 2px 10px' : ''; this.className = activeObject.textShadow ? 'selected' : ''; @@ -581,7 +581,7 @@ if (supportsColorpicker()) { activeObjectButtons.push(textAlignSwitch); textAlignSwitch.disabled = true; textAlignSwitch.onchange = function() { - var activeObject = canvas.getActiveObject(); + var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.textAlign = this.value.toLowerCase(); canvas.renderAll(); @@ -594,7 +594,7 @@ if (supportsColorpicker()) { activeObjectButtons.push(fontFamilySwitch); fontFamilySwitch.disabled = true; fontFamilySwitch.onchange = function() { - var activeObject = canvas.getActiveObject(); + var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.fontFamily = this.value; canvas.renderAll(); @@ -605,7 +605,7 @@ if (supportsColorpicker()) { var bgColorField = document.getElementById('text-bg-color'); if (bgColorField) { bgColorField.onchange = function() { - var activeObject = canvas.getActiveObject(); + var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.backgroundColor = this.value; canvas.renderAll(); @@ -616,7 +616,7 @@ if (supportsColorpicker()) { var strokeColorField = document.getElementById('text-stroke-color'); if (strokeColorField) { strokeColorField.onchange = function() { - var activeObject = canvas.getActiveObject(); + var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.strokeStyle = this.value; canvas.renderAll(); @@ -639,7 +639,7 @@ if (supportsColorpicker()) { label.appendChild(slider); slider.title = "Line height"; slider.onchange = function(){ - var activeObject = canvas.getActiveObject(); + var activeObject = canvas.getActiveObject(); if (activeObject && activeObject.type === 'text') { activeObject.lineHeight = this.value; canvas.renderAll(); @@ -661,7 +661,7 @@ if (supportsColorpicker()) { }); }; - if (typeof Cufon !== 'undefined') { - Cufon.fonts.delicious.offsetLeft = 75; - Cufon.fonts.delicious.offsetTop = 25; - } \ No newline at end of file + //if (typeof Cufon !== 'undefined') { + // Cufon.fonts.delicious.offsetLeft = 75; + // Cufon.fonts.delicious.offsetTop = 25; + //} \ No newline at end of file diff --git a/google.analytics/ga.d.ts b/google.analytics/ga.d.ts index b24bc6649..c7de005e9 100644 --- a/google.analytics/ga.d.ts +++ b/google.analytics/ga.d.ts @@ -3,7 +3,7 @@ // Definitions by: Ronnie Haakon Hegelund // Definitions: https://github.com/borisyankov/DefinitelyTyped -class Tracker { +declare class Tracker { _trackPageview(): void; _getName(): string; _getAccount(): string; diff --git a/hammerjs/hammerjs.d.ts b/hammerjs/hammerjs.d.ts index 4283191bc..f933058ce 100644 --- a/hammerjs/hammerjs.d.ts +++ b/hammerjs/hammerjs.d.ts @@ -52,7 +52,7 @@ interface HammerDirectionEvent extends HammerEvent { distanceY: number; } -class Hammer { +declare class Hammer { constructor (element: any, options?: HammerOptions); ondragstart: (event: HammerDirectionEvent) => void; diff --git a/jake/jake.d.ts b/jake/jake.d.ts index ec6f20d2b..bf0f77a60 100644 --- a/jake/jake.d.ts +++ b/jake/jake.d.ts @@ -8,28 +8,28 @@ /** * Complets an asynchronous task, allowing Jake's execution to proceed to the next task */ -function complete(): void; +declare function complete(): void; /** * Creates a description for a Jake Task (or FileTask, DirectoryTask). When invoked, the description that iscreated will be associated with whatever Task is created next. * @param description The description for the Task */ -function desc(description:string): void; +declare function desc(description:string): void; /** * Creates a Jake DirectoryTask. Can be used as a prerequisite for FileTasks, or for simply ensuring a directory exists for use with a Task's action. * @param name The name of the DiretoryTask */ -function directory(name:string): jake.DirectoryTask; +declare function directory(name:string): jake.DirectoryTask; /** * Causes Jake execution to abort with an error. Allows passing an optional error code, which will be used to set the exit-code of exiting process. * @param err The error to thow when aborting execution. If this argument is an Error object, it will simply be thrown. If a String, it will be used as the error-message. (If it is a multi-line String, the first line will be used as the Error message, and the remaining lines will be used as the error-stack.) */ -function fail(...err:string[]): void; -function fail(...err:Error[]): void; -function fail(...err:any[]): void; +declare function fail(...err:string[]): void; +declare function fail(...err:Error[]): void; +declare function fail(...err:any[]): void; /** * Creates a Jake FileTask. @@ -38,14 +38,14 @@ function fail(...err:any[]): void; * @param action The action to perform for this task * @param opts Perform this task asynchronously. If you flag a task with this option, you must call the global `complete` method inside the task's action, for execution to proceed to the next task. */ -function file(name:string, prereqs?:string[], action?:()=>void, opts?:jake.FileTaskOptions): jake.FileTask; +declare function file(name:string, prereqs?:string[], action?:()=>void, opts?:jake.FileTaskOptions): jake.FileTask; /** * Creates a namespace which allows logical grouping of tasks, and prevents name-collisions with task-names. Namespaces can be nested inside of other namespaces. * @param name The name of the namespace * @param scope The enclosing scope for the namespaced tasks */ -function namespace(name:string, scope:()=>void): void; +declare function namespace(name:string, scope:()=>void): void; /** * @param name The name of the Task @@ -53,11 +53,11 @@ function namespace(name:string, scope:()=>void): void; * @param action The action to perform for this task * @param opts */ -function task(name:string, prereqs?:string[], action?:(...params:any[])=>any, opts?:jake.TaskOptions): jake.Task; -function task(name:string, action?:(...params:any[])=>any, opts?:jake.TaskOptions): jake.Task; -function task(name:string, opts?:jake.TaskOptions, action?:(...params:any[])=>any): jake.Task; +declare function task(name:string, prereqs?:string[], action?:(...params:any[])=>any, opts?:jake.TaskOptions): jake.Task; +declare function task(name:string, action?:(...params:any[])=>any, opts?:jake.TaskOptions): jake.Task; +declare function task(name:string, opts?:jake.TaskOptions, action?:(...params:any[])=>any): jake.Task; -module jake{ +declare module jake{ //////////////////////////////////////////////////////////////////////////////////// // File-utils ////////////////////////////////////////////////////////////////////// diff --git a/jszip/jszip.d.ts b/jszip/jszip.d.ts index af6c58329..0ed833fed 100644 --- a/jszip/jszip.d.ts +++ b/jszip/jszip.d.ts @@ -3,7 +3,7 @@ // Definitions by: mzeiher // Definitions: https://github.com/borisyankov/DefinitelyTyped -module jszip { +declare module jszip { export interface JSZip { /** * Get a file from the archive diff --git a/linq/linq.d.ts b/linq/linq.d.ts index 6cee18a08..960b20a90 100644 --- a/linq/linq.d.ts +++ b/linq/linq.d.ts @@ -5,7 +5,7 @@ // todo: jQuery plugin, RxJS Binding -module linq { +declare module linq { interface EnumerableStatic { Choice(...contents: any[]): Enumerable; diff --git a/scroller/easyscroller.d.ts b/scroller/easyscroller.d.ts index 5b6477fe5..edc3c55d6 100644 --- a/scroller/easyscroller.d.ts +++ b/scroller/easyscroller.d.ts @@ -6,7 +6,7 @@ /// -class EasyScroller { +declare class EasyScroller { constructor (content: any, options: ScrollerOptions); render(): void; diff --git a/scroller/scroller-tests.ts b/scroller/scroller-tests.ts index ff12a8639..941e05ff1 100644 --- a/scroller/scroller-tests.ts +++ b/scroller/scroller-tests.ts @@ -41,7 +41,7 @@ function test_canvas() { function test_domlist() { var container = document.getElementById("container"); var content = document.getElementById("content"); - var refreshElem = content.getElementsByTagName("div")[0]; + var refreshElem = content.getElementsByTagName("div")[0]; var scroller = new Scroller(render, { scrollingX: false }); diff --git a/scroller/scroller.d.ts b/scroller/scroller.d.ts index 72bf30d2f..b1e439b0a 100644 --- a/scroller/scroller.d.ts +++ b/scroller/scroller.d.ts @@ -28,7 +28,7 @@ interface ScrollValuesWithZoom extends ScrollValues { zoom: number; } -class Scroller { +declare class Scroller { constructor (callback: (left: number, top: number, zoom: number) => void , options: ScrollerOptions); setDimensions(clientWidth: number, clientHeight: number, contentWidth: number, contentHeight: number): void; diff --git a/soundjs/soundjs.d.ts b/soundjs/soundjs.d.ts index a00d33775..24eeb0139 100644 --- a/soundjs/soundjs.d.ts +++ b/soundjs/soundjs.d.ts @@ -10,7 +10,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -module createjs { +declare module createjs { export class FlashPlugin { // properties static BASE_PATH: string; diff --git a/threejs/three-r55.d.ts b/threejs/three-r55.d.ts index d14ab7de4..29b68a69e 100644 --- a/threejs/three-r55.d.ts +++ b/threejs/three-r55.d.ts @@ -7,9 +7,9 @@ * */ -interface WebGLRenderingContext {}; +interface WebGLRenderingContext {} -module THREE { +declare module THREE { export var REVISION: string; // GL STATE CONSTANTS @@ -5259,6 +5259,7 @@ module THREE { lensFlares: LensFlareProperty[]; positionScreen: Vector3; customUpdateCallback: () => void; + add(object: Object3D): void; add(texture?: Texture, size?: number, distance?: number, blending?: Blending, color?: number, opacity?: number): void; updateLensFlares(): void; } diff --git a/threejs/three-tests.ts b/threejs/three-tests.ts index 5b3bbb2ca..e075af9c5 100644 --- a/threejs/three-tests.ts +++ b/threejs/three-tests.ts @@ -3235,7 +3235,7 @@ interface HTMLElement{ // Cubes - var geometry = new THREE.CubeGeometry( 50, 50, 50 ); + geometry = new THREE.CubeGeometry( 50, 50, 50 ); var materialCube = new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: true } ); for ( var i = 0; i < 100; i ++ ) { @@ -4085,7 +4085,7 @@ var container, stats; // line - var geometry = shape.createPointsGeometry(); + geometry = shape.createPointsGeometry(); var materialLine = new THREE.LineBasicMaterial( { linewidth: 10, color: 0x333333, transparent: true } ); var line = new THREE.Line( geometry, materialLine ); @@ -4783,7 +4783,7 @@ var container, stats; // Cubes - var geometry = new THREE.CubeGeometry( 50, 50, 50 ); + geometry = new THREE.CubeGeometry( 50, 50, 50 ); var cubeMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, shading: THREE.FlatShading, overdraw: true } ); for ( var i = 0; i < 100; i ++ ) { @@ -5725,7 +5725,7 @@ var container, stats; // Spheres - var geometry = new THREE.SphereGeometry( 100, 14, 7 ); + geometry = new THREE.SphereGeometry( 100, 14, 7 ); var materials:THREE.Material[] = [ @@ -6708,7 +6708,7 @@ var container, stats; // https://github.com/mrdoob/three.js/blob/master/examples/canvas_particles_sprites.html -()=>{ +() => { var container, stats; var camera, scene, renderer, particle; var mouseX = 0, mouseY = 0; @@ -6721,43 +6721,43 @@ var container, stats; function init() { - container = document.createElement( 'div' ); - document.body.appendChild( container ); + container = document.createElement('div'); + document.body.appendChild(container); - camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 5000 ); + camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 1, 5000); camera.position.z = 1000; scene = new THREE.Scene(); - var material = new THREE.ParticleBasicMaterial( { map: new THREE.Texture( generateSprite() ), blending: THREE.AdditiveBlending } ); + var material = new THREE.ParticleBasicMaterial({ map: new THREE.Texture(generateSprite()), blending: THREE.AdditiveBlending }); - for ( var i = 0; i < 1000; i++ ) { + for (var i = 0; i < 1000; i++) { - particle = new THREE.Particle( material ); + particle = new THREE.Particle(material); - initParticle( particle, i * 10 ); + initParticle(particle, i * 10); - scene.add( particle ); + scene.add(particle); } renderer = new THREE.CanvasRenderer(); - renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.setSize(window.innerWidth, window.innerHeight); renderer.sortElements = false; - renderer.setClearColorHex( 0x0000ff, 0.25 ); - container.appendChild( renderer.domElement ); + renderer.setClearColorHex(0x0000ff, 0.25); + container.appendChild(renderer.domElement); stats = new Stats(); stats.domElement.style.position = 'absolute'; stats.domElement.style.top = '0px'; - container.appendChild( stats.domElement ); + container.appendChild(stats.domElement); - document.addEventListener( 'mousemove', onDocumentMouseMove, false ); - document.addEventListener( 'touchstart', onDocumentTouchStart, false ); - document.addEventListener( 'touchmove', onDocumentTouchMove, false ); + document.addEventListener('mousemove', onDocumentMouseMove, false); + document.addEventListener('touchstart', onDocumentTouchStart, false); + document.addEventListener('touchmove', onDocumentTouchMove, false); // - window.addEventListener( 'resize', onWindowResize, false ); + window.addEventListener('resize', onWindowResize, false); } @@ -6769,31 +6769,31 @@ var container, stats; camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); - renderer.setSize( window.innerWidth, window.innerHeight ); + renderer.setSize(window.innerWidth, window.innerHeight); } function generateSprite() { - var canvas = document.createElement( 'canvas' ); + var canvas = document.createElement('canvas'); canvas.width = 16; canvas.height = 16; - var context = canvas.getContext( '2d' ); - var gradient = context.createRadialGradient( canvas.width / 2, canvas.height / 2, 0, canvas.width / 2, canvas.height / 2, canvas.width / 2 ); - gradient.addColorStop( 0, 'rgba(255,255,255,1)' ); - gradient.addColorStop( 0.2, 'rgba(0,255,255,1)' ); - gradient.addColorStop( 0.4, 'rgba(0,0,64,1)' ); - gradient.addColorStop( 1, 'rgba(0,0,0,1)' ); + var context = canvas.getContext('2d'); + var gradient = context.createRadialGradient(canvas.width / 2, canvas.height / 2, 0, canvas.width / 2, canvas.height / 2, canvas.width / 2); + gradient.addColorStop(0, 'rgba(255,255,255,1)'); + gradient.addColorStop(0.2, 'rgba(0,255,255,1)'); + gradient.addColorStop(0.4, 'rgba(0,0,64,1)'); + gradient.addColorStop(1, 'rgba(0,0,0,1)'); context.fillStyle = gradient; - context.fillRect( 0, 0, canvas.width, canvas.height ); + context.fillRect(0, 0, canvas.width, canvas.height); return canvas; } - function initParticle( particle, delay ) { + function initParticle(particle, delay) { var particle = this instanceof THREE.Particle ? this : particle; var delay = delay !== undefined ? delay : 0; @@ -6803,53 +6803,53 @@ var container, stats; particle.position.z = 0; particle.scale.x = particle.scale.y = Math.random() * 3 + 1; - new TWEEN.Tween( particle ) - .delay( delay ) - .to( {}, 10000 ) - .onComplete( initParticle ) + new TWEEN.Tween(particle) + .delay(delay) + .to({}, 10000) + .onComplete(initParticle) .start(); - new TWEEN.Tween( particle.position ) - .delay( delay ) - .to( { x: Math.random() * 4000 - 2000, y: Math.random() * 1000 - 500, z: Math.random() * 4000 - 2000 }, 10000 ) + new TWEEN.Tween(particle.position) + .delay(delay) + .to({ x: Math.random() * 4000 - 2000, y: Math.random() * 1000 - 500, z: Math.random() * 4000 - 2000 }, 10000) .start(); - new TWEEN.Tween( particle.scale ) - .delay( delay ) - .to( { x: 0, y: 0 }, 10000 ) + new TWEEN.Tween(particle.scale) + .delay(delay) + .to({ x: 0, y: 0 }, 10000) .start(); } // - function onDocumentMouseMove( event ) { + function onDocumentMouseMove(event) { mouseX = event.clientX - windowHalfX; mouseY = event.clientY - windowHalfY; } - function onDocumentTouchStart( event ) { + function onDocumentTouchStart(event) { - if ( event.touches.length == 1 ) { + if (event.touches.length == 1) { event.preventDefault(); - mouseX = event.touches[ 0 ].pageX - windowHalfX; - mouseY = event.touches[ 0 ].pageY - windowHalfY; + mouseX = event.touches[0].pageX - windowHalfX; + mouseY = event.touches[0].pageY - windowHalfY; } } - function onDocumentTouchMove( event ) { + function onDocumentTouchMove(event) { - if ( event.touches.length == 1 ) { + if (event.touches.length == 1) { event.preventDefault(); - mouseX = event.touches[ 0 ].pageX - windowHalfX; - mouseY = event.touches[ 0 ].pageY - windowHalfY; + mouseX = event.touches[0].pageX - windowHalfX; + mouseY = event.touches[0].pageY - windowHalfY; } @@ -6859,7 +6859,7 @@ var container, stats; function animate() { - requestAnimationFrame( animate ); + requestAnimationFrame(animate); render(); stats.update(); @@ -6870,14 +6870,16 @@ var container, stats; TWEEN.update(); - camera.position.x += ( mouseX - camera.position.x ) * 0.05; - camera.position.y += ( - mouseY - camera.position.y ) * 0.05; - camera.lookAt( scene.position ); + camera.position.x += (mouseX - camera.position.x) * 0.05; + camera.position.y += (- mouseY - camera.position.y) * 0.05; + camera.lookAt(scene.position); - renderer.render( scene, camera ); + renderer.render(scene, camera); } -var container, stats; +}; +() => { + var container, stats; var camera, scene, renderer, particle; var mouseX = 0, mouseY = 0; @@ -16400,7 +16402,7 @@ function render() { F.prototype = klass.prototype; - return new F( klass, args ); + return F( klass, args ); }; @@ -17263,7 +17265,7 @@ function render() { F.prototype = klass.prototype; - return new F( klass, args ); + return F( klass, args ); }; @@ -20869,7 +20871,7 @@ function render() { objects = []; - var sphere, geometry, material; + var sphere, material; for ( var i = 0, l = materials.length; i < l; i ++ ) { @@ -21374,7 +21376,8 @@ function render() { object: null, buttons: null, - materials: null + materials: null, + mmap: null }, @@ -21390,7 +21393,8 @@ function render() { object: null, buttons: null, - materials: null + materials: null, + mmap: null }, @@ -21406,7 +21410,8 @@ function render() { object: null, buttons: null, - materials: null + materials: null, + mmap: null }, @@ -21422,7 +21427,8 @@ function render() { object: null, buttons: null, - materials: null + materials: null, + mmap: null } diff --git a/threejs/three.d.ts b/threejs/three.d.ts index 9a18dd72e..e8bf50d68 100644 --- a/threejs/three.d.ts +++ b/threejs/three.d.ts @@ -5,7 +5,7 @@ interface WebGLRenderingContext {} -module THREE { +declare module THREE { export var REVISION: string; // GL STATE CONSTANTS @@ -1277,7 +1277,7 @@ module THREE { degToRad(degrees: number): number; radToDeg(radians: number): number; - }; + } /** * @@ -5777,7 +5777,8 @@ module THREE { constructor(texture?: Texture, size?: number, distance?: number, blending?: Blending, color?: Color); lensFlares: LensFlareProperty[]; positionScreen: Vector3; - customUpdateCallback: (object:LensFlare) => void; + customUpdateCallback: (object: LensFlare) => void; + add(object: Object3D): void; add(texture?: Texture, size?: number, distance?: number, blending?: Blending, color?: Color, opacity?: number): void; updateLensFlares(): void; } diff --git a/webaudioapi/waa-20120802.d.ts b/webaudioapi/waa-20120802.d.ts index b90c4b959..271bb4139 100644 --- a/webaudioapi/waa-20120802.d.ts +++ b/webaudioapi/waa-20120802.d.ts @@ -71,7 +71,7 @@ interface AudioNode { numberOfInputs: number; numberOfOutputs: number; -}; +} interface AudioSourceNode extends AudioNode { diff --git a/webaudioapi/waa-nightly.d.ts b/webaudioapi/waa-nightly.d.ts index 38ef2f401..edacc8e10 100644 --- a/webaudioapi/waa-nightly.d.ts +++ b/webaudioapi/waa-nightly.d.ts @@ -93,7 +93,7 @@ interface DelayNode extends AudioNode { delayTime: AudioParam; -}; +} interface AudioBuffer { diff --git a/webaudioapi/waa.d.ts b/webaudioapi/waa.d.ts index be6898d39..5479fe334 100644 --- a/webaudioapi/waa.d.ts +++ b/webaudioapi/waa.d.ts @@ -597,7 +597,7 @@ interface AudioProcessingEvent extends Event { outputBuffer: AudioBuffer; } -enum PanningModelType { +declare enum PanningModelType { /** * A simple and efficient spatialization algorithm using equal-power panning. */ @@ -614,7 +614,7 @@ enum PanningModelType { soundfield } -enum DistanceModelType { +declare enum DistanceModelType { /** * A linear distance model which calculates distanceGain according to: * 1 - rolloffFactor * (distance - refDistance) / (maxDistance - refDistance) @@ -895,7 +895,7 @@ interface DynamicsCompressorNode extends AudioNode { } -enum BiquadFilterType { +declare enum BiquadFilterType { /** * A lowpass filter allows frequencies below the cutoff frequency to pass through and attenuates frequencies above the cutoff. It implements a standard second-order resonant lowpass filter with 12dB/octave rolloff. * @@ -1043,7 +1043,7 @@ interface WaveShaperNode extends AudioNode { curve: Float32Array; } -enum OscillatorType { +declare enum OscillatorType { sine, square, sawtooth, diff --git a/youtube/youtube.d.ts b/youtube/youtube.d.ts index 98e2334f1..fa74be939 100644 --- a/youtube/youtube.d.ts +++ b/youtube/youtube.d.ts @@ -4,7 +4,7 @@ // Updated by: Ian Obermiller // Definitions: https://github.com/borisyankov/DefinitelyTyped -module YT { +declare module YT { interface EventArgs { target: Player; data: any; @@ -148,5 +148,5 @@ module YT { ENDED, PAUSED, PLAYING - }; + } }