-
Notifications
You must be signed in to change notification settings - Fork 20
/
index.d.ts
39 lines (36 loc) · 808 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
declare module "potpack" {
export interface PotpackBox {
w: number;
h: number;
/**
* X coordinate in the resulting container.
*/
x?: number;
/**
* Y coordinate in the resulting container.
*/
y?: number;
}
interface PotpackStats {
/**
* Width of the resulting container.
*/
w: number;
/**
* Height of the resulting container.
*/
h: number;
/**
* The space utilization value (0 to 1). Higher is better.
*/
fill: number;
}
/**
* Packs 2D rectangles into a near-square container.
*
* Mutates the {@link boxes} array: it's sorted by height,
* and box objects are augmented with `x`, `y` coordinates.
*/
const potpack: (boxes: PotpackBox[]) => PotpackStats;
export default potpack;
}