@antischematic/angular-state-library
Version:
Reactive state without boilerplate
23 lines (22 loc) • 1.44 kB
TypeScript
import { ProviderToken } from "@angular/core";
import { ActionMetadata, CaughtMetadata, DepMap, Metadata, Phase } from "./interfaces";
export declare const meta: WeakMap<object, any>;
export declare const action: unique symbol;
export declare const selector: unique symbol;
export declare const tracked: unique symbol;
export declare const injector: unique symbol;
export declare const caught: unique symbol;
export declare const attach: unique symbol;
export declare function getMetaKeys<T>(metaKey: any, target: object): Map<unknown, Metadata<T>>;
export declare function getMeta<T>(metaKey: any, target: object, key?: PropertyKey): Metadata<T> | undefined;
export declare function setMeta(metaKey: any, value: any, target: object, key?: PropertyKey): any;
export declare function getMetaValues<T>(metaKey: any, target: object): Metadata<T>[];
export declare function getActions(target: {}, phase?: Phase): Metadata<ActionMetadata>[];
export declare function getSelectors<T>(target: {}, withDescriptor: boolean): Metadata<T>[];
export declare function getErrorHandlers(target: {}): Metadata<CaughtMetadata>[];
export declare function getDeps(target: {}, key: PropertyKey): DepMap | undefined;
export declare function getToken<T>(token: ProviderToken<T>, context: {}, key?: string): T;
export declare function markDirty(context: {}): void;
export declare function getAttachments(target: {}): Metadata<{
token: ProviderToken<any>;
}>[];