mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #7835 from AyaMorisawa/patch-15
Remove trailing whitespaces
This commit is contained in:
Vendored
+31
-31
@@ -8,21 +8,21 @@ declare function WordCloud(elements: HTMLElement | HTMLElement[], options: WordC
|
||||
declare namespace WordCloud {
|
||||
var isSupported: boolean;
|
||||
var miniumFontSize: number;
|
||||
|
||||
|
||||
interface Options {
|
||||
/**
|
||||
* List of words/text to paint on the canvas in a 2-d array, in the form of [word, size],
|
||||
* e.g. [['foo', 12] , ['bar', 6]].
|
||||
/**
|
||||
* List of words/text to paint on the canvas in a 2-d array, in the form of [word, size],
|
||||
* e.g. [['foo', 12] , ['bar', 6]].
|
||||
*/
|
||||
list?: Array<ListEntry> | any[];
|
||||
/** font to use. */
|
||||
fontFamily?: string;
|
||||
/** font weight to use, e.g. normal, bold or 600 */
|
||||
fontWeight?: string | number;
|
||||
/**
|
||||
* color of the text, can be any CSS color, or a callback(word, weight, fontSize, distance, theta)
|
||||
* specifies different color for each item in the list. You may also specify colors with built-in
|
||||
* keywords: random-dark and random-light.
|
||||
/**
|
||||
* color of the text, can be any CSS color, or a callback(word, weight, fontSize, distance, theta)
|
||||
* specifies different color for each item in the list. You may also specify colors with built-in
|
||||
* keywords: random-dark and random-light.
|
||||
*/
|
||||
color?: string | ((word: string, weight: string | number, fontSize: number, distance: number, theta: number) => string);
|
||||
/** minimum font size to draw on the canvas. */
|
||||
@@ -33,73 +33,73 @@ declare namespace WordCloud {
|
||||
clearCanvas?: boolean;
|
||||
/** color of the background. */
|
||||
backgroundColor?: string;
|
||||
|
||||
/**
|
||||
* size of the grid in pixels for marking the availability of the canvas — the larger the grid size,
|
||||
* the bigger the gap between words.
|
||||
|
||||
/**
|
||||
* size of the grid in pixels for marking the availability of the canvas — the larger the grid size,
|
||||
* the bigger the gap between words.
|
||||
*/
|
||||
gridSize?: number;
|
||||
/** origin of the “cloud” in [x, y]. */
|
||||
origin?: [number, number];
|
||||
|
||||
|
||||
/** visualize the grid by draw squares to mask the drawn areas. */
|
||||
drawMask?: boolean;
|
||||
/** color of the mask squares. */
|
||||
maskColor?: string;
|
||||
/** width of the gaps between mask squares. */
|
||||
maskGapWidth?: number;
|
||||
|
||||
|
||||
/** Wait for x milliseconds before start drawn the next item using setTimeout. */
|
||||
wait?: number;
|
||||
/** If the call with in the loop takes more than x milliseconds (and blocks the browser), abort immediately. */
|
||||
abortThreshold?: number;
|
||||
/** callback function to call when abort. */
|
||||
abort?: Function;
|
||||
|
||||
|
||||
/** If the word should rotate, the minimum rotation (in rad) the text should rotate. */
|
||||
minRotation?: number;
|
||||
/**
|
||||
* If the word should rotate, the maximum rotation (in rad) the text should rotate. Set the two value equal
|
||||
* to keep all text in one angle.
|
||||
/**
|
||||
* If the word should rotate, the maximum rotation (in rad) the text should rotate. Set the two value equal
|
||||
* to keep all text in one angle.
|
||||
*/
|
||||
maxRotation?: number;
|
||||
|
||||
|
||||
/** Shuffle the points to draw so the result will be different each time for the same list and settings. */
|
||||
shuffle?: boolean;
|
||||
/** Probability for the word to rotate. Set the number to 1 to always rotate. */
|
||||
rotateRatio?: number;
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* The shape of the "cloud" to draw. Can be any polar equation represented as a callback function, or a
|
||||
* keyword present. Available presents are circle (default), cardioid (apple or heart shape curve, the most
|
||||
* known polar equation), diamond (alias of square), triangle-forward, triangle, (alias of triangle-upright,
|
||||
* pentagon, and star.
|
||||
* pentagon, and star.
|
||||
*/
|
||||
shape?: string | ((theta: number) => number);
|
||||
/** degree of "flatness" of the shape wordcloud2.js should draw. */
|
||||
ellipticity?: number;
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* callback to call when the cursor enters or leaves a region occupied by a word. The callback will take
|
||||
* arugments callback(item, dimension, event), where event is the original mousemove event. This only will work
|
||||
* on HTML5 canvas word clouds.
|
||||
* on HTML5 canvas word clouds.
|
||||
*/
|
||||
hover?: EventCallback;
|
||||
/**
|
||||
* callback to call when the user clicks on a word. The callback will take arugments
|
||||
/**
|
||||
* callback to call when the user clicks on a word. The callback will take arugments
|
||||
* callback(item, dimension, event), where event is the original click event. This only will work on HTML5
|
||||
* canvas word clouds.
|
||||
* canvas word clouds.
|
||||
*/
|
||||
click?: EventCallback;
|
||||
}
|
||||
|
||||
|
||||
interface Dimension {
|
||||
x: number;
|
||||
y: number;
|
||||
w: number;
|
||||
h: number;
|
||||
}
|
||||
|
||||
|
||||
type ListEntry = [string, number];
|
||||
type EventCallback = (item: ListEntry, dimension: Dimension, event: MouseEvent) => void;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user