Skip to content

Commit

Permalink
fix types from squash
Browse files Browse the repository at this point in the history
  • Loading branch information
jbolda committed Jun 21, 2024
1 parent 932e1da commit e23e781
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/foundation/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export function createFoundationSimulationServer<
ExtendedSimulationSelectors,
ExtendedSimulationSchema
>;
logs?: boolean;
};
extendRouter?(
router: express.Router,
Expand Down
26 changes: 14 additions & 12 deletions packages/foundation/src/store/index.ts
Original file line number Diff line number Diff line change
@@ -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<typeof createThunks>;
type Store<ExtendedSimulationSchema> = ReturnType<
typeof setupStore<ExtendedSimulationSchema>
type GeneratedSchema<ExtendedSimulationSchema> = ReturnType<
typeof generateSchemaWithInputSlices<ExtendedSimulationSchema>
>;
type GeneratedStore<ExtendedSimulationSchema> = ReturnType<
typeof createStore<GeneratedSchema<ExtendedSimulationSchema>[1]>
>;
export type ExtendSimulationActionsInput<Actions, ExtendedSimulationSchema> =
(arg: {
thunks: StoreThunks;
store: Store<ExtendedSimulationSchema>["store"];
schema: Store<ExtendedSimulationSchema>["schema"];
store: GeneratedStore<ExtendedSimulationSchema>;
schema: GeneratedSchema<ExtendedSimulationSchema>[0];
}) => Actions;
export type ExtendSimulationSelectorsInput<
Selectors,
ExtendedSimulationSchema
> = (arg: {
store: Store<ExtendedSimulationSchema>["store"];
schema: Store<ExtendedSimulationSchema>["schema"];
store: GeneratedStore<ExtendedSimulationSchema>;
schema: GeneratedSchema<ExtendedSimulationSchema>[0];
createSelector: typeof createSelector;
}) => Selectors;

Expand All @@ -44,7 +46,7 @@ export function createSimulationStore<
ExtendedSimulationSelectors,
ExtendedSimulationSchema
>;
logs: boolean;
logs?: boolean;
} = {
schema:
(() => ({})) as unknown as ExtendSimulationSchemaInput<ExtendedSimulationSchema>,
Expand Down Expand Up @@ -142,14 +144,14 @@ export type ExtendSimulationActions<
InputSchema extends ExtendSimulationSchemaInput<any>
> = {
thunks: StoreThunks;
store: Store<ReturnType<InputSchema>>["store"];
schema: Store<ReturnType<InputSchema>>["schema"];
store: GeneratedStore<ReturnType<InputSchema>>;
schema: GeneratedSchema<ReturnType<InputSchema>>[0];
};

export type ExtendSimulationSelectors<
InputSchema extends ExtendSimulationSchemaInput<any>
> = {
store: Store<ReturnType<InputSchema>>["store"];
schema: Store<ReturnType<InputSchema>>["schema"];
store: GeneratedStore<ReturnType<InputSchema>>;
schema: GeneratedSchema<ReturnType<InputSchema>>[0];
createSelector: typeof createSelector;
};

0 comments on commit e23e781

Please sign in to comment.