@blotch/angular-lynx 22.2.9 → 22.2.11

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.
@@ -3,7 +3,7 @@ import { ApplicationConfig, ApplicationRef, ComponentRef, EmbeddedViewRef, Envir
3
3
  import { Animation, AnimationOptions, Element as Element$1 } from "@lynx-js/types/main-thread";
4
4
  import { AnyObject } from "@lynx-js/types/common";
5
5
  import { ControlValueAccessor } from "@angular/forms";
6
- import { AnimationEvent, MouseEvent, PlatformType, ResourcePrefetchData, ResourcePrefetchResult, TextInfo, TextMetrics, TouchEvent, TransitionEvent } from "@lynx-js/types";
6
+ import { AnimationEvent, MouseEvent, ResourcePrefetchData, ResourcePrefetchResult, TextInfo, TextMetrics, TouchEvent, TransitionEvent } from "@lynx-js/types";
7
7
  import { BaseAnimationEvent, BaseKeyEvent, BaseMouseEvent, BaseTouchEvent, BaseTransitionEvent, BaseWheelEvent, LayoutChangeDetailEvent, UIAppearanceDetailEvent } from "@lynx-js/types/events";
8
8
  import { LocationChangeListener, LocationStrategy, PlatformLocation } from "@angular/common";
9
9
  import { ActivatedRouteSnapshot, DetachedRouteHandle, RouteReuseStrategy, RouterFeatures, Routes } from "@angular/router";
@@ -2150,7 +2150,7 @@ type LynxVideoEventMap = WithPrefixes<{
2150
2150
  bindfirstframe: LynxEvent<VideoFirstFrameDetail>;
2151
2151
  bindtimeupdate: LynxEvent<VideoTimeUpdateDetail>;
2152
2152
  bindbuffering: LynxEvent<VideoBufferingDetail>;
2153
- binderror: LynxEvent<VideoErrorDetail | undefined>;
2153
+ binderror: LynxEvent<VideoErrorDetail>;
2154
2154
  bindplaying: LynxEvent;
2155
2155
  bindpaused: LynxEvent;
2156
2156
  bindstopped: LynxEvent;
@@ -3779,6 +3779,324 @@ type BaseLynxElement = Pick<Element$1, 'setAttribute'> & {
3779
3779
  */
3780
3780
  invoke(methodName: string, params?: Record<string, unknown>): void;
3781
3781
  };
3782
+ /**
3783
+ * The listener registry behind the `document` and `window` stand-ins (see
3784
+ * global-events.ts): `addEventListener()`, `removeEventListener()` and
3785
+ * `dispatchEvent()` as a DOM EventTarget has them, for Lynx's main thread,
3786
+ * which has no EventTarget.
3787
+ *
3788
+ * Code written for the browser listens on these two objects without checking
3789
+ * they can be listened on: Angular's `document:`/`window:` host listeners,
3790
+ * RxJS's `fromEvent(document, …)`, and libraries that close a menu on a
3791
+ * `click` anywhere. So the registry keeps the DOM's rules, which such code
3792
+ * relies on: a listener added twice runs once, `once` and `signal` remove
3793
+ * it, an object's `handleEvent()` is called, a listener removed by an
3794
+ * earlier one doesn't run, and one that throws doesn't stop the others.
3795
+ */
3796
+ /** A listener, as addEventListener takes it. */
3797
+ type EventListenerLike = ((event: any) => unknown) | {
3798
+ handleEvent(event: any): unknown;
3799
+ };
3800
+ /** The third argument of addEventListener and removeEventListener. */
3801
+ type ListenerOptionsLike = boolean | {
3802
+ capture?: boolean;
3803
+ once?: boolean;
3804
+ passive?: boolean;
3805
+ signal?: AbortSignalLike;
3806
+ };
3807
+ type AbortSignalLike = {
3808
+ readonly aborted: boolean;
3809
+ addEventListener(type: 'abort', listener: () => void): void;
3810
+ removeEventListener?(type: 'abort', listener: () => void): void;
3811
+ };
3812
+ /** `Event.eventPhase`'s values. */
3813
+ declare const CAPTURING_PHASE = 1;
3814
+ declare const AT_TARGET = 2;
3815
+ declare const BUBBLING_PHASE = 3;
3816
+ /**
3817
+ * What the listeners of one dispatch did to it, across the targets it goes
3818
+ * through.
3819
+ */
3820
+ type PropagationState = {
3821
+ stopped: boolean;
3822
+ stoppedImmediately: boolean;
3823
+ };
3824
+ /**
3825
+ * Sets a property of an event object, whatever kind it is: a DOM Event's
3826
+ * `target` and `currentTarget` are getters on its prototype, which an own
3827
+ * property shadows.
3828
+ */
3829
+ declare const setEventProperty: (event: object, name: string, value: unknown) => void;
3830
+ /**
3831
+ * One object's listeners. `owner` is the object they're added to, which
3832
+ * listeners see as the event's `currentTarget`: the document stand-in is its
3833
+ * own, and the window's is `globalThis`.
3834
+ */
3835
+ declare class GlobalEventTarget {
3836
+ #private;
3837
+ constructor(owner?: object);
3838
+ /**
3839
+ * @internal Called whenever the set of types with listeners changes, so
3840
+ * the events for them can be listened for (see global-events.ts).
3841
+ */
3842
+ set onTypesChange(callback: () => void);
3843
+ addEventListener(type: string, callback: EventListenerLike | null | undefined, options?: ListenerOptionsLike): void;
3844
+ removeEventListener(type: string, callback: EventListenerLike | null | undefined, options?: ListenerOptionsLike): void;
3845
+ /**
3846
+ * Dispatches `event` to this object's own listeners, as the DOM does for
3847
+ * an object with no parent. The document stand-in overrides it, since the
3848
+ * window is its parent.
3849
+ */
3850
+ dispatchEvent(event: any): boolean;
3851
+ /**
3852
+ * The types that have a listener.
3853
+ */
3854
+ get types(): string[];
3855
+ hasListeners(type: string): boolean;
3856
+ /**
3857
+ * The object listeners are added to, which they see as currentTarget.
3858
+ */
3859
+ get owner(): object;
3860
+ /**
3861
+ * @internal Runs this object's listeners for `type` in `phase`: the
3862
+ * capturing ones in the capturing phase, the others in the bubbling one,
3863
+ * and both at the target, capturing first, as Chrome and Firefox do.
3864
+ * `type` is passed apart from the event, since a Lynx `tap` reaches the
3865
+ * listeners for `click`.
3866
+ */
3867
+ invoke(type: string, event: any, phase: number, state: PropagationState): void;
3868
+ }
3869
+ /**
3870
+ * One event's dispatch at `target` through `path`, the listening objects
3871
+ * from the target's side out (document, then window): capturing listeners
3872
+ * from the outside in, then the others from the inside out, if the event
3873
+ * bubbles. When the target is the first object of the path, as for
3874
+ * `dispatchEvent()`, its listeners run at the target, in the bubbling half.
3875
+ *
3876
+ * Otherwise the target is an element, and the event a screen event (see
3877
+ * global-events.ts), whose two halves run apart: the capturing one before
3878
+ * the elements' own listeners, and the bubbling one after them, as a
3879
+ * browser runs a document's listeners.
3880
+ *
3881
+ * `type` is the listeners' type, which defaults to the event's own.
3882
+ */
3883
+ declare class PathDispatch {
3884
+ #private;
3885
+ constructor(event: any, target: object, path: GlobalEventTarget[], type?: string);
3886
+ /**
3887
+ * Runs the capturing listeners of the objects around the target.
3888
+ */
3889
+ capture(): void;
3890
+ /**
3891
+ * Runs the target's listeners, if it's in the path, then the bubbling
3892
+ * listeners around it. Returns false if a listener canceled the event, as
3893
+ * dispatchEvent does.
3894
+ */
3895
+ bubble(): boolean;
3896
+ }
3897
+ /**
3898
+ * Dispatches `event` at `target` through `path` at once (see PathDispatch).
3899
+ */
3900
+ declare const dispatchThrough: (event: any, target: object, path: GlobalEventTarget[]) => boolean;
3901
+ /**
3902
+ * `document` and `window` as event targets, for Lynx's main thread.
3903
+ *
3904
+ * Angular resolves a `document:` or `body:` host listener's target from the
3905
+ * host element's `ownerDocument`, and a `window:` one from its
3906
+ * `ownerDocument.defaultView`. Lynx elements had no `ownerDocument`, so a
3907
+ * component with a global listener threw "not a function" as it was created.
3908
+ * Now a LynxElement's `ownerDocument` is the LynxGlobalDocument below, which
3909
+ * is also the `DOCUMENT` token's value and, on iOS and Android, the
3910
+ * `document` global. Its `defaultView` is `globalThis`, the `window` global
3911
+ * on Lynx, whose listeners are this hub's `window` (see window.ts).
3912
+ *
3913
+ * Both hear what a browser's document and window do: the events of a touch
3914
+ * anywhere on screen (see native-source.ts, and web-source.ts for Lynx for
3915
+ * Web), and on the window, `resize` when the LynxView changes size.
3916
+ *
3917
+ * A browser runs a document's capturing listeners before the touched
3918
+ * element's, and its other listeners after them. Lynx runs a `global-bind`
3919
+ * listener, which hears a touch wherever it lands, before every other
3920
+ * (see "A popover that leaves the screen usable" in
3921
+ * investigations/lynx-vs-web-differences.md). So a screen event's dispatch
3922
+ * runs in two halves (see PathDispatch): `early()` runs the capturing
3923
+ * listeners when the event begins, and `late()` the others when it reaches
3924
+ * the page element, the last of the elements it goes through, after the
3925
+ * page's own listeners. An event an
3926
+ * element's `catch` listener stopped never reaches the page, so its second
3927
+ * half runs on the next timer, after every listener of that event.
3928
+ */
3929
+ /** What the hub needs of the page element: its LynxElement. */
3930
+ type GlobalEventsPage = {
3931
+ /** The native element: a DOM element on Lynx for Web. */
3932
+ readonly element: unknown;
3933
+ addEventListener(name: string, listener: (event: any) => unknown): () => void;
3934
+ /** Adds a listener that runs after the page's others for the event. */
3935
+ addTrailingEventListener(name: string, listener: (event: any) => unknown): () => void;
3936
+ };
3937
+ /** The element wrapper with a unique id, for a screen event's target. */
3938
+ type ElementLookup = (uniqueId: number) => object | undefined;
3939
+ type ViewportSize = {
3940
+ readonly width: number;
3941
+ readonly height: number;
3942
+ };
3943
+ /** An event to dispatch through the document and window. */
3944
+ type Delivery = {
3945
+ /** The listeners' type: a Lynx `tap` reaches the ones for `click`. */
3946
+ readonly type: string;
3947
+ readonly event: any;
3948
+ /** The element the event happened on. */
3949
+ readonly target: object;
3950
+ };
3951
+ /** Where a platform's screen events come from. */
3952
+ type ScreenSource = {
3953
+ /**
3954
+ * Listens on `page` for the events of `types`, and stops listening for
3955
+ * the others, or on a page that's gone.
3956
+ */
3957
+ sync(page: GlobalEventsPage | null, types: ReadonlySet<string>): void;
3958
+ /**
3959
+ * The LynxView's size now, where it can be read at any time (the web
3960
+ * preview). Otherwise it's the last `resized()` one.
3961
+ */
3962
+ viewport?(): ViewportSize | null;
3963
+ };
3964
+ /**
3965
+ * The `document` stand-in. Only what code written for the browser reaches
3966
+ * for on a document it can't do without: listening, `defaultView`, `body`,
3967
+ * and the queries Angular makes of it, which find nothing, as Lynx's
3968
+ * elements come from templates.
3969
+ */
3970
+ declare class LynxGlobalDocument extends GlobalEventTarget {
3971
+ #private;
3972
+ constructor(events: GlobalEvents);
3973
+ /**
3974
+ * The window, as a document's is: `globalThis` on Lynx.
3975
+ */
3976
+ get defaultView(): any;
3977
+ /**
3978
+ * The page element, which every element is in, as a browser's body is, so
3979
+ * a `body:` listener hears the events that bubble up to it. Null until
3980
+ * the app's root element is made, as `document.body` is before a page's
3981
+ * body is parsed.
3982
+ */
3983
+ get body(): GlobalEventsPage | null;
3984
+ /**
3985
+ * TransferState's root factory calls
3986
+ * `inject(DOCUMENT).getElementById(APP_ID + '-state')` to restore the
3987
+ * `<script>` Angular SSR inlines. `resource()` and `httpResource()` inject
3988
+ * TransferState on construction. Lynx never has that script (AngularLynx
3989
+ * SSR hydrates from its own element snapshot), so `null`, "no transferred
3990
+ * state", is the right answer, not just a stub.
3991
+ */
3992
+ getElementById(_id: string): null;
3993
+ /**
3994
+ * Angular's getBaseHrefFromDOM() calls `document.querySelector('base')`.
3995
+ * Null makes it fall back to APP_BASE_HREF (see provideRenderer).
3996
+ */
3997
+ querySelector(_selector: string): null;
3998
+ querySelectorAll(_selector: string): never[];
3999
+ /**
4000
+ * A document's event bubbles to its window, as in the DOM.
4001
+ */
4002
+ dispatchEvent(event: any): boolean;
4003
+ }
4004
+ /**
4005
+ * The screen's size in CSS pixels, from SystemInfo's physical pixels: what
4006
+ * `innerWidth` and `innerHeight` are until the LynxView's first layout
4007
+ * reports its own.
4008
+ */
4009
+ declare const screenViewport: () => ViewportSize;
4010
+ declare class GlobalEvents {
4011
+ #private;
4012
+ readonly window: GlobalEventTarget;
4013
+ readonly document: LynxGlobalDocument;
4014
+ /**
4015
+ * @param windowObject The window, which listeners see as currentTarget:
4016
+ * `globalThis`.
4017
+ * @param createSource Makes the platform's ScreenSource.
4018
+ */
4019
+ constructor(windowObject: object, createSource: (events: GlobalEvents) => ScreenSource);
4020
+ /**
4021
+ * Makes `page` the one screen events come from: the root element of the
4022
+ * app that was bootstrapped last (see LynxDocument.createRootElement).
4023
+ * `lookup` finds the element a touch landed on.
4024
+ */
4025
+ attach(page: GlobalEventsPage, lookup: ElementLookup): void;
4026
+ get page(): GlobalEventsPage | null;
4027
+ /**
4028
+ * The LynxView's size, for `innerWidth` and `innerHeight`.
4029
+ */
4030
+ get viewport(): ViewportSize | null;
4031
+ /**
4032
+ * Whether the document or the window has a listener for `type`.
4033
+ */
4034
+ hasListeners(type: string): boolean;
4035
+ /**
4036
+ * The wrapper of the element with this unique id: a screen event's
4037
+ * target. Every touch is on the page, so it's the page when the element
4038
+ * has no wrapper, and the document only before there's a page.
4039
+ */
4040
+ targetFor(uniqueId: number | undefined): object;
4041
+ /**
4042
+ * A screen event begins: runs the capturing listeners of each delivery,
4043
+ * and keeps the others for late(), or the next timer. `key` names the
4044
+ * event for late(): its name natively, where each event has its own
4045
+ * objects per listener, and the DOM event on the web.
4046
+ */
4047
+ early(key: unknown, deliveries: Delivery[]): void;
4048
+ /**
4049
+ * The screen event `key` reached the page: runs its other listeners.
4050
+ */
4051
+ late(key: unknown): void;
4052
+ /**
4053
+ * Runs the second halves of the screen events still pending. Natively,
4054
+ * one event's listeners all run before the next event begins, so one still
4055
+ * pending when the next begins was stopped on its way to the page, and its
4056
+ * listeners run before the next one's, in the order the events happened.
4057
+ */
4058
+ finishPending(): void;
4059
+ /**
4060
+ * The LynxView changed size: fires `resize` on the window. Lynx also
4061
+ * reports the size after the first layout, which a browser has no event
4062
+ * for, so the size `innerWidth` and `innerHeight` already said, the
4063
+ * screen's until then, fires nothing.
4064
+ */
4065
+ resized(size: ViewportSize): void;
4066
+ }
4067
+ /**
4068
+ * The window's half of global-events.ts, on `globalThis`, which is the
4069
+ * window on Lynx's main thread: the polyfills make `window` point to it, and
4070
+ * the document's `defaultView` is it.
4071
+ *
4072
+ * On iOS and Android it has no `addEventListener` of its own (only the
4073
+ * polyfills' no-op), so all its listeners are the hub's. Where it's a
4074
+ * browser's window, which it is in the web preview (a hidden iframe's) and
4075
+ * in jsdom tests, the hub takes the screen's events (SCREEN_EVENTS) and the
4076
+ * window keeps the others, such as `message`.
4077
+ *
4078
+ * `innerWidth` and `innerHeight` are the LynxView's size (see
4079
+ * GlobalEvents.viewport): before the first layout reports it, the screen's,
4080
+ * from SystemInfo. jsdom keeps its own.
4081
+ */
4082
+ /** The events of the screen, which the hub's window hears. */
4083
+ declare const SCREEN_EVENTS: ReadonlySet<string>;
4084
+ /**
4085
+ * Makes `events.window` the window's listeners on `target` (`globalThis`),
4086
+ * and its `innerWidth` and `innerHeight` the LynxView's.
4087
+ */
4088
+ declare const installGlobalWindow: (target: Record<string | symbol, any>, events: GlobalEvents) => void;
4089
+ /**
4090
+ * Makes `events.document` the `document` global where there isn't a DOM
4091
+ * one: on iOS and Android, where the polyfills give it a placeholder. In
4092
+ * the web preview and in jsdom tests, `document` stays the browser's, and
4093
+ * only `ownerDocument` and `DOCUMENT` are the hub's.
4094
+ */
4095
+ declare const installGlobalDocument: (target: Record<string, any>, events: GlobalEvents) => void;
4096
+ /**
4097
+ * The app's `document` and `window` events (see global-events.ts).
4098
+ */
4099
+ declare const globalEvents: () => GlobalEvents;
3782
4100
  /**
3783
4101
  * An element's layout, kept from its `layoutchange` events, so code written
3784
4102
  * for the DOM can read it synchronously: `getBoundingClientRect()`,
@@ -3812,6 +4130,12 @@ type LynxDOMRect = {
3812
4130
  toJSON(): Omit<LynxDOMRect, 'toJSON'>;
3813
4131
  };
3814
4132
  declare const toDOMRect: (rect: LayoutRect | null) => LynxDOMRect;
4133
+ /**
4134
+ * Asks native for a native element's box now, relative to the LynxView: the
4135
+ * `boundingClientRect` UI method. It answers later, with null if the element
4136
+ * has no UI to measure (it was never flushed, or it's gone).
4137
+ */
4138
+ declare const measureLayout: (element: unknown, callback: (rect: LayoutRect | null) => void) => void;
3815
4139
  /** What the tracker needs from its element. */
3816
4140
  type LayoutHost = {
3817
4141
  /** Adds a listener for one of the element's Lynx events (`bindlayoutchange`). */
@@ -3834,6 +4158,18 @@ declare class LayoutTracker {
3834
4158
  */
3835
4159
  observe(observer: (rect: LayoutRect) => void): () => void;
3836
4160
  }
4161
+ /**
4162
+ * Gives a new scroll-view or list a `scroll` handler on iOS, so that a
4163
+ * listener added later hears its scroll events. iOS's scroll-view
4164
+ * (LynxUIScroller) and list (LynxUIListScroll) hand their scroll event
4165
+ * manager the element's event set the first time they're told of one, as the
4166
+ * UI is made, and never a later one. So a scroll handler added after that is
4167
+ * never called, even after a flush: an IntersectionObserver with options adds
4168
+ * one once it has measured its element, which is laid out by then. The
4169
+ * handler does nothing; the listeners added later share it (see
4170
+ * #syncNativeHandler), and Android, which reads the set afresh, needs none.
4171
+ */
4172
+ declare const listenForScrollsFromTheStart: (element: LynxElement) => void;
3837
4173
  declare class LynxElement implements BaseLynxElement {
3838
4174
  #private;
3839
4175
  get element(): ElementRef;
@@ -3854,14 +4190,49 @@ declare class LynxElement implements BaseLynxElement {
3854
4190
  _virtualParent: LynxElement | null;
3855
4191
  _virtualPrev: LynxElement | null;
3856
4192
  _virtualNext: LynxElement | null;
4193
+ /**
4194
+ * @internal The canonical wrapper of the element with this unique id, if
4195
+ * it has one: the target of a touch the document heard (see
4196
+ * global-events/native-source.ts), which names the element by its id.
4197
+ */
4198
+ static byUniqueId(uniqueId: number): LynxElement | undefined;
3857
4199
  constructor(element: ElementRef);
3858
4200
  /**
3859
4201
  * Drops this wrapper's current native id from the registry. Called when the
3860
- * native ref is swapped (recreate-on-remount) for the STALE id, and by the
3861
- * renderer's destroyNode when Angular tears the element down, so the registry
3862
- * doesn't retain wrappers for dead native refs.
4202
+ * native ref is swapped (recreate-on-remount) for the STALE id, and when the
4203
+ * element is released after Angular destroyed it (see #release), so the
4204
+ * registry doesn't retain wrappers for dead native refs.
3863
4205
  */
3864
4206
  deregisterNative(): void;
4207
+ /**
4208
+ * @internal Angular destroyed this element: the renderer's destroyNode.
4209
+ *
4210
+ * Angular calls destroyNode only for a destroyed view's top-level nodes.
4211
+ * `destroyLView` walks them with `applyView`, which never descends into an
4212
+ * element's children, and the views nested in it (embedded views, child
4213
+ * components' views) are cleaned up by `destroyViewTree` without the
4214
+ * renderer. So this element releases its whole subtree (see #release),
4215
+ * whatever views the elements under it belong to.
4216
+ *
4217
+ * It waits for the commit at the end of the cycle (see
4218
+ * #commitPendingReleases), when the cycle's moves are done: an element
4219
+ * moved out of the subtree in the meantime, as CDK's DomPortal hands its
4220
+ * element back when it's destroyed, isn't under this one any more and
4221
+ * stays registered. An element still in the tree then (a leave animation
4222
+ * delays Angular's removal) is released when its removal commits.
4223
+ */
4224
+ markDestroyed(): void;
4225
+ /**
4226
+ * @internal The children this element keeps out of `#children`, which a
4227
+ * release must reach too: a list's items (see LynxListElement). None here.
4228
+ */
4229
+ virtualChildren(): LynxElement[];
4230
+ /**
4231
+ * The document stand-in (see global-events), as a DOM element's is its
4232
+ * document. Angular resolves a `document:` or `body:` host listener's
4233
+ * target from it, and a `window:` one from its `defaultView`.
4234
+ */
4235
+ get ownerDocument(): LynxGlobalDocument;
3865
4236
  setProperty(name: string, value: any): void;
3866
4237
  /**
3867
4238
  * Seeds the cached text for a raw-text element so #recreateSubtree() can
@@ -3981,6 +4352,15 @@ declare class LynxElement implements BaseLynxElement {
3981
4352
  * gets one native handler that runs all of them (see #syncNativeHandler).
3982
4353
  */
3983
4354
  addEventListener(name: string, cb: (event: any) => any): () => void;
4355
+ /**
4356
+ * @internal Adds a listener for a Lynx event name (`bindtap`, …) that runs
4357
+ * after the element's other listeners for the event, whenever they were
4358
+ * added. The document's listeners hear the end of a touch from the page
4359
+ * element this way (see global-events/native-source.ts), so they run after
4360
+ * the page's own, the root component's host listeners and `body:` ones,
4361
+ * as a browser runs a document's listeners after its body's.
4362
+ */
4363
+ addTrailingEventListener(name: string, cb: (event: any) => any): () => void;
3984
4364
  /**
3985
4365
  * Removes a listener added with addEventListener, as the DOM method does,
3986
4366
  * for code that pairs the two on the element itself rather than going
@@ -4025,6 +4405,24 @@ declare class LynxElement implements BaseLynxElement {
4025
4405
  * The box from the element's last layout, or null before the first.
4026
4406
  */
4027
4407
  get layoutRect(): LayoutRect | null;
4408
+ /**
4409
+ * Leaves the element's handler for `eventName` to a main-thread directive
4410
+ * (`[mainThreadBindscroll]` and the like), which registers its own with
4411
+ * `__AddEvent`. Lynx keeps one handler per event name (see nativeEventKey),
4412
+ * so registering the element's own afterwards would replace the
4413
+ * directive's: an IntersectionObserver with options, listening for a
4414
+ * scroll-view's scroll events, would stop the app's main-thread scroll
4415
+ * handler. Until releaseNativeEvent, the element's listeners for the event
4416
+ * aren't registered natively, and don't hear it, as they didn't when the
4417
+ * directive registered after them. Counted, as `mainThreadBindscroll` and
4418
+ * `mainThreadCatchscroll` share one.
4419
+ */
4420
+ holdNativeEvent(eventName: string): void;
4421
+ /**
4422
+ * Hands `eventName` back once the directive has removed its handler, and
4423
+ * registers the element's own for the listeners it has for it.
4424
+ */
4425
+ releaseNativeEvent(eventName: string): void;
4028
4426
  }
4029
4427
  /**
4030
4428
  * Commits all queued genuine element removals — a free-function wrapper over
@@ -5228,8 +5626,8 @@ declare class LynxCanvasElement extends LynxElement {
5228
5626
  * then pointerout and pointerleave (a touch leaves when it lifts)
5229
5627
  * - touchcancel: pointercancel, lostpointercapture, pointerout, pointerleave
5230
5628
  *
5231
- * Each finger is a pointer: `pointerId` is its touch's identifier, and
5232
- * `isPrimary` marks the first one down. `offsetX`/`offsetY` are relative to
5629
+ * Each finger is a pointer, whose `pointerId` stays the same until it lifts
5630
+ * (see pointerIdOf), and `isPrimary` marks the first one down. `offsetX`/`offsetY` are relative to
5233
5631
  * the element, from the touch's `x`/`y` when the element itself was touched
5234
5632
  * and from its last layout otherwise; `clientX`/`clientY` and
5235
5633
  * `pageX`/`pageY` are in the LynxView's coordinates.
@@ -5263,6 +5661,21 @@ type LynxTouchEvent = {
5263
5661
  touches?: LynxTouch[];
5264
5662
  changedTouches?: LynxTouch[];
5265
5663
  };
5664
+ /**
5665
+ * A touch's pointerId, the same in each of its events, at an element and at
5666
+ * the document.
5667
+ *
5668
+ * With multi-touch on, Lynx numbers each finger from 0 and keeps its number
5669
+ * until it lifts (`touches_map_` in iOS's LynxTouchHandler.mm, and Android's
5670
+ * `MotionEvent.getPointerId()`). With it off, which is the LynxView's
5671
+ * default, there's one touch at a time, and its `identifier` is the address
5672
+ * of the dictionary Lynx builds the touch in (`reinterpret_cast<int64_t>(&touch)`
5673
+ * in TouchEventHandler::GetTouchEventParam), which changes from one event to
5674
+ * the next: on the iOS 27 Simulator, a drag's touchmove events had one and its
5675
+ * touchend another. So a touch with such an identifier is the one touch, and
5676
+ * gets the number multi-touch gives the first finger.
5677
+ */
5678
+ declare const pointerIdOf: (touch: LynxTouch) => number;
5266
5679
  /** What the source needs from its element. */
5267
5680
  type PointerEventHost = {
5268
5681
  /** The element's unique id, which a touch event's `target.uid` names. */
@@ -5355,6 +5768,19 @@ declare class PointerEventSource {
5355
5768
  releasePointerCapture(pointerId: number): void;
5356
5769
  hasPointerCapture(pointerId: number): boolean;
5357
5770
  }
5771
+ /**
5772
+ * The pointer event a browser fires for `touch`: the one an element makes
5773
+ * (see PointerEventSource), and the one the document gets for a touch
5774
+ * anywhere (see global-events/native-source.ts). `pointer` says which finger
5775
+ * it is and where it is on the target; a capture event, which no touch
5776
+ * causes, has no `touch`.
5777
+ */
5778
+ declare const pointerEventFor: (type: string, pointer: {
5779
+ pointerId: number;
5780
+ isPrimary: boolean;
5781
+ offsetX: number;
5782
+ offsetY: number;
5783
+ }, touch: LynxTouch | null, timeStamp: number | undefined, target: object) => LynxPointerEvent;
5358
5784
  export declare class LynxLogger {
5359
5785
  #private;
5360
5786
  log(...args: unknown[]): void;
@@ -5549,6 +5975,12 @@ declare class LynxListElement extends LynxElement {
5549
5975
  * for the general "never key a Set/Map on an element ref" constraint.
5550
5976
  */
5551
5977
  getUIChildren(): ElementRef[];
5978
+ /**
5979
+ * The items, anchors included: they live in this linked list, not in the
5980
+ * `#children` a release walks, and a list in a destroyed view must let
5981
+ * them go too (see LynxElement.virtualChildren).
5982
+ */
5983
+ virtualChildren(): LynxElement[];
5552
5984
  /**
5553
5985
  * The UI children list as of the last _processUpdate() call, pre-filtered
5554
5986
  * and cached — for componentAtIndex/componentAtIndexes (create-list-element.ts)
@@ -6069,6 +6501,103 @@ export declare class LynxResourcePrefetch {
6069
6501
  static ɵfac: i0.ɵɵFactoryDeclaration<LynxResourcePrefetch, never>;
6070
6502
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
6071
6503
  }
6504
+ /**
6505
+ * The platform the app runs on, spelled exactly as Lynx reports it. Compare
6506
+ * with these strings as written: `'iOS'`, not `'ios'`.
6507
+ *
6508
+ * The casing is uneven because each platform's Lynx code names itself (Lynx
6509
+ * core's desktop code returns `'windows'` but `'macOS'`), so it can't be
6510
+ * normalized without breaking comparisons against what Lynx reports.
6511
+ *
6512
+ * It differs from `@lynx-js/types`' `PlatformType` in two places:
6513
+ * - It adds `'web'`, which web-core (Lynx for Web, the docs' live previews)
6514
+ * reports. Without it, code that checks for the web needs a cast.
6515
+ * - It drops `'pc'`, the name desktop Lynx used before 3.3, which no Lynx
6516
+ * that AngularLynx supports reports.
6517
+ */
6518
+ type PlatformType = 'Android' | 'iOS' | 'Harmony' | 'windows' | 'macOS' | 'web';
6519
+ /**
6520
+ * Wraps the global `SystemInfo` object as an Angular injectable,
6521
+ * providing device and platform information from the Lynx runtime.
6522
+ *
6523
+ * `SystemInfo` is populated once when the Lynx view initializes and
6524
+ * is read-only for the lifetime of the app — the values never change.
6525
+ *
6526
+ * On iOS and Android (Lynx 4.1), the main thread has no global `SystemInfo`,
6527
+ * only `lynx.SystemInfo`, so that's read first. The background thread and the
6528
+ * web have the global. The main thread's copy has no `osVersion` either: see
6529
+ * {@link LynxSystemInfo.osVersion} for where that comes from instead.
6530
+ *
6531
+ * @usageNotes
6532
+ * ```typescript
6533
+ * const systemInfo = inject(LynxSystemInfo);
6534
+ *
6535
+ * // Device dimensions in physical pixels
6536
+ * const { pixelWidth, pixelHeight, pixelRatio } = systemInfo;
6537
+ *
6538
+ * // Logical screen dimensions (CSS pixels)
6539
+ * const cssWidth = systemInfo.screenWidth;
6540
+ * const cssHeight = systemInfo.screenHeight;
6541
+ *
6542
+ * // Platform detection
6543
+ * if (systemInfo.platform === 'iOS') {
6544
+ * // iOS-specific logic
6545
+ * }
6546
+ * ```
6547
+ */
6548
+ export declare class LynxSystemInfo {
6549
+ #private;
6550
+ constructor();
6551
+ /**
6552
+ * The platform of the current device (e.g. `'iOS'`, `'Android'`, or
6553
+ * `'web'` in Lynx for Web). See {@link PlatformType}.
6554
+ */
6555
+ get platform(): PlatformType;
6556
+ /**
6557
+ * The Lynx engine version (e.g. `'3.2'`).
6558
+ */
6559
+ get engineVersion(): string;
6560
+ /**
6561
+ * The current operating system version, such as `'26.1'` on iOS or `'15'`
6562
+ * on Android. Empty while it isn't known.
6563
+ *
6564
+ * The native main thread's SystemInfo lacks it, so there it comes from the
6565
+ * host app's `osVersion` global prop, or else from the background thread,
6566
+ * which answers shortly after the first frame. It reads a signal, so a
6567
+ * `computed()` that reads it updates when the answer arrives.
6568
+ */
6569
+ get osVersion(): string;
6570
+ /**
6571
+ * Physical pixel width of the device screen.
6572
+ */
6573
+ get pixelWidth(): number;
6574
+ /**
6575
+ * Physical pixel height of the device screen.
6576
+ */
6577
+ get pixelHeight(): number;
6578
+ /**
6579
+ * Device pixel ratio (physical pixels per CSS pixel).
6580
+ */
6581
+ get pixelRatio(): number;
6582
+ /**
6583
+ * The JavaScript engine in use (`'v8'`, `'jsc'`, or `'quickjs'`). Only available on the background thread.
6584
+ */
6585
+ get runtimeType(): 'v8' | 'jsc' | 'quickjs';
6586
+ /**
6587
+ * Screen width in logical/CSS pixels (`pixelWidth / pixelRatio`).
6588
+ */
6589
+ get screenWidth(): number;
6590
+ /**
6591
+ * Screen height in logical/CSS pixels (`pixelHeight / pixelRatio`).
6592
+ */
6593
+ get screenHeight(): number;
6594
+ /**
6595
+ * The theme object, if provided by the host application.
6596
+ */
6597
+ get theme(): object | undefined;
6598
+ static ɵfac: i0.ɵɵFactoryDeclaration<LynxSystemInfo, never>;
6599
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
6600
+ }
6072
6601
  /**
6073
6602
  * CSS `env()` value for the top safe area inset (notch / status bar).
6074
6603
  */
@@ -6118,9 +6647,10 @@ export declare class LynxSafeArea {
6118
6647
  */
6119
6648
  readonly isNotchScreen: import("@angular/core").Signal<boolean>;
6120
6649
  /**
6121
- * The current platform (`'iOS'`, `'Android'`, `'Harmony'`, etc.).
6650
+ * The current platform (`'iOS'`, `'Android'`, `'web'`, etc.). Same as
6651
+ * {@link LynxSystemInfo.platform}.
6122
6652
  */
6123
- get platform(): import("@lynx-js/types").PlatformType;
6653
+ get platform(): PlatformType;
6124
6654
  static ɵfac: i0.ɵɵFactoryDeclaration<LynxSafeArea, never>;
6125
6655
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
6126
6656
  }
@@ -6330,87 +6860,6 @@ export declare class LynxSecureStorage extends PersistentStorage {
6330
6860
  static ɵfac: i0.ɵɵFactoryDeclaration<LynxSecureStorage, never>;
6331
6861
  static ɵprov: i0.ɵɵInjectableDeclaration<any>;
6332
6862
  }
6333
- /**
6334
- * Wraps the global `SystemInfo` object as an Angular injectable,
6335
- * providing device and platform information from the Lynx runtime.
6336
- *
6337
- * `SystemInfo` is populated once when the Lynx view initializes and
6338
- * is read-only for the lifetime of the app — the values never change.
6339
- *
6340
- * On iOS and Android (Lynx 4.1), the main thread has no global `SystemInfo`,
6341
- * only `lynx.SystemInfo`, so that's read first. The background thread and the
6342
- * web have the global. The main thread's copy has no `osVersion` either: see
6343
- * {@link LynxSystemInfo.osVersion} for where that comes from instead.
6344
- *
6345
- * @usageNotes
6346
- * ```typescript
6347
- * const systemInfo = inject(LynxSystemInfo);
6348
- *
6349
- * // Device dimensions in physical pixels
6350
- * const { pixelWidth, pixelHeight, pixelRatio } = systemInfo;
6351
- *
6352
- * // Logical screen dimensions (CSS pixels)
6353
- * const cssWidth = systemInfo.screenWidth;
6354
- * const cssHeight = systemInfo.screenHeight;
6355
- *
6356
- * // Platform detection
6357
- * if (systemInfo.platform === 'iOS') {
6358
- * // iOS-specific logic
6359
- * }
6360
- * ```
6361
- */
6362
- export declare class LynxSystemInfo {
6363
- #private;
6364
- constructor();
6365
- /**
6366
- * The platform of the current device (e.g. `'iOS'`, `'Android'`).
6367
- */
6368
- get platform(): PlatformType;
6369
- /**
6370
- * The Lynx engine version (e.g. `'3.2'`).
6371
- */
6372
- get engineVersion(): string;
6373
- /**
6374
- * The current operating system version, such as `'26.1'` on iOS or `'15'`
6375
- * on Android. Empty while it isn't known.
6376
- *
6377
- * The native main thread's SystemInfo lacks it, so there it comes from the
6378
- * host app's `osVersion` global prop, or else from the background thread,
6379
- * which answers shortly after the first frame. It reads a signal, so a
6380
- * `computed()` that reads it updates when the answer arrives.
6381
- */
6382
- get osVersion(): string;
6383
- /**
6384
- * Physical pixel width of the device screen.
6385
- */
6386
- get pixelWidth(): number;
6387
- /**
6388
- * Physical pixel height of the device screen.
6389
- */
6390
- get pixelHeight(): number;
6391
- /**
6392
- * Device pixel ratio (physical pixels per CSS pixel).
6393
- */
6394
- get pixelRatio(): number;
6395
- /**
6396
- * The JavaScript engine in use (`'v8'`, `'jsc'`, or `'quickjs'`). Only available on the background thread.
6397
- */
6398
- get runtimeType(): 'v8' | 'jsc' | 'quickjs';
6399
- /**
6400
- * Screen width in logical/CSS pixels (`pixelWidth / pixelRatio`).
6401
- */
6402
- get screenWidth(): number;
6403
- /**
6404
- * Screen height in logical/CSS pixels (`pixelHeight / pixelRatio`).
6405
- */
6406
- get screenHeight(): number;
6407
- /**
6408
- * The theme object, if provided by the host application.
6409
- */
6410
- get theme(): object | undefined;
6411
- static ɵfac: i0.ɵɵFactoryDeclaration<LynxSystemInfo, never>;
6412
- static ɵprov: i0.ɵɵInjectableDeclaration<any>;
6413
- }
6414
6863
  /**
6415
6864
  * Wraps `lynx.getTextInfo()` for measuring text dimensions and
6416
6865
  * performing line-breaking calculations.
@@ -6711,7 +7160,7 @@ export declare class LynxWebAuthSession {
6711
7160
  * Central DI configuration for the Lynx renderer. Must be included in every
6712
7161
  * Lynx Angular app's providers (typically via app.config.ts). Sets up:
6713
7162
  * 1. The document (LynxDocument, or LynxHydrateDocument for SSR)
6714
- * 2. DOCUMENT stub (Angular requires this token but Lynx has no DOM Document)
7163
+ * 2. DOCUMENT: the document stand-in elements' ownerDocument is (global-events)
6715
7164
  * 3. APP_BASE_HREF (prevents BrowserPlatformLocation from crashing)
6716
7165
  * 4. Renderer factory (creates LynxRenderer / EmulatedLynxRenderer)
6717
7166
  * 5. Error handler (routes to _ReportError + __lynxLastError)
@@ -7163,4 +7612,4 @@ declare global {
7163
7612
  _wkltId: string;
7164
7613
  }, ...args: unknown[]): Promise<unknown>;
7165
7614
  }
7166
- export type { AccessibilityActionDetail, AccessibilityTrait, AccessibilityTraitStates, BackgroundFnHandle, BaseLynxAnimation, BaseLynxElement, DataProcessorDefinition, DevToolsStats, DynamicColorRole, DynamicColorScheme, DynamicColors, ExposureEventDetail, FlingGestureEvent, FrameLoadDetail, FrameLoadMetricsDetail, GestureCallback, GestureCallbackWithState, GestureEvent, GlobalData, GlobalExposureEvent, HostElementTag, ImageErrorDetail, ImageLoadDetail, InitData, InitDataRaw, InputDetail, InputSelectionDetail, InputValueDetail, LayoutChangeDetail, ListAttachedCell, ListItemInfo, ListLayoutCompleteDetail, ListScrollDetail, ListScrollStateChangeDetail, ListSnapDetail, LongPressGestureEvent, LynxAnimationOptions, LynxCanvasElement, LynxDOMRect, LynxEvent, LynxEventTarget, LynxFontEntry, LynxFontFaceConfig, LynxFontStatus, LynxPointerEvent, LynxTraceOptions, LynxWebGL2RenderingContext, MainThread, MainThreadFnHandle, NativeModuleMap, NativeModuleProxy, ObserverFrameRateOptions, OverlayErrorDetail, OverlayTouchDetail, PanGestureEvent, PinchGestureEvent, PortalConfig, PrefetchCacheTarget, PrefetchPriority, PrefetchRequest, PrefetchResultDetail, RefreshHeaderOffsetDetail, RefreshStartDetail, RefreshStateChangeDetail, ResourcePrefetchData, ResourcePrefetchResult, RotationGestureEvent, ScrollCoordinatorOffsetDetail, ScrollDetail, SessionStorageSubscription, TapGestureEvent, TextLayoutDetail, TextSelectionChangeDetail, UIAppearanceDetail, VideoBufferingDetail, VideoErrorDetail, VideoFirstFrameDetail, VideoTimeUpdateDetail, ViewPagerChangeDetail, ViewPagerOffsetChangeDetail, WebAuthSessionErrorCode, WebAuthSessionOptions, WebViewErrorDetail, WebViewMessageDetail, WebViewUrlDetail };
7615
+ export type { AccessibilityActionDetail, AccessibilityTrait, AccessibilityTraitStates, BackgroundFnHandle, BaseLynxAnimation, BaseLynxElement, DataProcessorDefinition, DevToolsStats, DynamicColorRole, DynamicColorScheme, DynamicColors, ExposureEventDetail, FlingGestureEvent, FrameLoadDetail, FrameLoadMetricsDetail, GestureCallback, GestureCallbackWithState, GestureEvent, GlobalData, GlobalExposureEvent, HostElementTag, ImageErrorDetail, ImageLoadDetail, InitData, InitDataRaw, InputDetail, InputSelectionDetail, InputValueDetail, LayoutChangeDetail, ListAttachedCell, ListItemInfo, ListLayoutCompleteDetail, ListScrollDetail, ListScrollStateChangeDetail, ListSnapDetail, LongPressGestureEvent, LynxAnimationOptions, LynxCanvasElement, LynxDOMRect, LynxEvent, LynxEventTarget, LynxFontEntry, LynxFontFaceConfig, LynxFontStatus, LynxPointerEvent, LynxTraceOptions, LynxWebGL2RenderingContext, MainThread, MainThreadFnHandle, NativeModuleMap, NativeModuleProxy, ObserverFrameRateOptions, OverlayErrorDetail, OverlayTouchDetail, PanGestureEvent, PinchGestureEvent, PlatformType, PortalConfig, PrefetchCacheTarget, PrefetchPriority, PrefetchRequest, PrefetchResultDetail, RefreshHeaderOffsetDetail, RefreshStartDetail, RefreshStateChangeDetail, ResourcePrefetchData, ResourcePrefetchResult, RotationGestureEvent, ScrollCoordinatorOffsetDetail, ScrollDetail, SessionStorageSubscription, TapGestureEvent, TextLayoutDetail, TextSelectionChangeDetail, UIAppearanceDetail, VideoBufferingDetail, VideoErrorDetail, VideoFirstFrameDetail, VideoTimeUpdateDetail, ViewPagerChangeDetail, ViewPagerOffsetChangeDetail, WebAuthSessionErrorCode, WebAuthSessionOptions, WebViewErrorDetail, WebViewMessageDetail, WebViewUrlDetail };