Skip to content

Commit

Permalink
Remove most of the phantom types from the StateMachine (#4479)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist authored Nov 21, 2023
1 parent d70c3f3 commit d2a3bf6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
18 changes: 0 additions & 18 deletions packages/core/src/StateMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,24 +611,6 @@ export class StateMachine<
return restoredSnapshot;
}

/**@deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
__TContext!: TContext;
/** @deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
__TEvent!: TEvent;
/** @deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
__TActor!: TActor;
/** @deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
__TAction!: TAction;
/** @deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
__TGuard!: TGuard;
/** @deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
__TDelay!: TDelay;
/** @deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
__TTag!: TTag;
/** @deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
__TInput!: TInput;
/** @deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
__TOutput!: TOutput;
/** @deprecated an internal property acting as a "phantom" type, not meant to be used at runtime */
__TResolvedTypesMeta!: TResolvedTypesMeta;
}
5 changes: 3 additions & 2 deletions packages/xstate-solid/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import type {
AnyStateMachine,
AreAllImplementationsAssumedToBeProvided,
InternalMachineImplementations,
ActorOptions
ActorOptions,
ContextFrom
} from 'xstate';

type InternalMachineOpts<
TMachine extends AnyStateMachine,
RequireMissing extends boolean = false
> = InternalMachineImplementations<
TMachine['__TContext'],
ContextFrom<TMachine>,
TMachine['__TResolvedTypesMeta'],
RequireMissing
>;
Expand Down
7 changes: 4 additions & 3 deletions packages/xstate-svelte/src/useMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
createActor,
ActorOptions,
StateFrom,
Actor
Actor,
ContextFrom
} from 'xstate';

type Prop<T, K> = K extends keyof T ? T[K] : never;
Expand All @@ -19,15 +20,15 @@ type RestParams<TMachine extends AnyStateMachine> =
? [
options: ActorOptions<TMachine> &
InternalMachineImplementations<
TMachine['__TContext'],
ContextFrom<TMachine>,
TMachine['__TResolvedTypesMeta'],
true
>
]
: [
options?: ActorOptions<TMachine> &
InternalMachineImplementations<
TMachine['__TContext'],
ContextFrom<TMachine>,
TMachine['__TResolvedTypesMeta']
>
];
Expand Down

0 comments on commit d2a3bf6

Please sign in to comment.