Skip to content

Commit

Permalink
Export inspection event types (#4344)
Browse files Browse the repository at this point in the history
* Export inspection events

* Update test
  • Loading branch information
davidkpiano authored Oct 9, 2023
1 parent 986b726 commit f9b17f1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .changeset/stale-crews-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'xstate': patch
---

Inspection events are now exported:

```ts
import type {
InspectedActorEvent,
InspectedEventEvent,
InspectedSnapshotEvent,
InspectionEvent
} from 'xstate';
```
6 changes: 6 additions & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export {
StateNode,
type Interpreter
};
export type {
InspectedActorEvent,
InspectedEventEvent,
InspectedSnapshotEvent,
InspectionEvent
} from './system.ts';

export { and, not, or, stateIn } from './guards.ts';

Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/inspect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
fromPromise,
sendParent,
sendTo,
waitFor
waitFor,
InspectionEvent
} from '../src';
import { InspectionEvent } from '../src/system';

function simplifyEvent(inspectionEvent: InspectionEvent) {
if (inspectionEvent.type === '@xstate.event') {
Expand Down

0 comments on commit f9b17f1

Please sign in to comment.