UNPKG

@lithiumjs/angular

Version:

Reactive components made easy. Lithium provides utilities that enable seamless reactive state and event interactions for Angular components.

481 lines (461 loc) 28.9 kB
import { Subject, Observable, Subscription, Subscriber, TeardownLogic, BehaviorSubject, ReplaySubject, SchedulerLike } from 'rxjs'; import { ChangeDetectorRef, Type, FactoryProvider, Injector, EventEmitter } from '@angular/core'; type StringKey<T> = (keyof T & string); type IfEquals<X, Y> = (<T>() => T extends X ? 1 : 2) extends (<T>() => T extends Y ? 1 : 2) ? true : false; type IfReadonly<T, K extends keyof T> = IfEquals<{ [P in K]: T[P]; }, { readonly [P in K]: T[P]; }>; type Publicize<T extends Record<string, any>, K extends string> = Omit<T, K> & Record<K, T[K]>; type Constructable<T, Ctor = (...args: any[]) => T> = { constructor: Ctor; }; type ImmutableMap<M extends Map<unknown, unknown>> = Omit<M, "set" | "clear" | "delete">; declare namespace _LangUtils { function isNil(value: any): value is null | undefined; } type AsyncSourceKey<T, K extends StringKey<T> = StringKey<T>> = `${K}$`; type ValidAsyncSourceKey<T, K extends StringKey<T> = StringKey<T>> = AsyncSourceKey<T, K> & StringKey<T>; declare namespace ComponentStateMetadata { interface ManagedProperty<T, K extends StringKey<T> = StringKey<T>> { key: K; publicKey?: StringKey<T>; asyncSource?: ValidAsyncSourceKey<T>; } type ManagedPropertyList<T> = ManagedProperty<T>[]; const MANAGED_PROPERTY_LIST_KEY = "MANAGED_PROPERTY_LIST_KEY"; function GetOwnManagedPropertyList<T>(target: Object): ManagedPropertyList<T>; function GetInheritedManagedPropertyList<T>(target: Object): ManagedPropertyList<T>; function SetManagedPropertyList<T>(target: Object, list: ManagedPropertyList<T>): void; function AddManagedProperty<T>(target: Object, property: ManagedProperty<T>): void; } declare function asyncStateKey<ComponentT, K extends StringKey<ComponentT> = StringKey<ComponentT>>(key: K): AsyncSourceKey<ComponentT, K>; declare namespace CommonMetadata { const MANAGED_ONDESTROY_KEY = "__LI__MANAGED__ONDESTROY__"; const MANAGED_INSTANCE_DESTROYED_KEY = "__LI__MANAGED__INSTANCE__DESTROYED__"; function instanceIsDestroyed(componentInstance: any): boolean; } /** @deprecated */ type EmitterType = string; /** @deprecated */ declare namespace EmitterMetadata { const BOOTSTRAPPED_KEY = "$$STATEEMITTER_BOOTSTRAPPED"; type ProxyMode = keyof { None: any; From: any; Alias: any; Merge: any; }; namespace ProxyMode { const None: ProxyMode; const From: ProxyMode; const Alias: ProxyMode; const Merge: ProxyMode; } interface SubjectInfo extends SubjectInfo.CoreDetails { propertyKey: string | symbol; observable: Subject<any> | Observable<any>; } namespace SubjectInfo { interface CoreDetails { initial?: () => any; initialValue?: any; readOnly?: boolean; writeOnly?: boolean; proxyMode?: ProxyMode; proxyPath?: string; proxyMergeUpdates?: boolean; unmanaged?: boolean; } interface WithDynamicAlias extends SubjectInfo { observable: Observable<any>; } interface WithStaticAlias extends SubjectInfo { observable: Subject<any>; } function IsDynamicAlias(subjectInfo: SubjectInfo): subjectInfo is SubjectInfo.WithDynamicAlias; function IsStaticAlias(subjectInfo: SubjectInfo): subjectInfo is SubjectInfo.WithStaticAlias; function IsSelfProxy(subjectInfo: SubjectInfo): boolean; } type MetadataMap = Map<EmitterType, SubjectInfo>; const EmitterMapSymbol: unique symbol; /** @description Gets the metadata map object for the given target class (or its inheritted classes). */ function GetMetadataMap(target: Object): MetadataMap; /** @description Gets the metadata map object for the given target class. */ function GetOwnMetadataMap(target: Object): MetadataMap; function HasOwnMetadataMap(target: Object): boolean; function SetMetadataMap(target: Object, map: MetadataMap): void; /** @description Copy all metadata from the source map to the target map. * * Note: This mutates the target map. **/ function CopyMetadata(target: MetadataMap, source: MetadataMap, overwrite?: boolean): MetadataMap; /** @description Merge own and inheritted metadata into a single map. * * Note: This mutates the object's metadata. **/ function CopyInherittedMetadata(object: any): MetadataMap; } type EventType = string; declare namespace EventMetadata { const SUBJECT_TABLE_MERGED_KEY = "$$EVENTSOURCE_SUBJECT_TABLE_MERGED"; const BOOTSTRAPPED_KEY = "$$EVENTSOURCE_BOOTSTRAPPED"; const LIFECYCLE_REGISTRATION_KEY = "$$EVENTSOURCE_LIFECYCLE_REGISTRATION"; interface ConfigOptions { eventType: EventType; skipMethodCheck?: boolean; unmanaged?: boolean; } interface SubjectInfo extends ConfigOptions { subject: Subject<any>; } type PropertySubjectMap = Map<string | symbol, SubjectInfo>; type EventSubjectTable = Map<EventType, PropertySubjectMap>; type InstanceBootstrapMap = Map<EventType, boolean>; type LifecycleRegistrationMap = Map<EventType, boolean>; type LifecycleCallbackMap = Map<EventType, Array<(...args: any[]) => void>>; /** @description Gets the metadata map object for the given target class (or its inheritted classes). */ function GetEventSubjectTable(target: Object): EventSubjectTable; /** @description Gets the metadata map object for the given target class. */ function GetOwnEventSubjectTable(target: Object): EventSubjectTable; function GetInstanceBootstrapMap(target: Object): InstanceBootstrapMap; function GetOwnLifecycleRegistrationMap(target: Object): LifecycleRegistrationMap; /** @description Gets own and inherited lifecycle registration data merged into a single Map. */ function GetLifecycleRegistrationMap(target: Object): ImmutableMap<LifecycleRegistrationMap>; function GetOwnLifecycleCallbackMap(target: Object): LifecycleCallbackMap; /** @description Gets own and inherited lifecycle callback data merged into a single Map. */ function GetLifecycleCallbackMap(target: Object): ImmutableMap<LifecycleCallbackMap>; /** * @description * Gets the property subject map for the given event type from the metadata map for the given target class (or its inheritted classes). */ function GetPropertySubjectMap(type: EventType, target: Object): PropertySubjectMap; /** * @description * Gets the property subject map for the given event type from the metadata map for the given target class. */ function GetOwnPropertySubjectMap(type: EventType, target: Object): PropertySubjectMap; function GetLifecycleCallbackList(target: Object, type: EventType): ReadonlyArray<(...args: any[]) => void>; function HasOwnEventSubjectTable(target: Object): boolean; function SetEventSubjectTable(target: Object, map: EventSubjectTable): void; function AddLifecycleCallback(target: Object, type: EventType, callback: (...args: any[]) => void): void; function RemoveLifecycleCallback(target: Object, type: EventType, callback: (...args: any[]) => void): void; /** * @description Copy all metadata from the source map to the target map. * * Note: This mutates the target map. **/ function CopySubjectTable(target: EventSubjectTable, source: EventSubjectTable, overwrite?: boolean): EventSubjectTable; /** * @description Merge own and inheritted metadata into a single map. * * Note: This mutates the object's metadata. **/ function CopyInherittedSubjectTable(object: any): EventSubjectTable; } declare namespace Metadata { type MetadataKey = string | symbol | number; export function requireMetadata<T>(symbol: MetadataKey, target: any, defaultValue?: T): T; export function requireOwnMetadata<T>(symbol: MetadataKey, target: any, defaultValue?: T): T; export function getMetadataMap(target: any): Map<MetadataKey, any>; export function setMetadata(symbol: MetadataKey, target: any, value: any): void; export function hasMetadata(symbol: MetadataKey, target: any): boolean; export function hasOwnMetadata(symbol: MetadataKey, target: any): boolean; export function getMetadata(symbol: MetadataKey, target: any): any; export function getOwnMetadata(symbol: MetadataKey | number, target: any): any; export function getMetadataKeys(target: any): MetadataKey[]; export {}; } interface Metadata { } type ValidateAsyncSource<T, K extends StringKey<T>, Source extends string | undefined = AsyncSourceKey<T, K>> = Source extends StringKey<T> ? (T[Source] extends Observable<T[K]> ? T[Source] : never) : never; /** @PropertyDecoratorFactory */ declare function AsyncState<Source extends string | undefined = undefined>(asyncSource?: Source): <ComponentT extends Constructable<any, any>, K extends StringKey<ComponentT>>(target: Source extends undefined ? ComponentT : (ValidateAsyncSource<ComponentT, K, Source> extends never ? never : ComponentT), key: Source extends undefined ? (ValidateAsyncSource<ComponentT, K> extends never ? never : K) : K) => void; declare namespace AutoPush { type ChangeDetectorLike = Pick<ChangeDetectorRef, "detectChanges" | "markForCheck">; export interface ChangeDetectorProxy { doCheck(): void; } export namespace ChangeDetectorProxy { function fromRef(ref: ChangeDetectorLike, options: CdRefOptions): ChangeDetectorProxy; } export interface Options { } export interface CdRefOptions extends Options { forceDetectChanges?: boolean; } export function changeDetector(component: any): ChangeDetectorProxy | undefined; export function enable(component: any, changeDetector: ChangeDetectorLike, options?: CdRefOptions): void; export function enable(component: any, changeDetector: ChangeDetectorProxy, options?: Options): void; export function notifyChanges(component: any): void; export function isChangeDetectorLike(object: any): object is ChangeDetectorLike; export {}; } /** @deprecated */ declare function TemplateDynamic(): new (...args: any[]) => { [K in keyof any]: any[K]; }; declare const LiComponent_base: new (...args: any[]) => { [K in keyof any]: any[K]; }; /** @deprecated */ declare abstract class LiComponent extends LiComponent_base { } declare const COMPONENT_STATE_IDENTITY: unique symbol; type ComponentClassProvider<ComponentT> = Type<ComponentT> | Type<unknown>; type ManagedComponent = Constructable<any, any> & { [CommonMetadata.MANAGED_ONDESTROY_KEY]: Observable<void>; }; declare class ComponentStateRef<ComponentT> extends Promise<ComponentState<ComponentT>> { componentInstance: ComponentT & ManagedComponent; /** * @description Resolves the `ComponentState` instance for this reference. * @returns An `Observable` that emits the `ComponentState` instance for this reference. */ state(): Observable<ComponentState<ComponentT>>; /** * @description Returns an `Observable` that represents the current value of the given state property and emits whenever the value of the given state * property is changed. * @param stateProp - The state property to observe. * @returns An `Observable` that emits the value of the given state property and re-emits when the value is changed. */ get<K extends StringKey<ComponentT>>(stateProp: ComponentState.ReadableKey<ComponentT, K>): Observable<ComponentT[K]>; /** * @description Returns an array of `Observable`s that represents the current value for each given state property. Each `Observable` emits whenever a * value of the corresponding given state property is changed. * @param stateProps - The state properties to observe. * @returns An array of `Observable`s that represents the current value for each given state property and re-emits when the corresponding value is * changed. */ getAll<K extends Array<ComponentState.ReadableKey<ComponentT, StringKey<ComponentT>>>>(...stateProps: K): ComponentState.StateSelector<ComponentT, K>; /** * @description Returns an `EventEmitter` that emits whenever the value of the given state property is changed. * @param stateProp - The state property to observe. * @returns An `EventEmitter` instance that emits whenever the value of the given state property is changed. */ emitter<K extends StringKey<ComponentT>>(stateProp: ComponentState.ReadableKey<ComponentT, K>): EventEmitter<ComponentT[K]>; /** * @description Updates the value of the given state property with the given value. Equivalent to assigning to the component state property directly. * @param stateProp - The state property to update. This property must not be readonly. * @param value - The new value to update to. * @returns An `Observable` that emits and completes when the value has been updated. */ set<K extends StringKey<ComponentT>, V extends ComponentT[K]>(stateProp: ComponentState.WritableKey<ComponentT, K>, value: V): Observable<void>; /** * @description Subscribes the given state property to the given source `Observable`. If `managed` is set to true, the lifetime of the subscription will * be managed and cleaned up when the component is destroyed. * @param stateProp - The state property to receive source updates. This property must not be readonly. * @param source$ - The source `Observable` to subscribe to. * @param managed - Whether or not the subscription lifetime should be managed. Defaults to `true`. * @returns A `Subscription` representing the subscription to the source. */ subscribeTo<K extends StringKey<ComponentT>, V extends ComponentT[K]>(stateProp: ComponentState.WritableKey<ComponentT, K>, source$: Observable<V>, managed?: boolean): Subscription; /** * @description Synchronizes the values of the given state properties such that any changes from one state property will be propagated to the * other state property. The initial value of the first given state property is used. * @param statePropA - The first state property to synchronize. This property must not be readonly. * @param statePropB - The second state property to synchronize. This property must not be readonly. */ sync<K1 extends StringKey<ComponentT>, K2 extends StringKey<ComponentT>, V extends IfEquals<ComponentT[K1], ComponentT[K2]> extends true ? ComponentT[K1] & ComponentT[K2] : never>(statePropA: V extends never ? never : ComponentState.WritableKey<ComponentT, K1>, statePropB: V extends never ? never : ComponentState.WritableKey<ComponentT, K2>): void; /** * @description Synchronizes the values of the given state property and source `Subject` such that any changes from the state property will be * propagated to the source `Subject` and vice versa. The initial value of the source `Subject` is used. * @param stateProp - The state property to synchronize. This property must not be readonly. * @param source$ - The source `Subject` to synchronize with. */ syncWith<K extends StringKey<ComponentT>>(stateProp: ComponentState.WritableKey<ComponentT, K>, source$: Subject<ComponentT[K]>): void; /** * @description Synchronizes the state of `stateProp` and `sourceProp`, a property from another `ComponentStateRef`, such that any changes from * `stateProp` will be propagated to `sourceProp` and vice versa. The initial state value of `sourceProp` is used. * @param stateProp - The state property to synchronize. This property must not be readonly. * @param sourceState - The source `ComponentStateRef` instance. * @param sourceProp - The source state property from `sourceState` to synchronize with. This property must not be readonly. */ syncWith<ComponentT2, K1 extends StringKey<ComponentT>, K2 extends StringKey<ComponentT2>, V extends IfEquals<ComponentT[K1], ComponentT2[K2]> extends true ? ComponentT[K1] & ComponentT2[K2] : never>(stateProp: V extends never ? never : ComponentState.WritableKey<ComponentT, K1>, sourceState: ComponentStateRef<ComponentT2>, sourceProp: V extends never ? never : ComponentState.WritableKey<ComponentT2, K2>): void; private get resolvedState(); } type ComponentState<ComponentT> = ComponentState.Of<ComponentT>; declare namespace ComponentState { export interface CreateOptions { lazy?: boolean; } export type ReactiveStateKey<ComponentT, K extends keyof ComponentT = keyof ComponentT> = K extends string ? AsyncSourceKey<ComponentT, K> : never; type QualifiedStateKey<ComponentT, K extends keyof ComponentT = keyof ComponentT> = K extends `${infer _K}$` ? never : K; export type StateKey<ComponentT> = keyof { [K in keyof ComponentT as QualifiedStateKey<ComponentT, K>]: never; }; export type Of<ComponentT> = { readonly [K in keyof ComponentT as ReactiveStateKey<ComponentT, QualifiedStateKey<ComponentT, K>>]-?: IfReadonly<ComponentT, K> extends true ? Observable<ComponentT[K]> : Subject<ComponentT[K]>; }; export type ReadableKey<ComponentT, K extends keyof ComponentT = keyof ComponentT> = K extends StateKey<ComponentT> ? K : never; export type WritableKey<ComponentT, K extends keyof ComponentT = keyof ComponentT> = IfReadonly<ComponentT, K> extends true ? never : ReadableKey<ComponentT, K>; export type StateSelector<ComponentT, K extends Array<ReadableKey<ComponentT>>> = { [I in keyof K]: K[I] extends ReadableKey<ComponentT> ? Observable<ComponentT[K[I]]> : never; }; export function create<ComponentT>($class: ComponentClassProvider<ComponentT>, options?: CreateOptions): FactoryProvider; export function createFactory<ComponentT>($class: ComponentClassProvider<ComponentT>, options?: CreateOptions): (injector: Injector) => ComponentStateRef<ComponentT>; export function tokenFor(provider: FactoryProvider): any; export function stateKey<ComponentT, K extends StringKey<ComponentT> = StringKey<ComponentT>>(key: K): ReactiveStateKey<ComponentT, K> & keyof Of<ComponentT>; export {}; } declare function createComponentState<ComponentT>($class: ComponentClassProvider<ComponentT>, options?: ComponentState.CreateOptions): FactoryProvider; declare function stateTokenFor(provider: FactoryProvider): any; declare function _requireComponentState<T extends { [COMPONENT_STATE_IDENTITY]?: Partial<ComponentState<T>>; } & Record<any, any>>(instance: T, initValue?: Partial<ComponentState<T>>): Partial<ComponentState<T>>; /** @description Ensures that `T[Name]` is the same type as `T[K]`. * `K` is not required to be a strict `keyof T` since it may be a private field. */ type ValidateName<T extends Record<string, any>, K extends string, Name extends string | undefined> = Name extends keyof T ? (IfEquals<T[Name], Publicize<T, K>[K]> extends true ? Name : never) : never; /** @PropertyDecoratorFactory * @description Explicitly declares the decorated property as a stateful property to be tracked by `ComponentStateRef`. * @param publicName (Optional) The public property that this state should be exposed through. */ declare function DeclareState<Name extends string | undefined = undefined>(publicName?: Name): <ComponentT extends Constructable<any, any>, K extends string>(target: Name extends undefined ? ComponentT : (ValidateName<ComponentT, K, Name> extends never ? never : ComponentT), propKey: K) => void; type DirectiveStateRef<DirectiveT> = ComponentStateRef<DirectiveT>; declare const DirectiveStateRef: typeof ComponentStateRef; type DirectiveState<DirectiveT> = ComponentState<DirectiveT>; declare namespace DirectiveState { type CreateOptions = ComponentState.CreateOptions; function create<DirectiveT>($class: Type<any>, options?: CreateOptions): FactoryProvider; function tokenFor(provider: FactoryProvider): any; } declare function createDirectiveState<DirectiveT>($class: Type<any>, options?: DirectiveState.CreateOptions): FactoryProvider; declare function EventSource(): PropertyDecorator; declare function EventSource(...methodDecorators: MethodDecorator[]): PropertyDecorator; declare function EventSource(options: EventSource.DecoratorOptions, ...methodDecorators: MethodDecorator[]): PropertyDecorator; declare namespace EventSource { type DecoratorOptions = Partial<EventMetadata.ConfigOptions>; /** @PropertyDecoratorFactory */ function WithParams(options?: DecoratorOptions, ...methodDecorators: MethodDecorator[]): PropertyDecorator; /** * @description Registers a lifecycle event handler for use with `registerPreOrderHooks`/`registerPostOrderHooks` */ function registerLifecycleEvent(targetClass: Type<any>, eventType: EventType, hookFn: (...args: any[]) => void): void; function unregisterLifecycleEvent(targetClass: Type<any>, eventType: EventType, hookFn: (...args: any[]) => void): void; } declare enum AngularLifecycleType { OnChanges = "ngOnChanges", OnInit = "ngOnInit", OnDestroy = "ngOnDestroy", DoCheck = "ngDoCheck", AfterContentInit = "ngAfterContentInit", AfterContentChecked = "ngAfterContentChecked", AfterViewInit = "ngAfterViewInit", AfterViewChecked = "ngAfterViewChecked" } declare namespace AngularLifecycleType { const values: AngularLifecycleType[]; } declare namespace AngularLifecycleDecorator { type Factory = (options?: EventSource.DecoratorOptions, ...methodDecorators: MethodDecorator[]) => PropertyDecorator; /** @PropertyDecoratorMetaFactory */ function Factory(eventType: AngularLifecycleType): Factory; } declare function OnChanges(options?: EventSource.DecoratorOptions, ...methodDecorators: MethodDecorator[]): PropertyDecorator; declare function OnInit(options?: EventSource.DecoratorOptions, ...methodDecorators: MethodDecorator[]): PropertyDecorator; declare function OnDestroy(options?: EventSource.DecoratorOptions, ...methodDecorators: MethodDecorator[]): PropertyDecorator; declare function DoCheck(options?: EventSource.DecoratorOptions, ...methodDecorators: MethodDecorator[]): PropertyDecorator; declare function AfterContentInit(options?: EventSource.DecoratorOptions, ...methodDecorators: MethodDecorator[]): PropertyDecorator; declare function AfterContentChecked(options?: EventSource.DecoratorOptions, ...methodDecorators: MethodDecorator[]): PropertyDecorator; declare function AfterViewInit(options?: EventSource.DecoratorOptions, ...methodDecorators: MethodDecorator[]): PropertyDecorator; declare function AfterViewChecked(options?: EventSource.DecoratorOptions, ...methodDecorators: MethodDecorator[]): PropertyDecorator; type Constructor<T> = new (...args: any[]) => T; type GenericConstructor<BaseT> = new <T extends BaseT>(...args: any[]) => T; type BaseObservable = Observable<unknown>; declare function ManagedObservableWrapper($class: Constructor<BaseObservable>): GenericConstructor<BaseObservable>; declare const ManagedObservable_base: GenericConstructor<BaseObservable>; declare class ManagedObservable<T> extends ManagedObservable_base<Observable<T>> { constructor(componentInstance: any, subscribe?: (this: Observable<T>, subscriber: Subscriber<T>) => TeardownLogic); } declare const ManagedSubject_base: GenericConstructor<BaseObservable>; declare class ManagedSubject<T> extends ManagedSubject_base<Subject<T>> { constructor(componentInstance: any); } declare const ManagedBehaviorSubject_base: GenericConstructor<BaseObservable>; declare class ManagedBehaviorSubject<T> extends ManagedBehaviorSubject_base<BehaviorSubject<T>> { constructor(componentInstance: any, initialValue: T); } declare const ManagedReplaySubject_base: GenericConstructor<BaseObservable>; declare class ManagedReplaySubject<T> extends ManagedReplaySubject_base<ReplaySubject<T>> { constructor(componentInstance: any, bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike); } declare namespace ObservableUtil { /** @description * Creates an observable from the given property. */ function CreateFromProperty<T>(property: T | Subject<T> | Observable<T>): Observable<T>; /** * @param target The target object. * @param path The target property path. * @description Creates an observable chain from the given property path. * * Note: Any property in the path that isn't an Observable or Subject will implicitly be converted to an Observable. */ function CreateFromPropertyPath(target: any, path: string): Observable<any>; /** * @param target The target object. * @param path The target property path. * @description Checks if the given property path is dynamic. * A path is considered dynamic or non-static if: * * - It contains any Observables, or Subjects that are not the terminal property in the path. * - It does not terminate with a Subject. * - It contains optional fields (those that are conditionally evaluated via the `?.` operator). */ function IsDynamicPropertyPath(target: any, path: string): boolean; function ResolvePropertyPath(target: any, path: string): Observable<any>; function ResolveStaticPropertyPath<T>(target: any, path: string): Subject<T>; /** * @param target The target object. * @param path The target property path. * @param value The new value of the property. * @param mergeValue Whether or not the newly emitted value should be merged into the last emitted value. * @description Traverses the property path for a Subject, and appropriately wraps and emits the given value from the Subject. */ function UpdateDynamicPropertyPathValue<T>(target: any, path: string, value: T, mergeValue?: boolean): void; } interface ObservableUtil { } /** @deprecated */ declare function StateEmitter(): PropertyDecorator; /** @deprecated */ declare function StateEmitter(...propertyDecorators: PropertyDecorator[]): PropertyDecorator; /** @deprecated */ declare function StateEmitter(params: StateEmitter.DecoratorParams, ...propertyDecorators: PropertyDecorator[]): PropertyDecorator; /** @deprecated */ declare namespace StateEmitter { interface DecoratorParams extends EmitterMetadata.SubjectInfo.CoreDetails { propertyName?: EmitterType; } interface ProxyDecoratorParams { path: string; propertyName?: EmitterType; mergeUpdates?: boolean; readOnly?: boolean; writeOnly?: boolean; unmanaged?: boolean; } interface SelfProxyDecoratorParams { propertyName?: EmitterType; readOnly?: boolean; writeOnly?: boolean; unmanaged?: boolean; } /** @PropertyDecoratorFactory */ function WithParams(params?: StateEmitter.DecoratorParams, ...propertyDecorators: PropertyDecorator[]): PropertyDecorator; function _ResolveProxyDecoratorParams(params: ProxyDecoratorParams | string): ProxyDecoratorParams; /** @PropertyDecoratorFactory */ function Alias(params: ProxyDecoratorParams | string, ...propertyDecorators: PropertyDecorator[]): PropertyDecorator; /** @PropertyDecoratorFactory */ function From(params: ProxyDecoratorParams | string, ...propertyDecorators: PropertyDecorator[]): PropertyDecorator; /** @PropertyDecoratorFactory */ function Merge(params: ProxyDecoratorParams | string, ...propertyDecorators: PropertyDecorator[]): PropertyDecorator; /** @PropertyDecoratorFactory */ function AliasSelf(params?: SelfProxyDecoratorParams, ...propertyDecorators: PropertyDecorator[]): PropertyDecorator; /** @PropertyDecoratorFactory */ function FromSelf(params?: SelfProxyDecoratorParams, ...propertyDecorators: PropertyDecorator[]): PropertyDecorator; /** @PropertyDecoratorFactory */ function MergeSelf(params?: SelfProxyDecoratorParams, ...propertyDecorators: PropertyDecorator[]): PropertyDecorator; } export { AfterContentChecked, AfterContentInit, AfterViewChecked, AfterViewInit, AngularLifecycleDecorator, AsyncState, AutoPush, CommonMetadata, ComponentState, ComponentStateMetadata, ComponentStateRef, DeclareState, DirectiveState, DirectiveStateRef, DoCheck, EmitterMetadata, EventMetadata, EventSource, LiComponent, ManagedBehaviorSubject, ManagedObservable, ManagedObservableWrapper, ManagedReplaySubject, ManagedSubject, Metadata, ObservableUtil, OnChanges, OnDestroy, OnInit, StateEmitter, TemplateDynamic, _LangUtils, _requireComponentState, asyncStateKey, createComponentState, createDirectiveState, stateTokenFor }; export type { AsyncSourceKey, BaseObservable, Constructable, Constructor, EmitterType, EventType, GenericConstructor, IfEquals, IfReadonly, ImmutableMap, ManagedComponent, Publicize, StringKey, ValidAsyncSourceKey };