Skip to content

Commit

Permalink
Export all TS snapshot types (#4516)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist authored Nov 29, 2023
1 parent d648de0 commit daf532b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/large-comics-vanish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'xstate': patch
---

Export all TS snapshot types to fix type portability errors that could be reported when generating declaration files for files depending on `xstate`.
2 changes: 1 addition & 1 deletion packages/core/src/actors/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '../types';
import { XSTATE_STOP } from '../constants.ts';

type CallbackSnapshot<TInput, TEvent> = Snapshot<undefined> & {
export type CallbackSnapshot<TInput, TEvent> = Snapshot<undefined> & {
input: TInput;
_receivers: Set<(e: TEvent) => void>;
_dispose: (() => void) | void;
Expand Down
15 changes: 12 additions & 3 deletions packages/core/src/actors/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { createActor } from '../interpreter.ts';
import type { ActorRef, AnyEventObject, Snapshot } from '../types.ts';
import { fromTransition } from './transition.ts';
export { fromCallback, type CallbackActorLogic } from './callback.ts';
export {
fromCallback,
type CallbackActorLogic,
type CallbackSnapshot
} from './callback.ts';
export {
fromEventObservable,
fromObservable,
type ObservableActorLogic
type ObservableActorLogic,
type ObservableSnapshot
} from './observable.ts';
export { fromPromise, type PromiseActorLogic } from './promise.ts';
export {
fromPromise,
type PromiseActorLogic,
type PromiseSnapshot
} from './promise.ts';
export {
fromTransition,
type TransitionActorLogic,
Expand Down

0 comments on commit daf532b

Please sign in to comment.