UNPKG

@rx-angular/template

Version:

**Fully** Reactive Component Template Rendering in Angular. @rx-angular/template aims to be a reflection of Angular's built in renderings just reactive.

58 lines (57 loc) 1.77 kB
import { InjectionToken, Provider } from '@angular/core'; import { RxStrategyNames } from '@rx-angular/cdk/render-strategies'; export declare const VIRTUAL_VIEW_CONFIG_TOKEN: InjectionToken<RxVirtualViewConfig>; export interface RxVirtualViewConfig { keepLastKnownSize: boolean; useContentVisibility: boolean; useContainment: boolean; placeholderStrategy: RxStrategyNames<string>; contentStrategy: RxStrategyNames<string>; cacheEnabled: boolean; startWithPlaceholderAsap: boolean; cache: { /** * The maximum number of contents that can be stored in the cache. * Defaults to 20. */ contentCacheSize: number; /** * The maximum number of placeholders that can be stored in the cache. * Defaults to 20. */ placeholderCacheSize: number; }; } export declare const VIRTUAL_VIEW_CONFIG_DEFAULT: RxVirtualViewConfig; /** * Provides a configuration object for the `VirtualView` service. * * Can be used to customize the behavior of the `VirtualView` service. * * Default configuration: * - contentCacheSize: 20 * - placeholderCacheSize: 20 * * Example usage: * * ```ts * import { provideVirtualViewConfig } from '@rx-angular/template/virtual-view'; * * const appConfig: ApplicationConfig = { * providers: [ * provideVirtualViewConfig({ * contentCacheSize: 50, * placeholderCacheSize: 50, * }), * ], * }; * ``` * * @developerPreview * * @param config - The configuration object. * @returns An object that can be provided to the `VirtualView` service. */ export declare function provideVirtualViewConfig(config: Partial<RxVirtualViewConfig & { cache?: Partial<RxVirtualViewConfig['cache']>; }>): Provider;