UNPKG

790 BPlain TextView Raw
1import { IRectangle, Rectangle } from "./geom/Rectangle";
2import { IOption } from "./maxrects-packer";
3
4export interface IBin {
5 width: number;
6 height: number;
7 maxWidth: number;
8 maxHeight: number;
9 freeRects: IRectangle[];
10 rects: IRectangle[];
11 options: IOption;
12 [propName: string]: any;
13}
14
15export abstract class Bin implements IBin {
16 public width!: number;
17 public height!: number;
18 public maxWidth!: number;
19 public maxHeight!: number;
20 public freeRects!: IRectangle[];
21 public rects!: IRectangle[];
22 public options!: IOption;
23 public abstract add (rect: IRectangle): IRectangle | undefined;
24 public abstract add (width: number, height: number, data: any): IRectangle | undefined;
25 public data?: any;
26 public tag?: string;
27}