mirror of https://github.com/ANL-CEEESA/RELOG.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
726 B
22 lines
726 B
import type { StateCreator, StoreMutatorIdentifier } from '../vanilla';
|
|
type Write<T, U> = Omit<T, keyof U> & U;
|
|
type Action = {
|
|
type: string;
|
|
};
|
|
type StoreRedux<A> = {
|
|
dispatch: (a: A) => A;
|
|
dispatchFromDevtools: true;
|
|
};
|
|
type ReduxState<A> = {
|
|
dispatch: StoreRedux<A>['dispatch'];
|
|
};
|
|
type WithRedux<S, A> = Write<S, StoreRedux<A>>;
|
|
type Redux = <T, A extends Action, Cms extends [StoreMutatorIdentifier, unknown][] = []>(reducer: (state: T, action: A) => T, initialState: T) => StateCreator<Write<T, ReduxState<A>>, Cms, [['zustand/redux', A]]>;
|
|
declare module '../vanilla' {
|
|
interface StoreMutators<S, A> {
|
|
'zustand/redux': WithRedux<S, A>;
|
|
}
|
|
}
|
|
export declare const redux: Redux;
|
|
export {};
|