@blotch/angular-lynx 22.2.9 → 22.2.10
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/README.md +2 -0
- package/fesm2022/blotch-angular-lynx.mjs +1054 -138
- package/fesm2022/blotch-angular-lynx.mjs.map +1 -1
- package/package.json +1 -1
- package/types/blotch-angular-lynx.d.ts +479 -89
package/package.json
CHANGED
|
@@ -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,
|
|
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
|
|
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`). */
|
|
@@ -3854,6 +4178,12 @@ declare class LynxElement implements BaseLynxElement {
|
|
|
3854
4178
|
_virtualParent: LynxElement | null;
|
|
3855
4179
|
_virtualPrev: LynxElement | null;
|
|
3856
4180
|
_virtualNext: LynxElement | null;
|
|
4181
|
+
/**
|
|
4182
|
+
* @internal The canonical wrapper of the element with this unique id, if
|
|
4183
|
+
* it has one: the target of a touch the document heard (see
|
|
4184
|
+
* global-events/native-source.ts), which names the element by its id.
|
|
4185
|
+
*/
|
|
4186
|
+
static byUniqueId(uniqueId: number): LynxElement | undefined;
|
|
3857
4187
|
constructor(element: ElementRef);
|
|
3858
4188
|
/**
|
|
3859
4189
|
* Drops this wrapper's current native id from the registry. Called when the
|
|
@@ -3862,6 +4192,12 @@ declare class LynxElement implements BaseLynxElement {
|
|
|
3862
4192
|
* doesn't retain wrappers for dead native refs.
|
|
3863
4193
|
*/
|
|
3864
4194
|
deregisterNative(): void;
|
|
4195
|
+
/**
|
|
4196
|
+
* The document stand-in (see global-events), as a DOM element's is its
|
|
4197
|
+
* document. Angular resolves a `document:` or `body:` host listener's
|
|
4198
|
+
* target from it, and a `window:` one from its `defaultView`.
|
|
4199
|
+
*/
|
|
4200
|
+
get ownerDocument(): LynxGlobalDocument;
|
|
3865
4201
|
setProperty(name: string, value: any): void;
|
|
3866
4202
|
/**
|
|
3867
4203
|
* Seeds the cached text for a raw-text element so #recreateSubtree() can
|
|
@@ -3981,6 +4317,15 @@ declare class LynxElement implements BaseLynxElement {
|
|
|
3981
4317
|
* gets one native handler that runs all of them (see #syncNativeHandler).
|
|
3982
4318
|
*/
|
|
3983
4319
|
addEventListener(name: string, cb: (event: any) => any): () => void;
|
|
4320
|
+
/**
|
|
4321
|
+
* @internal Adds a listener for a Lynx event name (`bindtap`, …) that runs
|
|
4322
|
+
* after the element's other listeners for the event, whenever they were
|
|
4323
|
+
* added. The document's listeners hear the end of a touch from the page
|
|
4324
|
+
* element this way (see global-events/native-source.ts), so they run after
|
|
4325
|
+
* the page's own, the root component's host listeners and `body:` ones,
|
|
4326
|
+
* as a browser runs a document's listeners after its body's.
|
|
4327
|
+
*/
|
|
4328
|
+
addTrailingEventListener(name: string, cb: (event: any) => any): () => void;
|
|
3984
4329
|
/**
|
|
3985
4330
|
* Removes a listener added with addEventListener, as the DOM method does,
|
|
3986
4331
|
* for code that pairs the two on the element itself rather than going
|
|
@@ -5228,8 +5573,8 @@ declare class LynxCanvasElement extends LynxElement {
|
|
|
5228
5573
|
* then pointerout and pointerleave (a touch leaves when it lifts)
|
|
5229
5574
|
* - touchcancel: pointercancel, lostpointercapture, pointerout, pointerleave
|
|
5230
5575
|
*
|
|
5231
|
-
* Each finger is a pointer
|
|
5232
|
-
* `isPrimary` marks the first one down. `offsetX`/`offsetY` are relative to
|
|
5576
|
+
* Each finger is a pointer, whose `pointerId` stays the same until it lifts
|
|
5577
|
+
* (see pointerIdOf), and `isPrimary` marks the first one down. `offsetX`/`offsetY` are relative to
|
|
5233
5578
|
* the element, from the touch's `x`/`y` when the element itself was touched
|
|
5234
5579
|
* and from its last layout otherwise; `clientX`/`clientY` and
|
|
5235
5580
|
* `pageX`/`pageY` are in the LynxView's coordinates.
|
|
@@ -5263,6 +5608,21 @@ type LynxTouchEvent = {
|
|
|
5263
5608
|
touches?: LynxTouch[];
|
|
5264
5609
|
changedTouches?: LynxTouch[];
|
|
5265
5610
|
};
|
|
5611
|
+
/**
|
|
5612
|
+
* A touch's pointerId, the same in each of its events, at an element and at
|
|
5613
|
+
* the document.
|
|
5614
|
+
*
|
|
5615
|
+
* With multi-touch on, Lynx numbers each finger from 0 and keeps its number
|
|
5616
|
+
* until it lifts (`touches_map_` in iOS's LynxTouchHandler.mm, and Android's
|
|
5617
|
+
* `MotionEvent.getPointerId()`). With it off, which is the LynxView's
|
|
5618
|
+
* default, there's one touch at a time, and its `identifier` is the address
|
|
5619
|
+
* of the dictionary Lynx builds the touch in (`reinterpret_cast<int64_t>(&touch)`
|
|
5620
|
+
* in TouchEventHandler::GetTouchEventParam), which changes from one event to
|
|
5621
|
+
* the next: on the iOS 27 Simulator, a drag's touchmove events had one and its
|
|
5622
|
+
* touchend another. So a touch with such an identifier is the one touch, and
|
|
5623
|
+
* gets the number multi-touch gives the first finger.
|
|
5624
|
+
*/
|
|
5625
|
+
declare const pointerIdOf: (touch: LynxTouch) => number;
|
|
5266
5626
|
/** What the source needs from its element. */
|
|
5267
5627
|
type PointerEventHost = {
|
|
5268
5628
|
/** The element's unique id, which a touch event's `target.uid` names. */
|
|
@@ -5355,6 +5715,19 @@ declare class PointerEventSource {
|
|
|
5355
5715
|
releasePointerCapture(pointerId: number): void;
|
|
5356
5716
|
hasPointerCapture(pointerId: number): boolean;
|
|
5357
5717
|
}
|
|
5718
|
+
/**
|
|
5719
|
+
* The pointer event a browser fires for `touch`: the one an element makes
|
|
5720
|
+
* (see PointerEventSource), and the one the document gets for a touch
|
|
5721
|
+
* anywhere (see global-events/native-source.ts). `pointer` says which finger
|
|
5722
|
+
* it is and where it is on the target; a capture event, which no touch
|
|
5723
|
+
* causes, has no `touch`.
|
|
5724
|
+
*/
|
|
5725
|
+
declare const pointerEventFor: (type: string, pointer: {
|
|
5726
|
+
pointerId: number;
|
|
5727
|
+
isPrimary: boolean;
|
|
5728
|
+
offsetX: number;
|
|
5729
|
+
offsetY: number;
|
|
5730
|
+
}, touch: LynxTouch | null, timeStamp: number | undefined, target: object) => LynxPointerEvent;
|
|
5358
5731
|
export declare class LynxLogger {
|
|
5359
5732
|
#private;
|
|
5360
5733
|
log(...args: unknown[]): void;
|
|
@@ -6069,6 +6442,103 @@ export declare class LynxResourcePrefetch {
|
|
|
6069
6442
|
static ɵfac: i0.ɵɵFactoryDeclaration<LynxResourcePrefetch, never>;
|
|
6070
6443
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
6071
6444
|
}
|
|
6445
|
+
/**
|
|
6446
|
+
* The platform the app runs on, spelled exactly as Lynx reports it. Compare
|
|
6447
|
+
* with these strings as written: `'iOS'`, not `'ios'`.
|
|
6448
|
+
*
|
|
6449
|
+
* The casing is uneven because each platform's Lynx code names itself (Lynx
|
|
6450
|
+
* core's desktop code returns `'windows'` but `'macOS'`), so it can't be
|
|
6451
|
+
* normalized without breaking comparisons against what Lynx reports.
|
|
6452
|
+
*
|
|
6453
|
+
* It differs from `@lynx-js/types`' `PlatformType` in two places:
|
|
6454
|
+
* - It adds `'web'`, which web-core (Lynx for Web, the docs' live previews)
|
|
6455
|
+
* reports. Without it, code that checks for the web needs a cast.
|
|
6456
|
+
* - It drops `'pc'`, the name desktop Lynx used before 3.3, which no Lynx
|
|
6457
|
+
* that AngularLynx supports reports.
|
|
6458
|
+
*/
|
|
6459
|
+
type PlatformType = 'Android' | 'iOS' | 'Harmony' | 'windows' | 'macOS' | 'web';
|
|
6460
|
+
/**
|
|
6461
|
+
* Wraps the global `SystemInfo` object as an Angular injectable,
|
|
6462
|
+
* providing device and platform information from the Lynx runtime.
|
|
6463
|
+
*
|
|
6464
|
+
* `SystemInfo` is populated once when the Lynx view initializes and
|
|
6465
|
+
* is read-only for the lifetime of the app — the values never change.
|
|
6466
|
+
*
|
|
6467
|
+
* On iOS and Android (Lynx 4.1), the main thread has no global `SystemInfo`,
|
|
6468
|
+
* only `lynx.SystemInfo`, so that's read first. The background thread and the
|
|
6469
|
+
* web have the global. The main thread's copy has no `osVersion` either: see
|
|
6470
|
+
* {@link LynxSystemInfo.osVersion} for where that comes from instead.
|
|
6471
|
+
*
|
|
6472
|
+
* @usageNotes
|
|
6473
|
+
* ```typescript
|
|
6474
|
+
* const systemInfo = inject(LynxSystemInfo);
|
|
6475
|
+
*
|
|
6476
|
+
* // Device dimensions in physical pixels
|
|
6477
|
+
* const { pixelWidth, pixelHeight, pixelRatio } = systemInfo;
|
|
6478
|
+
*
|
|
6479
|
+
* // Logical screen dimensions (CSS pixels)
|
|
6480
|
+
* const cssWidth = systemInfo.screenWidth;
|
|
6481
|
+
* const cssHeight = systemInfo.screenHeight;
|
|
6482
|
+
*
|
|
6483
|
+
* // Platform detection
|
|
6484
|
+
* if (systemInfo.platform === 'iOS') {
|
|
6485
|
+
* // iOS-specific logic
|
|
6486
|
+
* }
|
|
6487
|
+
* ```
|
|
6488
|
+
*/
|
|
6489
|
+
export declare class LynxSystemInfo {
|
|
6490
|
+
#private;
|
|
6491
|
+
constructor();
|
|
6492
|
+
/**
|
|
6493
|
+
* The platform of the current device (e.g. `'iOS'`, `'Android'`, or
|
|
6494
|
+
* `'web'` in Lynx for Web). See {@link PlatformType}.
|
|
6495
|
+
*/
|
|
6496
|
+
get platform(): PlatformType;
|
|
6497
|
+
/**
|
|
6498
|
+
* The Lynx engine version (e.g. `'3.2'`).
|
|
6499
|
+
*/
|
|
6500
|
+
get engineVersion(): string;
|
|
6501
|
+
/**
|
|
6502
|
+
* The current operating system version, such as `'26.1'` on iOS or `'15'`
|
|
6503
|
+
* on Android. Empty while it isn't known.
|
|
6504
|
+
*
|
|
6505
|
+
* The native main thread's SystemInfo lacks it, so there it comes from the
|
|
6506
|
+
* host app's `osVersion` global prop, or else from the background thread,
|
|
6507
|
+
* which answers shortly after the first frame. It reads a signal, so a
|
|
6508
|
+
* `computed()` that reads it updates when the answer arrives.
|
|
6509
|
+
*/
|
|
6510
|
+
get osVersion(): string;
|
|
6511
|
+
/**
|
|
6512
|
+
* Physical pixel width of the device screen.
|
|
6513
|
+
*/
|
|
6514
|
+
get pixelWidth(): number;
|
|
6515
|
+
/**
|
|
6516
|
+
* Physical pixel height of the device screen.
|
|
6517
|
+
*/
|
|
6518
|
+
get pixelHeight(): number;
|
|
6519
|
+
/**
|
|
6520
|
+
* Device pixel ratio (physical pixels per CSS pixel).
|
|
6521
|
+
*/
|
|
6522
|
+
get pixelRatio(): number;
|
|
6523
|
+
/**
|
|
6524
|
+
* The JavaScript engine in use (`'v8'`, `'jsc'`, or `'quickjs'`). Only available on the background thread.
|
|
6525
|
+
*/
|
|
6526
|
+
get runtimeType(): 'v8' | 'jsc' | 'quickjs';
|
|
6527
|
+
/**
|
|
6528
|
+
* Screen width in logical/CSS pixels (`pixelWidth / pixelRatio`).
|
|
6529
|
+
*/
|
|
6530
|
+
get screenWidth(): number;
|
|
6531
|
+
/**
|
|
6532
|
+
* Screen height in logical/CSS pixels (`pixelHeight / pixelRatio`).
|
|
6533
|
+
*/
|
|
6534
|
+
get screenHeight(): number;
|
|
6535
|
+
/**
|
|
6536
|
+
* The theme object, if provided by the host application.
|
|
6537
|
+
*/
|
|
6538
|
+
get theme(): object | undefined;
|
|
6539
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LynxSystemInfo, never>;
|
|
6540
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
6541
|
+
}
|
|
6072
6542
|
/**
|
|
6073
6543
|
* CSS `env()` value for the top safe area inset (notch / status bar).
|
|
6074
6544
|
*/
|
|
@@ -6118,9 +6588,10 @@ export declare class LynxSafeArea {
|
|
|
6118
6588
|
*/
|
|
6119
6589
|
readonly isNotchScreen: import("@angular/core").Signal<boolean>;
|
|
6120
6590
|
/**
|
|
6121
|
-
* The current platform (`'iOS'`, `'Android'`, `'
|
|
6591
|
+
* The current platform (`'iOS'`, `'Android'`, `'web'`, etc.). Same as
|
|
6592
|
+
* {@link LynxSystemInfo.platform}.
|
|
6122
6593
|
*/
|
|
6123
|
-
get platform():
|
|
6594
|
+
get platform(): PlatformType;
|
|
6124
6595
|
static ɵfac: i0.ɵɵFactoryDeclaration<LynxSafeArea, never>;
|
|
6125
6596
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
6126
6597
|
}
|
|
@@ -6330,87 +6801,6 @@ export declare class LynxSecureStorage extends PersistentStorage {
|
|
|
6330
6801
|
static ɵfac: i0.ɵɵFactoryDeclaration<LynxSecureStorage, never>;
|
|
6331
6802
|
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
6332
6803
|
}
|
|
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
6804
|
/**
|
|
6415
6805
|
* Wraps `lynx.getTextInfo()` for measuring text dimensions and
|
|
6416
6806
|
* performing line-breaking calculations.
|
|
@@ -6711,7 +7101,7 @@ export declare class LynxWebAuthSession {
|
|
|
6711
7101
|
* Central DI configuration for the Lynx renderer. Must be included in every
|
|
6712
7102
|
* Lynx Angular app's providers (typically via app.config.ts). Sets up:
|
|
6713
7103
|
* 1. The document (LynxDocument, or LynxHydrateDocument for SSR)
|
|
6714
|
-
* 2. DOCUMENT
|
|
7104
|
+
* 2. DOCUMENT: the document stand-in elements' ownerDocument is (global-events)
|
|
6715
7105
|
* 3. APP_BASE_HREF (prevents BrowserPlatformLocation from crashing)
|
|
6716
7106
|
* 4. Renderer factory (creates LynxRenderer / EmulatedLynxRenderer)
|
|
6717
7107
|
* 5. Error handler (routes to _ReportError + __lynxLastError)
|
|
@@ -7163,4 +7553,4 @@ declare global {
|
|
|
7163
7553
|
_wkltId: string;
|
|
7164
7554
|
}, ...args: unknown[]): Promise<unknown>;
|
|
7165
7555
|
}
|
|
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 };
|
|
7556
|
+
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 };
|