Skip to content

Commit

Permalink
chore: release 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
bigopon committed Jan 30, 2023
1 parent 0cb1d1d commit 44debee
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 33 deletions.
147 changes: 147 additions & 0 deletions dist/aurelia-store.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
// Generated by dts-bundle-generator v7.2.0

import { Container } from 'aurelia-dependency-injection';
import { Logger } from 'aurelia-logging';
import { Observable } from 'rxjs';

export interface StateHistory<T> {
past: T[];
present: T;
future: T[];
}
export interface HistoryOptions {
undoable: boolean;
limit?: number;
}
export declare function jump<T>(state: T, n: number): T | StateHistory<any>;
export declare function nextStateHistory<T>(presentStateHistory: StateHistory<T>, nextPresent: T): StateHistory<T>;
export declare function applyLimits<T>(state: T, limit: number): T;
export declare function isStateHistory(history: any): history is StateHistory<any>;
export declare const DEFAULT_LOCAL_STORAGE_KEY = "aurelia-store-state";
export interface CallingAction {
name: string;
params?: any[];
pipedActions?: {
name: string;
params?: any[];
}[];
}
export type Middleware<T, S = any> = (state: T, originalState: T | undefined, settings: S, action?: CallingAction) => T | Promise<T | undefined | false> | void | false;
export declare enum MiddlewarePlacement {
Before = "before",
After = "after"
}
export declare function logMiddleware(state: unknown, _: unknown, settings?: {
logType: "debug" | "error" | "info" | "log" | "trace" | "warn";
}): void;
export declare function localStorageMiddleware(state: unknown, _: unknown, settings?: {
key: string;
}): void;
export declare function rehydrateFromLocalStorage<T>(state: T, key?: string): any;
export declare enum LogLevel {
trace = "trace",
debug = "debug",
info = "info",
log = "log",
warn = "warn",
error = "error"
}
export declare class LoggerIndexed extends Logger {
[key: string]: any;
}
export interface LogDefinitions {
performanceLog?: LogLevel;
dispatchedActions?: LogLevel;
devToolsStatus?: LogLevel;
}
export declare function getLogType(options: Partial<StoreOptions>, definition: keyof LogDefinitions, defaultLevel: LogLevel): LogLevel;
export interface Action<T = any> {
type: T;
params?: any[];
}
export interface ActionCreator<T> {
(...args: any[]): T;
}
export type DevToolsOptions = import("@redux-devtools/extension").EnhancerOptions | {
disable: boolean;
};
export type Reducer<T, P extends any[] = any[]> = (state: T, ...params: P) => T | false | Promise<T | false>;
export declare enum PerformanceMeasurement {
StartEnd = "startEnd",
All = "all"
}
export interface StoreOptions {
history?: Partial<HistoryOptions>;
logDispatchedActions?: boolean;
measurePerformance?: PerformanceMeasurement;
propagateError?: boolean;
logDefinitions?: LogDefinitions;
devToolsOptions?: DevToolsOptions;
}
export interface PipedDispatch<T> {
pipe: <P extends any[]>(reducer: Reducer<T, P> | string, ...params: P) => PipedDispatch<T>;
dispatch: () => Promise<void>;
}
export declare class UnregisteredActionError<T, P extends any[]> extends Error {
constructor(reducer?: string | Reducer<T, P>);
}
export declare class Store<T> {
private initialState;
readonly state: Observable<T>;
private logger;
private devToolsAvailable;
private devTools;
private actions;
private middlewares;
private _state;
private options;
private _markNames;
private _measureNames;
private dispatchQueue;
constructor(initialState: T, options?: Partial<StoreOptions>);
registerMiddleware<S extends undefined>(reducer: Middleware<T, undefined>, placement: MiddlewarePlacement): void;
registerMiddleware<S extends NonNullable<any>>(reducer: Middleware<T, S>, placement: MiddlewarePlacement, settings: S): void;
unregisterMiddleware(reducer: Middleware<T, any>): void;
isMiddlewareRegistered(middleware: Middleware<T, any>): boolean;
registerAction(name: string, reducer: Reducer<T>): void;
unregisterAction(reducer: Reducer<T>): void;
isActionRegistered(reducer: Reducer<T> | string): boolean;
resetToState(state: T): void;
dispatch<P extends any[]>(reducer: Reducer<T, P> | string, ...params: P): Promise<void>;
pipe<P extends any[]>(reducer: Reducer<T, P> | string, ...params: P): PipedDispatch<T>;
private lookupAction;
private queueDispatch;
private handleQueue;
private internalDispatch;
private executeMiddlewares;
private setupDevTools;
private updateDevToolsState;
private registerHistoryMethods;
private mark;
private clearMarks;
private measure;
private clearMeasures;
}
export declare function dispatchify<T, P extends any[]>(action: Reducer<T, P> | string): (...params: P) => Promise<void>;
export type StepFn<T> = (res: T) => void;
export declare function executeSteps<T>(store: Store<T>, shouldLogResults: boolean, ...steps: StepFn<T>[]): Promise<void>;
export interface ConnectToSettings<T, R = T | any> {
onChanged?: string;
selector: ((store: Store<T>) => Observable<R>) | MultipleSelector<T, R>;
setup?: string;
target?: string;
teardown?: string;
}
export interface MultipleSelector<T, R = T | any> {
[key: string]: ((store: Store<T>) => Observable<R>);
}
export declare function connectTo<T, R = any>(settings?: ((store: Store<T>) => Observable<R>) | ConnectToSettings<T, R>): (target: any) => void;
export interface FrameworkConfiguration {
container: Container;
}
export interface StorePluginOptions<T> extends StoreOptions {
initialState: T;
}
export declare function configure<T>(aurelia: FrameworkConfiguration, options: Partial<StorePluginOptions<T>>): void;

export {};
54 changes: 24 additions & 30 deletions doc/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
<a name="2.0.0"></a>
# [2.0.0](https://github.com/aurelia/store/compare/1.7.2...2.0.0) (2022-11-12)


### Features

* update rxjs and typescript versions ([20157d5](https://github.com/aurelia/store/commit/20157d5))


### BREAKING CHANGES

* This might conflict with your projects rxjs version



<a name="2.0.0"></a>
# [2.0.0](https://github.com/aurelia/store/compare/1.7.2...2.0.0) (2022-11-12)


### Features

* update rxjs and typescript versions ([20157d5](https://github.com/aurelia/store/commit/20157d5))


### BREAKING CHANGES

* This might conflict with your projects rxjs version



<a name="2.0.1"></a>
# [2.0.1](https://github.com/aurelia/store/compare/1.7.2...2.0.1) (2022-01-31)


### Bug Fixes

* Correct typings in dist files


<a name="2.0.0"></a>
# [2.0.0](https://github.com/aurelia/store/compare/1.7.2...2.0.0) (2022-11-12)


### Features

* update rxjs and typescript versions ([20157d5](https://github.com/aurelia/store/commit/20157d5))


### BREAKING CHANGES

* This might conflict with your projects rxjs version



<a name="1.7.2"></a>
## [1.7.2](https://github.com/aurelia/store/compare/1.7.0...1.7.2) (2022-03-16)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-store",
"version": "2.0.0",
"version": "2.0.1",
"description": "Aurelia single state store based on RxJS",
"keywords": [
"aurelia",
Expand Down

0 comments on commit 44debee

Please sign in to comment.