Skip to content

Commit 443d1f1

Browse files
committed
Give more precise type to Store
1 parent 2eacc8d commit 443d1f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

node_package/src/types/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import type { Readable } from 'stream';
77
// See https://github.com/shakacode/react_on_rails/issues/1321
88
// and https://redux.js.org/api/store for the actual API.
99
/* eslint-disable @typescript-eslint/no-explicit-any */
10-
type Store = unknown;
10+
type Store = {
11+
getState(): unknown;
12+
};
1113

1214
type ReactComponent = ComponentType<any> | string;
1315

@@ -171,7 +173,6 @@ export interface ReactOnRails {
171173
/** @deprecated Use registerStoreGenerators instead */
172174
registerStore(stores: Record<string, StoreGenerator>): void;
173175
registerStoreGenerators(storeGenerators: Record<string, StoreGenerator>): void;
174-
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
175176
getStore(name: string, throwIfMissing?: boolean): Store | undefined;
176177
getOrWaitForStore(name: string): Promise<Store>;
177178
getOrWaitForStoreGenerator(name: string): Promise<StoreGenerator>;

0 commit comments

Comments
 (0)