From e23e781f72d7a00d30cf3ed7de2fa65039383d9f Mon Sep 17 00:00:00 2001 From: Jacob Bolda Date: Fri, 21 Jun 2024 14:13:01 -0500 Subject: [PATCH] fix types from squash --- packages/foundation/src/index.ts | 1 + packages/foundation/src/store/index.ts | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/packages/foundation/src/index.ts b/packages/foundation/src/index.ts index 28c47915..e6de65d1 100644 --- a/packages/foundation/src/index.ts +++ b/packages/foundation/src/index.ts @@ -73,6 +73,7 @@ export function createFoundationSimulationServer< ExtendedSimulationSelectors, ExtendedSimulationSchema >; + logs?: boolean; }; extendRouter?( router: express.Router, diff --git a/packages/foundation/src/store/index.ts b/packages/foundation/src/store/index.ts index 16e64203..92c1806c 100644 --- a/packages/foundation/src/store/index.ts +++ b/packages/foundation/src/store/index.ts @@ -1,26 +1,28 @@ import { generateSchemaWithInputSlices } from "./schema"; import type { ExtendSimulationSchemaInput } from "./schema"; -import { setupStore } from "./setup"; import type { AnyState, StoreUpdater, Callable } from "starfx"; import { parallel, take, createStore, createSelector } from "starfx"; import { updateStore, createThunks, mdw } from "starfx"; type StoreThunks = ReturnType; -type Store = ReturnType< - typeof setupStore +type GeneratedSchema = ReturnType< + typeof generateSchemaWithInputSlices +>; +type GeneratedStore = ReturnType< + typeof createStore[1]> >; export type ExtendSimulationActionsInput = (arg: { thunks: StoreThunks; - store: Store["store"]; - schema: Store["schema"]; + store: GeneratedStore; + schema: GeneratedSchema[0]; }) => Actions; export type ExtendSimulationSelectorsInput< Selectors, ExtendedSimulationSchema > = (arg: { - store: Store["store"]; - schema: Store["schema"]; + store: GeneratedStore; + schema: GeneratedSchema[0]; createSelector: typeof createSelector; }) => Selectors; @@ -44,7 +46,7 @@ export function createSimulationStore< ExtendedSimulationSelectors, ExtendedSimulationSchema >; - logs: boolean; + logs?: boolean; } = { schema: (() => ({})) as unknown as ExtendSimulationSchemaInput, @@ -142,14 +144,14 @@ export type ExtendSimulationActions< InputSchema extends ExtendSimulationSchemaInput > = { thunks: StoreThunks; - store: Store>["store"]; - schema: Store>["schema"]; + store: GeneratedStore>; + schema: GeneratedSchema>[0]; }; export type ExtendSimulationSelectors< InputSchema extends ExtendSimulationSchemaInput > = { - store: Store>["store"]; - schema: Store>["schema"]; + store: GeneratedStore>; + schema: GeneratedSchema>[0]; createSelector: typeof createSelector; };