diff --git a/.gitignore b/.gitignore
index 06b5b751f..2a767c771 100644
--- a/.gitignore
+++ b/.gitignore
@@ -30,3 +30,7 @@ yarn-error.log*
# JetBrains IDE's
.idea
.fleet
+
+# API Extractor temporary files
+temp/
+
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..6fc5365ce
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "xstate"]
+ path = xstate
+ url = https://github.com/statelyai/xstate
diff --git a/README.md b/README.md
index 8fe4ff767..5880c38d6 100644
--- a/README.md
+++ b/README.md
@@ -31,6 +31,16 @@ Currently we serve the root landing page from a static file.
- During server side rendering (SSR) we use [`/static/index.html`](./static/index.html)
- During client side rendering (CSR) we use [`/static/landing-page/index.html`](./static/landing-page/index.html)
+## Updating API Documentation
+
+```
+$ scripts/update-api-docs.sh
+```
+
+This command generates API Documentation as Markdown files to the `api` directory.
+
+It uses [API Extractor](https://api-extractor.com) to analyze code and inline TSDoc comments from xstate packages, creating `*.api.json` doc model files, which are then used by [API Documenter](https://api-extractor.com/pages/setup/generating_docs) to generate Markdown files in the appropriate `api` directory for each package. We use the [Docusaurus Multi-Instance](https://docusaurus.io/docs/docs-multi-instance) feature to configure each `api/*` directory as its own set of versionable docs.
+
## Build
```
diff --git a/api/xstate/index.md b/api/xstate/index.md
new file mode 100644
index 000000000..738da53f9
--- /dev/null
+++ b/api/xstate/index.md
@@ -0,0 +1,259 @@
+---
+title: "xstate"
+hide_title: true
+custom_edit_url: null
+pagination_prev: null
+pagination_next: null
+---
+
+
+
+
+## xstate package
+
+## Classes
+
+| Class | Description |
+| --- | --- |
+| [Actor](./xstate.actor.md) | |
+| [SimulatedClock](./xstate.simulatedclock.md) | |
+| [State](./xstate.state.md) | |
+| [StateMachine](./xstate.statemachine.md) | |
+| [StateNode](./xstate.statenode.md) | |
+
+## Enumerations
+
+| Enumeration | Description |
+| --- | --- |
+| [ActorStatus](./xstate.actorstatus.md) | |
+| [SpecialTargets](./xstate.specialtargets.md) | |
+
+## Functions
+
+| Function | Description |
+| --- | --- |
+| [and(guards)](./xstate.and.md) | |
+| [assign(assignment)](./xstate.assign.md) | Updates the current context of the machine. |
+| [cancel(sendId)](./xstate.cancel.md) | Cancels an in-flight send(...)
action. A canceled sent action will not be executed, nor will its event be sent, unless it has already been sent (e.g., if cancel(...)
is called after the send(...)
action's delay
). |
+| [choose(branches)](./xstate.choose.md) | |
+| [createActor(machine, options)](./xstate.createactor.md) | Creates a new ActorRef
instance for the given machine with the provided options, if any. |
+| [createActor(logic, options)](./xstate.createactor_1.md) | |
+| [createEmptyActor()](./xstate.createemptyactor.md) | |
+| [createMachine(config, implementations)](./xstate.createmachine.md) | |
+| [escalate(errorData, options)](./xstate.escalate.md) | Escalates an error by sending it as an event to this machine's parent. |
+| [forwardTo(target, options)](./xstate.forwardto.md) | Forwards (sends) an event to a specified service. |
+| [fromCallback(invokeCallback)](./xstate.fromcallback.md) | |
+| [fromEventObservable(lazyObservable)](./xstate.fromeventobservable.md) | Creates event observable logic that listens to an observable that delivers event objects. |
+| [fromObservable(observableCreator)](./xstate.fromobservable.md) | |
+| [fromPromise(promiseCreator)](./xstate.frompromise.md) | |
+| [fromTransition(transition, initialContext)](./xstate.fromtransition.md) |
Returns actor logic from a transition function and its initial state.
A transition function is a function that takes the current state and an event and returns the next state.
| +| [getStateNodes(stateNode, state)](./xstate.getstatenodes.md) | Returns the state nodes represented by the current state value. | +| [log(value, label)](./xstate.log.md) | | +| [mapState(stateMap, stateId)](./xstate.mapstate.md) | | +| [matchesState(parentStateId, childStateId)](./xstate.matchesstate.md) | | +| [not(guard)](./xstate.not.md) | | +| [or(guards)](./xstate.or.md) | | +| [pathToStateValue(statePath)](./xstate.pathtostatevalue.md) | | +| [pure(getActions)](./xstate.pure.md) | | +| [raise(eventOrExpr, options)](./xstate.raise.md) | Raises an event. This places the event in the internal event queue, so that the event is immediately consumed by the machine in the current step. | +| [sendParent(event, options)](./xstate.sendparent.md) | Sends an event to this machine's parent. | +| [sendTo(to, eventOrExpr, options)](./xstate.sendto.md) | Sends an event to an actor. | +| [stateIn(stateValue)](./xstate.statein.md) | | +| [stop\_2(actorRef)](./xstate.stop_2.md) | Stops an actor. | +| [toObserver(nextHandler, errorHandler, completionHandler)](./xstate.toobserver.md) | | +| [waitFor(actorRef, predicate, options)](./xstate.waitfor.md) | Subscribes to an actor ref and waits for its emitted value to satisfy a predicate, and then resolves with that value. Will throw if the desired state is not reached after a timeout (defaults to 10 seconds). | + +## Interfaces + +| Interface | Description | +| --- | --- | +| [ActionArgs](./xstate.actionargs.md) | | +| [ActorContext](./xstate.actorcontext.md) | | +| [ActorLike](./xstate.actorlike.md) | | +| [ActorLogic](./xstate.actorlogic.md) | | +| [ActorOptions](./xstate.actoroptions.md) | | +| [ActorRef](./xstate.actorref.md) | | +| [ActorSystem](./xstate.actorsystem.md) | | +| [ActorSystemInfo](./xstate.actorsysteminfo.md) | | +| [AnyEventObject](./xstate.anyeventobject.md) | | +| [AssignAction](./xstate.assignaction.md) | | +| [AssignArgs](./xstate.assignargs.md) | | +| [AtomicStateNodeConfig](./xstate.atomicstatenodeconfig.md) | | +| [BaseActorRef](./xstate.baseactorref.md) | | +| [CancelAction](./xstate.cancelaction.md) | | +| [ChooseAction](./xstate.chooseaction.md) | | +| [ChooseBranch](./xstate.choosebranch.md) | | +| [DelayedTransitionDefinition](./xstate.delayedtransitiondefinition.md) | | +| [DoneActorEvent](./xstate.doneactorevent.md) | | +| [DoneStateEvent](./xstate.donestateevent.md) | | +| [ErrorActorEvent](./xstate.erroractorevent.md) | | +| [EventObject](./xstate.eventobject.md) | The full definition of an event, with a stringtype
. |
+| [HistoryStateNode](./xstate.historystatenode.md) | |
+| [HistoryStateNodeConfig](./xstate.historystatenodeconfig.md) | |
+| [InitialTransitionConfig](./xstate.initialtransitionconfig.md) | |
+| [InitialTransitionDefinition](./xstate.initialtransitiondefinition.md) | |
+| [InspectedActorEvent](./xstate.inspectedactorevent.md) | |
+| [InspectedEventEvent](./xstate.inspectedeventevent.md) | |
+| [InspectedSnapshotEvent](./xstate.inspectedsnapshotevent.md) | |
+| [InteropObservable](./xstate.interopobservable.md) | |
+| [InteropSubscribable](./xstate.interopsubscribable.md) | |
+| [InvokeDefinition](./xstate.invokedefinition.md) | |
+| [LogAction](./xstate.logaction.md) | |
+| [MachineImplementationsSimplified](./xstate.machineimplementationssimplified.md) | |
+| [MachineTypes](./xstate.machinetypes.md) | |
+| [MarkAllImplementationsAsProvided](./xstate.markallimplementationsasprovided.md) | |
+| [ParameterizedObject](./xstate.parameterizedobject.md) | |
+| [ProvidedActor](./xstate.providedactor.md) | |
+| [PureAction](./xstate.pureaction.md) | |
+| [RaiseAction](./xstate.raiseaction.md) | |
+| [RaiseActionOptions](./xstate.raiseactionoptions.md) | |
+| [RaiseActionParams](./xstate.raiseactionparams.md) | |
+| [ResolvedTypegenMeta](./xstate.resolvedtypegenmeta.md) | |
+| [ResolveTypegenMeta](./xstate.resolvetypegenmeta.md) | |
+| [SendToAction](./xstate.sendtoaction.md) | |
+| [SendToActionOptions](./xstate.sendtoactionoptions.md) | |
+| [SendToActionParams](./xstate.sendtoactionparams.md) | |
+| [SimulatedClock](./xstate.simulatedclock.md) | |
+| [SnapshotEvent](./xstate.snapshotevent.md) | |
+| [StateConfig](./xstate.stateconfig.md) | |
+| [StateLike](./xstate.statelike.md) | |
+| [StateMachineDefinition](./xstate.statemachinedefinition.md) | |
+| [StateNodeConfig](./xstate.statenodeconfig.md) | |
+| [StateNodeDefinition](./xstate.statenodedefinition.md) | |
+| [StateValueMap](./xstate.statevaluemap.md) | |
+| [StopAction](./xstate.stopaction.md) | |
+| [Subscribable](./xstate.subscribable.md) | |
+| [Subscription](./xstate.subscription.md) | |
+| [TransitionConfig](./xstate.transitionconfig.md) | |
+| [TransitionDefinition](./xstate.transitiondefinition.md) | |
+| [TypegenDisabled](./xstate.typegendisabled.md) | |
+| [TypegenEnabled](./xstate.typegenenabled.md) | |
+| [TypegenMeta](./xstate.typegenmeta.md) | |
+| [UnifiedArg](./xstate.unifiedarg.md) | |
+
+## Variables
+
+| Variable | Description |
+| --- | --- |
+| [interpret](./xstate.interpret.md) | Creates a new Interpreter instance for the given machine with the provided options, if any. |
+| [InterpreterStatus](./xstate.interpreterstatus.md) | |
+
+## Type Aliases
+
+| Type Alias | Description |
+| --- | --- |
+| [\_\_ResolvedTypesMetaFrom](./xstate.__resolvedtypesmetafrom.md) | |
+| [Action](./xstate.action.md) | |
+| [ActionFunction](./xstate.actionfunction.md) | |
+| [ActionFunctionMap](./xstate.actionfunctionmap.md) | |
+| [Actions](./xstate.actions.md) | |
+| [ActorLogicFrom](./xstate.actorlogicfrom.md) | |
+| [ActorRefFrom](./xstate.actorreffrom.md) | |
+| [AnyActor](./xstate.anyactor.md) | |
+| [AnyActorContext](./xstate.anyactorcontext.md) | |
+| [AnyActorLogic](./xstate.anyactorlogic.md) | |
+| [AnyActorRef](./xstate.anyactorref.md) | |
+| [AnyActorSystem](./xstate.anyactorsystem.md) | |
+| [AnyFunction](./xstate.anyfunction.md) | |
+| [AnyHistoryValue](./xstate.anyhistoryvalue.md) | |
+| [AnyInterpreter](./xstate.anyinterpreter.md) | |
+| [AnyInvokeConfig](./xstate.anyinvokeconfig.md) | |
+| [AnyState](./xstate.anystate.md) | |
+| [AnyStateConfig](./xstate.anystateconfig.md) | |
+| [AnyStateMachine](./xstate.anystatemachine.md) | |
+| [AnyStateNode](./xstate.anystatenode.md) | |
+| [AnyStateNodeConfig](./xstate.anystatenodeconfig.md) | |
+| [AnyStateNodeDefinition](./xstate.anystatenodedefinition.md) | |
+| [AnyTransitionConfig](./xstate.anytransitionconfig.md) | |
+| [AnyTransitionDefinition](./xstate.anytransitiondefinition.md) | |
+| [AreAllImplementationsAssumedToBeProvided](./xstate.areallimplementationsassumedtobeprovided.md) | |
+| [Assigner](./xstate.assigner.md) | |
+| [CallbackActorLogic](./xstate.callbackactorlogic.md) | |
+| [Cast](./xstate.cast.md) | |
+| [Compute](./xstate.compute.md) | |
+| [ContextFactory](./xstate.contextfactory.md) | |
+| [ContextFrom](./xstate.contextfrom.md) | |
+| [DelayConfig](./xstate.delayconfig.md) | |
+| [DelayedTransitions](./xstate.delayedtransitions.md) | |
+| [DelayExpr](./xstate.delayexpr.md) | |
+| [DelayFunctionMap](./xstate.delayfunctionmap.md) | |
+| [DevToolsAdapter](./xstate.devtoolsadapter.md) | |
+| [Equals](./xstate.equals.md) | |
+| [EventDescriptor](./xstate.eventdescriptor.md) | |
+| [EventFrom](./xstate.eventfrom.md) | |
+| [EventFromLogic](./xstate.eventfromlogic.md) | |
+| [ExtractEvent](./xstate.extractevent.md) | |
+| [HistoryValue](./xstate.historyvalue.md) | |
+| [HomomorphicOmit](./xstate.homomorphicomit.md) | |
+| [HomomorphicPick](./xstate.homomorphicpick.md) | |
+| [IndexByProp](./xstate.indexbyprop.md) | |
+| [IndexByType](./xstate.indexbytype.md) | |
+| [InferEvent](./xstate.inferevent.md) | |
+| [InputFrom](./xstate.inputfrom.md) | |
+| [InspectionEvent](./xstate.inspectionevent.md) | |
+| [InternalMachineImplementations](./xstate.internalmachineimplementations.md) | |
+| [Interpreter](./xstate.interpreter.md) | |
+| [InterpreterFrom](./xstate.interpreterfrom.md) | |
+| [InvokeConfig](./xstate.invokeconfig.md) | |
+| [IsAny](./xstate.isany.md) | |
+| [IsLiteralString](./xstate.isliteralstring.md) | |
+| [IsNever](./xstate.isnever.md) | |
+| [Lazy](./xstate.lazy.md) | |
+| [LogExpr](./xstate.logexpr.md) | |
+| [LowInfer](./xstate.lowinfer.md) | |
+| [MachineConfig](./xstate.machineconfig.md) | |
+| [MachineContext](./xstate.machinecontext.md) | |
+| [MachineImplementations](./xstate.machineimplementations.md) | |
+| [MachineImplementationsFrom](./xstate.machineimplementationsfrom.md) | |
+| [MachineSnapshot](./xstate.machinesnapshot.md) | |
+| [Mapper](./xstate.mapper.md) | |
+| [MaybeLazy](./xstate.maybelazy.md) | |
+| [Merge](./xstate.merge.md) | |
+| [MetaObject](./xstate.metaobject.md) | |
+| [MissingImplementationsError](./xstate.missingimplementationserror.md) | |
+| [NoInfer](./xstate.noinfer.md) | |
+| [NonReducibleUnknown](./xstate.nonreducibleunknown.md) | T | unknown
reduces to unknown
and that can be problematic when it comes to contextual typing. It especially is a problem when the union has a function member, like here:
This type can be used to avoid this problem. This union represents the same value space as unknown
.
_(Optional)_ If true
, states and events will be logged to Redux DevTools.
Default: false
true
. |
+| [id?](./xstate.actoroptions.id.md) | | string | _(Optional)_ The custom id
for referencing this service. |
+| [input?](./xstate.actoroptions.input.md) | | [InputFrom](./xstate.inputfrom.md)<>><TLogic> | _(Optional)_ The input data to pass to the actor. |
+| [inspect?](./xstate.actoroptions.inspect.md) | | [Observer](./xstate.observer.md)<>><[InspectionEvent](./xstate.inspectionevent.md)<>>> \| ((inspectionEvent: [InspectionEvent](./xstate.inspectionevent.md)<>>) => void) | _(Optional)_ |
+| [logger?](./xstate.actoroptions.logger.md) | | (...args: any\[\]) => void | _(Optional)_ |
+| [parent?](./xstate.actoroptions.parent.md) | | [ActorRef](./xstate.actorref.md)<>><any, any> | _(Optional)_ |
+| [src?](./xstate.actoroptions.src.md) | | string | _(Optional)_ The source definition. |
+| [state?](./xstate.actoroptions.state.md) | | any | _(Optional)_ |
+| [sync?](./xstate.actoroptions.sync.md) | | boolean | _(Optional)_ |
+| [systemId?](./xstate.actoroptions.systemid.md) | | string | _(Optional)_ The system ID to register this actor under |
+
diff --git a/api/xstate/xstate.actoroptions.parent.md b/api/xstate/xstate.actoroptions.parent.md
new file mode 100644
index 000000000..a698b14ab
--- /dev/null
+++ b/api/xstate/xstate.actoroptions.parent.md
@@ -0,0 +1,18 @@
+---
+title: "parent"
+hide_title: true
+custom_edit_url: null
+pagination_prev: null
+pagination_next: null
+---
+
+
+
+
+## ActorOptions.parent property
+
+**Signature:**
+
+```typescript
+parent?: ActorRef0
| |
+| Running | 1
| |
+| Stopped | 2
| |
+
diff --git a/api/xstate/xstate.actorsystem.get.md b/api/xstate/xstate.actorsystem.get.md
new file mode 100644
index 000000000..6e0137bc4
--- /dev/null
+++ b/api/xstate/xstate.actorsystem.get.md
@@ -0,0 +1,18 @@
+---
+title: "get"
+hide_title: true
+custom_edit_url: null
+pagination_prev: null
+pagination_next: null
+---
+
+
+
+
+## ActorSystem.get property
+
+**Signature:**
+
+```typescript
+get: id
of the send(...)
action to cancel. |
+
+**Returns:**
+
+[CancelAction](./xstate.cancelaction.md)<>><TContext, TExpressionEvent, TExpressionAction, TEvent>
+
diff --git a/api/xstate/xstate.cancelaction.md b/api/xstate/xstate.cancelaction.md
new file mode 100644
index 000000000..f3d38618b
--- /dev/null
+++ b/api/xstate/xstate.cancelaction.md
@@ -0,0 +1,18 @@
+---
+title: "CancelAction"
+hide_title: true
+custom_edit_url: null
+pagination_prev: null
+pagination_next: null
+---
+
+
+
+
+## CancelAction interface
+
+**Signature:**
+
+```typescript
+export interface CancelActionActorRef
options |
+
+**Returns:**
+
+[Actor](./xstate.actor.md)<>><TMachine>
+
diff --git a/api/xstate/xstate.createactor_1.md b/api/xstate/xstate.createactor_1.md
new file mode 100644
index 000000000..166313840
--- /dev/null
+++ b/api/xstate/xstate.createactor_1.md
@@ -0,0 +1,30 @@
+---
+title: "createActor"
+hide_title: true
+custom_edit_url: null
+pagination_prev: null
+pagination_next: null
+---
+
+
+
+
+## createActor() function
+
+**Signature:**
+
+```typescript
+export declare function createActorcontext
, event
, and meta
, and returns the error data to send. |
+| options | [SendToActionParams](./xstate.sendtoactionparams.md)<>><TContext, TExpressionEvent, TExpressionAction, [EventObject](./xstate.eventobject.md)<>>, TEvent, string> | _(Optional)_ Options to pass into the send action creator. |
+
+**Returns:**
+
+[SendToAction](./xstate.sendtoaction.md)<>><TContext, TExpressionEvent, TExpressionAction, TEvent, string>
+
diff --git a/api/xstate/xstate.eventdescriptor.md b/api/xstate/xstate.eventdescriptor.md
new file mode 100644
index 000000000..6dec35b72
--- /dev/null
+++ b/api/xstate/xstate.eventdescriptor.md
@@ -0,0 +1,20 @@
+---
+title: "EventDescriptor"
+hide_title: true
+custom_edit_url: null
+pagination_prev: null
+pagination_next: null
+---
+
+
+
+
+## EventDescriptor type
+
+**Signature:**
+
+```typescript
+export type EventDescriptor]: T[P];
+};
+```
diff --git a/api/xstate/xstate.homomorphicpick.md b/api/xstate/xstate.homomorphicpick.md
new file mode 100644
index 000000000..2a9120840
--- /dev/null
+++ b/api/xstate/xstate.homomorphicpick.md
@@ -0,0 +1,20 @@
+---
+title: "HomomorphicPick"
+hide_title: true
+custom_edit_url: null
+pagination_prev: null
+pagination_next: null
+---
+
+
+
+
+## HomomorphicPick type
+
+**Signature:**
+
+```typescript
+export type HomomorphicPick