UNPKG

@deepkit/desktop-ui

Version:

Library for desktop UI widgets in Angular 10+

55 lines (54 loc) 2.5 kB
import { AfterViewInit, ApplicationRef, OnDestroy, Type } from '@angular/core'; import { EventToken } from '@deepkit/event'; import * as i0 from "@angular/core"; export declare function observeAction(): (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<any>) => TypedPropertyDescriptor<any> | void; /** * Automatically unsubscribe the value (calling unsubscribe() on the current value) * when ngOnDestroy is called or a new value has been set. * When the component is already destroyed, newly set values will be unscubribed immediately. * This makes sure when a component is destroyed too fast before a async operation is completed * that the result is unsubscribed, otherwise it would be a memory leak. */ export declare function unsubscribe<T extends OnDestroy>(): (target: T, propertyKey: string | symbol) => void; /** * Listens on the given event token and calls the method when the event is triggered. * * @example * ```typescript * * const MyEvent = new EventToken('my-event'); * * @Component({ * //.. * }); * class MyComponent { * @EventListener(MyEvent) * onMyEvent(event: MyEvent) { * console.log('event triggered', event); * } * } * ``` */ export declare function EventListener(eventToken: EventToken): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void; /** * Important for components that use material design, which need Tick in AfterViewInit. */ export declare function reactiveComponent<T extends AfterViewInit>(): (target: Type<T>) => void; /** * Automatically subscribes on the value (when set) to trigger application ticks automatically. * When value is changed, the old subscription is cancelled and a new on the new value is created. * * Optionally @observe({unsubscribe: true}) unsubscribes the whole value as well (calling unsubscribe() on current value) on NgOnDestroy or when net property value is set. */ export declare function observe<T extends {}>(options?: { unsubscribe?: true; }): (target: T, propertyKey: string | symbol) => void; export declare class ReactiveChangeDetectionModule { private static a; private static throttled; constructor(a: ApplicationRef); static tick(): void; static ɵfac: i0.ɵɵFactoryDeclaration<ReactiveChangeDetectionModule, never>; static ɵmod: i0.ɵɵNgModuleDeclaration<ReactiveChangeDetectionModule, never, never, never>; static ɵinj: i0.ɵɵInjectorDeclaration<ReactiveChangeDetectionModule>; }