@geastack/core 0.1.38 → 0.1.40

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/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export type * from './audio-worklet'
6
6
  export declare function flushAudioWorkletOutput(): void
7
7
  export type * from './typed-arrays'
8
8
  import type { AudioContextOptions, AudioWorklet, MediaStreamAudioSourceNode } from './audio-worklet'
9
+ export type * from './audio-worklet'
9
10
 
10
11
  // Opt-in native 64-bit integer. Structurally a `number` (assign/read without
11
12
  // casts), but where a binding, parameter, field, or return is annotated `int`,
@@ -18,6 +19,19 @@ import type { AudioContextOptions, AudioWorklet, MediaStreamAudioSourceNode } fr
18
19
  declare const __gea_int_brand: unique symbol
19
20
  declare global {
20
21
  type int = number & { readonly [__gea_int_brand]?: never }
22
+ type i64 = number & { readonly [__gea_int_brand]?: never }
23
+ type int64 = number & { readonly [__gea_int_brand]?: never }
24
+ }
25
+
26
+ // Opt-in native 32-bit integer: `int` at the width of a 32-bit core, held in an
27
+ // `int32_t`. On an ESP32-S3 a 64-bit `int` sum is two instructions and its
28
+ // quotient a library call; an `i32` one is a single instruction. Arithmetic
29
+ // wraps at 32 bits, `/` landing in an `i32` truncates, and a Number stored into
30
+ // one converts by ToInt32 (truncate, wrap, NaN -> 0). Under Node it is a number.
31
+ declare const __gea_i32_brand: unique symbol
32
+ declare global {
33
+ type i32 = number & { readonly [__gea_i32_brand]?: never }
34
+ type int32 = number & { readonly [__gea_i32_brand]?: never }
21
35
  }
22
36
 
23
37
  // Opt-in single-precision float. Structurally a `number` (assign/read without
@@ -82,6 +96,10 @@ export interface GeaIntrinsicElements {
82
96
  img: ImageProps
83
97
  input: NativeInputElementProps
84
98
  textarea: NativeTextAreaElementProps
99
+ select: NativeSelectProps
100
+ option: NativeOptionProps
101
+ stepper: NativeStepperProps
102
+ progress: NativeProgressProps
85
103
  'virtual-list': NativeVirtualListProps
86
104
  }
87
105
 
@@ -116,7 +134,11 @@ declare global {
116
134
  }
117
135
  const console: Console
118
136
 
119
- function requestAnimationFrame(callback: (timestampMs: number) => void): number
137
+ // Retains the callback and runs it next frame, so it cannot be inert -- but it
138
+ // writes no property on anything, which is all the argument stamp asks.
139
+ // Native frames supply whole milliseconds; the request handle stays numeric.
140
+ /** @gea-host-no-property-writes */
141
+ function requestAnimationFrame(callback: (timestampMs: int) => void): number
120
142
 
121
143
  // Native one-shot / repeating timers (gea::host::setTimeout/setInterval,
122
144
  // engine/../host/include/host/timers.h), NOT Node's `NodeJS.Timeout` (there is
@@ -172,8 +194,20 @@ declare global {
172
194
  // fillText anchors the top of the line box, which carries ascender and
173
195
  // descender the glyphs do not fill, so subtracting half the font size sags.
174
196
  measureTextInkCenter(text: string): number
175
- drawImageCircle(image: GeaEmbeddedImage, dx: number, dy: number, width: number, height: number): void
176
- drawImageRotated90CW(image: GeaEmbeddedImage, dx: number, dy: number, width: number, height: number): void
197
+ drawImageCircle(
198
+ image: GeaEmbeddedImage,
199
+ dx: number,
200
+ dy: number,
201
+ width: number,
202
+ height: number,
203
+ ): void
204
+ drawImageRotated90CW(
205
+ image: GeaEmbeddedImage,
206
+ dx: number,
207
+ dy: number,
208
+ width: number,
209
+ height: number,
210
+ ): void
177
211
  drawImageTiledX(image: GeaEmbeddedImage, dx: number, dy: number, width: number): void
178
212
  }
179
213
 
@@ -197,7 +231,8 @@ export type StyleLength =
197
231
  | `max(${string})`
198
232
  | `clamp(${string})`
199
233
  export type StyleBox = StyleLength | string
200
- export type StylePreferredSize = StyleLength | 'auto' | 'min-content' | 'max-content' | 'fit-content'
234
+ export type StylePreferredSize =
235
+ StyleLength | 'auto' | 'min-content' | 'max-content' | 'fit-content'
201
236
  export type StyleOverflow = 'visible' | 'hidden' | 'clip' | 'scroll' | 'auto' | 'overlay'
202
237
  export type ClassMap = Record<string, string | number | boolean | null | undefined>
203
238
  export type ClassValue = string | ClassMap
@@ -312,7 +347,10 @@ export interface Event {
312
347
  }
313
348
 
314
349
  export interface EventTarget {
315
- addEventListener<K extends keyof GeaEventMap>(type: K, listener: (event: GeaEventMap[K]) => void): void
350
+ addEventListener<K extends keyof GeaEventMap>(
351
+ type: K,
352
+ listener: (event: GeaEventMap[K]) => void,
353
+ ): void
316
354
  addEventListener(type: string, listener: (event: Event) => void): void
317
355
  }
318
356
 
@@ -414,7 +452,9 @@ export interface PressEvent extends PointerEvent {
414
452
  readonly currentTarget: PressEventTarget
415
453
  }
416
454
 
417
- export type PressEventArgument = number & PressEvent
455
+ // Native listeners receive the engine event. Numeric press metadata is exposed
456
+ // through pressId/pressValue; the event itself is not an arithmetic value.
457
+ export type PressEventArgument = PressEvent
418
458
  export type PressHandler = (event: PressEventArgument) => void
419
459
 
420
460
  export interface TouchPoint {
@@ -461,9 +501,8 @@ export interface RotaryEvent extends Event {
461
501
  * `keydown` is the engine's hardware-button/shortcut event and carries a
462
502
  * `KeyEvent`; `input` carries an `InputEvent`. Both are dispatched off-tree by
463
503
  * the runtime (`dispatch_key_input`, and `virtual_keyboard.cpp`'s synthetic
464
- * pair). `keyup` and `pointercancel` are deliberately ABSENT: `eventTypeIndex`
465
- * returns -1 for both, so `addEventListener` drops them and the handler would
466
- * never run. Declaring them would promise a callback the engine does not make.
504
+ * pair). Hardware button releases dispatch `keyup` with the same KeyEvent.
505
+ * `pointercancel` remains unsupported by the native event dispatcher.
467
506
  */
468
507
  export interface GeaEventMap {
469
508
  click: PressEvent
@@ -475,6 +514,7 @@ export interface GeaEventMap {
475
514
  pointerup: PointerEvent
476
515
  input: InputEvent
477
516
  keydown: KeyEvent
517
+ keyup: KeyEvent
478
518
  rotary: RotaryEvent
479
519
  scroll: Event
480
520
  }
@@ -501,9 +541,12 @@ export interface NativeTouchEventAttributes {
501
541
  }
502
542
 
503
543
  export interface NativeEventAttributes extends NativeTouchEventAttributes {
544
+ /** Text services and app-owned editors may dispatch input on ordinary views. */
545
+ onInput?: (event: InputEvent) => void
504
546
  onClick?: PressHandler
505
547
  onPress?: PressHandler
506
548
  onKeyDown?: (event: KeyEvent) => void
549
+ onKeyUp?: (event: KeyEvent) => void
507
550
  onRotary?: RotaryEventHandler
508
551
  }
509
552
 
@@ -612,7 +655,10 @@ export interface AudioProps extends DataAttributes {
612
655
  autoplay?: boolean | string | number
613
656
  controls?: boolean | string | number
614
657
  loop?: boolean | string | number
615
- ref?: HTMLAudioElement | (typeof globalThis extends { HTMLAudioElement: { prototype: infer E } } ? E : never) | null
658
+ ref?:
659
+ | HTMLAudioElement
660
+ | (typeof globalThis extends { HTMLAudioElement: { prototype: infer E } } ? E : never)
661
+ | null
616
662
  autoPlay?: boolean
617
663
  children?: any
618
664
  }
@@ -626,7 +672,10 @@ export interface VideoProps extends DataAttributes {
626
672
  playsinline?: boolean
627
673
  autoPlay?: boolean
628
674
  playsInline?: boolean
629
- ref?: HTMLVideoElement | (typeof globalThis extends { HTMLVideoElement: { prototype: infer E } } ? E : never) | null
675
+ ref?:
676
+ | HTMLVideoElement
677
+ | (typeof globalThis extends { HTMLVideoElement: { prototype: infer E } } ? E : never)
678
+ | null
630
679
  }
631
680
 
632
681
  export type ImageSource = string | ArrayBuffer | Uint8Array | GeaEmbeddedImage
@@ -688,7 +737,10 @@ export interface LoadImageOptions {
688
737
  // native `GeaEmbeddedImage` handle directly rather than a Promise — `await` still
689
738
  // works and keeps the value (and any `GeaEmbeddedImage[]` cache) a concrete
690
739
  // struct instead of a boxed gea_cpp_value.
691
- export declare function loadImage(src: string | ArrayBuffer | Uint8Array, options?: LoadImageOptions): GeaEmbeddedImage
740
+ export declare function loadImage(
741
+ src: string | ArrayBuffer | Uint8Array,
742
+ options?: LoadImageOptions,
743
+ ): GeaEmbeddedImage
692
744
  export declare function loadImageWithOpaque(src: Uint8Array, opaque: boolean): GeaEmbeddedImage
693
745
 
694
746
  // Load + decode an image directly from a persistent-cache file (e.g. a microSD
@@ -713,6 +765,9 @@ export declare function writeCacheFile(path: string, bytes: Uint8Array): boolean
713
765
  // pushed to /sdcard). Empty Uint8Array when the file is absent / no storage.
714
766
  export declare function readCacheFile(path: string): Uint8Array
715
767
 
768
+ /** Delete a persistent-cache file. */
769
+ export declare function removeCacheFile(path: string): boolean
770
+
716
771
  // Read a .pmtiles archive flashed into the spare ota_1 partition over USB
717
772
  // (esptool). Empty Uint8Array when none present (or off-device).
718
773
  export declare function readMapArchive(): Uint8Array
@@ -798,7 +853,7 @@ export class Component<RootElement extends GeaElement = GeaElement, Props = void
798
853
  // reactive overhead. Extend this only when the component manages its own state.
799
854
  export class ReactiveComponent<
800
855
  RootElement extends GeaElement = GeaElement,
801
- Props = void
856
+ Props = void,
802
857
  > extends Component<RootElement, Props> {}
803
858
 
804
859
  export interface BluetoothKeyboard {
@@ -969,9 +1024,28 @@ export interface CanvasRenderingContext2D {
969
1024
  fillCircle(x: number, y: number, radius: number, fill?: string | number): void
970
1025
  strokeCircle(x: number, y: number, radius: number): void
971
1026
  fillCircleRgb565(x: number, y: number, radius: number, color: number): void
972
- fillTriangleRgb565(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, color: number): void
973
- fillCirclesRgb565(xs: ArrayLike<number>, ys: ArrayLike<number>, radius: number, colors: ArrayLike<number>, count?: number): void
974
- fillCirclesRgb565Uniform(xs: ArrayLike<number>, ys: ArrayLike<number>, radius: number, color: number): void
1027
+ fillTriangleRgb565(
1028
+ x0: number,
1029
+ y0: number,
1030
+ x1: number,
1031
+ y1: number,
1032
+ x2: number,
1033
+ y2: number,
1034
+ color: number,
1035
+ ): void
1036
+ fillCirclesRgb565(
1037
+ xs: ArrayLike<number>,
1038
+ ys: ArrayLike<number>,
1039
+ radius: number,
1040
+ colors: ArrayLike<number>,
1041
+ count?: number,
1042
+ ): void
1043
+ fillCirclesRgb565Uniform(
1044
+ xs: ArrayLike<number>,
1045
+ ys: ArrayLike<number>,
1046
+ radius: number,
1047
+ color: number,
1048
+ ): void
975
1049
  /**
976
1050
  * Batched opaque triangles as ONE recorded present command. `order[0..count)`
977
1051
  * indexes the coordinate/colour arrays in paint (depth) order; colours are
@@ -1012,8 +1086,20 @@ export interface CanvasRenderingContext2D {
1012
1086
  // with no alpha plane: the blit skips the pixels outside the shape rather
1013
1087
  // than blending them. A square opaque tile would otherwise paint its
1014
1088
  // corners over whatever it overlaps.
1015
- drawImageCircle(image: GeaEmbeddedImage, dx: number, dy: number, width: number, height: number): void
1016
- drawImageRotated90CW(image: GeaEmbeddedImage, dx: number, dy: number, width: number, height: number): void
1089
+ drawImageCircle(
1090
+ image: GeaEmbeddedImage,
1091
+ dx: number,
1092
+ dy: number,
1093
+ width: number,
1094
+ height: number,
1095
+ ): void
1096
+ drawImageRotated90CW(
1097
+ image: GeaEmbeddedImage,
1098
+ dx: number,
1099
+ dy: number,
1100
+ width: number,
1101
+ height: number,
1102
+ ): void
1017
1103
  drawImageTiledX(image: GeaEmbeddedImage, dx: number, dy: number, width: number): void
1018
1104
  /**
1019
1105
  * An RGB565 pixel buffer the app writes directly:
@@ -1023,6 +1109,16 @@ export interface CanvasRenderingContext2D {
1023
1109
  createImageData565(width: number, height: number): ImageData565
1024
1110
  /** Draw an `ImageData565` with its top-left corner at (dx, dy): one blit. */
1025
1111
  putImageData(image: ImageData565, dx: number, dy: number): void
1112
+ /** Draw only the dirty rectangle of an `ImageData565`, at (dx + dirtyX, dy + dirtyY). */
1113
+ putImageData(
1114
+ image: ImageData565,
1115
+ dx: number,
1116
+ dy: number,
1117
+ dirtyX: number,
1118
+ dirtyY: number,
1119
+ dirtyWidth: number,
1120
+ dirtyHeight: number,
1121
+ ): void
1026
1122
  flush(): void
1027
1123
  beginBatch(): void
1028
1124
  endBatch(): void
@@ -1067,7 +1163,8 @@ export interface DisplayEpaperRefreshConfig {
1067
1163
  fullOnCover?: boolean
1068
1164
  }
1069
1165
 
1070
- export type DisplayOrientation = 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary'
1166
+ export type DisplayOrientation =
1167
+ 'portrait-primary' | 'portrait-secondary' | 'landscape-primary' | 'landscape-secondary'
1071
1168
 
1072
1169
  export type DisplayOrientationSupport = DisplayOrientation | 'portrait' | 'landscape' | 'all'
1073
1170
 
@@ -1094,7 +1191,9 @@ export interface DisplayController {
1094
1191
  getOrientation(): DisplayOrientation
1095
1192
  setOrientation(orientation: DisplayOrientation): void
1096
1193
  getSupportedOrientations(): DisplayOrientationSupport[]
1097
- setSupportedOrientations(orientations: DisplayOrientationSupport | DisplayOrientationSupport[]): void
1194
+ setSupportedOrientations(
1195
+ orientations: DisplayOrientationSupport | DisplayOrientationSupport[],
1196
+ ): void
1098
1197
  getAutoRotate(): boolean
1099
1198
  setAutoRotate(enabled: boolean): void
1100
1199
  /**
@@ -1244,6 +1343,9 @@ export interface LedController {
1244
1343
  export declare const Led: LedController
1245
1344
 
1246
1345
  export interface ClockController {
1346
+ /** Set wall time and persist to the board RTC when present. */
1347
+ setEpochMs(timestamp: number): boolean
1348
+
1247
1349
  // Milliseconds since the Unix epoch from the platform real-time clock
1248
1350
  // (gettimeofday). Reflects a host-set time (GEADEV SETTIME / the companion
1249
1351
  // app on launch). Unlike Date.now() — which reads a monotonic clock on
@@ -1283,12 +1385,21 @@ declare global {
1283
1385
  }
1284
1386
 
1285
1387
  export interface BatteryController {
1388
+ /** External power is present. */
1389
+ charging(): boolean
1390
+
1286
1391
  // Battery charge percentage (0-100) read from the platform PMU.
1287
1392
  level(): number
1288
1393
  }
1289
1394
 
1290
1395
  export declare const Battery: BatteryController
1291
1396
 
1397
+ export interface HapticsController {
1398
+ vibrate(durationMs: number, strength?: number): boolean
1399
+ }
1400
+
1401
+ export declare const Haptics: HapticsController
1402
+
1292
1403
  export interface NotifyController {
1293
1404
  // Transient host->app notification channel (e.g. pushed from the companion
1294
1405
  // via GEADEV NOTIFY). text() is the latest message; seq() increments on each
@@ -1327,9 +1438,17 @@ export interface AudioBuffer {
1327
1438
  readonly length: number
1328
1439
  readonly duration: number
1329
1440
  readonly numberOfChannels: number
1330
- copyFromChannel(destination: Float32Array<ArrayBuffer>, channelNumber: number, bufferOffset?: number): void
1331
- copyToChannel(source: Float32Array<ArrayBuffer>, channelNumber: number, bufferOffset?: number): void
1332
- getChannelData(channel: number): Float32Array<ArrayBuffer>
1441
+ copyFromChannel(
1442
+ destination: Float32Array<ArrayBufferLike>,
1443
+ channelNumber: number,
1444
+ bufferOffset?: number,
1445
+ ): void
1446
+ copyToChannel(
1447
+ source: Float32Array<ArrayBufferLike>,
1448
+ channelNumber: number,
1449
+ bufferOffset?: number,
1450
+ ): void
1451
+ getChannelData(channel: number): Float32Array<ArrayBufferLike>
1333
1452
  }
1334
1453
 
1335
1454
  export interface AudioBufferSourceNode {
@@ -1358,6 +1477,7 @@ export interface AudioContext {
1358
1477
  readonly currentTime: number
1359
1478
  readonly destination: AudioDestinationNode
1360
1479
  createOscillator(): OscillatorNode
1480
+ createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer
1361
1481
  createBufferSource(): AudioBufferSourceNode
1362
1482
  decodeAudioData(audioData: ArrayBuffer | Uint8Array | GeaAudioBlob): Promise<AudioBuffer>
1363
1483
  createMediaStreamSource(stream: MediaStream): MediaStreamAudioSourceNode
@@ -1486,6 +1606,8 @@ export interface CameraController {
1486
1606
  /** Capture a still frame. `capturePhoto` is the preferred alias of `capture`. */
1487
1607
  capture(options?: CameraCaptureOptions): Promise<CameraPhoto>
1488
1608
  capturePhoto(options?: CameraCaptureOptions): Promise<CameraPhoto>
1609
+ /** Take the newest encoded JPEG data URL without waiting; empty when no fresh frame is ready. */
1610
+ captureFrame(): string
1489
1611
  /** Record a video clip (esp32-p4: Motion-JPEG; iOS movie: later). */
1490
1612
  startRecording(options: CameraRecordOptions): Promise<void>
1491
1613
  stopRecording(): Promise<CameraClip>
@@ -1545,12 +1667,12 @@ export interface GeolocationController {
1545
1667
  getCurrentPosition(
1546
1668
  success: (position: GeolocationPosition) => void,
1547
1669
  error?: (error: GeolocationPositionError) => void,
1548
- options?: PositionOptions
1670
+ options?: PositionOptions,
1549
1671
  ): void
1550
1672
  watchPosition(
1551
1673
  success: (position: GeolocationPosition) => void,
1552
1674
  error?: (error: GeolocationPositionError) => void,
1553
- options?: PositionOptions
1675
+ options?: PositionOptions,
1554
1676
  ): number
1555
1677
  clearWatch(id: number): void
1556
1678
  }
@@ -1559,6 +1681,12 @@ export declare const Geolocation: GeolocationController
1559
1681
  export declare const geolocation: GeolocationController
1560
1682
 
1561
1683
  export interface WiFiController {
1684
+ accessPointMac(): string
1685
+ startCaptivePortal(): boolean
1686
+ stopCaptivePortal(): void
1687
+ startAccessPoint(ssid: string, password?: string): boolean
1688
+ stopAccessPoint(): void
1689
+
1562
1690
  enabled(): boolean
1563
1691
  setEnabled(enabled: boolean): void
1564
1692
  connected(): boolean
@@ -1589,7 +1717,8 @@ export interface ButtonProps {
1589
1717
  children?: any
1590
1718
  }
1591
1719
 
1592
- export interface NativeButtonProps extends NativeEventAttributes {
1720
+ export interface NativeButtonProps extends DataAttributes, NativeEventAttributes {
1721
+ id?: string
1593
1722
  disabled?: boolean
1594
1723
  key?: string | number
1595
1724
  class?: ClassValue
@@ -1621,12 +1750,9 @@ export interface NativeVirtualListProps extends NativeEventAttributes {
1621
1750
  export interface InputElementProps {
1622
1751
  class?: ClassValue
1623
1752
  style?: Style
1624
- // The three shapes the renderer actually materializes: `range` becomes an
1625
- // NSSlider and `checkbox` an NSSwitch, everything else an NSTextField
1626
- // (`apple/targets/macos/main/macos_renderer.mm`, `makeViewForType`). The union
1627
- // had drifted to the text-field spellings alone, so an app writing the switch
1628
- // the renderer has always drawn did not typecheck.
1629
- type?: 'text' | 'password' | 'button' | 'range' | 'checkbox'
1753
+ // macOS uses NSSlider for range, NSButton for radio, and NSSwitch for checkbox.
1754
+ // Add data-control="checkbox" for an AppKit checkbox button.
1755
+ type?: 'text' | 'password' | 'button' | 'range' | 'checkbox' | 'radio'
1630
1756
  // Optional, because the renderer treats it as one: every reader guards with
1631
1757
  // `if (value && value[0])`, and `applySwitchProps` never reads it at all --
1632
1758
  // a switch's state is `checked`. Requiring it made `<input type="checkbox">`
@@ -1639,7 +1765,11 @@ export interface InputElementProps {
1639
1765
  // switch's state and is written back on toggle.
1640
1766
  min?: number | string
1641
1767
  max?: number | string
1768
+ step?: number | string
1642
1769
  checked?: boolean | string
1770
+ disabled?: boolean
1771
+ readOnly?: boolean
1772
+ name?: string
1643
1773
  placeholder?: string
1644
1774
  autoFocus?: boolean | number
1645
1775
  pressId?: number
@@ -1649,13 +1779,16 @@ export interface InputElementProps {
1649
1779
  onFocus?: () => void
1650
1780
  onBlur?: () => void
1651
1781
  onKeyDown?: (event: KeyEvent) => void
1782
+ onKeyUp?: (event: KeyEvent) => void
1652
1783
  input?: (value: string) => void
1653
1784
  focus?: () => void
1654
1785
  blur?: () => void
1655
1786
  keydown?: (keyCode: number) => void
1787
+ keyup?: (keyCode: number) => void
1656
1788
  }
1657
1789
 
1658
- export interface NativeInputElementProps extends InputElementProps {
1790
+ export interface NativeInputElementProps extends InputElementProps, DataAttributes {
1791
+ id?: string
1659
1792
  ref?: GeaElement | null
1660
1793
  }
1661
1794
 
@@ -1669,10 +1802,40 @@ export interface TextAreaElementProps {
1669
1802
  onBlur?: () => void
1670
1803
  }
1671
1804
 
1672
- export interface NativeTextAreaElementProps extends TextAreaElementProps {
1805
+ export interface NativeTextAreaElementProps extends TextAreaElementProps, DataAttributes {
1806
+ id?: string
1807
+ disabled?: boolean
1808
+ readOnly?: boolean
1673
1809
  ref?: GeaElement | null
1674
1810
  }
1675
1811
 
1812
+ export interface NativeSelectProps extends NativeViewProps {
1813
+ value?: string
1814
+ disabled?: boolean
1815
+ onInput?: (event: InputEvent) => void
1816
+ }
1817
+
1818
+ export interface NativeOptionProps extends TextProps {
1819
+ value?: string
1820
+ selected?: boolean
1821
+ disabled?: boolean
1822
+ }
1823
+
1824
+ export interface NativeStepperProps extends NativeViewProps {
1825
+ value?: string
1826
+ min?: number | string
1827
+ max?: number | string
1828
+ step?: number | string
1829
+ disabled?: boolean
1830
+ onInput?: (event: InputEvent) => void
1831
+ }
1832
+
1833
+ export interface NativeProgressProps extends NativeViewProps {
1834
+ value?: number | string
1835
+ max?: number | string
1836
+ indeterminate?: boolean
1837
+ }
1838
+
1676
1839
  export declare function mount(component: new () => Component): void
1677
1840
 
1678
1841
  /**
@@ -1735,7 +1898,7 @@ export declare function fetchUploadFileAsync(
1735
1898
  contentType: string,
1736
1899
  prefix: string,
1737
1900
  filePath: string,
1738
- suffix: string
1901
+ suffix: string,
1739
1902
  ): number
1740
1903
 
1741
1904
  /**
@@ -1764,7 +1927,7 @@ declare global {
1764
1927
  contentType: string,
1765
1928
  prefix: string,
1766
1929
  filePath: string,
1767
- suffix: string
1930
+ suffix: string,
1768
1931
  ): number
1769
1932
  function fetchDownloadFileAsync(url: string, auth: string, destPath: string): number
1770
1933
  function fetchUploadProgress(id: number): number
@@ -1830,7 +1993,16 @@ declare global {
1830
1993
  * off disk — a reply that sets `file` streams that path on the server worker
1831
1994
  * without ever loading the bytes into JS.
1832
1995
  */
1996
+ export interface HttpHeader {
1997
+ name: string
1998
+ value: string
1999
+ }
2000
+
1833
2001
  export interface IncomingMessage {
2002
+ readonly headers: HttpHeader[]
2003
+ /** Raw request body, limited to 2 MiB by the native server. */
2004
+ readonly body: Uint8Array
2005
+
1834
2006
  /** "GET", "POST", ... */
1835
2007
  readonly method: string
1836
2008
  /** Full request target including the query string (e.g. "/n/3.wav?x=1"). */
@@ -1842,6 +2014,7 @@ export interface IncomingMessage {
1842
2014
  }
1843
2015
 
1844
2016
  export interface HttpReply {
2017
+ headers?: HttpHeader[]
1845
2018
  /** HTTP status code. Defaults to 200. */
1846
2019
  status?: number
1847
2020
  /** Response Content-Type. Defaults to "text/plain". */
@@ -1899,7 +2072,13 @@ export interface MediaStreamConstructor {
1899
2072
  }
1900
2073
 
1901
2074
  export interface MediaStreamConstraints {
1902
- audio?: boolean | { sampleRate?: number; channelCount?: number; echoCancellation?: boolean }
2075
+ audio?:
2076
+ | boolean
2077
+ | {
2078
+ sampleRate?: number
2079
+ channelCount?: number
2080
+ echoCancellation?: boolean
2081
+ }
1903
2082
  video?: false
1904
2083
  }
1905
2084
 
@@ -2095,7 +2274,9 @@ export interface RTCDataChannelInit {
2095
2274
  negotiated?: boolean
2096
2275
  id?: number
2097
2276
  }
2098
- export interface RTCDataChannelMessageEvent { readonly data: string | ArrayBuffer }
2277
+ export interface RTCDataChannelMessageEvent {
2278
+ readonly data: string | ArrayBuffer
2279
+ }
2099
2280
  export interface RTCDataChannel {
2100
2281
  readonly label: string
2101
2282
  readonly protocol: string
@@ -2118,8 +2299,12 @@ export interface RTCRtpSender {
2118
2299
  readonly track: MediaStreamTrack | null
2119
2300
  replaceTrack(track: MediaStreamTrack | null): Promise<void>
2120
2301
  }
2121
- export interface RTCRtpReceiver { readonly track: MediaStreamTrack | null }
2122
- export interface RTCRtpTransceiverInit { direction?: 'sendrecv' | 'sendonly' | 'recvonly' | 'inactive' }
2302
+ export interface RTCRtpReceiver {
2303
+ readonly track: MediaStreamTrack | null
2304
+ }
2305
+ export interface RTCRtpTransceiverInit {
2306
+ direction?: 'sendrecv' | 'sendonly' | 'recvonly' | 'inactive'
2307
+ }
2123
2308
  export interface RTCRtpTransceiver {
2124
2309
  readonly sender: RTCRtpSender
2125
2310
  readonly receiver: RTCRtpReceiver
@@ -2131,8 +2316,10 @@ export interface RTCRtpTransceiver {
2131
2316
  }
2132
2317
 
2133
2318
  export interface RTCPeerConnectionInstance {
2134
- readonly connectionState: 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed'
2135
- readonly iceConnectionState: 'new' | 'checking' | 'connected' | 'completed' | 'failed' | 'disconnected' | 'closed'
2319
+ readonly connectionState:
2320
+ 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed'
2321
+ readonly iceConnectionState:
2322
+ 'new' | 'checking' | 'connected' | 'completed' | 'failed' | 'disconnected' | 'closed'
2136
2323
 
2137
2324
  onicecandidate: ((event: RTCPeerConnectionIceEvent) => void) | null
2138
2325
  ontrack: ((event: RTCTrackEvent) => void) | null
@@ -2147,7 +2334,10 @@ export interface RTCPeerConnectionInstance {
2147
2334
  ondatachannel: ((event: { channel: RTCDataChannel }) => void) | null
2148
2335
  addTrack(track: MediaStreamTrack, stream?: MediaStream): RTCRtpSender
2149
2336
  removeTrack(sender: RTCRtpSender): void
2150
- addTransceiver(trackOrKind: MediaStreamTrack | 'audio', init?: RTCRtpTransceiverInit): RTCRtpTransceiver
2337
+ addTransceiver(
2338
+ trackOrKind: MediaStreamTrack | 'audio',
2339
+ init?: RTCRtpTransceiverInit,
2340
+ ): RTCRtpTransceiver
2151
2341
  getTransceivers(): RTCRtpTransceiver[]
2152
2342
  getSenders(): RTCRtpSender[]
2153
2343
  getReceivers(): RTCRtpReceiver[]
@@ -2169,7 +2359,6 @@ declare global {
2169
2359
  function Image(props: ImageProps): GeaJsxElement
2170
2360
  }
2171
2361
 
2172
-
2173
2362
  /** Streaming mono signed PCM16, little endian, carried as base64 text. */
2174
2363
  export interface PcmAudioStream {
2175
2364
  setInput(stream: MediaStream): void
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geastack/core",
3
- "version": "0.1.38",
3
+ "version": "0.1.40",
4
4
  "description": "GeaStack app API, reactivity headers, runtime sources, and type declarations.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -65,8 +65,8 @@
65
65
  "@babel/types": "^7.23.0",
66
66
  "@geajs/core": "1.5.1",
67
67
  "@geajs/vite-plugin": "1.5.0",
68
- "@geastack/compiler": "^1.0.23",
69
- "@geastack/geatsc-plugin-gea": "^0.1.20",
68
+ "@geastack/compiler": "^1.0.29",
69
+ "@geastack/geatsc-plugin-gea": "^0.1.22",
70
70
  "opentype.js": "^2.0.0",
71
71
  "vite": "^8.0.0"
72
72
  }
@@ -13,14 +13,10 @@ export function flushAudioWorkletOutput(): void {
13
13
  __geaFlushAudioWorkletOutput()
14
14
  }
15
15
 
16
- declare function __geaRegisterAudioWorkletProcessor(
16
+ declare function __geaRegisterAudioWorkletProcessor<T extends AudioWorkletProcessor>(
17
17
  name: string,
18
- create: () => AudioWorkletProcessor,
19
- process: (
20
- processor: AudioWorkletProcessor,
21
- inputs: Float32Array[][],
22
- outputs: Float32Array[][]
23
- ) => boolean
18
+ create: () => T,
19
+ process: (processor: T, inputs: Float32Array[][], outputs: Float32Array[][]) => boolean,
24
20
  ): void
25
21
 
26
22
  export abstract class AudioWorkletProcessor {
@@ -33,19 +29,19 @@ export abstract class AudioWorkletProcessor {
33
29
  abstract process(
34
30
  inputs: Float32Array[][],
35
31
  outputs: Float32Array[][],
36
- parameters: Record<string, Float32Array>
32
+ parameters: Record<string, Float32Array>,
37
33
  ): boolean
38
34
  }
39
35
 
40
36
  // The native module builder validates the concrete registration constructor.
41
37
  // AudioParam descriptors are explicitly unsupported, before code generation.
42
- export function registerProcessor(
38
+ export function registerProcessor<T extends AudioWorkletProcessor>(
43
39
  name: string,
44
- constructor: new () => AudioWorkletProcessor
40
+ constructor: new () => T,
45
41
  ): void {
46
42
  __geaRegisterAudioWorkletProcessor(
47
43
  name,
48
44
  () => new constructor(),
49
- (processor, inputs, outputs) => processor.process(inputs, outputs, {})
45
+ (processor, inputs, outputs) => processor.process(inputs, outputs, {}),
50
46
  )
51
47
  }