import { Container, ContainerChild } from 'pixi.js'; import { LIST_TYPE } from './utils/HelpTypes'; export type ListType = (typeof LIST_TYPE)[number]; export type ListOptions = { elementsMargin?: number; children?: C[]; padding?: number; vertPadding?: number; horPadding?: number; topPadding?: number; bottomPadding?: number; leftPadding?: number; rightPadding?: number; items?: C[]; maxWidth?: number; maxHeight?: number; }; /** * Container-based component for arranging Pixi containers one after another based on their sizes. * * Type option is used to set the direction of the arrangement. * * If type is not specified, it will be acting like a bidirectional, items will be arranged to fit horizontally, * after there is no space left, new line will be started, so items will be arranged like `inline-block` in css. * Max width to fit horizontally can be set by `maxWidth` option, of not set, parent width will be used. * Check this example to see how it works: * https://pixijs.io/ui/storybook/?path=/story/components-scrollbox-use-graphics--use-graphics * * It is used inside elements with repeatable content, like {@link Select} or {@link ScrollBox}. * @example * const list = new List({ * children: [ new Graphics().rect(0, 0, 50, 50).fill(0x000000), new Graphics().rect(0, 0, 50, 50).fill(0xFFFFFF), * ], * }); * * list.addChild(new Graphics().rect(0, 0, 50, 50)).fill(0x000000); */ export declare class List extends Container { protected options?: { type?: ListType; } & ListOptions; /** Arrange direction. Defaults to 'bidirectional' for multi-column layout when type is not specified. */ protected _type: ListType; /** Width of area to fit elements when arrange. (If not set parent width will be used). */ protected _maxWidth: number; /** Returns all arranged elements. */ readonly children: C[]; constructor(options?: { type?: ListType; } & ListOptions); /** * Initiates list component. * @param options */ init(options?: { type?: ListType; } & ListOptions): void; /** * Set items arrange direction. * @param type - Arrange direction. */ set type(type: ListType); /** * Get items arrange direction. * @returns Arrange direction. */ get type(): ListType; /** * Set element margin. * @param margin - Margin between elements. */ set elementsMargin(margin: number); /** * Get element margin. * @returns Margin between elements. */ get elementsMargin(): number; /** * Set padding, overriding all padding options. * @param padding - Padding surrounding list elements and its border. */ set padding(padding: number); /** * Get padding. * @returns Padding surrounding list elements and its border. */ get padding(): number; /** * Set vertical padding, overriding all top and bottom padding options. * @param padding - Vertical padding between list border and its elements. */ set vertPadding(padding: number); /** * Get vertical padding. * @returns Vertical padding between list border and its elements. */ get vertPadding(): number; /** * Set horizontal padding, overriding all left and right padding options. * @param padding - Horizontal padding between list border and its elements. */ set horPadding(padding: number); /** * Get horizontal padding. * @returns Horizontal padding between list border and its elements. */ get horPadding(): number; /** * Set left padding. * @param padding - Left padding between list border and its elements. */ set leftPadding(padding: number); /** * Get left padding. * @returns Left padding between list border and its elements. */ get leftPadding(): number; /** * Set right padding. * @param padding - Right padding between list border and its elements. */ set rightPadding(padding: number); /** * Get right padding. * @returns Right padding between list border and its elements. */ get rightPadding(): number; /** * Set top padding. * @param padding - Top padding between list border and its elements. */ set topPadding(padding: number); /** * Get top padding. * @returns Top padding between list border and its elements. */ get topPadding(): number; /** * Set bottom padding. * @param padding - Bottom padding between list border and its elements. */ set bottomPadding(padding: number); /** * Get bottom padding. * @returns Bottom padding between list border and its elements. */ get bottomPadding(): number; /** * Arrange all elements basing in their sizes and component options. * Can be arranged vertically, horizontally or bidirectional. */ arrangeChildren(): void; /** * Removes items from the list. (Does not destroy them) * @param itemID - Item to remove (starting from 0). */ removeItem(itemID: number): void; /** Set width of area to fit elements when arrange. (If not set parent width will be used). */ set maxWidth(width: number); /** Get width of area to fit elements when arrange. (If not set parent width will be used). */ get maxWidth(): number; } //# sourceMappingURL=List.d.ts.map