Hi @b4rtaz,
I have a use case that's quite similar to the triggers example. As in that example, the first step in the root sequence is the launch pad. I am restricting it further such that only one trigger can be added, which functionally works well. To make the typing work I'm currently using a type assertion, because the sequence property isn't defined on the elements of Sequence.
const configuration: DesignerConfiguration = {
placeholder: {
canShow(
sequence: Sequence,
_index: number,
_draggingStepComponentType: string,
draggingStepType: string,
definition: Definition
) {
const launchPad = definition.sequence[0] as SequentialStep // here
const isTriggerStep = draggingStepType === 'trigger'
const isLaunchPadSequence = sequence === launchPad.sequence // to make this access possible
const triggerExists = launchPad.sequence.length > 0 // and this one
return (
(isTriggerStep && isLaunchPadSequence && !triggerExists) ||
(!isTriggerStep && !isLaunchPadSequence)
)
},
},
...otherConfig,
}
Is there a way to make the typing work without the type assertion, something I've missed maybe?
Hi @b4rtaz,
I have a use case that's quite similar to the triggers example. As in that example, the first step in the root sequence is the launch pad. I am restricting it further such that only one trigger can be added, which functionally works well. To make the typing work I'm currently using a type assertion, because the
sequenceproperty isn't defined on the elements ofSequence.Is there a way to make the typing work without the type assertion, something I've missed maybe?