UNPKG

@nativescript-community/ui-collectionview

Version:

Allows you to easily add a collection view (grid list view) to your projects. Supports vertical and horizontal modes, templating, and more.

83 lines (82 loc) 3.84 kB
import { AfterContentInit, ComponentRef, DoCheck, ElementRef, EmbeddedViewRef, EventEmitter, IterableDiffers, NgZone, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core'; import { CollectionViewItemEventData } from '@nativescript-community/ui-collectionview'; import { DetachedLoader, NativeScriptRendererFactory } from '@nativescript/angular'; import { View } from '@nativescript/core'; import * as i0 from "@angular/core"; export declare class ItemContext { $implicit?: any; item?: any; index?: number; even?: boolean; odd?: boolean; constructor($implicit?: any, item?: any, index?: number, even?: boolean, odd?: boolean); } export interface SetupItemViewArgs { view: EmbeddedViewRef<any>; data: any; index: number; context: ItemContext; } export declare class CollectionViewComponent implements DoCheck, OnDestroy, AfterContentInit { private _elementRef; private _iterableDiffers; private _renderer; private _ngZone; get nativeElement(): any; get listView(): any; loader: ViewContainerRef; setupItemView: EventEmitter<SetupItemViewArgs>; itemTemplateQuery: TemplateRef<ItemContext>; autoReuseViews: boolean; detachedLoaderFactory(): ComponentRef<DetachedLoader>; get itemTemplate(): any; set itemTemplate(value: any); get items(): any; set items(value: any); private _collectionView; private _items; private _differ; private _itemTemplate; private _templateMap; private _loaders; constructor(_elementRef: ElementRef, _iterableDiffers: IterableDiffers, _renderer: NativeScriptRendererFactory, _ngZone: NgZone); private itemViewLoader; ngAfterContentInit(): void; ngOnDestroy(): void; ngDoCheck(): void; registerTemplate(key: string, template: TemplateRef<ItemContext>): void; onItemLoading(args: CollectionViewItemEventData): void; onItemRecyclingInternal(args: any): void; onItemDisposingInternal(args: any): void; setupViewRef(view: EmbeddedViewRef<ItemContext>, data: any, index: number): void; protected getItemTemplateViewFactory(template: TemplateRef<ItemContext>): () => View; viewPool: Map<TemplateRef<ItemContext>, { scrapSize: number; scrapHead: Set<EmbeddedViewRef<ItemContext>>; }>; private storeViewRef; viewToTemplate: WeakMap<EmbeddedViewRef<any>, TemplateRef<any>>; viewToLoader: WeakMap<EmbeddedViewRef<any>, ComponentRef<DetachedLoader>>; private getOrCreate; private getView; private getViewPool; private setItemTemplates; private detectChangesOnChild; private refresh; static ɵfac: i0.ɵɵFactoryDeclaration<CollectionViewComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<CollectionViewComponent, "CollectionView", never, { "autoReuseViews": { "alias": "autoReuseViews"; "required": false; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; }; "items": { "alias": "items"; "required": false; }; }, { "setupItemView": "setupItemView"; }, ["itemTemplateQuery"], never, false, never>; } export interface ComponentView { rootNodes: any[]; destroy(): void; } export type RootLocator = (nodes: any[], nestLevel: number) => View; export declare function getItemViewRoot(viewRef: ComponentView, rootLocator?: RootLocator): View; export declare class TemplateKeyDirective { private templateRef; private collectionView; constructor(templateRef: TemplateRef<any>, collectionView: CollectionViewComponent); set cvTemplateKey(value: any); static ɵfac: i0.ɵɵFactoryDeclaration<TemplateKeyDirective, [null, { host: true; }]>; static ɵdir: i0.ɵɵDirectiveDeclaration<TemplateKeyDirective, "[cvTemplateKey]", never, { "cvTemplateKey": { "alias": "cvTemplateKey"; "required": false; }; }, {}, never, never, false, never>; }