* Builds a devtools view from an internal registration.
( reg: SequenceRegistration, )
| 153 | * Builds a devtools view from an internal registration. |
| 154 | */ |
| 155 | function toRegistrationView( |
| 156 | reg: SequenceRegistration, |
| 157 | ): SequenceRegistrationView { |
| 158 | const len = reg.parsedSequence.length |
| 159 | const inProgress = reg.currentIndex > 0 && reg.currentIndex < len |
| 160 | return { |
| 161 | id: reg.id, |
| 162 | sequence: reg.sequence, |
| 163 | options: reg.options, |
| 164 | target: reg.target, |
| 165 | triggerCount: reg.triggerCount, |
| 166 | hasFired: reg.hasFired, |
| 167 | matchedStepCount: inProgress ? reg.currentIndex : 0, |
| 168 | partialMatchLastKeyTime: inProgress ? reg.lastKeyTime : 0, |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | export class SequenceManager { |
| 173 | static #instance: SequenceManager | null = null |
no outgoing calls
no test coverage detected
searching dependent graphs…