mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #697 from nestalk/testfixes
Fix definitions for TS 0.9
This commit is contained in:
Vendored
+2
-2
@@ -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;
|
||||
};
|
||||
}
|
||||
Vendored
+31
-22
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
///<reference path="..\fabricjs.d.ts" />
|
||||
///<reference path="fabricjs.d.ts" />
|
||||
|
||||
var canvas = new fabric.Canvas('c', {
|
||||
hoverCursor: 'pointer',
|
||||
@@ -1,4 +1,4 @@
|
||||
///<reference path="..\fabricjs.d.ts" />
|
||||
///<reference path="fabricjs.d.ts" />
|
||||
|
||||
var dot, i,
|
||||
t1, t2,
|
||||
@@ -1,4 +1,4 @@
|
||||
///<reference path="..\fabricjs.d.ts" />
|
||||
///<reference path="fabricjs.d.ts" />
|
||||
|
||||
var $ = function(id){return document.getElementById(id)};
|
||||
|
||||
@@ -28,7 +28,7 @@ canvas.on({
|
||||
|
||||
for (var i = 0; i < filters.length; i++) {
|
||||
var checkBox = <HTMLInputElement>$(filters[i]);
|
||||
var image = <fabric.Image>canvas.getActiveObject();
|
||||
var image = <fabric.IImage>canvas.getActiveObject();
|
||||
checkBox.checked = !!image.filters[i];
|
||||
}
|
||||
},
|
||||
@@ -1,4 +1,4 @@
|
||||
///<reference path="..\fabricjs.d.ts" />
|
||||
///<reference path="fabricjs.d.ts" />
|
||||
|
||||
var canvas = new fabric.Canvas('c');
|
||||
var $ = function (id) { return document.getElementById(id); };
|
||||
@@ -1,4 +1,4 @@
|
||||
///<reference path="..\fabricjs.d.ts" />
|
||||
///<reference path="fabricjs.d.ts" />
|
||||
|
||||
module fabric {
|
||||
export interface CircleWithLineInfos extends ICircle {
|
||||
@@ -1,4 +1,4 @@
|
||||
///<reference path="..\fabricjs.d.ts" />
|
||||
///<reference path="fabricjs.d.ts" />
|
||||
|
||||
var canvas = new fabric.Canvas('c');
|
||||
fabric.loadSVGFromURL('../assets/135.svg', function (objects) {
|
||||
@@ -1,4 +1,4 @@
|
||||
///<reference path="..\fabricjs.d.ts" />
|
||||
///<reference path="fabricjs.d.ts" />
|
||||
|
||||
module fabric {
|
||||
export interface ImageWithInfo extends IImage {
|
||||
@@ -1,4 +1,4 @@
|
||||
///<reference path="..\fabricjs.d.ts" />
|
||||
///<reference path="fabricjs.d.ts" />
|
||||
|
||||
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 = (<fabric.Text>activeObject).text;
|
||||
this.value = (<fabric.IText>activeObject).text;
|
||||
}
|
||||
};
|
||||
textEl.onkeyup = function(e) {
|
||||
@@ -485,7 +485,7 @@ if (supportsColorpicker()) {
|
||||
canvas.discardActiveObject();
|
||||
}
|
||||
else {
|
||||
(<fabric.Text>activeObject).text = this.value;
|
||||
(<fabric.IText>activeObject).text = this.value;
|
||||
}
|
||||
canvas.renderAll();
|
||||
}
|
||||
@@ -497,7 +497,7 @@ if (supportsColorpicker()) {
|
||||
activeObjectButtons.push(cmdUnderlineBtn);
|
||||
cmdUnderlineBtn.disabled = true;
|
||||
cmdUnderlineBtn.onclick = function() {
|
||||
var activeObject = <fabric.Text>canvas.getActiveObject();
|
||||
var activeObject = <fabric.IText>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 = <fabric.Text>canvas.getActiveObject();
|
||||
var activeObject = <fabric.IText>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 = <fabric.Text>canvas.getActiveObject();
|
||||
var activeObject = <fabric.IText>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 = <fabric.Text>canvas.getActiveObject();
|
||||
var activeObject = <fabric.IText>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 = <fabric.Text>canvas.getActiveObject();
|
||||
var activeObject = <fabric.IText>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 = <fabric.Text>canvas.getActiveObject();
|
||||
var activeObject = <fabric.IText>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 = <fabric.Text>canvas.getActiveObject();
|
||||
var activeObject = <fabric.IText>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 = <fabric.Text>canvas.getActiveObject();
|
||||
var activeObject = <fabric.IText>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 = <fabric.Text>canvas.getActiveObject();
|
||||
var activeObject = <fabric.IText>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 = <fabric.Text>canvas.getActiveObject();
|
||||
var activeObject = <fabric.IText>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 = <fabric.Text>canvas.getActiveObject();
|
||||
var activeObject = <fabric.IText>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;
|
||||
}
|
||||
//if (typeof Cufon !== 'undefined') {
|
||||
// Cufon.fonts.delicious.offsetLeft = 75;
|
||||
// Cufon.fonts.delicious.offsetTop = 25;
|
||||
//}
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
// Definitions by: Ronnie Haakon Hegelund <http://ronniehegelund.blogspot.dk>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
class Tracker {
|
||||
declare class Tracker {
|
||||
_trackPageview(): void;
|
||||
_getName(): string;
|
||||
_getAccount(): string;
|
||||
|
||||
Vendored
+1
-1
@@ -52,7 +52,7 @@ interface HammerDirectionEvent extends HammerEvent {
|
||||
distanceY: number;
|
||||
}
|
||||
|
||||
class Hammer {
|
||||
declare class Hammer {
|
||||
constructor (element: any, options?: HammerOptions);
|
||||
|
||||
ondragstart: (event: HammerDirectionEvent) => void;
|
||||
|
||||
Vendored
+12
-12
@@ -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 //////////////////////////////////////////////////////////////////////
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
// Definitions by: mzeiher <https://github.com/mzeiher>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
module jszip {
|
||||
declare module jszip {
|
||||
export interface JSZip {
|
||||
/**
|
||||
* Get a file from the archive
|
||||
|
||||
Vendored
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
// todo: jQuery plugin, RxJS Binding
|
||||
|
||||
module linq {
|
||||
declare module linq {
|
||||
|
||||
interface EnumerableStatic {
|
||||
Choice(...contents: any[]): Enumerable;
|
||||
|
||||
Vendored
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
/// <reference path="scroller.d.ts"/>
|
||||
|
||||
class EasyScroller {
|
||||
declare class EasyScroller {
|
||||
constructor (content: any, options: ScrollerOptions);
|
||||
|
||||
render(): void;
|
||||
|
||||
@@ -41,7 +41,7 @@ function test_canvas() {
|
||||
function test_domlist() {
|
||||
var container = document.getElementById("container");
|
||||
var content = document.getElementById("content");
|
||||
var refreshElem = <HTMLCanvasElement>content.getElementsByTagName("div")[0];
|
||||
var refreshElem = content.getElementsByTagName("div")[0];
|
||||
var scroller = new Scroller(render, {
|
||||
scrollingX: false
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
Vendored
+3
-2
@@ -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;
|
||||
}
|
||||
|
||||
+69
-63
@@ -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
|
||||
|
||||
}
|
||||
|
||||
|
||||
Vendored
+4
-3
@@ -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;
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -71,7 +71,7 @@ interface AudioNode {
|
||||
numberOfInputs: number;
|
||||
numberOfOutputs: number;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
interface AudioSourceNode extends AudioNode {
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -93,7 +93,7 @@ interface DelayNode extends AudioNode {
|
||||
|
||||
delayTime: AudioParam;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
interface AudioBuffer {
|
||||
|
||||
|
||||
Vendored
+4
-4
@@ -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,
|
||||
|
||||
Vendored
+2
-2
@@ -4,7 +4,7 @@
|
||||
// Updated by: Ian Obermiller <http://ianobermiller.com>
|
||||
// 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
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user