MCPcopy Create free account
hub / github.com/TanStack/hotkeys / toRegistrationView

Function toRegistrationView

packages/hotkeys/src/sequence-manager.ts:155–170  ·  view source on GitHub ↗

* Builds a devtools view from an internal registration.

(
  reg: SequenceRegistration,
)

Source from the content-addressed store, hash-verified

153 * Builds a devtools view from an internal registration.
154 */
155function 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
172export class SequenceManager {
173 static #instance: SequenceManager | null = null

Callers 2

#syncRegistrationViewMethod · 0.85
registerMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…