This commit is contained in:
hansrwindhoff
2015-01-16 08:47:59 -07:00
parent 2cc4331067
commit 2b646da6ae
2 changed files with 88 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
// Type definitions for d3JS cloud layout plugin by Jason Davies
// Project: https://github.com/jasondavies/d3-cloud
// Definitions by: hans windhoff <https://github.com/hansrwindhoff>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../d3/d3.d.ts" />
declare module D3 {
export module Layout {
export interface IRotate {
(number:number) : CloudLayout;
(number:()=>number) : CloudLayout;
}
export interface CloudLayout {
(layers: any[], index?: number): any[];
values(accessor?: (d: any) => any): CloudLayout;
offset(offset: string): CloudLayout;
size: {
/**
* Gets the available layout size
*/
(): Array<number>;
/**
* Sets the available layout size
*/
(size: Array<number>): CloudLayout;
};
words: (inputArray: Array<any>) => CloudLayout;
rotate:IRotate;
padding: (number:number) => CloudLayout;
font: (string:string) => CloudLayout;
fontSize(fctn: (d: any) => number): CloudLayout;
on: (eventname: string, callee: (words: any[]) => void) => CloudLayout;
start: () => CloudLayout;
}
export interface Layout {
cloud(): CloudLayout;
}
}
}