Files
med-notes/.pnpm-store/v10/files/37/1b1ea8c6c7ba88141341a0068d4f3129b600d5d2711243fc109f413ea54209ba9c78514cae5736374e95f4df05bb051d6f8eb2ddeaa81004670fdd14addc5d
2025-05-09 05:30:08 +02:00

22 lines
735 B
Plaintext

import type { StateCreator, StoreMutatorIdentifier } from 'zustand/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.mjs' {
interface StoreMutators<S, A> {
'zustand/redux': WithRedux<S, A>;
}
}
export declare const redux: Redux;
export {};