import { AfterViewInit, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList } from '@angular/core'; import { CbjGalleryItemComponent } from './cbj-gallery-item.component'; export declare class CbjGalleryComponent implements OnInit, AfterViewInit, OnDestroy { /** * The galleries height * * @type {string} height */ height: string; /** * The galleries width * * @type {string} width */ width: string; /** * The columns width in pixels * * @type {number} colWidth */ colWidth: number; /** * The width of the space between cols * * @type {number} gutterWidth */ gutterWidth: number; /** * An array of image links * * @type {string[]} images */ images: string[]; /** * An array of classes to add to the img tags * * @type {string[]} classes */ classes: string[]; /** * The generated gallery items * * @type {QueryList} items */ items: QueryList; /** * The click event emitter for broadcasting the click events on the images * * @type {EventEmitter<{ i: CbjGalleryItemComponent, e: Event }>} imgClick */ imgClick: EventEmitter<{ i: CbjGalleryItemComponent; e: Event; }>; /** * The element wrapping all the items * * @type {ElementRef} wrapper */ wrapper: ElementRef; /** * An array of heights of each column * * @private * @type {number[]} */ private colHeights; /** * The number of columns in a row * * @private * @type {number} colsPerRow */ private colsPerRow; /** * The column currently being inserted into * * @private * @type {number} curCol */ private curCol; /** * The row currently adding columns to * * @private * @type {number} curCol */ private curRow; /** * OnInit * Setup the EventEmitter */ ngOnInit(): void; /** * AfterViewInit * Wait a tick to make sure all values are set * Make our measurement to calc how many cols per row * Position the items */ ngAfterViewInit(): void; /** * OnDestroy * Cleanup the emitter */ ngOnDestroy(): void; /** * Emit our click event * * @param {{ i: CbjGalleryItemComponent, e: Event }} arg */ emitClick: (arg: { i: CbjGalleryItemComponent; e: Event; }) => void; /** * Use to add items to the gallery after creation * * @param {string[]} images */ addItems(images: string[]): void; /** * Position the items in the gallery AfterViewInit * */ private createLayout(); /** * Add items to an existing gallery */ private addToLayout; /** * Calculate and set the items dimensions * * @param {CbjGalleryItemComponent} it */ private setItemDims(it); /** * Calculates aspect-ratio * * @param {ElementRef} el * * @returns {number} */ private getRatio(el); /** * Positions an individual item * * @param {CbjGalleryItemComponent} it */ private positionItem(it); /** * Calculates the left property for an item * * @returns {string} */ private findLeft(); /** * Calculates the top position of an item * * @param {CbjGalleryItemComponent} it * * @returns {string} */ private findTop(it); /** * Increments curCol or sets to 0 if on last column in row * Increments row number if at last col */ private incrementColRow(); private rePosition(start); }