eo-typewriterjs / TimelineBuilder
Class: TimelineBuilder
Defined in: core/timeline/builders/timeline-builder.ts:28
Description
Fluent builder that accumulates user commands into an ordered command list. Commands are not executed immediately - they are compiled and played by the player.
A monotonic version counter is incremented whenever commands are appended, allowing playback controllers to detect when their compiled cache is stale.
Constructors
Constructor
new TimelineBuilder(): TimelineBuilder;Returns
TimelineBuilder
Accessors
commands
Get Signature
get commands(): readonly TCommand[];Defined in: core/timeline/builders/timeline-builder.ts:38
Description
Return a read-only view of the accumulated commands
Returns
readonly TCommand[]
The current list of commands
version
Get Signature
get version(): number;Defined in: core/timeline/builders/timeline-builder.ts:49
Description
Monotonically increasing version counter. Incremented on every command append.
Returns
number
The current version number
Methods
wait()
wait(duration, options?): this;Defined in: core/timeline/builders/timeline-builder.ts:61
Parameters
| Parameter | Type | Description |
|---|---|---|
duration | number | The duration to wait in milliseconds |
options? | TCommandHookOptions | Optional lifecycle hooks (before, after) |
Returns
this
This builder instance for future chaining
Description
Schedule a wait command that pauses the timeline for a given duration
select()
select(count, options?): this;Defined in: core/timeline/builders/timeline-builder.ts:84
Parameters
| Parameter | Type | Description |
|---|---|---|
count | TSelectValue | Number of units or boundary string |
options? | TSelectOptions | Optional configuration (advance mode, cursor id, lifecycle hooks) |
Returns
this
This builder instance for future chaining
Description
Schedule a select command that creates a text selection
move()
move(offset, options?): this;Defined in: core/timeline/builders/timeline-builder.ts:110
Parameters
| Parameter | Type | Description |
|---|---|---|
offset | TMoveValue | Number of units to move or boundary string |
options? | TMoveOptions | Optional configuration (advance mode, cursor id, lifecycle hooks) |
Returns
this
This builder instance for future chaining
Description
Schedule a move command that moves the cursor
delete()
delete(count, options?): this;Defined in: core/timeline/builders/timeline-builder.ts:136
Parameters
| Parameter | Type | Description |
|---|---|---|
count | TDeleteValue | Number of units or boundary string |
options? | TDeleteOptions | Optional delete configuration (advance mode, interval, cursor, lifecycle hooks) |
Returns
this
This builder instance for future chaining
Description
Schedule a delete command that removes text
type()
type(text, options?): this;Defined in: core/timeline/builders/timeline-builder.ts:162
Parameters
| Parameter | Type | Description |
|---|---|---|
text | string | The text to type |
options? | TTypeOptions | Optional typing configuration (advance mode, interval, style, cursor, lifecycle hooks) |
Returns
this
This builder instance for future chaining
Description
Schedule a type command that inserts text into the document
style()
style(
styleRef,
range,
options?): this;Defined in: core/timeline/builders/timeline-builder.ts:190
Parameters
| Parameter | Type | Description |
|---|---|---|
styleRef | TStyleRef | The style reference to apply |
range | TStyleRange | "selection" | The target range |
options? | TStyleOptions | Optional configuration (cursor id, lifecycle hooks) |
Returns
this
This builder instance for future chaining
Description
Schedule a style command that applies a style to a document range or cursor selection
unselect()
unselect(options?): this;Defined in: core/timeline/builders/timeline-builder.ts:214
Parameters
| Parameter | Type | Description |
|---|---|---|
options? | TUnselectOptions | Optional configuration (cursor id, lifecycle hooks) |
Returns
this
This builder instance for future chaining
Description
Schedule an unselect command that removes the active text selection
unstyle()
unstyle(range, options?): this;Defined in: core/timeline/builders/timeline-builder.ts:237
Parameters
| Parameter | Type | Description |
|---|---|---|
range | TStyleRange | "selection" | The target range |
options? | TUnstyleOptions | Optional configuration (cursor id, lifecycle hooks) |
Returns
this
This builder instance for future chaining
Description
Schedule an unstyle command that removes styles overlapping a document range or cursor selection
call()
call(callback, options?): this;Defined in: core/timeline/builders/timeline-builder.ts:261
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | TCallbackFn | The function to invoke |
options? | TCommandHookOptions | Optional lifecycle hooks (before, after) |
Returns
this
This builder instance for future chaining
Description
Schedule a call command that invokes a callback function as a named step in the timeline