This commit is contained in:
milkisevil
2014-11-18 14:45:17 +00:00
10 changed files with 35 additions and 19 deletions
+2 -1
View File
@@ -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);
+11 -3
View File
@@ -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<T>(val: T, circular?: boolean, depth?: number): T;
module clone {
/**
* @param obj the object that you want to clone
*/
function clonePrototype<T>(obj: T): T;
}
export = clone
}
-5
View File
@@ -223,11 +223,8 @@ declare module jasmine {
message(): any;
toBe(expected: any): boolean;
toNotBe(expected: any): boolean;
toEqual(expected: any): boolean;
toNotEqual(expected: any): boolean;
toMatch(expected: any): boolean;
toNotMatch(expected: any): boolean;
toBeDefined(): boolean;
toBeUndefined(): boolean;
toBeNull(): boolean;
@@ -235,10 +232,8 @@ declare module jasmine {
toBeTruthy(): boolean;
toBeFalsy(): boolean;
toHaveBeenCalled(): boolean;
wasNotCalled(): boolean;
toHaveBeenCalledWith(...params: any[]): boolean;
toContain(expected: any): boolean;
toNotContain(expected: any): boolean;
toBeLessThan(expected: any): boolean;
toBeGreaterThan(expected: any): boolean;
toBeCloseTo(expected: any, precision: any): boolean;
-5
View File
@@ -215,11 +215,8 @@ declare module jasmine {
message(): any;
toBe(expected: any): boolean;
toNotBe(expected: any): boolean;
toEqual(expected: any): boolean;
toNotEqual(expected: any): boolean;
toMatch(expected: any): boolean;
toNotMatch(expected: any): boolean;
toBeDefined(): boolean;
toBeUndefined(): boolean;
toBeNull(): boolean;
@@ -227,10 +224,8 @@ declare module jasmine {
toBeTruthy(): boolean;
toBeFalsy(): boolean;
toHaveBeenCalled(): boolean;
wasNotCalled(): boolean;
toHaveBeenCalledWith(...params: any[]): boolean;
toContain(expected: any): boolean;
toNotContain(expected: any): boolean;
toBeLessThan(expected: any): boolean;
toBeGreaterThan(expected: any): boolean;
toBeCloseTo(expected: any, precision: any): boolean;
+2 -1
View File
@@ -3,6 +3,7 @@
function test_basics() {
NProgress.start();
NProgress.inc();
NProgress.inc(0.2);
NProgress.done();
NProgress.set(0.5);
@@ -29,4 +30,4 @@ function test_configuration() {
trickleRate: 0.42,
trickleSpeed: 42
});
}
}
+8 -1
View File
@@ -23,6 +23,13 @@ interface NProgressStatic {
*/
inc(): NProgressStatic;
/**
* Increments the progress bar with a set amount.
* @param {number} amount This will get the current status value and adds the value until status is max 0.994
* @returns {NProgressConfigureOptions} The current NProgress object, useful for chaining.
*/
inc(amount: number): NProgressStatic;
/**
* Removes the progress indicator.
*/
@@ -102,4 +109,4 @@ interface NProgressConfigureOptions {
template?: string;
}
declare var NProgress: NProgressStatic;
declare var NProgress: NProgressStatic;
+1 -1
View File
@@ -91,7 +91,7 @@ declare module React {
findAllInRenderedTree(tree: ReactElement<any, any>, test: (component: ReactElement<any, any>) => boolean): ReactElement<any, any>[];
scryRenderedDOMComponentsWithClass(tree: ReactElement<any, any>, className: string): ReactElement<any, any>[];
findRenderedDOMComponentWithClass(tree: ReactElement<any, any>, className: string): ReactElement<any, any>;
scryRenderedDOMComponentsWithTag(tree: ReactElement<any, any>, className: string): ReactElement<any, any>[];
scryRenderedDOMComponentsWithTag(tree: ReactElement<any, any>, tagName: string): ReactElement<any, any>[];
findRenderedDOMComponentWithTag(tree: ReactElement<any, any>, tagName: string): ReactElement<any, any>;
scryRenderedComponentsWithTag(tree: ReactElement<any, any>, componentClass: Function): ReactElement<any, any>[];
findRenderedComponentWithType<P>(tree: ReactElement<any, any>, componentClass: ReactComponentFactory<P>): Component<P, any>;
+7
View File
@@ -197,3 +197,10 @@ r.post(str);
r(options);
r.get(options);
r.post(options);
request
.get('http://example.com/example.png')
.on('response', function(response: any) {
// check response
})
.pipe(request.put('http://another.com/another.png'));
+2
View File
@@ -110,6 +110,8 @@ declare module 'request' {
oauth(oauth: OAuthOptions): Request;
jar(jar: CookieJar): Request;
on(event: string, listener: Function): Request;
write(buffer: Buffer, cb?: Function): boolean;
write(str: string, cb?: Function): boolean;
write(str: string, encoding: string, cb?: Function): boolean;
+2 -2
View File
@@ -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;