Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core): fix type ExtractStateValue to describe real state value
Consider the following schema: type LightStateSchema = { states: { green: {}, yellow: {}, red: { states: { walk: {}, wait: {}, stop: {}, }, }, }, } The current implementation of the ExtractStateValue type generates the following type: { green?: {} | undefined yellow?: {} | undefined red?: "walk" | "wait" | "stop" | { walk?: {} | undefined wait?: {} | undefined stop?: {} | undefined } | undefined } This does not describe the StateValue of LightStateSchema as provided in State.value. The new implementation generates the following type: "green" | "yellow" | "red" | { red?: "walk" | "wait" | "stop" | undefined }
- Loading branch information