statelyai / xstate

Actor-based state management & orchestration for complex app logic.
https://stately.ai/docs
MIT License
26.51k stars 1.22k forks source link

Bug: @xstate/store does not export any types #4916

Closed boneskull closed 1 month ago

boneskull commented 1 month ago

XState version

XState version 5

Description

@xstate/store's root declarations only export the functions fromStore, createStore, and createStoreWithProducer.

Store, EventPayloadMap, and StoreContext--any novel type appearing in the type signatures of these functions--should be exposed, at minimum. And whatever's needed for the other exports (e.g., react)

Expected result

That e.g., the Store type would be exported, so I could use it as the type of a function parameter.

Actual result

No such types are exported.

It might be possible to use ReturnType or Parameters to get at this stuff, as a workaround... but that hurts.

Reproduction

import {Store} from '@xstate/store` 😄

Additional context

This is using v0.0.4. I have a feeling I'm an early adopter 😜