@tur-ng/std 0.0.1

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.
Files changed (2) hide show
  1. package/package.json +13 -0
  2. package/src/index.d.ts +659 -0
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@tur-ng/std",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "types": "src/index.d.ts",
6
+ "files": [
7
+ "src"
8
+ ],
9
+ "publishConfig": {
10
+ "access": "public",
11
+ "registry": "https://registry.npmjs.org/"
12
+ }
13
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,659 @@
1
+ /**
2
+ * @tur-ng/std — ambient type declarations for the native tur widget library.
3
+ *
4
+ * Runtime is a synthetic boa module registered by tur-engine under the
5
+ * specifier `"tur:std"`. It re-exports everything from
6
+ * `"tur:core"` (the reactive primitives + meta-types) and adds the
7
+ * widget layer: view factories, prop interfaces, enums, value types (Color /
8
+ * LinearGradient / SpanData), view controllers, resources, and the event
9
+ * detail payloads.
10
+ *
11
+ * Consumers typically import from `tur:std` alone — it is the
12
+ * convenience superset:
13
+ * ```ts
14
+ * import { Container, Column, source, Color, Axis } from "tur:std";
15
+ * ```
16
+ *
17
+ * `@tur-ng/animation` and other libraries that need only the reactive
18
+ * substrate may import directly from `tur:core`.
19
+ */
20
+
21
+ declare module "tur:std" {
22
+ // Re-export the reactive core (source/derive/mutate/get/set/view/render,
23
+ // Element/Atom/Mutation/Readable/Val, ReadonlyStoreCtx/StoreCtx).
24
+ export * from "tur:core";
25
+
26
+ // Core meta-types used by the prop interfaces below.
27
+ import type { Element, Mutation, Readable, Val } from "tur:core";
28
+
29
+ // ---------------------------------------------------------------------------
30
+ // Value types — Color / LinearGradient / Brush / SpanData
31
+ // ---------------------------------------------------------------------------
32
+
33
+ /** A solid sRGB color handle (Rust `ColorOpaque`). Built via the `Color`
34
+ * builder's static methods (`Color.hex/rgb/rgba`); the runtime value is a
35
+ * Rust-owned opaque, so callers must treat it as opaque. `Color` is also the
36
+ * instance type (the handle returned by `createColor`). */
37
+ export class Color {
38
+ private constructor();
39
+ static rgb(r: number, g: number, b: number): Color;
40
+ static rgba(r: number, g: number, b: number, a: number): Color;
41
+ static hex(hex: string): Color;
42
+ }
43
+
44
+ /** A gradient stop: an offset along the gradient and its color. */
45
+ export interface GradientStop {
46
+ offset: number;
47
+ color: Color;
48
+ }
49
+
50
+ /** A linear gradient brush handle (Rust `BrushOpaque`). Built via
51
+ * `LinearGradient.create`. Opaque to JS. */
52
+ export class LinearGradient {
53
+ private constructor();
54
+ static create(options: LinearGradientOptions): LinearGradient;
55
+ }
56
+
57
+ /** Options for `LinearGradient.create`. */
58
+ export interface LinearGradientOptions {
59
+ start: [number, number];
60
+ end: [number, number];
61
+ stops: GradientStop[];
62
+ }
63
+
64
+ /** Any fill the engine accepts for `color`-style props: a solid color or a
65
+ * gradient. */
66
+ export type Brush = Color | LinearGradient;
67
+
68
+ /** One styled run inside a rich-text `Text.spans` array. Mirrors the Rust
69
+ * `SpanData` struct (the JS field is `content`; Rust maps it to `text`). */
70
+ export interface SpanData {
71
+ content: string;
72
+ bold?: boolean;
73
+ italic?: boolean;
74
+ underline?: boolean;
75
+ fontSize?: number;
76
+ color?: Color;
77
+ }
78
+
79
+ /** The current canvas viewport size in CSS pixels — the value shape of the
80
+ * engine-owned `viewportSize$` reactive atom. The engine keeps it in sync
81
+ * on every resize; read via `get(viewportSize$).width`. */
82
+ export interface ViewportSize {
83
+ width: number;
84
+ height: number;
85
+ }
86
+
87
+ /** Engine-owned reactive atom holding the live canvas size
88
+ * (`{width, height}` in CSS pixels). Updated each frame from the resize
89
+ * handler; import from `tur:std`. */
90
+ export const viewportSize$: Atom<ViewportSize>;
91
+
92
+ /** OS cursor keywords (CSS cursor names). Mirrors `tur_engine::core::platform::Cursor`. */
93
+ export type Cursor =
94
+ | "auto"
95
+ | "default"
96
+ | "none"
97
+ | "context-menu"
98
+ | "help"
99
+ | "pointer"
100
+ | "progress"
101
+ | "wait"
102
+ | "cell"
103
+ | "crosshair"
104
+ | "text"
105
+ | "vertical-text"
106
+ | "alias"
107
+ | "copy"
108
+ | "move"
109
+ | "no-drop"
110
+ | "not-allowed"
111
+ | "grab"
112
+ | "grabbing"
113
+ | "e-resize"
114
+ | "n-resize"
115
+ | "ne-resize"
116
+ | "nw-resize"
117
+ | "s-resize"
118
+ | "se-resize"
119
+ | "sw-resize"
120
+ | "w-resize"
121
+ | "ew-resize"
122
+ | "ns-resize"
123
+ | "nesw-resize"
124
+ | "nwse-resize"
125
+ | "col-resize"
126
+ | "row-resize"
127
+ | "all-scroll"
128
+ | "zoom-in"
129
+ | "zoom-out";
130
+
131
+ // ---------------------------------------------------------------------------
132
+ // Event detail payloads
133
+ // ---------------------------------------------------------------------------
134
+
135
+ export interface Point {
136
+ x: number;
137
+ y: number;
138
+ }
139
+
140
+ export interface PointerInteractEvent {
141
+ /** Position relative to the element's top-left. */
142
+ local: Point;
143
+ /** Position relative to the canvas. */
144
+ global: Point;
145
+ }
146
+
147
+ export interface PointerRegionEvent {
148
+ local: Point;
149
+ global: Point;
150
+ }
151
+
152
+ export interface KeyEvent {
153
+ key: string;
154
+ code: string;
155
+ ctrl: boolean;
156
+ shift: boolean;
157
+ alt: boolean;
158
+ meta: boolean;
159
+ }
160
+
161
+ export interface ScrollEvent {
162
+ offset: number;
163
+ maxExtent: number;
164
+ viewportDimension: number;
165
+ }
166
+
167
+ // ---------------------------------------------------------------------------
168
+ // Enums — exported as runtime objects (`MainAxisSize.Max`) directly from
169
+ // this native module; the matching type is the union of their literal values.
170
+ // Mirrors the `tur_engine::core::layout` C-like enums. The native module exports each as a
171
+ // TS-style numeric enum object (forward `Name: n` + reverse `"n": "Name"`).
172
+ // ---------------------------------------------------------------------------
173
+
174
+ export enum Axis {
175
+ Vertical = 0,
176
+ Horizontal = 1,
177
+ }
178
+
179
+ export enum MainAxisAlignment {
180
+ Start = 0,
181
+ Center = 1,
182
+ End = 2,
183
+ SpaceBetween = 3,
184
+ SpaceAround = 4,
185
+ SpaceEvenly = 5,
186
+ }
187
+
188
+ export enum CrossAxisAlignment {
189
+ Start = 0,
190
+ Center = 1,
191
+ End = 2,
192
+ Stretch = 3,
193
+ }
194
+
195
+ export enum MainAxisSize {
196
+ Max = 0,
197
+ Min = 1,
198
+ }
199
+
200
+ export enum HitTestBehavior {
201
+ Opaque = 0,
202
+ Translucent = 1,
203
+ }
204
+
205
+ export enum BoxFit {
206
+ Fill = 0,
207
+ Contain = 1,
208
+ Cover = 2,
209
+ FitWidth = 3,
210
+ FitHeight = 4,
211
+ None = 5,
212
+ }
213
+
214
+ export enum Alignment {
215
+ TopLeft = 0,
216
+ TopCenter = 1,
217
+ TopRight = 2,
218
+ CenterLeft = 3,
219
+ Center = 4,
220
+ CenterRight = 5,
221
+ BottomLeft = 6,
222
+ BottomCenter = 7,
223
+ BottomRight = 8,
224
+ }
225
+
226
+ export enum BorderPosition {
227
+ Inside = 0,
228
+ Center = 1,
229
+ Outside = 2,
230
+ }
231
+
232
+ // ---------------------------------------------------------------------------
233
+ // Prop interfaces
234
+ // ---------------------------------------------------------------------------
235
+
236
+ export interface ContainerProps {
237
+ width?: Val<number>;
238
+ height?: Val<number>;
239
+ padding?: Val<number>;
240
+ color?: Val<Brush | null>;
241
+ borderColor?: Val<Brush | null>;
242
+ borderWidth?: Val<number>;
243
+ borderRadius?: Val<number>;
244
+ borderPosition?: Val<BorderPosition>;
245
+ shadowColor?: Val<Brush | null>;
246
+ shadowOffset?: Val<[number, number]>;
247
+ shadowBlur?: Val<number>;
248
+ alignment?: Val<Alignment>;
249
+ queryKey?: Val<string[]>;
250
+ children?: Element[];
251
+ }
252
+
253
+ export interface FlexProps {
254
+ mainAlignment?: Val<MainAxisAlignment>;
255
+ crossAlignment?: Val<CrossAxisAlignment>;
256
+ mainAxisSize?: Val<MainAxisSize>;
257
+ children: Element[];
258
+ }
259
+
260
+ export interface ExpandedProps {
261
+ flex?: Val<number>;
262
+ child: Element;
263
+ }
264
+
265
+ export interface StackProps {
266
+ children: Element[];
267
+ }
268
+
269
+ export interface PositionedProps {
270
+ left?: Val<number>;
271
+ top?: Val<number>;
272
+ right?: Val<number>;
273
+ bottom?: Val<number>;
274
+ width?: Val<number>;
275
+ height?: Val<number>;
276
+ child: Element;
277
+ }
278
+
279
+ export interface TextProps {
280
+ text: Val<string>;
281
+ fontSize?: Val<number>;
282
+ color?: Val<Brush | null>;
283
+ spans?: Val<SpanData[]>;
284
+ /** When `true`, the text can be drag-selected with the pointer. */
285
+ selectable?: boolean;
286
+ queryKey?: Val<string[]>;
287
+ }
288
+
289
+ export interface PointerInteractProps {
290
+ onClick?: Mutation<[PointerInteractEvent]>;
291
+ onPointerDown?: Mutation<[PointerInteractEvent]>;
292
+ onPointerMove?: Mutation<[PointerInteractEvent]>;
293
+ onPointerUp?: Mutation<[PointerInteractEvent]>;
294
+ onContextMenu?: Mutation<[PointerInteractEvent]>;
295
+ behavior?: Val<HitTestBehavior>;
296
+ queryKey?: Val<string[]>;
297
+ child?: Element;
298
+ }
299
+
300
+ export interface MouseRegionProps {
301
+ cursor?: Val<Cursor>;
302
+ onEnter?: Mutation<[PointerRegionEvent]>;
303
+ onExit?: Mutation<[PointerRegionEvent]>;
304
+ behavior?: Val<HitTestBehavior>;
305
+ child?: Element;
306
+ }
307
+
308
+ export interface ConditionProps {
309
+ condition: Val<boolean>;
310
+ child?: () => Element;
311
+ elseChild?: () => Element;
312
+ queryKey?: Val<string[]>;
313
+ }
314
+
315
+ export interface SwitchCase {
316
+ key: string | number | boolean | null | undefined;
317
+ child: () => Element;
318
+ }
319
+
320
+ export interface SwitchProps {
321
+ value: Val<string | number | boolean | null | undefined>;
322
+ cases: SwitchCase[];
323
+ fallback?: () => Element;
324
+ queryKey?: Val<string[]>;
325
+ }
326
+
327
+ export interface ScrollViewProps {
328
+ axis?: Val<Axis>;
329
+ padding?: Val<number>;
330
+ color?: Val<Brush | null>;
331
+ controller?: ScrollController;
332
+ child: Element;
333
+ queryKey?: Val<string[]>;
334
+ }
335
+
336
+ export interface ScrollbarProps {
337
+ controller?: ScrollController;
338
+ color?: Val<Brush | null>;
339
+ trackColor?: Val<Brush | null>;
340
+ thickness?: Val<number>;
341
+ thumbRadius?: Val<number>;
342
+ queryKey?: Val<string[]>;
343
+ }
344
+
345
+ export interface LazyListProps {
346
+ axis?: Val<Axis>;
347
+ itemCount: Val<number>;
348
+ overscan?: Val<number>;
349
+ itemExtent?: Val<number>;
350
+ builder: (index: number) => Element;
351
+ queryKey?: Val<string[]>;
352
+ }
353
+
354
+ /** A non-scrollable grid that tiles its static `children` row-major. The
355
+ * column count is derived from the available cross-axis size and
356
+ * `maxCrossAxisExtent` (`count = floor(width / maxCrossAxisExtent)`). Cell
357
+ * main-axis size is `mainAxisExtent` if given, else
358
+ * `cell_cross / childAspectRatio` (default square). */
359
+ export interface GridProps {
360
+ maxCrossAxisExtent: Val<number>;
361
+ childAspectRatio?: Val<number>;
362
+ mainAxisExtent?: Val<number>;
363
+ crossAxisSpacing?: Val<number>;
364
+ mainAxisSpacing?: Val<number>;
365
+ children: Element[];
366
+ queryKey?: Val<string[]>;
367
+ }
368
+
369
+ /** A scrollable, virtualized grid. Only the cells inside the viewport +
370
+ * overscan are mounted. Same sizing model as `Grid`. `builder` receives
371
+ * the flat item `index`; row/col are derived from `crossAxisCount`. */
372
+ export interface LazyGridProps {
373
+ axis?: Val<Axis>;
374
+ itemCount: Val<number>;
375
+ maxCrossAxisExtent: Val<number>;
376
+ childAspectRatio?: Val<number>;
377
+ mainAxisExtent?: Val<number>;
378
+ crossAxisSpacing?: Val<number>;
379
+ mainAxisSpacing?: Val<number>;
380
+ overscan?: Val<number>;
381
+ builder: (index: number) => Element;
382
+ queryKey?: Val<string[]>;
383
+ }
384
+
385
+ export interface EachProps<T> {
386
+ items: Readable<T[]>;
387
+ build: (item: T, index: number) => Element;
388
+ mainAlignment?: Val<MainAxisAlignment>;
389
+ crossAlignment?: Val<CrossAxisAlignment>;
390
+ mainAxisSize?: Val<MainAxisSize>;
391
+ queryKey?: Val<string[]>;
392
+ }
393
+
394
+ export interface ImageProps {
395
+ resourceId: Val<number>;
396
+ width?: Val<number>;
397
+ height?: Val<number>;
398
+ fit?: Val<BoxFit>;
399
+ queryKey?: Val<string[]>;
400
+ child?: Element;
401
+ }
402
+
403
+ export interface InputProps {
404
+ controller?: TextController;
405
+ undoController?: UndoController;
406
+ placeholder?: Val<string>;
407
+ color?: Val<Brush | null>;
408
+ placeholderColor?: Val<Brush | null>;
409
+ cursorColor?: Val<Brush | null>;
410
+ fontSize?: Val<number>;
411
+ fontFamily?: Val<string>;
412
+ width?: Val<number>;
413
+ height?: Val<number>;
414
+ multiline?: Val<boolean>;
415
+ onContextMenu?: Mutation<[PointerInteractEvent]>;
416
+ queryKey?: Val<string[]>;
417
+ }
418
+
419
+ export interface FragmentProps {
420
+ children: Element[];
421
+ }
422
+
423
+ export interface FocusableProps {
424
+ onKeyDown?: Mutation<[KeyEvent]>;
425
+ onKeyUp?: Mutation<[KeyEvent]>;
426
+ onFocus?: Mutation<[]>;
427
+ onBlur?: Mutation<[]>;
428
+ child?: Element;
429
+ }
430
+
431
+ export interface ReadableSubscribeProps {
432
+ readables: Readable<unknown>[];
433
+ onUpdate$: Mutation<[]>;
434
+ child: Element;
435
+ }
436
+
437
+ export interface LifecycleDescriptor {
438
+ element: Element;
439
+ onMounted$?: Mutation<[]>;
440
+ beforeDestroy$?: Mutation<[]>;
441
+ }
442
+
443
+ // ---------------------------------------------------------------------------
444
+ // Controllers
445
+ // ---------------------------------------------------------------------------
446
+
447
+ export interface TextEditingControllerOpts {
448
+ initialText?: string;
449
+ onInput?: Mutation<[string, boolean], void>;
450
+ onCursorChange?: Mutation<[number], void>;
451
+ onSelectionChange?: Mutation<[number, number], void>;
452
+ onKeyDown?: Mutation<[KeyEvent], void>;
453
+ onKeyUp?: Mutation<[KeyEvent], void>;
454
+ onFocus?: Mutation<[], void>;
455
+ onBlur?: Mutation<[], void>;
456
+ onCompositionStart?: Mutation<[], void>;
457
+ onCompositionUpdate?: Mutation<[string], void>;
458
+ onCompositionEnd?: Mutation<[string], void>;
459
+ }
460
+
461
+ /** Text-edit controller (registered boa class). Built via
462
+ * `createTextEditingController`. Exposes the editable buffer + selection. */
463
+ export interface TextController {
464
+ /** The full buffer text. */
465
+ readonly text: string;
466
+ /** Current cursor offset (byte index into `text`). */
467
+ readonly cursorPosition: number;
468
+ /** Selection anchor (start) byte offset. */
469
+ readonly selectionAnchor: number;
470
+ /** Selection end byte offset. */
471
+ readonly selectionEnd: number;
472
+ /** The currently selected text, or `""` if no selection. */
473
+ readonly selectedText: string;
474
+ /** Replace the rich-text span list. */
475
+ setSpans(spans: SpanData[]): void;
476
+ /** Replace spans without moving the cursor. */
477
+ setSpansPreserveCursor(spans: SpanData[]): void;
478
+ /** Clear all text and spans. */
479
+ clear(): void;
480
+ /** Set the selection range `[anchor, end)` (byte offsets). */
481
+ setSelection(anchor: number, end: number): void;
482
+ /** Replace the current selection with `text`, or insert at the cursor. */
483
+ insertText(text: string): void;
484
+ /** Delete the current selection, if any. */
485
+ deleteSelection(): void;
486
+ /** Attach an `UndoController` so edits record undo history. */
487
+ setUndoController(undo: UndoController): void;
488
+ /** Focus the bound input. */
489
+ requestFocus(): void;
490
+ }
491
+
492
+ export interface UndoController {
493
+ readonly canUndo: boolean;
494
+ readonly canRedo: boolean;
495
+ clear(): void;
496
+ }
497
+
498
+ export interface ScrollControllerOpts {
499
+ onScroll?: Mutation<[ScrollEvent], void>;
500
+ initialOffset?: number;
501
+ }
502
+
503
+ /** Scroll controller (registered boa class). Built via `createScrollController`.
504
+ * Pair with a `ScrollView` / `Scrollbar` via the `controller` prop. */
505
+ export interface ScrollController {
506
+ readonly offset: number;
507
+ readonly maxScrollExtent: number;
508
+ readonly viewportDimension: number;
509
+ /** Jump to `offset` (clamped to the scroll bounds). */
510
+ jumpTo(offset: number): void;
511
+ }
512
+
513
+ export interface LazyListControllerOpts {
514
+ onScroll?: Mutation<[ScrollEvent], void>;
515
+ onVisibleRangeChange?: Mutation<[number, number], void>;
516
+ }
517
+
518
+ /** Lazy-list controller (registered boa class). Built via
519
+ * `createLazyListController`. Pair with a `LazyList` via the `controller` prop
520
+ * (the prop is currently read implicitly — pass the same instance). */
521
+ export interface LazyListController {
522
+ readonly offset: number;
523
+ readonly maxScrollExtent: number;
524
+ readonly viewportDimension: number;
525
+ jumpTo(offset: number): void;
526
+ }
527
+
528
+ export interface LazyGridControllerOpts {
529
+ onScroll?: Mutation<[ScrollEvent], void>;
530
+ onVisibleRangeChange?: Mutation<[number, number], void>;
531
+ }
532
+
533
+ /** Lazy-grid controller (registered boa class). Built via
534
+ * `createLazyGridController`. Mirrors `LazyListController`. */
535
+ export interface LazyGridController {
536
+ readonly offset: number;
537
+ readonly maxScrollExtent: number;
538
+ readonly viewportDimension: number;
539
+ jumpTo(offset: number): void;
540
+ }
541
+
542
+ // ---------------------------------------------------------------------------
543
+ // Async task primitives — `sleep` (a timer primitive) + `launch` (a
544
+ // cancellable generator coroutine driver). These replace the old
545
+ // `setTimeout` / `setInterval` globals.
546
+ // ---------------------------------------------------------------------------
547
+
548
+ /** Resolve after `ms` milliseconds (engine time). The engine's frame loop
549
+ * wakes precisely at the deadline. Use bare (`sleep(ms).then(...)`) or
550
+ * inside a `launch` coroutine via `yield sleep(ms)`. */
551
+ export function sleep(ms: number): Promise<void>;
552
+
553
+ /** A cancellable coroutine task returned by `launch`. `cancel()` stops the
554
+ * generator from resuming after its current `yield`. Any in-flight
555
+ * `sleep` resolves harmlessly and is ignored. */
556
+ export interface Task {
557
+ cancel(): void;
558
+ }
559
+
560
+ /** Run a zero-arg generator function as a cancellable coroutine. The
561
+ * generator must `yield` Promises (typically `sleep(ms)`); each resolved
562
+ * promise resumes the generator, passing the resolved value back as the
563
+ * `yield` result. Returns a `Task` whose `cancel()` halts further
564
+ * resumption.
565
+ *
566
+ * Rejections: when a yielded promise rejects, the rejection reason is
567
+ * thrown into the generator at the `yield` point — so a `try/catch`
568
+ * around `yield` catches it (the same ergonomics as `await`). An uncaught
569
+ * rejection stops the coroutine. This makes `launch` safe to use with
570
+ * fallible Promises (`clipboard.readText`, `http`, `fetch`), not just
571
+ * `sleep`.
572
+ *
573
+ * Unlike `async`/`await`, generators can be externally stepped/abandoned,
574
+ * which is what makes real cancellation possible. Use the debounce
575
+ * pattern: `task?.cancel(); task = launch(function* () { yield sleep(ms);
576
+ * ... });`. */
577
+ export function launch<T>(
578
+ gen: () => Generator<Promise<unknown>, T, unknown>,
579
+ ): Task;
580
+
581
+ // ---------------------------------------------------------------------------
582
+ // Element factories
583
+ // ---------------------------------------------------------------------------
584
+
585
+ export function Container(props: ContainerProps): Element;
586
+
587
+ /** A width/height-only `Container` (no decoration, no child layout props beyond
588
+ * `children`). Sugar for `Container({ width, height, children })`. */
589
+ export function SizedBox(props: {
590
+ width?: Val<number>;
591
+ height?: Val<number>;
592
+ children?: Element[];
593
+ }): Element;
594
+ export function Column(props: FlexProps): Element;
595
+ export function Row(props: FlexProps): Element;
596
+ export function Expanded(props: ExpandedProps): Element;
597
+ export function Stack(props: StackProps): Element;
598
+ export function Positioned(props: PositionedProps): Element;
599
+ export function Text(props: TextProps): Element;
600
+ export function PointerInteract(props: PointerInteractProps): Element;
601
+ export function MouseRegion(props: MouseRegionProps): Element;
602
+ export function Condition(props: ConditionProps): Element;
603
+ export function Switch(props: SwitchProps): Element;
604
+ export function Each<T>(props: EachProps<T>): Element;
605
+ export function LazyList(props: LazyListProps): Element;
606
+ export function Grid(props: GridProps): Element;
607
+ export function LazyGrid(props: LazyGridProps): Element;
608
+ export function ScrollView(props: ScrollViewProps): Element;
609
+ export function Scrollbar(props: ScrollbarProps): Element;
610
+ export function Image(props: ImageProps): Element;
611
+ export function Input(props: InputProps): Element;
612
+ export function Fragment(props: FragmentProps): Element;
613
+ export function Focusable(props: FocusableProps): Element;
614
+ export function lifecycleView(f: () => LifecycleDescriptor): Element;
615
+ export function ReadableSubscribe(props: ReadableSubscribeProps): Element;
616
+
617
+ // ---------------------------------------------------------------------------
618
+ // Controllers / resources / colors / focus
619
+ // ---------------------------------------------------------------------------
620
+
621
+ export function createTextEditingController(
622
+ opts?: TextEditingControllerOpts,
623
+ ): TextController;
624
+ export function createUndoController(): UndoController;
625
+ export function createScrollController(
626
+ opts?: ScrollControllerOpts,
627
+ ): ScrollController;
628
+ export function createLazyListController(
629
+ opts?: LazyListControllerOpts,
630
+ ): LazyListController;
631
+ export function createLazyGridController(
632
+ opts?: LazyGridControllerOpts,
633
+ ): LazyGridController;
634
+ export function createImageResource(
635
+ bytes: Uint8Array | ArrayBuffer,
636
+ ): number;
637
+ export function createSvgResource(svg: string): number;
638
+ export function createColor(
639
+ r: number,
640
+ g: number,
641
+ b: number,
642
+ a: number,
643
+ ): Color;
644
+ export function createLinearGradient(
645
+ sx: number,
646
+ sy: number,
647
+ ex: number,
648
+ ey: number,
649
+ stops: Array<{
650
+ offset: number;
651
+ r: number;
652
+ g: number;
653
+ b: number;
654
+ a: number;
655
+ }>,
656
+ ): LinearGradient;
657
+ export function colorLerp(a: Color, b: Color, t: number): Color;
658
+ export function requestFocus(target: TextController | Element): void;
659
+ }