FlxWatch
Live field watcher. Mirrors AS3 FlxG.watch.
export declare class FlxWatchMethods
add()
add(obj: Record<string, any>, field: string, displayName?: string): voidBegins watching obj[field] each step.
Parameters:
| Parameter | Type | Description |
|---|---|---|
obj | Record<string, any> | Object to read from. |
field | string | Property name on the object. |
displayName | string | Label shown in the Watch panel (defaults to field name). |
Returns: void
clear()
clear(): voidRemoves all watched fields.
Returns: void
edit()
edit(id: string, input: string): FlxWatchMutationResultParses, validates, and applies an explicitly registered editable value.
Parameters:
| Parameter | Type | Description |
|---|---|---|
id | string | - |
input | string | - |
Returns: FlxWatchMutationResult
remove()
remove(obj: Record<string, any>, field: string): voidStops watching obj[field].
Parameters:
| Parameter | Type | Description |
|---|---|---|
obj | Record<string, any> | - |
field | string | - |
Returns: void
setMutationGuard()
setMutationGuard(guard: FlxWatchMutationGuard | null): voidInstalls or clears the global policy checked before editable mutations.
Parameters:
| Parameter | Type | Description |
|---|---|---|
guard | FlxWatchMutationGuard | null | - |
Returns: void
snapshot()
snapshot(): WatchSnapshot[]Returns current values for all watched fields.
Returns: WatchSnapshot[]
track()
track<T>(definition: FlxWatchDefinition<T>): () => voidTracks a getter-backed value. Editing is disabled unless an explicit parser, validator, and setter contract is supplied through editor. Returns an idempotent function that removes this tracked value.
Parameters:
| Parameter | Type | Description |
|---|---|---|
definition | FlxWatchDefinition<T> | - |
Returns: () => void
trackObject()
trackObject<T extends object, K extends Extract<keyof T, string>>(name: string, obj: T, fields: readonly K[]): () => voidTracks an explicit shallow field list from an object as read-only values. No prototype traversal or implicit property discovery is performed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
name | string | - |
obj | T | - |
fields | readonly K[] | - |
Returns: () => void