@lithiumjs/angular
Version:
Reactive components made easy. Lithium provides utilities that enable seamless reactive state and event interactions for Angular components.
39 lines (38 loc) • 1.91 kB
TypeScript
import { Observable, Subject } from "rxjs";
export 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;
}
export interface ObservableUtil {
}