@opentui/core 0.6.8 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NativeScene.d.ts +14 -29
- package/Renderable.d.ts +47 -34
- package/animation/Timeline.d.ts +9 -0
- package/audio.d.ts +1 -0
- package/buffer.d.ts +6 -2
- package/{chunk-bun-4e5bpeqh.js → chunk-bun-6kxdhkdc.js} +1243 -1034
- package/chunk-bun-6kxdhkdc.js.map +70 -0
- package/{chunk-bun-ehr9v0n8.js → chunk-bun-x6cz4jyg.js} +514 -84
- package/chunk-bun-x6cz4jyg.js.map +35 -0
- package/{chunk-node-yyjd8p1g.js → chunk-node-q5ccgbk5.js} +1243 -1034
- package/chunk-node-q5ccgbk5.js.map +70 -0
- package/{chunk-node-jhq62x0c.js → chunk-node-y0w0hq5m.js} +514 -84
- package/chunk-node-y0w0hq5m.js.map +34 -0
- package/edit-buffer.d.ts +4 -0
- package/index.bun.js +1086 -549
- package/index.bun.js.map +15 -13
- package/index.d.ts +1 -1
- package/index.node.js +1086 -549
- package/index.node.js.map +16 -12
- package/lib/detect-links.d.ts +2 -0
- package/lib/extmarks.d.ts +3 -1
- package/lib/parse.keypress-kitty.d.ts +2 -0
- package/lib/scroll-chain.d.ts +16 -0
- package/lib/stdin-parser-native.d.ts +90 -0
- package/lib/stdin-parser.d.ts +2 -0
- package/lib/terminal-capability-detection.d.ts +6 -1
- package/native-abi.generated.d.ts +700 -7
- package/package.json +9 -9
- package/renderables/Box.d.ts +2 -2
- package/renderables/Code.d.ts +2 -1
- package/renderables/Diff.d.ts +2 -2
- package/renderables/EditBufferRenderable.d.ts +2 -2
- package/renderables/EmbeddedTerminal.d.ts +2 -2
- package/renderables/FrameBuffer.d.ts +4 -3
- package/renderables/Image.d.ts +2 -2
- package/renderables/Markdown.d.ts +2 -2
- package/renderables/ScrollBar.d.ts +9 -3
- package/renderables/ScrollBox.d.ts +87 -44
- package/renderables/ScrollBoxParts.d.ts +165 -0
- package/renderables/Slider.d.ts +2 -2
- package/renderables/Text.d.ts +2 -2
- package/renderables/TextBufferRenderable.d.ts +2 -4
- package/renderables/index.d.ts +1 -1
- package/renderer-theme-mode.d.ts +1 -6
- package/renderer.d.ts +30 -7
- package/testing/test-renderer.d.ts +4 -0
- package/testing.bun.js +12 -4
- package/testing.bun.js.map +3 -3
- package/testing.js +12 -4
- package/testing.js.map +3 -3
- package/types.d.ts +11 -0
- package/yoga.bun.js +1 -1
- package/yoga.internal.d.ts +3 -3
- package/yoga.js +1 -1
- package/zig-structs.d.ts +26 -0
- package/zig.d.ts +96 -13
- package/chunk-bun-4e5bpeqh.js.map +0 -69
- package/chunk-bun-ehr9v0n8.js.map +0 -35
- package/chunk-node-jhq62x0c.js.map +0 -34
- package/chunk-node-yyjd8p1g.js.map +0 -69
package/NativeScene.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { StyledText } from "./lib/styled-text.js";
|
|
|
9
9
|
import type { RGBA } from "./lib/RGBA.js";
|
|
10
10
|
import type { LocalSelectionBounds } from "./lib/selection.js";
|
|
11
11
|
import { type Value, type MeasureFunction } from "./yoga.js";
|
|
12
|
-
import { NativeSessionRenderStatus, type NativeSceneFrameOptions, type NativeSceneFrameRequest, type NativeSceneLayout, type NativeScenePaint, type NativeScenePaintUpdate, type NativeSceneBoxDetails, type NativeSceneTextOptions, type NativeSceneSliderOptions, type NativeSceneArrowOptions, type NativeSceneEditorOptions, type ContextEditorViewHandle, type ContextTextBufferViewHandle, type SceneNodeHandle } from "./zig.js";
|
|
12
|
+
import { NativeSessionRenderStatus, type NativeSceneFrameOptions, type NativeSceneFrameRequest, type NativeSceneLayout, type NativeScenePaint, type NativeScenePaintUpdate, type NativeSceneBoxDetails, type NativeSceneTextOptions, type NativeSceneSliderOptions, type NativeSceneArrowOptions, type NativeSceneScrollOptions, type NativeSceneScrollState, type NativeSceneEditorOptions, type ContextEditorViewHandle, type ContextTextBufferViewHandle, type SceneNodeHandle } from "./zig.js";
|
|
13
13
|
type PaintOptions = () => Pick<NativeSceneFrameOptions, "background" | "useMouse" | "excludedHitNum" | "preserveUnwritten">;
|
|
14
14
|
declare class NativeLifecyclePasses extends Set<Renderable> {
|
|
15
15
|
private order;
|
|
@@ -25,7 +25,6 @@ declare class NativeLifecyclePasses extends Set<Renderable> {
|
|
|
25
25
|
export declare class NativeScene {
|
|
26
26
|
readonly driver: NativeSession;
|
|
27
27
|
private readonly renderer;
|
|
28
|
-
private readonly workBudget?;
|
|
29
28
|
get resourceContext(): import("./buffer.js").ResourceContext;
|
|
30
29
|
readonly lifecyclePasses: NativeLifecyclePasses;
|
|
31
30
|
/** @internal Renderables whose destroy walk is still running; renderer finalization waits for them. */
|
|
@@ -33,27 +32,21 @@ export declare class NativeScene {
|
|
|
33
32
|
private readonly nodes;
|
|
34
33
|
private paintedFrame;
|
|
35
34
|
private paintRecording?;
|
|
36
|
-
private cancelPaintYield;
|
|
37
35
|
private destroyed;
|
|
38
36
|
private destroying;
|
|
39
|
-
private geometryRevision;
|
|
40
37
|
private layoutRevision;
|
|
41
38
|
private readonly staging;
|
|
42
|
-
private hookScans;
|
|
43
|
-
private scanningHooks;
|
|
44
39
|
private readonly yogaHost;
|
|
45
|
-
constructor(driver: NativeSession, renderer: Pick<CliRenderer, "root" | "isDestroyed" | "controlState" | "unregisterLifecyclePass"
|
|
40
|
+
constructor(driver: NativeSession, renderer: Pick<CliRenderer, "root" | "isDestroyed" | "controlState" | "unregisterLifecyclePass">);
|
|
46
41
|
/** @internal Buffer wrappers borrow the completed paint ticket. */
|
|
47
42
|
get frame(): NativeSceneFrameRequest | null;
|
|
48
|
-
/** @internal Accepted geometry mutations invalidate hook-local layout observations. */
|
|
49
|
-
get currentGeometryRevision(): number;
|
|
50
43
|
/** @internal Layout reads return the same values until this changes. Undefined while callbacks run inside
|
|
51
44
|
* native layout, because that layout is still being computed. */
|
|
52
45
|
get observedLayoutRevision(): number | undefined;
|
|
53
46
|
/** The scene does no more hook or frame work once it, its Session, or its renderer is gone or going. */
|
|
54
47
|
private get stopped();
|
|
55
|
-
|
|
56
|
-
|
|
48
|
+
/** Frames, moves, destroys, and translations are the only changes a layout read can see. Measurement and cancels
|
|
49
|
+
* change none today; they bump so that a native solve or observation outside a frame step stays covered. */
|
|
57
50
|
private changeLayout;
|
|
58
51
|
/** @internal Whether style or paint writes await native acceptance. */
|
|
59
52
|
get hasStagedMutations(): boolean;
|
|
@@ -65,15 +58,6 @@ export declare class NativeScene {
|
|
|
65
58
|
* thrown once by whichever call flushes, which may belong to another node.
|
|
66
59
|
* A closing Session paints no more frames, so like a disposed one it drops staged writes. */
|
|
67
60
|
flushStaged(): void;
|
|
68
|
-
/** @internal Keep construction pending until a boundary after derived class fields have run. */
|
|
69
|
-
scheduleHookScan(renderable: Renderable): void;
|
|
70
|
-
/** @internal Restore assignment accessors at attachment, but keep discovery pending:
|
|
71
|
-
* an intermediate constructor can attach before the most-derived fields run. */
|
|
72
|
-
refreshPendingHooks(renderable: Renderable): void;
|
|
73
|
-
/** Scans may publish hooks natively or register lifecycle passes, so this runs
|
|
74
|
-
* before lifecycle passes and native resumes. Reentrant scheduling drains in
|
|
75
|
-
* bounded batches without walking the scene. */
|
|
76
|
-
private drainHookScans;
|
|
77
61
|
/** @internal Detached settlement visits owned controllers, not the render tree. */
|
|
78
62
|
getRenderables(): IterableIterator<Renderable>;
|
|
79
63
|
/** @internal Reject stale scene operations before accessing their Context. */
|
|
@@ -135,6 +119,12 @@ export declare class NativeScene {
|
|
|
135
119
|
/** @internal Standard arrow paint commits before its wrapper projection. */
|
|
136
120
|
setArrow(renderable: Renderable, options: NativeSceneArrowOptions): void;
|
|
137
121
|
setImage(renderable: Renderable, image: NativeImage | null, fit: ImageFit, protocol: ImageRenderProtocol, buffer: OptimizedBuffer | null): void;
|
|
122
|
+
/** @internal A scroll write moves the box's children, so it bumps the layout revision like a frame step. */
|
|
123
|
+
setScroll(renderable: Renderable, options: NativeSceneScrollOptions): void;
|
|
124
|
+
setScrollArrow(renderable: Renderable, axis: number, end: number, options: Omit<NativeSceneArrowOptions, "direction">): void;
|
|
125
|
+
scrollTo(renderable: Renderable, x: number, y: number, relativeX: boolean, relativeY: boolean, reapply?: boolean): NativeSceneScrollState;
|
|
126
|
+
scrollRequest(renderable: Renderable, kind: "into-view" | "anchor" | "layout", target: Renderable | null, align?: "nearest" | "start" | "end", inset?: number): NativeSceneScrollState;
|
|
127
|
+
getScroll(renderable: Renderable): NativeSceneScrollState;
|
|
138
128
|
setEditorView(renderable: Renderable, view: ContextEditorViewHandle): void;
|
|
139
129
|
setSurface(renderable: Renderable, buffer: OptimizedBuffer | null): void;
|
|
140
130
|
setTextView(renderable: Renderable, view: ContextTextBufferViewHandle | null): void;
|
|
@@ -142,8 +132,8 @@ export declare class NativeScene {
|
|
|
142
132
|
setEditorOptions(renderable: Renderable, options: NativeSceneEditorOptions): void;
|
|
143
133
|
/** @internal Query native text metrics only when requested, never during JS frame traversal. */
|
|
144
134
|
getText(renderable: Renderable): string;
|
|
145
|
-
/** @internal Inherited Text drawing records or draws at the caller's position. */
|
|
146
|
-
|
|
135
|
+
/** @internal Inherited Text and Box drawing records or draws the native body at the caller's position. */
|
|
136
|
+
drawBody(renderable: Renderable, buffer: OptimizedBuffer, x: number, y: number): void;
|
|
147
137
|
setTextSelection(renderable: Renderable, operation: "set" | "update" | "reset", bounds: LocalSelectionBounds | null, bg?: RGBA, fg?: RGBA): boolean;
|
|
148
138
|
getTextSelection(renderable: Renderable): {
|
|
149
139
|
start: number;
|
|
@@ -161,11 +151,10 @@ export declare class NativeScene {
|
|
|
161
151
|
}, rawYoga?: boolean | "paint"): NativeSceneLayout;
|
|
162
152
|
/** @internal Measure a snapshot using its existing scene root, without preparing a frame. */
|
|
163
153
|
measureSnapshot(root: Renderable): number;
|
|
164
|
-
paint(deltaTime: number, getPaintOptions: PaintOptions): void
|
|
154
|
+
paint(deltaTime: number, getPaintOptions: PaintOptions): void;
|
|
165
155
|
private runLifecyclePasses;
|
|
166
|
-
private resumePaint;
|
|
167
156
|
private advancePaint;
|
|
168
|
-
/** Destruction
|
|
157
|
+
/** Destruction or Session shutdown may have cancelled the attempt already; keep the caller's failure. */
|
|
169
158
|
private cancelAttempt;
|
|
170
159
|
/** Run every slot's paint hooks in paint order before native code paints the frame. */
|
|
171
160
|
private recordPaint;
|
|
@@ -175,10 +164,6 @@ export declare class NativeScene {
|
|
|
175
164
|
commitSplit(commits: Parameters<NativeSession["renderSplit"]>[1], pinnedRenderOffset: number, force: boolean): ReturnType<NativeSession["renderSplit"]>;
|
|
176
165
|
/** @internal Called after active effects and captures unwind, never during synchronous node destruction. */
|
|
177
166
|
cancelFrame(): void;
|
|
178
|
-
/** @internal Wake a parked turn without revoking active synchronous framebuffer scopes. */
|
|
179
|
-
interruptPaint(): void;
|
|
180
|
-
/** @internal An accepted native resize cancels only a parked attempt, not a synchronous hook scope. */
|
|
181
|
-
restartPaint(): void;
|
|
182
167
|
hitTest(x: number, y: number): number;
|
|
183
168
|
destroy(): void;
|
|
184
169
|
}
|
package/Renderable.d.ts
CHANGED
|
@@ -8,8 +8,9 @@ import { type AlignString, type FlexDirectionString, type JustifyString, type Ov
|
|
|
8
8
|
import { type VNode } from "./renderables/composition/vnode.js";
|
|
9
9
|
import type { MouseEvent } from "./renderer.js";
|
|
10
10
|
import type { RenderContext } from "./types.js";
|
|
11
|
-
import { type NativePaintRecorder, type NativeSceneFrameRequest, type NativeScenePaint, type NativeScenePaintSlot, type SceneNodeHandle } from "./zig.js";
|
|
11
|
+
import { type NativePaintRecorder, type NativeSceneFrameRequest, type NativeSceneLayout, type NativeScenePaint, type NativeScenePaintSlot, type SceneNodeHandle } from "./zig.js";
|
|
12
12
|
declare const BrandedRenderable: unique symbol;
|
|
13
|
+
type PaintHook = (this: Renderable, buffer: OptimizedBuffer, deltaTime: number) => void;
|
|
13
14
|
export declare enum LayoutEvents {
|
|
14
15
|
LAYOUT_CHANGED = "layout-changed",
|
|
15
16
|
RESIZED = "resized"
|
|
@@ -70,6 +71,8 @@ export interface RenderableOptions<T extends BaseRenderable = BaseRenderable> ex
|
|
|
70
71
|
visible?: boolean;
|
|
71
72
|
buffered?: boolean;
|
|
72
73
|
live?: boolean;
|
|
74
|
+
/** Ticks `onAnimationTick` at this rate on the renderer's shared animation clock while the node is visible. */
|
|
75
|
+
animationFps?: number;
|
|
73
76
|
opacity?: number;
|
|
74
77
|
renderBefore?: (this: T, buffer: OptimizedBuffer, deltaTime: number) => void;
|
|
75
78
|
renderAfter?: (this: T, buffer: OptimizedBuffer, deltaTime: number) => void;
|
|
@@ -87,8 +90,8 @@ export interface RenderableOptions<T extends BaseRenderable = BaseRenderable> ex
|
|
|
87
90
|
onKeyDown?: (key: KeyEvent) => void;
|
|
88
91
|
onSizeChange?: (this: T) => void;
|
|
89
92
|
}
|
|
90
|
-
/** Class-owned native integration, declared
|
|
91
|
-
* identify work performed by native; overrides use the ordinary host hook dispatcher. */
|
|
93
|
+
/** Class-owned native integration, declared as the class's static `nativeIntegration`. Method
|
|
94
|
+
* identities identify work performed by native; overrides use the ordinary host hook dispatcher. */
|
|
92
95
|
export interface NativeRenderableIntegration {
|
|
93
96
|
readonly kind: Parameters<NativeScene["driver"]["renderLib"]["sceneCreateNode"]>[2];
|
|
94
97
|
readonly body: "host" | {
|
|
@@ -103,14 +106,17 @@ export interface NativeRenderableIntegration {
|
|
|
103
106
|
readonly idle: (deltaTime: number) => void;
|
|
104
107
|
readonly active: (renderable: Renderable) => boolean;
|
|
105
108
|
};
|
|
109
|
+
/** A scroll node's SCROLL request, asked for only while `active` holds. */
|
|
110
|
+
readonly scroll?: {
|
|
111
|
+
readonly active: (renderable: Renderable) => boolean;
|
|
112
|
+
readonly notify: (renderable: Renderable) => void;
|
|
113
|
+
};
|
|
106
114
|
};
|
|
107
115
|
readonly beforeAfter?: boolean;
|
|
108
116
|
readonly paintBuffer?: "destination";
|
|
109
117
|
readonly bufferComposition?: "native";
|
|
110
118
|
readonly lineInfo?: boolean;
|
|
111
119
|
readonly measure?: (this: Renderable, ...constraints: Parameters<MeasureFunction>) => ReturnType<MeasureFunction>;
|
|
112
|
-
/** Only an own description can promise that construction adds no hook class fields. */
|
|
113
|
-
readonly construction?: "prototype" | "fields";
|
|
114
120
|
}
|
|
115
121
|
export declare function isRenderable(obj: any): obj is Renderable;
|
|
116
122
|
export declare abstract class BaseRenderable extends EventEmitter {
|
|
@@ -145,6 +151,7 @@ export declare abstract class Renderable extends BaseRenderable {
|
|
|
145
151
|
protected static readonly defaultFocusable: boolean;
|
|
146
152
|
static renderablesByNumber: Map<number, Renderable>;
|
|
147
153
|
static readonly nativeIntegration: NativeRenderableIntegration;
|
|
154
|
+
private static readonly baseHooks;
|
|
148
155
|
/** @internal Stable class description shared by creation, hook registration, and dispatch. */
|
|
149
156
|
readonly nativeIntegration: NativeRenderableIntegration;
|
|
150
157
|
protected _isDestroyed: boolean;
|
|
@@ -166,24 +173,22 @@ export declare abstract class Renderable extends BaseRenderable {
|
|
|
166
173
|
protected frameBuffer: OptimizedBuffer | null;
|
|
167
174
|
protected _focusable: boolean;
|
|
168
175
|
protected _focused: boolean;
|
|
169
|
-
protected _hasFocusedDescendant: boolean;
|
|
170
176
|
protected keypressHandler: ((key: KeyEvent) => void) | null;
|
|
171
177
|
protected pasteHandler: ((event: PasteEvent) => void) | null;
|
|
172
178
|
private _live;
|
|
179
|
+
private _animationFps;
|
|
180
|
+
private stopAnimationTick;
|
|
181
|
+
private animationDrawnFrame;
|
|
173
182
|
protected _liveCount: number;
|
|
174
183
|
private _sizeChangeListener;
|
|
175
|
-
private
|
|
184
|
+
private _hooks;
|
|
176
185
|
protected _nativeSceneHookGeneration: bigint;
|
|
177
186
|
private _nativeSceneHooksRegistered;
|
|
178
187
|
private _nativeSceneResize;
|
|
179
|
-
private
|
|
180
|
-
private _nativeSceneHookLayout?;
|
|
188
|
+
private _paintLayout?;
|
|
181
189
|
private _observedLayout?;
|
|
182
190
|
private _observedLayoutRevision;
|
|
183
|
-
private
|
|
184
|
-
private _computedLayoutRevision;
|
|
185
|
-
private _nativeSceneMethods?;
|
|
186
|
-
private _nativeSceneMethodsPending;
|
|
191
|
+
private _selectable;
|
|
187
192
|
private _mouseListener;
|
|
188
193
|
private _mouseListeners;
|
|
189
194
|
private _pasteListener;
|
|
@@ -195,9 +200,12 @@ export declare abstract class Renderable extends BaseRenderable {
|
|
|
195
200
|
private _flexShrink;
|
|
196
201
|
protected _childrenInLayoutOrder: Renderable[];
|
|
197
202
|
parent: Renderable | null;
|
|
198
|
-
onLifecyclePass: (() => void) | null;
|
|
199
|
-
|
|
200
|
-
|
|
203
|
+
get onLifecyclePass(): (() => void) | null;
|
|
204
|
+
set onLifecyclePass(value: (() => void) | null | undefined);
|
|
205
|
+
get renderBefore(): PaintHook | undefined;
|
|
206
|
+
set renderBefore(value: PaintHook | null | undefined);
|
|
207
|
+
get renderAfter(): PaintHook | undefined;
|
|
208
|
+
set renderAfter(value: PaintHook | null | undefined);
|
|
201
209
|
constructor(ctx: RenderContext, options: RenderableOptions<any>);
|
|
202
210
|
protected abortConstruction(error: unknown, cleanup?: (run: (step: () => void) => void) => void): never;
|
|
203
211
|
/** Completed base layers need full cleanup even before a subclass destroy override can run. */
|
|
@@ -217,7 +225,8 @@ export declare abstract class Renderable extends BaseRenderable {
|
|
|
217
225
|
getSelectedText(): string;
|
|
218
226
|
shouldStartSelection(x: number, y: number): boolean;
|
|
219
227
|
focus(): void;
|
|
220
|
-
|
|
228
|
+
/** Ancestors can paint focus within, so a focus change marks them dirty. */
|
|
229
|
+
protected propagateFocusChange(_hasFocus: boolean): void;
|
|
221
230
|
blur(): void;
|
|
222
231
|
get focused(): boolean;
|
|
223
232
|
get hasFocusedDescendant(): boolean;
|
|
@@ -226,6 +235,10 @@ export declare abstract class Renderable extends BaseRenderable {
|
|
|
226
235
|
set live(value: boolean);
|
|
227
236
|
protected propagateLiveCount(delta: number): void;
|
|
228
237
|
protected onLiveCountChanged(previous: number): void;
|
|
238
|
+
get animationFps(): number | undefined;
|
|
239
|
+
set animationFps(value: number | undefined);
|
|
240
|
+
private updateAnimationTick;
|
|
241
|
+
protected onAnimationTick(deltaTime: number, ticks: number, time: number): void;
|
|
229
242
|
handleKeyPress?(key: KeyEvent): boolean;
|
|
230
243
|
handlePaste?(event: PasteEvent): void;
|
|
231
244
|
findDescendantById(id: string): Renderable | undefined;
|
|
@@ -240,7 +253,12 @@ export declare abstract class Renderable extends BaseRenderable {
|
|
|
240
253
|
get screenY(): number;
|
|
241
254
|
protected get _screenX(): number;
|
|
242
255
|
protected get _screenY(): number;
|
|
243
|
-
|
|
256
|
+
/** @internal Where the body paints: the buffer's origin when the node paints its own buffer. */
|
|
257
|
+
protected _paintOrigin(buffer: OptimizedBuffer): [number, number];
|
|
258
|
+
/** @internal Record or draw the native body at its paint origin. */
|
|
259
|
+
protected _drawNativeBody(buffer: OptimizedBuffer): void;
|
|
260
|
+
protected get _paintWidth(): number;
|
|
261
|
+
protected get _paintHeight(): number;
|
|
244
262
|
get x(): number;
|
|
245
263
|
set x(value: number);
|
|
246
264
|
get top(): number | "auto" | `${number}%` | undefined;
|
|
@@ -260,6 +278,8 @@ export declare abstract class Renderable extends BaseRenderable {
|
|
|
260
278
|
protected defaultDimension(_kind: "width" | "height"): number | "auto" | `${number}%`;
|
|
261
279
|
private styledDimension;
|
|
262
280
|
private getNativeSceneLayout;
|
|
281
|
+
/** Caches a layout that native returned since the last frame, move, destroy, or translation. */
|
|
282
|
+
private observeLayout;
|
|
263
283
|
set height(value: number | "auto" | `${number}%` | null | undefined);
|
|
264
284
|
private setDimension;
|
|
265
285
|
get zIndex(): number;
|
|
@@ -381,32 +401,25 @@ export declare abstract class Renderable extends BaseRenderable {
|
|
|
381
401
|
protected renderSelf(buffer: OptimizedBuffer, deltaTime: number): void;
|
|
382
402
|
protected getNativeScenePaint(): NativeScenePaint;
|
|
383
403
|
protected setNativeScenePaint(paint?: Partial<NativeScenePaint>): void;
|
|
384
|
-
private static
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
/** Snapshot reflective hook replacements and restore normal callback assignment.
|
|
390
|
-
* Call after defineProperty/delete, or to finalize fields after early constructor attachment.
|
|
391
|
-
* Ordinary paint and style changes do not discover hooks. */
|
|
404
|
+
private static normalizeHook;
|
|
405
|
+
private setHook;
|
|
406
|
+
private syncLifecyclePass;
|
|
407
|
+
/** Adopt hooks that an instance class field, `Object.defineProperty`, or an instance assignment of a
|
|
408
|
+
* protected hook method supplied. Until this call, the node runs the hooks of its class. */
|
|
392
409
|
refreshHooks(): void;
|
|
393
|
-
/** @internal Snapshot hooks for construction, explicit refresh, or retry. */
|
|
394
|
-
_scanNativeSceneHooks(): void;
|
|
395
|
-
private ensureNativeSceneMethods;
|
|
396
|
-
private nativeSceneNeedsHookPublish;
|
|
397
410
|
private usesNativeDrawing;
|
|
398
411
|
private needsHostResize;
|
|
399
412
|
private hostUpdateFlags;
|
|
400
|
-
private refreshNativeSceneMethods;
|
|
401
413
|
protected refreshNativeSceneHooks(): void;
|
|
402
|
-
/** @internal Retained surfaces restore their binding accessor
|
|
414
|
+
/** @internal Retained surfaces restore their binding accessor when hooks are refreshed. */
|
|
403
415
|
_refreshNativeSceneSurface(): void;
|
|
404
|
-
|
|
416
|
+
/** Publish the flags for `hooks`, then adopt them. `pending` carries listener changes that are about to apply. */
|
|
417
|
+
private publishHooks;
|
|
405
418
|
/** @internal Refresh only requested host hooks, never walk wrappers to collect layout. */
|
|
406
419
|
_runNativeSceneHook(request: NativeSceneFrameRequest, deltaTime: number): void;
|
|
407
420
|
/** @internal Record this node's paint hooks for one slot. Native code paints the
|
|
408
421
|
* recording at the slot's prepared position after every slot has recorded. */
|
|
409
|
-
_recordNativeScenePaint(slot: NativeScenePaintSlot, index: number, deltaTime: number, frame: OptimizedBuffer, recorder: NativePaintRecorder,
|
|
422
|
+
_recordNativeScenePaint(slot: NativeScenePaintSlot, index: number, deltaTime: number, frame: OptimizedBuffer, recorder: NativePaintRecorder, publicLayout: NativeSceneLayout | undefined): void;
|
|
410
423
|
protected _invokeNativePaint(buffer: OptimizedBuffer, deltaTime: number): void;
|
|
411
424
|
get isDestroyed(): boolean;
|
|
412
425
|
destroy(): void;
|
package/animation/Timeline.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { CliRenderer } from "../renderer.js";
|
|
2
2
|
export interface TimelineOptions {
|
|
3
3
|
duration?: number;
|
|
4
|
+
/** Updates per second while it plays, above 0 (Infinity allowed). Below the renderer's targetFps it ticks on the
|
|
5
|
+
* shared animation clock instead of holding the render loop. Default: the engine's `defaults.frameRate` (60). */
|
|
6
|
+
frameRate?: number;
|
|
4
7
|
loop?: boolean;
|
|
5
8
|
autoplay?: boolean;
|
|
6
9
|
onComplete?: () => void;
|
|
@@ -84,6 +87,7 @@ export declare class Timeline {
|
|
|
84
87
|
isPlaying: boolean;
|
|
85
88
|
isComplete: boolean;
|
|
86
89
|
duration: number;
|
|
90
|
+
private _frameRate;
|
|
87
91
|
loop: boolean;
|
|
88
92
|
synced: boolean;
|
|
89
93
|
private autoplay;
|
|
@@ -91,6 +95,8 @@ export declare class Timeline {
|
|
|
91
95
|
private onPause?;
|
|
92
96
|
private stateChangeListeners;
|
|
93
97
|
constructor(options?: TimelineOptions);
|
|
98
|
+
get frameRate(): number | undefined;
|
|
99
|
+
set frameRate(value: number | undefined);
|
|
94
100
|
addStateChangeListener(listener: (timeline: Timeline) => void): void;
|
|
95
101
|
removeStateChangeListener(listener: (timeline: Timeline) => void): void;
|
|
96
102
|
private notifyStateChange;
|
|
@@ -109,6 +115,8 @@ declare class TimelineEngine {
|
|
|
109
115
|
private renderer;
|
|
110
116
|
private frameCallback;
|
|
111
117
|
private isLive;
|
|
118
|
+
private tickFps;
|
|
119
|
+
private stopTicks;
|
|
112
120
|
defaults: {
|
|
113
121
|
frameRate: number;
|
|
114
122
|
};
|
|
@@ -116,6 +124,7 @@ declare class TimelineEngine {
|
|
|
116
124
|
attach(renderer: CliRenderer): void;
|
|
117
125
|
detach(): void;
|
|
118
126
|
private updateLiveState;
|
|
127
|
+
private setTickFps;
|
|
119
128
|
private onTimelineStateChange;
|
|
120
129
|
register(timeline: Timeline): void;
|
|
121
130
|
unregister(timeline: Timeline): void;
|
package/audio.d.ts
CHANGED
|
@@ -294,6 +294,7 @@ export declare class AudioStream<M = AudioStreamMetadata> extends EventEmitter<A
|
|
|
294
294
|
private pumpSource;
|
|
295
295
|
private processDemuxOutput;
|
|
296
296
|
private writeStreamChunk;
|
|
297
|
+
private nativeCallError;
|
|
297
298
|
private resolveConnection;
|
|
298
299
|
private beginResourceAcquisition;
|
|
299
300
|
private cleanupAttempt;
|
package/buffer.d.ts
CHANGED
|
@@ -58,8 +58,8 @@ export declare class OptimizedBuffer {
|
|
|
58
58
|
/** @internal Resource controllers draw only within their owning Context. */
|
|
59
59
|
_getSceneDrawTarget(scene: NativeScene): NativeDrawingTarget;
|
|
60
60
|
private drawChecked;
|
|
61
|
-
/** @internal Scene text
|
|
62
|
-
|
|
61
|
+
/** @internal Scene text and boxes draw their native body without exposing its buffer. */
|
|
62
|
+
_drawSceneBody(scene: NativeScene, node: SceneNodeHandle, x: number, y: number): void;
|
|
63
63
|
/** Raw planes are available only during a synchronous post-process scope. Prefer withBuffers(). */
|
|
64
64
|
get buffers(): {
|
|
65
65
|
char: Uint32Array;
|
|
@@ -98,6 +98,8 @@ export declare class OptimizedBuffer {
|
|
|
98
98
|
get widthMethod(): WidthMethod;
|
|
99
99
|
get width(): number;
|
|
100
100
|
get height(): number;
|
|
101
|
+
/** With `respectAlpha`, `drawFrameBuffer()` blends this buffer's cells when it is the source. Without it, a source at
|
|
102
|
+
* full opacity is copied cell for cell, transparent and translucent cells included, unless either buffer holds images. */
|
|
101
103
|
setRespectAlpha(respectAlpha: boolean): void;
|
|
102
104
|
getRealCharBytes(addLineBreaks?: boolean): Uint8Array;
|
|
103
105
|
private withResolvedChars;
|
|
@@ -114,6 +116,8 @@ export declare class OptimizedBuffer {
|
|
|
114
116
|
fillRect(x: number, y: number, width: number, height: number, bg: RGBA): void;
|
|
115
117
|
colorMatrix(matrix: Float32Array, cellMask: Float32Array, strength?: number, target?: TargetChannel): void;
|
|
116
118
|
colorMatrixUniform(matrix: Float32Array, strength?: number, target?: TargetChannel): void;
|
|
119
|
+
/** Composites a source cell rectangle, clipped to the scissor. At full opacity a source without `respectAlpha` is
|
|
120
|
+
* copied, transparent and translucent cells included, unless either buffer holds images; otherwise each cell blends. */
|
|
117
121
|
drawFrameBuffer(destX: number, destY: number, frameBuffer: OptimizedBuffer, sourceX?: number, sourceY?: number, sourceWidth?: number, sourceHeight?: number): void;
|
|
118
122
|
destroy(): void;
|
|
119
123
|
drawTextBuffer(textBufferView: TextBufferView, x: number, y: number): void;
|