@antischematic/angular-state-library
Version:
Reactive state without boilerplate
17 lines (16 loc) • 1.45 kB
TypeScript
import { ProviderToken } from "@angular/core";
import { Observable } from "rxjs";
import { ActionMetadata } from "./interfaces";
export declare function createDecorator<T extends {}>(symbol: symbol, defaults: {}): (options?: T) => (target: {}, key: PropertyKey, descriptor?: PropertyDescriptor) => void;
export declare function Store(): (target: Function) => void;
export declare const Action: (options?: ActionMetadata | undefined) => (target: {}, key: PropertyKey, descriptor?: PropertyDescriptor) => void;
export declare const Invoke: (options?: ActionMetadata | undefined) => (target: {}, key: PropertyKey, descriptor?: PropertyDescriptor) => void;
export declare const Before: (options?: ActionMetadata | undefined) => (target: {}, key: PropertyKey, descriptor?: PropertyDescriptor) => void;
export declare const Layout: (options?: ActionMetadata | undefined) => (target: {}, key: PropertyKey, descriptor?: PropertyDescriptor) => void;
export declare function Caught(): (target: {}, key: PropertyKey, descriptor: PropertyDescriptor) => void;
export declare function Select(): (target: {}, key: PropertyKey, descriptor?: PropertyDescriptor) => void;
export declare function Select(token: ProviderToken<any>): (target: {}, key: PropertyKey, descriptor: void) => void;
export declare type Action<TFunction extends (...params: any[]) => void = () => void> = TFunction;
export declare type Select<T> = {
[key in keyof T]: Observable<T[key]>;
};