Skip to content

Commit 441c36d

Browse files
committed
chore: release 2.0.1
1 parent 0cb1d1d commit 441c36d

File tree

2 files changed

+171
-30
lines changed

2 files changed

+171
-30
lines changed

dist/aurelia-store.d.ts

+147
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
// Generated by dts-bundle-generator v7.2.0
2+
3+
import { Container } from 'aurelia-dependency-injection';
4+
import { Logger } from 'aurelia-logging';
5+
import { Observable } from 'rxjs';
6+
7+
export interface StateHistory<T> {
8+
past: T[];
9+
present: T;
10+
future: T[];
11+
}
12+
export interface HistoryOptions {
13+
undoable: boolean;
14+
limit?: number;
15+
}
16+
export declare function jump<T>(state: T, n: number): T | StateHistory<any>;
17+
export declare function nextStateHistory<T>(presentStateHistory: StateHistory<T>, nextPresent: T): StateHistory<T>;
18+
export declare function applyLimits<T>(state: T, limit: number): T;
19+
export declare function isStateHistory(history: any): history is StateHistory<any>;
20+
export declare const DEFAULT_LOCAL_STORAGE_KEY = "aurelia-store-state";
21+
export interface CallingAction {
22+
name: string;
23+
params?: any[];
24+
pipedActions?: {
25+
name: string;
26+
params?: any[];
27+
}[];
28+
}
29+
export type Middleware<T, S = any> = (state: T, originalState: T | undefined, settings: S, action?: CallingAction) => T | Promise<T | undefined | false> | void | false;
30+
export declare enum MiddlewarePlacement {
31+
Before = "before",
32+
After = "after"
33+
}
34+
export declare function logMiddleware(state: unknown, _: unknown, settings?: {
35+
logType: "debug" | "error" | "info" | "log" | "trace" | "warn";
36+
}): void;
37+
export declare function localStorageMiddleware(state: unknown, _: unknown, settings?: {
38+
key: string;
39+
}): void;
40+
export declare function rehydrateFromLocalStorage<T>(state: T, key?: string): any;
41+
export declare enum LogLevel {
42+
trace = "trace",
43+
debug = "debug",
44+
info = "info",
45+
log = "log",
46+
warn = "warn",
47+
error = "error"
48+
}
49+
export declare class LoggerIndexed extends Logger {
50+
[key: string]: any;
51+
}
52+
export interface LogDefinitions {
53+
performanceLog?: LogLevel;
54+
dispatchedActions?: LogLevel;
55+
devToolsStatus?: LogLevel;
56+
}
57+
export declare function getLogType(options: Partial<StoreOptions>, definition: keyof LogDefinitions, defaultLevel: LogLevel): LogLevel;
58+
export interface Action<T = any> {
59+
type: T;
60+
params?: any[];
61+
}
62+
export interface ActionCreator<T> {
63+
(...args: any[]): T;
64+
}
65+
export type DevToolsOptions = import("@redux-devtools/extension").EnhancerOptions | {
66+
disable: boolean;
67+
};
68+
export type Reducer<T, P extends any[] = any[]> = (state: T, ...params: P) => T | false | Promise<T | false>;
69+
export declare enum PerformanceMeasurement {
70+
StartEnd = "startEnd",
71+
All = "all"
72+
}
73+
export interface StoreOptions {
74+
history?: Partial<HistoryOptions>;
75+
logDispatchedActions?: boolean;
76+
measurePerformance?: PerformanceMeasurement;
77+
propagateError?: boolean;
78+
logDefinitions?: LogDefinitions;
79+
devToolsOptions?: DevToolsOptions;
80+
}
81+
export interface PipedDispatch<T> {
82+
pipe: <P extends any[]>(reducer: Reducer<T, P> | string, ...params: P) => PipedDispatch<T>;
83+
dispatch: () => Promise<void>;
84+
}
85+
export declare class UnregisteredActionError<T, P extends any[]> extends Error {
86+
constructor(reducer?: string | Reducer<T, P>);
87+
}
88+
export declare class Store<T> {
89+
private initialState;
90+
readonly state: Observable<T>;
91+
private logger;
92+
private devToolsAvailable;
93+
private devTools;
94+
private actions;
95+
private middlewares;
96+
private _state;
97+
private options;
98+
private _markNames;
99+
private _measureNames;
100+
private dispatchQueue;
101+
constructor(initialState: T, options?: Partial<StoreOptions>);
102+
registerMiddleware<S extends undefined>(reducer: Middleware<T, undefined>, placement: MiddlewarePlacement): void;
103+
registerMiddleware<S extends NonNullable<any>>(reducer: Middleware<T, S>, placement: MiddlewarePlacement, settings: S): void;
104+
unregisterMiddleware(reducer: Middleware<T, any>): void;
105+
isMiddlewareRegistered(middleware: Middleware<T, any>): boolean;
106+
registerAction(name: string, reducer: Reducer<T>): void;
107+
unregisterAction(reducer: Reducer<T>): void;
108+
isActionRegistered(reducer: Reducer<T> | string): boolean;
109+
resetToState(state: T): void;
110+
dispatch<P extends any[]>(reducer: Reducer<T, P> | string, ...params: P): Promise<void>;
111+
pipe<P extends any[]>(reducer: Reducer<T, P> | string, ...params: P): PipedDispatch<T>;
112+
private lookupAction;
113+
private queueDispatch;
114+
private handleQueue;
115+
private internalDispatch;
116+
private executeMiddlewares;
117+
private setupDevTools;
118+
private updateDevToolsState;
119+
private registerHistoryMethods;
120+
private mark;
121+
private clearMarks;
122+
private measure;
123+
private clearMeasures;
124+
}
125+
export declare function dispatchify<T, P extends any[]>(action: Reducer<T, P> | string): (...params: P) => Promise<void>;
126+
export type StepFn<T> = (res: T) => void;
127+
export declare function executeSteps<T>(store: Store<T>, shouldLogResults: boolean, ...steps: StepFn<T>[]): Promise<void>;
128+
export interface ConnectToSettings<T, R = T | any> {
129+
onChanged?: string;
130+
selector: ((store: Store<T>) => Observable<R>) | MultipleSelector<T, R>;
131+
setup?: string;
132+
target?: string;
133+
teardown?: string;
134+
}
135+
export interface MultipleSelector<T, R = T | any> {
136+
[key: string]: ((store: Store<T>) => Observable<R>);
137+
}
138+
export declare function connectTo<T, R = any>(settings?: ((store: Store<T>) => Observable<R>) | ConnectToSettings<T, R>): (target: any) => void;
139+
export interface FrameworkConfiguration {
140+
container: Container;
141+
}
142+
export interface StorePluginOptions<T> extends StoreOptions {
143+
initialState: T;
144+
}
145+
export declare function configure<T>(aurelia: FrameworkConfiguration, options: Partial<StorePluginOptions<T>>): void;
146+
147+
export {};

doc/CHANGELOG.md

+24-30
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,27 @@
1-
<a name="2.0.0"></a>
2-
# [2.0.0](https://github.com/aurelia/store/compare/1.7.2...2.0.0) (2022-11-12)
3-
4-
5-
### Features
6-
7-
* update rxjs and typescript versions ([20157d5](https://github.com/aurelia/store/commit/20157d5))
8-
9-
10-
### BREAKING CHANGES
11-
12-
* This might conflict with your projects rxjs version
13-
14-
15-
16-
<a name="2.0.0"></a>
17-
# [2.0.0](https://github.com/aurelia/store/compare/1.7.2...2.0.0) (2022-11-12)
18-
19-
20-
### Features
21-
22-
* update rxjs and typescript versions ([20157d5](https://github.com/aurelia/store/commit/20157d5))
23-
24-
25-
### BREAKING CHANGES
26-
27-
* This might conflict with your projects rxjs version
28-
29-
30-
1+
<a name="2.0.1"></a>
2+
# [2.0.1](https://github.com/aurelia/store/compare/1.7.2...2.0.1) (2022-01-31)
3+
4+
5+
### Bug Fixes
6+
7+
* Correct typings in dist files
8+
9+
10+
<a name="2.0.0"></a>
11+
# [2.0.0](https://github.com/aurelia/store/compare/1.7.2...2.0.0) (2022-11-12)
12+
13+
14+
### Features
15+
16+
* update rxjs and typescript versions ([20157d5](https://github.com/aurelia/store/commit/20157d5))
17+
18+
19+
### BREAKING CHANGES
20+
21+
* This might conflict with your projects rxjs version
22+
23+
24+
3125
<a name="1.7.2"></a>
3226
## [1.7.2](https://github.com/aurelia/store/compare/1.7.0...1.7.2) (2022-03-16)
3327

0 commit comments

Comments
 (0)