effect-browser 0.3.0-beta.24 → 0.3.0-beta.25
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 +333 -157
- package/dist/Action.d.mts +1 -1
- package/dist/Action.mjs +61 -9
- package/dist/Action.mjs.map +1 -1
- package/dist/Browser.d.mts +2 -2
- package/dist/Browser.mjs +2 -2
- package/dist/BrowserError.d.mts +2 -2
- package/dist/BrowserError.mjs +194 -41
- package/dist/BrowserError.mjs.map +1 -1
- package/dist/BrowserEvent.d.mts +1 -1
- package/dist/BrowserEvent.mjs +166 -35
- package/dist/BrowserEvent.mjs.map +1 -1
- package/dist/Cdp.d.mts +15 -0
- package/dist/Cdp.mjs +22 -0
- package/dist/Cdp.mjs.map +1 -0
- package/dist/Change.d.mts +2 -2
- package/dist/Change.mjs +33 -6
- package/dist/Change.mjs.map +1 -1
- package/dist/Frame.d.mts +2 -2
- package/dist/Frame.mjs +132 -14
- package/dist/Frame.mjs.map +1 -1
- package/dist/{Style.d.mts → InputStyle.d.mts} +93 -25
- package/dist/{Style.mjs → InputStyle.mjs} +1 -1
- package/dist/Layout.d.mts +2 -2
- package/dist/Layout.mjs +58 -16
- package/dist/Layout.mjs.map +1 -1
- package/dist/Overlay.d.mts +2 -2
- package/dist/Overlay.mjs +33 -5
- package/dist/Overlay.mjs.map +1 -1
- package/dist/Page.d.mts +2 -2
- package/dist/Page.mjs +2 -2
- package/dist/PageTime.d.mts +2 -2
- package/dist/PageTime.mjs +13 -3
- package/dist/PageTime.mjs.map +1 -1
- package/dist/Pose.d.mts +2 -2
- package/dist/Pose.mjs +30 -9
- package/dist/Pose.mjs.map +1 -1
- package/dist/Site.d.mts +288 -18
- package/dist/Site.mjs +11 -3
- package/dist/Site.mjs.map +1 -1
- package/dist/Snapshot.d.mts +2 -2
- package/dist/Snapshot.mjs +87 -6
- package/dist/Snapshot.mjs.map +1 -1
- package/dist/Text.d.mts +2 -0
- package/dist/Text.mjs +45 -0
- package/dist/Text.mjs.map +1 -0
- package/dist/Window.d.mts +2 -2
- package/dist/Window.mjs +31 -6
- package/dist/Window.mjs.map +1 -1
- package/dist/ai/BrowserTools.d.mts +4987 -0
- package/dist/ai/BrowserTools.mjs +3 -0
- package/dist/ai/PageControl.d.mts +286 -0
- package/dist/ai/PageControl.mjs +426 -0
- package/dist/ai/PageControl.mjs.map +1 -0
- package/dist/ai/PromptCache.d.mts +16 -0
- package/dist/ai/PromptCache.mjs +72 -0
- package/dist/ai/PromptCache.mjs.map +1 -0
- package/dist/ai/Tabs.d.mts +2 -0
- package/dist/ai/Tabs.mjs +72 -0
- package/dist/ai/Tabs.mjs.map +1 -0
- package/dist/ai/ToolError.d.mts +34 -0
- package/dist/ai/ToolError.mjs +2 -0
- package/dist/ai/index.d.mts +6 -0
- package/dist/ai/index.mjs +6 -0
- package/dist/index.d.mts +7 -18
- package/dist/index.mjs +6 -9
- package/dist/{Action-24sLOubi.d.mts → internal/Action-CkanNTUw.d.mts} +64 -4
- package/dist/{Browser-DGR6ZEYo.d.mts → internal/Browser-DD9Vm1c-.d.mts} +75 -11
- package/dist/{Browser-CAQFhTkM.mjs → internal/Browser-vzD7i2oj.mjs} +174 -237
- package/dist/internal/Browser-vzD7i2oj.mjs.map +1 -0
- package/dist/{BrowserError-BlcmLVzn.d.mts → internal/BrowserError-CsuRYcDX.d.mts} +187 -28
- package/dist/{BrowserEvent-C2p-NwuU.d.mts → internal/BrowserEvent-tGPYYf6R.d.mts} +168 -13
- package/dist/internal/BrowserTools-Yi3lOX4h.mjs +497 -0
- package/dist/internal/BrowserTools-Yi3lOX4h.mjs.map +1 -0
- package/dist/{Style-T3ezDYLI.mjs → internal/InputStyle-CPzxoN4g.mjs} +75 -20
- package/dist/internal/InputStyle-CPzxoN4g.mjs.map +1 -0
- package/dist/{moment/Moment.mjs → internal/Moment-CstaX1mR.mjs} +49 -16
- package/dist/internal/Moment-CstaX1mR.mjs.map +1 -0
- package/dist/{moment/Moment.d.mts → internal/Moment-DOcldBdf.d.mts} +53 -20
- package/dist/internal/Page-BfGxn7oN.d.mts +1553 -0
- package/dist/{Page-BaAOshxo.mjs → internal/Page-DqF-tuTx.mjs} +62 -74
- package/dist/internal/Page-DqF-tuTx.mjs.map +1 -0
- package/dist/internal/Release-CFONkPDP.d.mts +39 -0
- package/dist/internal/Stage-D5ymSXDT.mjs +298 -0
- package/dist/internal/Stage-D5ymSXDT.mjs.map +1 -0
- package/dist/internal/Stillness-DCPeAN1a.mjs +1124 -0
- package/dist/internal/Stillness-DCPeAN1a.mjs.map +1 -0
- package/dist/internal/Supervisor-BcY_QNIY.d.mts +108 -0
- package/dist/internal/Supervisor-BcglY23c.mjs +531 -0
- package/dist/internal/Supervisor-BcglY23c.mjs.map +1 -0
- package/dist/internal/Tabs-dXMscIUQ.d.mts +52 -0
- package/dist/internal/TestPage-CYiYbh63.d.mts +159 -0
- package/dist/internal/ToolError-DArsRS2m.mjs +117 -0
- package/dist/internal/ToolError-DArsRS2m.mjs.map +1 -0
- package/dist/{plan/index.d.mts → internal/Walk-BNXcfZ2z.d.mts} +59 -35
- package/dist/{plan/index.mjs → internal/Walk-C5ky7uSf.mjs} +83 -51
- package/dist/internal/Walk-C5ky7uSf.mjs.map +1 -0
- package/dist/{ActionPort.mjs → internal/action-port-B5EkeGOR.mjs} +6 -12
- package/dist/internal/action-port-B5EkeGOR.mjs.map +1 -0
- package/dist/internal/cdp/workerd.d.mts +13 -0
- package/dist/internal/cdp/workerd.mjs +19 -0
- package/dist/internal/cdp/workerd.mjs.map +1 -0
- package/dist/{Clock.mjs → internal/clock-BKSAEf00.mjs} +13 -13
- package/dist/internal/clock-BKSAEf00.mjs.map +1 -0
- package/dist/{connection-Db-YtlbE.d.mts → internal/connection-BaB0vp1o.d.mts} +6 -6
- package/dist/{connection-C_jWYIwe.mjs → internal/connection-C2X4GmXM.mjs} +19 -15
- package/dist/internal/connection-C2X4GmXM.mjs.map +1 -0
- package/dist/internal/events-DzCrww-y.mjs +72 -0
- package/dist/internal/events-DzCrww-y.mjs.map +1 -0
- package/dist/internal/fold.inpage-uhrT-dOB.mjs +49 -0
- package/dist/internal/fold.inpage-uhrT-dOB.mjs.map +1 -0
- package/dist/internal/functions-jBOs6GKv.mjs +27 -0
- package/dist/internal/functions-jBOs6GKv.mjs.map +1 -0
- package/dist/{Geometry-DJx9qrYy.d.mts → internal/geometry-Dhj_ztJs.d.mts} +3 -3
- package/dist/{Geometry.mjs → internal/geometry-Lxyflb9J.mjs} +3 -12
- package/dist/internal/geometry-Lxyflb9J.mjs.map +1 -0
- package/dist/{Matching.mjs → internal/matching-Cs-UeOY0.mjs} +3 -3
- package/dist/internal/matching-Cs-UeOY0.mjs.map +1 -0
- package/dist/internal/page-DFQb-YOK.mjs +436 -0
- package/dist/internal/page-DFQb-YOK.mjs.map +1 -0
- package/dist/{pose.inpage-CLq7Mfdr.mjs → internal/pose.inpage-CBFeWcVa.mjs} +2 -48
- package/dist/internal/pose.inpage-CBFeWcVa.mjs.map +1 -0
- package/dist/{Url.mjs → internal/url-DB0pQYk6.mjs} +3 -12
- package/dist/internal/url-DB0pQYk6.mjs.map +1 -0
- package/dist/policy/Policy.d.mts +60 -6
- package/dist/policy/Policy.mjs +52 -9
- package/dist/policy/Policy.mjs.map +1 -1
- package/dist/policy/index.d.mts +2 -0
- package/dist/policy/index.mjs +2 -0
- package/dist/{film → presentation}/Film.d.mts +83 -16
- package/dist/{film → presentation}/Film.mjs +82 -30
- package/dist/presentation/Film.mjs.map +1 -0
- package/dist/presentation/Motion.d.mts +5 -1
- package/dist/presentation/Motion.mjs +16 -2
- package/dist/presentation/Motion.mjs.map +1 -1
- package/dist/presentation/Presentation.d.mts +42 -7
- package/dist/presentation/Presentation.mjs +26 -9
- package/dist/presentation/Presentation.mjs.map +1 -1
- package/dist/presentation/Stage.d.mts +40 -6
- package/dist/presentation/Stage.mjs +1 -262
- package/dist/presentation/index.d.mts +5 -0
- package/dist/presentation/index.mjs +5 -0
- package/dist/supervisor/Release.d.mts +2 -0
- package/dist/supervisor/Release.mjs +40 -0
- package/dist/supervisor/Release.mjs.map +1 -0
- package/dist/supervisor/Supervisor.d.mts +2 -104
- package/dist/supervisor/Supervisor.mjs +2 -515
- package/dist/supervisor/index.d.mts +3 -0
- package/dist/supervisor/index.mjs +3 -0
- package/dist/testing/HttpCassette.d.mts +98 -0
- package/dist/testing/HttpCassette.mjs +146 -0
- package/dist/testing/HttpCassette.mjs.map +1 -0
- package/dist/testing/Story.d.mts +31 -0
- package/dist/testing/Story.mjs +76 -0
- package/dist/testing/Story.mjs.map +1 -0
- package/dist/testing/TestBrowser.d.mts +191 -0
- package/dist/testing/TestBrowser.mjs +105 -0
- package/dist/testing/TestBrowser.mjs.map +1 -0
- package/dist/testing/TestModel.d.mts +133 -0
- package/dist/testing/TestModel.mjs +209 -0
- package/dist/testing/TestModel.mjs.map +1 -0
- package/dist/testing/TestPage.d.mts +2 -0
- package/dist/testing/TestPage.mjs +47 -0
- package/dist/testing/TestPage.mjs.map +1 -0
- package/dist/testing/index.d.mts +6 -311
- package/dist/testing/index.mjs +6 -521
- package/dist/timeline/Moment.d.mts +3 -0
- package/dist/timeline/Moment.mjs +3 -0
- package/dist/timeline/Stillness.d.mts +34 -0
- package/dist/timeline/Stillness.mjs +2 -0
- package/dist/timeline/index.d.mts +3 -0
- package/dist/timeline/index.mjs +3 -0
- package/dist/walk/Walk.d.mts +2 -0
- package/dist/walk/Walk.mjs +2 -0
- package/dist/walk/index.d.mts +2 -0
- package/dist/walk/index.mjs +2 -0
- package/package.json +54 -163
- package/src/Action.ts +73 -8
- package/src/Browser.ts +75 -9
- package/src/BrowserError.ts +258 -63
- package/src/BrowserEvent.ts +252 -55
- package/src/Cdp.ts +42 -0
- package/src/Change.ts +68 -3
- package/src/Frame.ts +247 -14
- package/src/{Style.ts → InputStyle.ts} +98 -22
- package/src/Layout.ts +95 -24
- package/src/Overlay.ts +42 -3
- package/src/Page.ts +144 -320
- package/src/PageTime.ts +29 -4
- package/src/Pose.ts +38 -7
- package/src/Site.ts +15 -3
- package/src/Snapshot.ts +179 -3
- package/src/Text.ts +60 -0
- package/src/Window.ts +53 -3
- package/src/ai/BrowserTools.ts +778 -0
- package/src/ai/PageControl.ts +702 -0
- package/src/ai/PromptCache.ts +87 -0
- package/src/ai/Tabs.ts +84 -0
- package/src/ai/ToolError.ts +50 -0
- package/src/ai/index.ts +36 -0
- package/src/ai/internal/crops.ts +38 -0
- package/src/ai/internal/points.ts +57 -0
- package/src/ai/internal/receipts.ts +107 -0
- package/src/index.ts +83 -6
- package/src/{ActionPort.ts → internal/action-port.ts} +3 -3
- package/src/{providers → internal/cdp}/connection.ts +19 -12
- package/src/internal/cdp/workerd.ts +36 -0
- package/src/{Clock.ts → internal/clock.ts} +20 -0
- package/src/internal/input/actions.ts +1 -1
- package/src/internal/input/dispatch.ts +2 -2
- package/src/internal/input/guard.inpage.ts +1 -1
- package/src/internal/input/guard.ts +1 -1
- package/src/internal/input/perform.ts +5 -5
- package/src/internal/input/pointer.ts +2 -2
- package/src/internal/input/targets.inpage.ts +3 -3
- package/src/{Matching.ts → internal/matching.ts} +6 -6
- package/src/internal/page/bridge.ts +2 -2
- package/src/internal/page/clock.inpage.ts +1 -1
- package/src/internal/page/compose.inpage.ts +2 -2
- package/src/internal/page/context.ts +2 -2
- package/src/internal/page/functions.ts +84 -0
- package/src/internal/page/navigation.ts +1 -1
- package/src/internal/page/openings.ts +2 -2
- package/src/internal/page/page.ts +33 -35
- package/src/internal/page/port.ts +14 -8
- package/src/internal/page/replies.ts +1 -1
- package/src/internal/page/requests.ts +1 -1
- package/src/internal/page/scripts.ts +1 -1
- package/src/internal/page/time.ts +1 -1
- package/src/internal/pictures/capture.ts +1 -4
- package/src/internal/pictures/dimensions.ts +1 -1
- package/src/internal/pictures/frame.ts +1 -1
- package/src/internal/pictures/pictures.ts +53 -61
- package/src/internal/reading/context.inpage.ts +2 -2
- package/src/internal/reading/expect.inpage.ts +1 -1
- package/src/internal/reading/layout.inpage.ts +3 -3
- package/src/internal/reading/layout.ts +5 -5
- package/src/internal/reading/outline.inpage.ts +3 -3
- package/src/internal/reading/reading.ts +11 -19
- package/src/internal/reading/ready.inpage.ts +2 -2
- package/src/internal/reading/ready.ts +3 -2
- package/src/internal/reading/subjects.inpage.ts +3 -3
- package/src/internal/reading/text.inpage.ts +2 -2
- package/src/internal/reading/walk.inpage.ts +1 -1
- package/src/internal/timeline/changes.inpage.ts +2 -2
- package/src/internal/timeline/changes.ts +3 -4
- package/src/internal/timeline/sight.inpage.ts +2 -2
- package/src/internal/timeline/window.ts +3 -4
- package/src/policy/Policy.ts +70 -16
- package/src/policy/index.ts +12 -0
- package/src/{film → presentation}/Film.ts +104 -37
- package/src/presentation/Motion.ts +45 -3
- package/src/presentation/Presentation.ts +47 -14
- package/src/presentation/Stage.ts +73 -35
- package/src/presentation/index.ts +30 -0
- package/src/presentation/{feed.ts → internal/feed.ts} +1 -1
- package/src/supervisor/Release.ts +45 -0
- package/src/supervisor/Supervisor.ts +80 -5
- package/src/supervisor/index.ts +18 -0
- package/src/supervisor/{contract.ts → internal/contract.ts} +14 -10
- package/src/supervisor/{lifecycle.ts → internal/lifecycle.ts} +7 -7
- package/src/supervisor/{runtime.ts → internal/runtime.ts} +7 -7
- package/src/testing/HttpCassette.ts +260 -0
- package/src/testing/Story.ts +103 -0
- package/src/testing/TestBrowser.ts +14 -4
- package/src/testing/TestModel.ts +297 -0
- package/src/testing/TestPage.ts +92 -4
- package/src/testing/index.ts +35 -1
- package/src/testing/{evidence.ts → internal/evidence.ts} +19 -11
- package/src/testing/{model.ts → internal/model.ts} +14 -8
- package/src/testing/{page.ts → internal/page.ts} +55 -56
- package/src/{moment → timeline}/Moment.ts +79 -29
- package/src/{stillness → timeline}/Stillness.ts +61 -43
- package/src/timeline/index.ts +18 -0
- package/src/{stillness/Pixels.ts → timeline/internal/pixels.ts} +2 -2
- package/src/{moment → timeline/internal}/words.ts +2 -2
- package/src/walk/Walk.ts +165 -0
- package/src/walk/index.ts +12 -0
- package/src/{plan → walk/internal}/choose.ts +23 -14
- package/src/{plan → walk/internal}/data.ts +37 -14
- package/src/{plan → walk/internal}/execute.ts +79 -36
- package/src/{plan → walk/internal}/record.ts +6 -6
- package/src/{plan → walk/internal}/targets.ts +35 -25
- package/dist/ActionPort.d.mts +0 -15
- package/dist/ActionPort.mjs.map +0 -1
- package/dist/Browser-CAQFhTkM.mjs.map +0 -1
- package/dist/Change-CxT1mp2e.d.mts +0 -80
- package/dist/Clock-Du5nP-nK.d.mts +0 -57
- package/dist/Clock.d.mts +0 -2
- package/dist/Clock.mjs.map +0 -1
- package/dist/Frame-UEH2hO5T.d.mts +0 -124
- package/dist/Geometry.d.mts +0 -2
- package/dist/Geometry.mjs.map +0 -1
- package/dist/Matching-MtcWZ_hA.d.mts +0 -266
- package/dist/Matching.d.mts +0 -2
- package/dist/Matching.mjs.map +0 -1
- package/dist/Overlay-CoGw5tL_.d.mts +0 -27
- package/dist/Page-BaAOshxo.mjs.map +0 -1
- package/dist/Page-CLzh5E9w.d.mts +0 -718
- package/dist/PageTime-68UPUZpZ.d.mts +0 -29
- package/dist/Pose-2qqGzPvb.d.mts +0 -32
- package/dist/Released-tURbFmal.d.mts +0 -15
- package/dist/Snapshot-CtBVOtuu.d.mts +0 -73
- package/dist/Stillness-BwP0RdI4.mjs +0 -157
- package/dist/Stillness-BwP0RdI4.mjs.map +0 -1
- package/dist/Style-T3ezDYLI.mjs.map +0 -1
- package/dist/Url-B7P-TWwL.d.mts +0 -26
- package/dist/Url.d.mts +0 -2
- package/dist/Url.mjs.map +0 -1
- package/dist/Window-BDa8MtNP.d.mts +0 -34
- package/dist/connection-C_jWYIwe.mjs.map +0 -1
- package/dist/film/Film.mjs.map +0 -1
- package/dist/moment/Moment.mjs.map +0 -1
- package/dist/plan/index.mjs.map +0 -1
- package/dist/pose.inpage-CLq7Mfdr.mjs.map +0 -1
- package/dist/presentation/Stage.mjs.map +0 -1
- package/dist/presentation/feed.d.mts +0 -20
- package/dist/presentation/feed.mjs +0 -18
- package/dist/presentation/feed.mjs.map +0 -1
- package/dist/providers/Cdp.d.mts +0 -9
- package/dist/providers/Cdp.mjs +0 -15
- package/dist/providers/Cdp.mjs.map +0 -1
- package/dist/providers/Chromium.d.mts +0 -32
- package/dist/providers/Chromium.mjs +0 -55
- package/dist/providers/Chromium.mjs.map +0 -1
- package/dist/providers/Released.d.mts +0 -2
- package/dist/providers/Released.mjs +0 -12
- package/dist/providers/Released.mjs.map +0 -1
- package/dist/stillness/Stillness.d.mts +0 -12
- package/dist/stillness/Stillness.mjs +0 -2
- package/dist/supervisor/Supervisor.mjs.map +0 -1
- package/dist/testing/index.mjs.map +0 -1
- package/dist/workerd/Cdp.d.mts +0 -8
- package/dist/workerd/Cdp.mjs +0 -13
- package/dist/workerd/Cdp.mjs.map +0 -1
- package/src/plan/index.ts +0 -36
- package/src/providers/Cdp.ts +0 -16
- package/src/providers/Chromium.ts +0 -99
- package/src/providers/Released.ts +0 -13
- package/src/workerd/Cdp.ts +0 -11
- /package/dist/{fold.inpage-CyVZQHZL.d.mts → internal/fold.inpage-CyVZQHZL.d.mts} +0 -0
- /package/dist/{rolldown-runtime-D7D4PA-g.mjs → internal/rolldown-runtime-D7D4PA-g.mjs} +0 -0
- /package/src/{Geometry.ts → internal/geometry.ts} +0 -0
- /package/src/{Url.ts → internal/url.ts} +0 -0
- /package/src/{stillness → timeline/internal}/utilsBundle.d.ts +0 -0
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { x as Subject } from "./BrowserEvent-C2p-NwuU.mjs";
|
|
2
|
-
import { Schema } from "effect";
|
|
3
|
-
declare namespace Change_d_exports {
|
|
4
|
-
export { Change, Changes, Kind };
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* `text` changed; `appeared` and `disappeared`, whether added or removed or shown or hidden;
|
|
8
|
-
* `brief`, appeared and gone again by the window's end; `value`, a field's; `title`, the document's.
|
|
9
|
-
*/
|
|
10
|
-
declare const Kind: Schema.Literals<readonly ["text", "appeared", "disappeared", "brief", "value", "title"]>;
|
|
11
|
-
type Kind = typeof Kind.Type;
|
|
12
|
-
declare const Change_base: Schema.Class<Change, Schema.Struct<{
|
|
13
|
-
readonly kind: Schema.Literals<readonly ["text", "appeared", "disappeared", "brief", "value", "title"]>;
|
|
14
|
-
/**
|
|
15
|
-
* What changed, as the page names it now, or where it was for what went. Its own words are what
|
|
16
|
-
* changed, so its name is empty unless something else names it, as a field's label does.
|
|
17
|
-
*/
|
|
18
|
-
readonly subject: typeof Subject;
|
|
19
|
-
/**
|
|
20
|
-
* Where it is as the changes are read, in viewport CSS pixels, unrounded; for what went, where
|
|
21
|
-
* what it sat in is. A caller can frame what an input did beside the input. Absent for the title
|
|
22
|
-
* and for what is drawn nowhere, as what was hidden is.
|
|
23
|
-
*/
|
|
24
|
-
readonly box: Schema.optional<Schema.Struct<{
|
|
25
|
-
readonly x: Schema.Finite;
|
|
26
|
-
readonly y: Schema.Finite;
|
|
27
|
-
readonly width: Schema.Finite;
|
|
28
|
-
readonly height: Schema.Finite;
|
|
29
|
-
}>>;
|
|
30
|
-
/** When it first changed in the window, in host monotonic milliseconds on the browser's clock. */
|
|
31
|
-
readonly startedAt: Schema.Finite;
|
|
32
|
-
/** When it last changed in the window. */
|
|
33
|
-
readonly at: Schema.Finite;
|
|
34
|
-
/**
|
|
35
|
-
* What it showed at the window's start; absent for what appeared and where the record let that go.
|
|
36
|
-
* What disappeared says what it showed as it went. A field's value reads `••••` unless unmasked.
|
|
37
|
-
*/
|
|
38
|
-
readonly before: Schema.optional<Schema.String>;
|
|
39
|
-
/** What it showed at the window's end; absent for what disappeared. What came and went says what it showed. */
|
|
40
|
-
readonly after: Schema.optional<Schema.String>;
|
|
41
|
-
/** How many times what it showed changed in the window. */
|
|
42
|
-
readonly count: Schema.Int;
|
|
43
|
-
/** For a number that changed more than once, its lowest and highest, as shown. */
|
|
44
|
-
readonly lowest: Schema.optional<Schema.String>;
|
|
45
|
-
readonly highest: Schema.optional<Schema.String>;
|
|
46
|
-
/** When it last changed before the window, as far back as the record keeps: in flux, not news. */
|
|
47
|
-
readonly earlier: Schema.optional<Schema.Finite>;
|
|
48
|
-
/**
|
|
49
|
-
* When the trusted input it followed reached the page, where it was that input's doing. It was not
|
|
50
|
-
* in flux: in the 10 s before the input it had not changed, and nothing had come into or left what
|
|
51
|
-
* it sits in, so a ticker's tick or a feed's line is not. Then it changed within 3 s inside what
|
|
52
|
-
* the input acted on or its row, form, dialog or controlled element; or, elsewhere, within 500 ms
|
|
53
|
-
* of an input on a page where nothing had changed in the 2 s before, as a menu a portal puts at
|
|
54
|
-
* the end of the page does. What holds the input's target, as a menu holds its item, does not
|
|
55
|
-
* count against it. The page's `Action` that sent it holds that time.
|
|
56
|
-
*/
|
|
57
|
-
readonly cause: Schema.optional<Schema.Finite>;
|
|
58
|
-
}>, {}>;
|
|
59
|
-
declare class Change extends Change_base {}
|
|
60
|
-
declare const Changes_base: Schema.Class<Changes, Schema.Struct<{
|
|
61
|
-
/** The page's document these changes belong to, as `Navigated` counts them. */
|
|
62
|
-
readonly document: Schema.Int;
|
|
63
|
-
/** Where the record is whole: before it, changes may be missing. */
|
|
64
|
-
readonly from: Schema.Finite;
|
|
65
|
-
/** Where the window ends: its `until`, or when the page was read. */
|
|
66
|
-
readonly until: Schema.Finite;
|
|
67
|
-
/**
|
|
68
|
-
* Where the window ends on the page's own clock. Give these changes as the next read's `since` and
|
|
69
|
-
* the two windows meet exactly, whatever the clock mapping does meanwhile.
|
|
70
|
-
*/
|
|
71
|
-
readonly cursor: Schema.Finite;
|
|
72
|
-
/** Changes in the window the record let go, at least; 0 when it kept them all. */
|
|
73
|
-
readonly dropped: Schema.Int;
|
|
74
|
-
/** Oldest first, by when each began to change. */
|
|
75
|
-
readonly changes: Schema.$Array<typeof Change>;
|
|
76
|
-
}>, {}>;
|
|
77
|
-
declare class Changes extends Changes_base {}
|
|
78
|
-
//#endregion
|
|
79
|
-
export { Kind as i, Change_d_exports as n, Changes as r, Change as t };
|
|
80
|
-
//# sourceMappingURL=Change-CxT1mp2e.d.mts.map
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { Clock, Effect, Option } from "effect";
|
|
2
|
-
declare namespace Clock_d_exports {
|
|
3
|
-
export { Estimate, Mapping, Probe, estimate, mapping, monotonicMillis, supersedes, toBrowserSeconds, toHostTime, uncertaintyAt };
|
|
4
|
-
}
|
|
5
|
-
/** Read the captured owner's clock, including from native callbacks, without changing its origin. */
|
|
6
|
-
declare const monotonicMillis: (clock: Clock.Clock) => number;
|
|
7
|
-
interface Probe {
|
|
8
|
-
readonly hostStart: number;
|
|
9
|
-
readonly hostEnd: number;
|
|
10
|
-
readonly browserTime: number;
|
|
11
|
-
}
|
|
12
|
-
interface Estimate {
|
|
13
|
-
/** Browser epoch milliseconds minus the owner's host monotonic milliseconds. */
|
|
14
|
-
readonly offsetMillis: number;
|
|
15
|
-
/** Either transport direction can own the entire round trip; symmetry is not assumed. */
|
|
16
|
-
readonly uncertaintyMillis: number;
|
|
17
|
-
readonly roundTripMillis: number;
|
|
18
|
-
readonly sampledAt: number;
|
|
19
|
-
}
|
|
20
|
-
/** The fastest complete probe limits uncertainty without mistaking transit delay for clock offset. */
|
|
21
|
-
declare const estimate: (probes: ReadonlyArray<Probe>) => Option.Option<Estimate>;
|
|
22
|
-
/** An estimate's uncertainty at `hostTime`, wider the further that is from when it was sampled. */
|
|
23
|
-
declare const uncertaintyAt: (estimate: Estimate, hostTime: number) => number;
|
|
24
|
-
/**
|
|
25
|
-
* The browser's one epoch mapping, shared by its pages, input runs and capture generations. It is
|
|
26
|
-
* measured on first need, by the first capture, never ahead of it.
|
|
27
|
-
*/
|
|
28
|
-
interface Mapping {
|
|
29
|
-
/** The latest estimate, without measuring: input uses it, and never waits for one. */
|
|
30
|
-
readonly latest: () => Estimate | undefined;
|
|
31
|
-
/** The latest estimate, measured through `measure` only while the browser has none. */
|
|
32
|
-
readonly current: <E>(measure: Effect.Effect<Estimate, E>) => Effect.Effect<Estimate, E>;
|
|
33
|
-
/**
|
|
34
|
-
* Measure again once ten seconds have passed since the latest measurement began. A failed
|
|
35
|
-
* measurement keeps the estimate, which keeps widening with its age.
|
|
36
|
-
*/
|
|
37
|
-
readonly renew: <E>(measure: Effect.Effect<Estimate, E>) => Effect.Effect<void>;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Whether a new measurement should replace the current estimate. Each interval contains the true
|
|
41
|
-
* offset, so overlapping intervals agree and the narrower one is kept, the current one widened by
|
|
42
|
-
* its age: a probe delayed behind a busy page cannot widen every tab's stamps. A disjoint
|
|
43
|
-
* measurement means the clocks moved (a wall clock step, or drift between a remote browser and
|
|
44
|
-
* this host), so the newer evidence wins.
|
|
45
|
-
*/
|
|
46
|
-
declare const supersedes: (next: Estimate, current: Estimate) => boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Every renderer of a browser reads the same host wall clock, so the offset belongs to the
|
|
49
|
-
* browser rather than a page. A busy page cannot fail work that an earlier estimate can serve.
|
|
50
|
-
*/
|
|
51
|
-
declare const mapping: (now: () => number) => Mapping;
|
|
52
|
-
declare const toHostTime: (calibration: Estimate, browserEpochMillis: number) => number;
|
|
53
|
-
/** CDP input timestamps use seconds, unlike browser frame timestamps and the owner's clock. */
|
|
54
|
-
declare const toBrowserSeconds: (calibration: Estimate, hostMillis: number) => number;
|
|
55
|
-
//#endregion
|
|
56
|
-
export { estimate as a, supersedes as c, uncertaintyAt as d, Probe as i, toBrowserSeconds as l, Estimate as n, mapping as o, Mapping as r, monotonicMillis as s, Clock_d_exports as t, toHostTime as u };
|
|
57
|
-
//# sourceMappingURL=Clock-Du5nP-nK.d.mts.map
|
package/dist/Clock.d.mts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { a as estimate, c as supersedes, d as uncertaintyAt, i as Probe, l as toBrowserSeconds, n as Estimate, o as mapping, r as Mapping, s as monotonicMillis, u as toHostTime } from "./Clock-Du5nP-nK.mjs";
|
|
2
|
-
export { Estimate, Mapping, Probe, estimate, mapping, monotonicMillis, supersedes, toBrowserSeconds, toHostTime, uncertaintyAt };
|
package/dist/Clock.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Clock.mjs","names":[],"sources":["../src/Clock.ts"],"sourcesContent":["/**\n * Host monotonic milliseconds and the browser's clock read on the owner's: estimates of their\n * offset from timed probes, how an estimate ages, and the mapping a browser's pages share.\n * `pictures.ts` takes the probes.\n */\nimport { type Clock, Duration, Effect, Option, Semaphore } from \"effect\";\n\n/** Read the captured owner's clock, including from native callbacks, without changing its origin. */\nexport const monotonicMillis = (clock: Clock.Clock): number =>\n Number(clock.monotonicTimeNanosUnsafe()) / 1e6;\n\nexport interface Probe {\n readonly hostStart: number;\n readonly hostEnd: number;\n readonly browserTime: number;\n}\n\nexport interface Estimate {\n /** Browser epoch milliseconds minus the owner's host monotonic milliseconds. */\n readonly offsetMillis: number;\n /** Either transport direction can own the entire round trip; symmetry is not assumed. */\n readonly uncertaintyMillis: number;\n readonly roundTripMillis: number;\n readonly sampledAt: number;\n}\n\n/** The fastest complete probe limits uncertainty without mistaking transit delay for clock offset. */\nexport const estimate = (probes: ReadonlyArray<Probe>): Option.Option<Estimate> => {\n let best: Estimate | undefined;\n\n for (const probe of probes) {\n const roundTripMillis = probe.hostEnd - probe.hostStart;\n\n if (\n !Number.isFinite(probe.hostStart) ||\n !Number.isFinite(probe.hostEnd) ||\n !Number.isFinite(probe.browserTime) ||\n !Number.isFinite(roundTripMillis) ||\n roundTripMillis < 0\n )\n continue;\n const sampledAt = probe.hostStart + roundTripMillis / 2;\n const offsetMillis = probe.browserTime - sampledAt;\n\n if (\n !Number.isFinite(offsetMillis) ||\n !Number.isFinite(probe.browserTime - probe.hostStart) ||\n !Number.isFinite(probe.browserTime - probe.hostEnd)\n )\n continue;\n if (best === undefined || roundTripMillis < best.roundTripMillis)\n best = {\n offsetMillis,\n uncertaintyMillis: roundTripMillis / 2,\n roundTripMillis,\n sampledAt,\n };\n }\n\n return Option.fromUndefinedOr(best);\n};\n\n// Two machines' clocks drift apart by up to about 100 parts per million, so an estimate says this\n// much less about the offset for each millisecond of its age.\nconst driftPerMillis = 1e-4;\n\n/** An estimate's uncertainty at `hostTime`, wider the further that is from when it was sampled. */\nexport const uncertaintyAt = (estimate: Estimate, hostTime: number): number =>\n estimate.uncertaintyMillis + Math.abs(hostTime - estimate.sampledAt) * driftPerMillis;\n\n// Ten seconds widen an estimate by a millisecond, far less than a remote round trip, so it is\n// measured again no more often than this.\nconst renewAfter = Duration.seconds(10);\n\n/**\n * The browser's one epoch mapping, shared by its pages, input runs and capture generations. It is\n * measured on first need, by the first capture, never ahead of it.\n */\nexport interface Mapping {\n /** The latest estimate, without measuring: input uses it, and never waits for one. */\n readonly latest: () => Estimate | undefined;\n /** The latest estimate, measured through `measure` only while the browser has none. */\n readonly current: <E>(measure: Effect.Effect<Estimate, E>) => Effect.Effect<Estimate, E>;\n /**\n * Measure again once ten seconds have passed since the latest measurement began. A failed\n * measurement keeps the estimate, which keeps widening with its age.\n */\n readonly renew: <E>(measure: Effect.Effect<Estimate, E>) => Effect.Effect<void>;\n}\n\n/**\n * Whether a new measurement should replace the current estimate. Each interval contains the true\n * offset, so overlapping intervals agree and the narrower one is kept, the current one widened by\n * its age: a probe delayed behind a busy page cannot widen every tab's stamps. A disjoint\n * measurement means the clocks moved (a wall clock step, or drift between a remote browser and\n * this host), so the newer evidence wins.\n */\nexport const supersedes = (next: Estimate, current: Estimate): boolean => {\n const aged = uncertaintyAt(current, next.sampledAt);\n\n return (\n next.uncertaintyMillis <= aged ||\n Math.abs(next.offsetMillis - current.offsetMillis) > next.uncertaintyMillis + aged\n );\n};\n\n/**\n * Every renderer of a browser reads the same host wall clock, so the offset belongs to the\n * browser rather than a page. A busy page cannot fail work that an earlier estimate can serve.\n */\nexport const mapping = (now: () => number): Mapping => {\n let latest: Estimate | undefined;\n let measuredAt = Number.NEGATIVE_INFINITY;\n const lock = Semaphore.makeUnsafe(1);\n\n // Called where a measurement is decided, so no other can be decided before this one begins.\n const adopt = <E>(measure: Effect.Effect<Estimate, E>) => {\n measuredAt = now();\n\n return measure.pipe(\n Effect.map((estimate) => {\n if (latest === undefined || supersedes(estimate, latest)) latest = estimate;\n\n return latest;\n }),\n );\n };\n\n return {\n latest: () => latest,\n current: (measure) =>\n Effect.suspend(() =>\n latest === undefined\n ? lock.withPermits(1)(\n Effect.suspend(() =>\n latest === undefined ? adopt(measure) : Effect.succeed(latest),\n ),\n )\n : Effect.succeed(latest),\n ),\n renew: (measure) =>\n lock.withPermits(1)(\n Effect.suspend(() =>\n latest === undefined || now() - measuredAt < Duration.toMillis(renewAfter)\n ? Effect.void\n : Effect.ignore(adopt(measure)),\n ),\n ),\n };\n};\n\nexport const toHostTime = (calibration: Estimate, browserEpochMillis: number): number =>\n browserEpochMillis - calibration.offsetMillis;\n\n/** CDP input timestamps use seconds, unlike browser frame timestamps and the owner's clock. */\nexport const toBrowserSeconds = (calibration: Estimate, hostMillis: number): number =>\n (hostMillis + calibration.offsetMillis) / 1000;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAQA,MAAa,mBAAmB,UAC9B,OAAO,MAAM,yBAAyB,CAAC,IAAI;;AAkB7C,MAAa,YAAY,WAA0D;CACjF,IAAI;CAEJ,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,kBAAkB,MAAM,UAAU,MAAM;EAE9C,IACE,CAAC,OAAO,SAAS,MAAM,SAAS,KAChC,CAAC,OAAO,SAAS,MAAM,OAAO,KAC9B,CAAC,OAAO,SAAS,MAAM,WAAW,KAClC,CAAC,OAAO,SAAS,eAAe,KAChC,kBAAkB,GAElB;EACF,MAAM,YAAY,MAAM,YAAY,kBAAkB;EACtD,MAAM,eAAe,MAAM,cAAc;EAEzC,IACE,CAAC,OAAO,SAAS,YAAY,KAC7B,CAAC,OAAO,SAAS,MAAM,cAAc,MAAM,SAAS,KACpD,CAAC,OAAO,SAAS,MAAM,cAAc,MAAM,OAAO,GAElD;EACF,IAAI,SAAS,KAAA,KAAa,kBAAkB,KAAK,iBAC/C,OAAO;GACL;GACA,mBAAmB,kBAAkB;GACrC;GACA;EACF;CACJ;CAEA,OAAO,OAAO,gBAAgB,IAAI;AACpC;AAIA,MAAM,iBAAiB;;AAGvB,MAAa,iBAAiB,UAAoB,aAChD,SAAS,oBAAoB,KAAK,IAAI,WAAW,SAAS,SAAS,IAAI;AAIzE,MAAM,aAAa,SAAS,QAAQ,EAAE;;;;;;;;AAyBtC,MAAa,cAAc,MAAgB,YAA+B;CACxE,MAAM,OAAO,cAAc,SAAS,KAAK,SAAS;CAElD,OACE,KAAK,qBAAqB,QAC1B,KAAK,IAAI,KAAK,eAAe,QAAQ,YAAY,IAAI,KAAK,oBAAoB;AAElF;;;;;AAMA,MAAa,WAAW,QAA+B;CACrD,IAAI;CACJ,IAAI,aAAa,OAAO;CACxB,MAAM,OAAO,UAAU,WAAW,CAAC;CAGnC,MAAM,SAAY,YAAwC;EACxD,aAAa,IAAI;EAEjB,OAAO,QAAQ,KACb,OAAO,KAAK,aAAa;GACvB,IAAI,WAAW,KAAA,KAAa,WAAW,UAAU,MAAM,GAAG,SAAS;GAEnE,OAAO;EACT,CAAC,CACH;CACF;CAEA,OAAO;EACL,cAAc;EACd,UAAU,YACR,OAAO,cACL,WAAW,KAAA,IACP,KAAK,YAAY,CAAC,CAAC,CACjB,OAAO,cACL,WAAW,KAAA,IAAY,MAAM,OAAO,IAAI,OAAO,QAAQ,MAAM,CAC/D,CACF,IACA,OAAO,QAAQ,MAAM,CAC3B;EACF,QAAQ,YACN,KAAK,YAAY,CAAC,CAAC,CACjB,OAAO,cACL,WAAW,KAAA,KAAa,IAAI,IAAI,aAAa,SAAS,SAAS,UAAU,IACrE,OAAO,OACP,OAAO,OAAO,MAAM,OAAO,CAAC,CAClC,CACF;CACJ;AACF;AAEA,MAAa,cAAc,aAAuB,uBAChD,qBAAqB,YAAY;;AAGnC,MAAa,oBAAoB,aAAuB,gBACrD,aAAa,YAAY,gBAAgB"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { Schema } from "effect";
|
|
2
|
-
declare namespace Frame_d_exports {
|
|
3
|
-
export { BrowserPaint, CaptureStats, Frame, Image, ScreencastOptions, Screenshot, sameCapture };
|
|
4
|
-
}
|
|
5
|
-
declare const Image_base: Schema.Class<Image, Schema.Struct<{
|
|
6
|
-
readonly data: Schema.Uint8Array;
|
|
7
|
-
readonly mediaType: Schema.Literals<readonly ["image/jpeg", "image/png"]>;
|
|
8
|
-
readonly width: Schema.Finite;
|
|
9
|
-
readonly height: Schema.Finite;
|
|
10
|
-
}>, {}>;
|
|
11
|
-
/** An encoded picture with its pixel dimensions. Crops also need their viewport origin. */
|
|
12
|
-
declare class Image extends Image_base {}
|
|
13
|
-
declare const BrowserPaint_base: Schema.Class<BrowserPaint, Schema.TaggedStruct<"BrowserPaint", {
|
|
14
|
-
readonly timestamp: Schema.Finite;
|
|
15
|
-
readonly hostTime: Schema.Finite;
|
|
16
|
-
readonly uncertaintyMillis: Schema.Finite;
|
|
17
|
-
}>, {}>;
|
|
18
|
-
/** Native CDP paint time mapped to the owning host clock, with transport uncertainty retained. */
|
|
19
|
-
declare class BrowserPaint extends BrowserPaint_base {}
|
|
20
|
-
declare const Screenshot_base: Schema.Class<Screenshot, Schema.TaggedStruct<"Screenshot", {
|
|
21
|
-
readonly hostTime: Schema.Finite;
|
|
22
|
-
readonly uncertaintyMillis: Schema.Finite;
|
|
23
|
-
}>, {}>;
|
|
24
|
-
/** A screenshot's host capture interval; it has no native browser paint timestamp. */
|
|
25
|
-
declare class Screenshot extends Screenshot_base {}
|
|
26
|
-
declare const Frame_base: Schema.Class<Frame, Schema.Struct<{
|
|
27
|
-
readonly page: Schema.String;
|
|
28
|
-
/** The page's browser session: its provider's session id, as `Browser.Service.id` gives it. */
|
|
29
|
-
readonly session: Schema.String;
|
|
30
|
-
/** Owning Browser connection; document counters restart on adoption or reattachment. */
|
|
31
|
-
readonly connection: Schema.String;
|
|
32
|
-
/** Native capture identity. Screenshots have no capture generation or sequence. */
|
|
33
|
-
readonly capture: Schema.optionalKey<Schema.Struct<{
|
|
34
|
-
readonly generation: Schema.Int;
|
|
35
|
-
readonly sequence: Schema.Int;
|
|
36
|
-
}>>;
|
|
37
|
-
readonly data: Schema.Uint8Array;
|
|
38
|
-
readonly timing: Schema.Union<readonly [typeof BrowserPaint, typeof Screenshot]>;
|
|
39
|
-
readonly receivedAt: Schema.Finite;
|
|
40
|
-
readonly width: Schema.Finite;
|
|
41
|
-
readonly height: Schema.Finite;
|
|
42
|
-
/**
|
|
43
|
-
* The page's document committed before the frame arrived, as `Navigated` counts them. Just
|
|
44
|
-
* after a commit a browser can still show the old document's paint, so a frame may show the
|
|
45
|
-
* document before its own, never one after it.
|
|
46
|
-
*/
|
|
47
|
-
readonly document: Schema.Int;
|
|
48
|
-
/** The page's address when the frame arrived. */
|
|
49
|
-
readonly url: Schema.String;
|
|
50
|
-
}>, {}>;
|
|
51
|
-
/**
|
|
52
|
-
* An image and its timing evidence. Paint time and screenshot capture time cannot be confused in
|
|
53
|
-
* serialized data. `receivedAt` records delivery on the owning host's monotonic clock; it does
|
|
54
|
-
* not make an old paint current.
|
|
55
|
-
*/
|
|
56
|
-
declare class Frame extends Frame_base {
|
|
57
|
-
get timestamp(): number | undefined;
|
|
58
|
-
get hostTime(): number;
|
|
59
|
-
get image(): Image;
|
|
60
|
-
}
|
|
61
|
-
/** Equal capture lineage survives an image copy; untagged pictures retain object identity only. */
|
|
62
|
-
declare const sameCapture: (frame: Frame, other: Frame | undefined) => boolean;
|
|
63
|
-
declare const CaptureStats_base: Schema.Class<CaptureStats, Schema.Struct<{
|
|
64
|
-
readonly received: Schema.Int;
|
|
65
|
-
readonly accepted: Schema.Int;
|
|
66
|
-
/**
|
|
67
|
-
* Frames Chromium finished encoding after a newer one, dropped rather than reordered. It encodes
|
|
68
|
-
* several at once, so a busy machine makes more of them; none was a paint readers missed.
|
|
69
|
-
*/
|
|
70
|
-
readonly late: Schema.Int;
|
|
71
|
-
readonly missingTimestamp: Schema.Int;
|
|
72
|
-
/**
|
|
73
|
-
* Frames dropped for their size. Most are other captures' frames, which a clipped screenshot
|
|
74
|
-
* draws into a screencast. The rest are the page's own frames of a new size, dropped while still
|
|
75
|
-
* unconfirmed: when another size replaced it, when its capture stopped, or beyond the 16 held.
|
|
76
|
-
*/
|
|
77
|
-
readonly foreignSize: Schema.Int;
|
|
78
|
-
/**
|
|
79
|
-
* Frames discarded while native capture is paused for a library picture and its restoration.
|
|
80
|
-
* A pause can produce no callbacks, so this count may remain zero even when pictures were taken.
|
|
81
|
-
*/
|
|
82
|
-
readonly duringPictures: Schema.Int;
|
|
83
|
-
/**
|
|
84
|
-
* Frames a reader missed by falling behind. Each reader counts its own, so with several readers
|
|
85
|
-
* this can exceed the frames accepted.
|
|
86
|
-
*/
|
|
87
|
-
readonly lost: Schema.Int;
|
|
88
|
-
/**
|
|
89
|
-
* Acknowledgements of frames sent and not yet answered, now, whatever the window. Chromium sends
|
|
90
|
-
* a frame only while few are unacknowledged, so a backlog means fewer frames.
|
|
91
|
-
*/
|
|
92
|
-
readonly ackBacklog: Schema.Int;
|
|
93
|
-
/** Paint-time gaps between consecutive accepted frames. */
|
|
94
|
-
readonly gaps: Schema.Struct<{
|
|
95
|
-
readonly count: Schema.Int;
|
|
96
|
-
readonly totalMillis: Schema.Finite;
|
|
97
|
-
readonly minMillis: Schema.NullOr<Schema.Finite>;
|
|
98
|
-
readonly maxMillis: Schema.NullOr<Schema.Finite>;
|
|
99
|
-
readonly lastMillis: Schema.NullOr<Schema.Finite>;
|
|
100
|
-
}>;
|
|
101
|
-
}>, {}>;
|
|
102
|
-
/**
|
|
103
|
-
* A page's capture counts, over its life or a window of the latest minute: what Chromium sent,
|
|
104
|
-
* what readers got, and why the rest went no further. Frames that came late are counted apart from
|
|
105
|
-
* those a reader lost.
|
|
106
|
-
*/
|
|
107
|
-
declare class CaptureStats extends CaptureStats_base {}
|
|
108
|
-
/**
|
|
109
|
-
* Settings for a page's one native capture. Readers that join a running capture share its
|
|
110
|
-
* settings: one without options accepts them, and one whose explicit options differ fails with
|
|
111
|
-
* `InvalidRequest`.
|
|
112
|
-
*/
|
|
113
|
-
interface ScreencastOptions {
|
|
114
|
-
/** JPEG quality, 0 to 100. Defaults to 80. */
|
|
115
|
-
readonly quality?: number | undefined;
|
|
116
|
-
/** Frames are scaled down to fit this box. Defaults to the viewport in CSS pixels. */
|
|
117
|
-
readonly size?: {
|
|
118
|
-
readonly width: number;
|
|
119
|
-
readonly height: number;
|
|
120
|
-
} | undefined;
|
|
121
|
-
}
|
|
122
|
-
//#endregion
|
|
123
|
-
export { Image as a, sameCapture as c, Frame_d_exports as i, CaptureStats as n, ScreencastOptions as o, Frame as r, Screenshot as s, BrowserPaint as t };
|
|
124
|
-
//# sourceMappingURL=Frame-UEH2hO5T.d.mts.map
|
package/dist/Geometry.d.mts
DELETED
package/dist/Geometry.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Geometry.mjs","names":[],"sources":["../src/Geometry.ts"],"sourcesContent":["/** Viewport geometry and bounded input schedules, independent of presentation planners. */\nimport { Effect, Random, Schema } from \"effect\";\n\nexport const maximumSamples = 2048;\nexport const maximumDurationMillis = 5000;\n\nexport const Point = Schema.Struct({ x: Schema.Finite, y: Schema.Finite });\nexport type Point = typeof Point.Type;\n\nexport const Sample = Schema.Struct({\n ...Point.fields,\n afterMillis: Schema.Finite.check(\n Schema.isGreaterThanOrEqualTo(0),\n Schema.isLessThanOrEqualTo(maximumDurationMillis),\n ),\n});\n\nexport type Sample = typeof Sample.Type;\n\n/** A complete glide: 1 to 2,048 samples whose offsets never decrease. */\nexport const Plan = Schema.Array(Sample).check(\n Schema.isBetweenLength(1, maximumSamples),\n Schema.makeFilter(\n (samples) =>\n samples.every(\n (sample, index) => sample.afterMillis >= (samples[index - 1]?.afterMillis ?? 0),\n ),\n { expected: \"nondecreasing sample offsets\" },\n ),\n);\n\nexport type Plan = typeof Plan.Type;\n\nexport interface Planner {\n /**\n * Offsets start when the performer publishes the plan, before its first input. The browser\n * decodes the result as a `Plan` whose last sample must be exactly `to`. Glide time has a budget\n * of its own, outside the browser's `actionTimeout`, so a drag may glide twice for 5 seconds.\n */\n readonly plan: (from: Point, to: Point) => Effect.Effect<ReadonlyArray<Sample>>;\n}\n\n/** One standard normal draw from the current seeded Effect random source. */\nexport const normal = Effect.gen(function* () {\n const radius = Math.sqrt(-2 * Math.log(1 - (yield* Random.next)));\n\n return radius * Math.cos(2 * Math.PI * (yield* Random.next));\n});\n"],"mappings":";;;;;;;;;;;;AAGA,MAAa,iBAAiB;AAC9B,MAAa,wBAAwB;AAErC,MAAa,QAAQ,OAAO,OAAO;CAAE,GAAG,OAAO;CAAQ,GAAG,OAAO;AAAO,CAAC;AAGzE,MAAa,SAAS,OAAO,OAAO;CAClC,GAAG,MAAM;CACT,aAAa,OAAO,OAAO,MACzB,OAAO,uBAAuB,CAAC,GAC/B,OAAO,oBAAoB,qBAAqB,CAClD;AACF,CAAC;;AAKD,MAAa,OAAO,OAAO,MAAM,MAAM,CAAC,CAAC,MACvC,OAAO,gBAAgB,GAAG,cAAc,GACxC,OAAO,YACJ,YACC,QAAQ,OACL,QAAQ,UAAU,OAAO,gBAAgB,QAAQ,QAAQ,EAAE,EAAE,eAAe,EAC/E,GACF,EAAE,UAAU,+BAA+B,CAC7C,CACF;;AAcA,MAAa,SAAS,OAAO,IAAI,aAAa;CAG5C,OAFe,KAAK,KAAK,KAAK,KAAK,IAAI,KAAK,OAAO,OAAO,KAAK,CAEnD,IAAI,KAAK,IAAI,IAAI,KAAK,MAAM,OAAO,OAAO,KAAK;AAC7D,CAAC"}
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
import { S as SubjectContext } from "./BrowserEvent-C2p-NwuU.mjs";
|
|
2
|
-
import { i as Point } from "./Geometry-DJx9qrYy.mjs";
|
|
3
|
-
import { R as Picks, s as FindQuery } from "./Page-CLzh5E9w.mjs";
|
|
4
|
-
//#region src/internal/reading/names.inpage.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* In the page: the foundation the other parts build on. It gives elements refs and reads the
|
|
7
|
-
* roles, names and states that the outline and the input checks report.
|
|
8
|
-
*
|
|
9
|
-
* Every `*.inpage.ts` part runs inside the page. The page receives it as source text, so it must
|
|
10
|
-
* stay self-contained: it uses only its parameters, the DOM and what it defines itself.
|
|
11
|
-
*/
|
|
12
|
-
declare const elements: () => {
|
|
13
|
-
adopt: (node: Node) => WeakSet<Node>;
|
|
14
|
-
clean: (value: string | null | undefined, max?: number) => string;
|
|
15
|
-
isInput: (element: Element) => element is HTMLInputElement;
|
|
16
|
-
isTextArea: (element: Element) => element is HTMLTextAreaElement;
|
|
17
|
-
isSelect: (element: Element) => element is HTMLSelectElement;
|
|
18
|
-
isFrame: (element: Element) => element is HTMLIFrameElement;
|
|
19
|
-
isHtml: (element: Element) => element is HTMLElement;
|
|
20
|
-
isButton: (element: Element) => element is HTMLButtonElement;
|
|
21
|
-
isLabel: (element: Element) => element is HTMLLabelElement;
|
|
22
|
-
textOf: (element: Element) => string;
|
|
23
|
-
isElement: (node: Node) => node is Element;
|
|
24
|
-
isDocument: (node: Node) => node is Document;
|
|
25
|
-
isOwn: (node: Node) => boolean;
|
|
26
|
-
textEntry: (element: Element) => boolean;
|
|
27
|
-
};
|
|
28
|
-
declare const names: (native: ReturnType<typeof elements>) => {
|
|
29
|
-
adopt: (node: Node) => WeakSet<Node>;
|
|
30
|
-
clean: (value: string | null | undefined, max?: number) => string;
|
|
31
|
-
isInput: (element: Element) => element is HTMLInputElement;
|
|
32
|
-
isTextArea: (element: Element) => element is HTMLTextAreaElement;
|
|
33
|
-
isSelect: (element: Element) => element is HTMLSelectElement;
|
|
34
|
-
isFrame: (element: Element) => element is HTMLIFrameElement;
|
|
35
|
-
isHtml: (element: Element) => element is HTMLElement;
|
|
36
|
-
isButton: (element: Element) => element is HTMLButtonElement;
|
|
37
|
-
isLabel: (element: Element) => element is HTMLLabelElement;
|
|
38
|
-
textOf: (element: Element) => string;
|
|
39
|
-
isElement: (node: Node) => node is Element;
|
|
40
|
-
isDocument: (node: Node) => node is Document;
|
|
41
|
-
isOwn: (node: Node) => boolean;
|
|
42
|
-
textEntry: (element: Element) => boolean;
|
|
43
|
-
activeElement: () => Element | null;
|
|
44
|
-
containers: Record<string, string>;
|
|
45
|
-
describe: (element: Element) => string;
|
|
46
|
-
inCurrentDocument: (element: Element) => boolean;
|
|
47
|
-
interactiveRoles: Set<string>;
|
|
48
|
-
isDisabled: (element: Element) => boolean;
|
|
49
|
-
isRoot: (node: Node) => node is Document | ShadowRoot;
|
|
50
|
-
isSecret: (element: Element) => boolean;
|
|
51
|
-
lookup: (ref: string) => Element | undefined;
|
|
52
|
-
nameOf: (element: Element, role: string | null) => string;
|
|
53
|
-
parentOf: (element: Element) => Element | null;
|
|
54
|
-
refFor: (element: Element) => string;
|
|
55
|
-
refs: {
|
|
56
|
-
next: number;
|
|
57
|
-
};
|
|
58
|
-
roleOf: (element: Element, structural?: boolean) => string | null;
|
|
59
|
-
};
|
|
60
|
-
type Names = ReturnType<typeof names>;
|
|
61
|
-
//#endregion
|
|
62
|
-
//#region src/internal/reading/walk.inpage.d.ts
|
|
63
|
-
interface Visitor<S> {
|
|
64
|
-
/** The state for the element's children, or undefined to leave them out. */
|
|
65
|
-
readonly enter: (element: Element, style: CSSStyleDeclaration, rect: DOMRect, state: S) => S | undefined;
|
|
66
|
-
/** Whether to visit a child of an element entered with `state`; all by default. */
|
|
67
|
-
readonly admit?: ((child: Element, state: S) => boolean) | undefined;
|
|
68
|
-
/** Each text node of an entered element, in order among its children. */
|
|
69
|
-
readonly text?: ((node: Node, state: S) => void) | undefined;
|
|
70
|
-
/** After the children of an element `enter` went into, with the state it returned. */
|
|
71
|
-
readonly leave?: ((element: Element, state: S) => void) | undefined;
|
|
72
|
-
/** A subtree left out because its box lies outside the viewport, in top-document pixels. */
|
|
73
|
-
readonly outside?: ((rect: DOMRect) => void) | undefined;
|
|
74
|
-
}
|
|
75
|
-
declare const walk: (names: Names) => {
|
|
76
|
-
acts: (element: Element, role: string | null) => boolean;
|
|
77
|
-
boxOf: (element: Element) => {
|
|
78
|
-
x: number;
|
|
79
|
-
y: number;
|
|
80
|
-
width: number;
|
|
81
|
-
height: number;
|
|
82
|
-
};
|
|
83
|
-
controlOf: (hit: Element) => Element;
|
|
84
|
-
hitAt: (root: Document | ShadowRoot, x: number, y: number) => Element | null;
|
|
85
|
-
inView: (rect: DOMRect, width?: number, height?: number) => boolean;
|
|
86
|
-
visible: (element: Element) => boolean;
|
|
87
|
-
visit: <S>(root: Element | null, viewport: boolean, state: S, visitor: Visitor<S>) => void;
|
|
88
|
-
};
|
|
89
|
-
type Walk = ReturnType<typeof walk>;
|
|
90
|
-
//#endregion
|
|
91
|
-
//#region src/internal/reading/context.inpage.d.ts
|
|
92
|
-
/** What one read has learnt of the page: each table's header row and each tree's headings. */
|
|
93
|
-
interface Known {
|
|
94
|
-
readonly headers: Map<Element, Element | null>;
|
|
95
|
-
readonly headings: Map<Node, ReadonlyArray<Element>>;
|
|
96
|
-
}
|
|
97
|
-
declare const context: (names: Names, walked: Walk) => {
|
|
98
|
-
contextOf: (element: Element, read?: Known) => SubjectContext;
|
|
99
|
-
groups: string;
|
|
100
|
-
headingBefore: (target: Element, scope: ParentNode, read?: Known) => string | undefined;
|
|
101
|
-
known: () => Known;
|
|
102
|
-
textBeside: (target: Element, scope: Node, backwards: boolean) => string;
|
|
103
|
-
treeOf: (element: Element) => ParentNode;
|
|
104
|
-
};
|
|
105
|
-
type ContextReader = ReturnType<typeof context>;
|
|
106
|
-
//#endregion
|
|
107
|
-
//#region src/internal/reading/subjects.inpage.d.ts
|
|
108
|
-
declare const states: (names: Names) => (element: Element, role: string | null) => {
|
|
109
|
-
disabled: boolean;
|
|
110
|
-
checked: boolean | undefined;
|
|
111
|
-
expanded: boolean | undefined;
|
|
112
|
-
selected: boolean | undefined;
|
|
113
|
-
pressed: boolean | undefined;
|
|
114
|
-
focused: boolean;
|
|
115
|
-
level: number | undefined;
|
|
116
|
-
};
|
|
117
|
-
declare const subjects: (names: Names, walked: Walk, matching: Match, placing: ContextReader, stateOf: ReturnType<typeof states>) => {
|
|
118
|
-
find: (request: FindRequest) => {
|
|
119
|
-
invalid: string;
|
|
120
|
-
found?: undefined;
|
|
121
|
-
} | {
|
|
122
|
-
invalid?: undefined;
|
|
123
|
-
found: {
|
|
124
|
-
ref: string;
|
|
125
|
-
subject: {
|
|
126
|
-
role: string | null;
|
|
127
|
-
name: string;
|
|
128
|
-
tag: string;
|
|
129
|
-
context: {
|
|
130
|
-
readonly row?: string | undefined;
|
|
131
|
-
readonly column?: string | undefined;
|
|
132
|
-
readonly label?: string | undefined;
|
|
133
|
-
readonly heading?: string | undefined;
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
box: {
|
|
137
|
-
x: number;
|
|
138
|
-
y: number;
|
|
139
|
-
width: number;
|
|
140
|
-
height: number;
|
|
141
|
-
};
|
|
142
|
-
inViewport: boolean;
|
|
143
|
-
state: {
|
|
144
|
-
disabled: boolean;
|
|
145
|
-
checked: boolean | undefined;
|
|
146
|
-
expanded: boolean | undefined;
|
|
147
|
-
selected: boolean | undefined;
|
|
148
|
-
pressed: boolean | undefined;
|
|
149
|
-
focused: boolean;
|
|
150
|
-
level: number | undefined;
|
|
151
|
-
};
|
|
152
|
-
}[];
|
|
153
|
-
};
|
|
154
|
-
elementsOf: (request: FindRequest) => ReadonlyArray<Element> | {
|
|
155
|
-
readonly invalid: string;
|
|
156
|
-
};
|
|
157
|
-
isControl: (element: Element, role: string | null, style: CSSStyleDeclaration, rect: DOMRect, insidePointer: boolean) => boolean;
|
|
158
|
-
stateOf: (element: Element, role: string | null) => {
|
|
159
|
-
disabled: boolean;
|
|
160
|
-
checked: boolean | undefined;
|
|
161
|
-
expanded: boolean | undefined;
|
|
162
|
-
selected: boolean | undefined;
|
|
163
|
-
pressed: boolean | undefined;
|
|
164
|
-
focused: boolean;
|
|
165
|
-
level: number | undefined;
|
|
166
|
-
};
|
|
167
|
-
};
|
|
168
|
-
type Subjects = ReturnType<typeof subjects>;
|
|
169
|
-
//#endregion
|
|
170
|
-
//#region src/internal/reading/layout.inpage.d.ts
|
|
171
|
-
interface PickRequest extends FindRequest {
|
|
172
|
-
readonly id: string;
|
|
173
|
-
readonly choose: "first" | "last" | "smallest" | "largest";
|
|
174
|
-
readonly words: Wanted | null;
|
|
175
|
-
}
|
|
176
|
-
declare const layout: (names: Names, walked: Walk, subjected: Subjects, matching: Match, placing: ContextReader) => {
|
|
177
|
-
read: (picks: ReadonlyArray<PickRequest>) => {
|
|
178
|
-
invalid: string;
|
|
179
|
-
layout?: undefined;
|
|
180
|
-
} | {
|
|
181
|
-
invalid?: undefined;
|
|
182
|
-
layout: {
|
|
183
|
-
url: string;
|
|
184
|
-
viewport: {
|
|
185
|
-
width: number;
|
|
186
|
-
height: number;
|
|
187
|
-
};
|
|
188
|
-
scroll: {
|
|
189
|
-
x: number;
|
|
190
|
-
y: number;
|
|
191
|
-
};
|
|
192
|
-
scale: number;
|
|
193
|
-
places: {
|
|
194
|
-
id: string;
|
|
195
|
-
ref: string;
|
|
196
|
-
subject: {
|
|
197
|
-
role: string | null;
|
|
198
|
-
name: string;
|
|
199
|
-
tag: string;
|
|
200
|
-
context: {
|
|
201
|
-
readonly row?: string | undefined;
|
|
202
|
-
readonly column?: string | undefined;
|
|
203
|
-
readonly label?: string | undefined;
|
|
204
|
-
readonly heading?: string | undefined;
|
|
205
|
-
};
|
|
206
|
-
};
|
|
207
|
-
box: {
|
|
208
|
-
x: number;
|
|
209
|
-
y: number;
|
|
210
|
-
width: number;
|
|
211
|
-
height: number;
|
|
212
|
-
};
|
|
213
|
-
fixed: boolean;
|
|
214
|
-
words: {
|
|
215
|
-
text: string;
|
|
216
|
-
box: {
|
|
217
|
-
x: number;
|
|
218
|
-
y: number;
|
|
219
|
-
width: number;
|
|
220
|
-
height: number;
|
|
221
|
-
};
|
|
222
|
-
}[] | undefined;
|
|
223
|
-
}[];
|
|
224
|
-
missing: string[];
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
};
|
|
228
|
-
type Layouts = ReturnType<typeof layout>;
|
|
229
|
-
//#endregion
|
|
230
|
-
//#region src/Matching.d.ts
|
|
231
|
-
/** A string, or a pattern sent to the page as its source and flags. */
|
|
232
|
-
type Wanted = string | {
|
|
233
|
-
readonly source: string;
|
|
234
|
-
readonly flags: string;
|
|
235
|
-
};
|
|
236
|
-
interface FindRequest {
|
|
237
|
-
readonly selector: string | null;
|
|
238
|
-
readonly state: "visible" | "enabled";
|
|
239
|
-
readonly role: string | null;
|
|
240
|
-
readonly name: Wanted | null;
|
|
241
|
-
readonly text: Wanted | null;
|
|
242
|
-
readonly near: string | null;
|
|
243
|
-
readonly at: Point | null;
|
|
244
|
-
readonly scope: "viewport" | "document";
|
|
245
|
-
}
|
|
246
|
-
/** A public query in its serializable, fully specified form. */
|
|
247
|
-
declare const request: (query: FindQuery, scope: FindRequest["scope"]) => FindRequest;
|
|
248
|
-
/** Layout picks in their serializable form. */
|
|
249
|
-
declare const pickRequests: (picks: Picks) => ReadonlyArray<PickRequest>;
|
|
250
|
-
/** What a query is matched against, read only when a rule needs it. */
|
|
251
|
-
interface Candidate {
|
|
252
|
-
readonly role: string | null;
|
|
253
|
-
readonly name: () => string;
|
|
254
|
-
readonly text: () => string;
|
|
255
|
-
readonly context: () => SubjectContext;
|
|
256
|
-
}
|
|
257
|
-
declare const match: () => {
|
|
258
|
-
compile: (request: Pick<FindRequest, "role" | "name" | "text" | "near">) => (candidate: Candidate) => boolean;
|
|
259
|
-
holds: (text: string, value: string) => boolean;
|
|
260
|
-
normalize: (value: string) => string;
|
|
261
|
-
mark: (observations: ReadonlyArray<string>) => string;
|
|
262
|
-
};
|
|
263
|
-
type Match = ReturnType<typeof match>;
|
|
264
|
-
//#endregion
|
|
265
|
-
export { match as a, Layouts as c, Walk as d, Names as f, Wanted as i, Subjects as l, FindRequest as n, pickRequests as o, Match as r, request as s, Candidate as t, ContextReader as u };
|
|
266
|
-
//# sourceMappingURL=Matching-MtcWZ_hA.d.mts.map
|
package/dist/Matching.d.mts
DELETED
package/dist/Matching.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Matching.mjs","names":[],"sources":["../src/Matching.ts"],"sourcesContent":["/**\n * In the page: the rules `find` matches by. It touches no DOM, so it also runs outside a page.\n *\n * - A role matches when it is the same token, ignoring case and the space around it.\n * - A name given as a string matches when the two read the same once their spaces are collapsed,\n * their case folded and their characters given one Unicode form; a pattern matches when it\n * finds itself in the name.\n * - Text matches when it appears, read the same way, in the element's text.\n * - `near` matches when its words appear, whole and in order, in any of the element's context:\n * its row, column, label or heading. Replay chooses among candidates by the same rule.\n */\nimport type { SubjectContext } from \"./BrowserEvent.ts\";\nimport type { Point } from \"./Geometry.ts\";\nimport type { PickRequest } from \"./internal/reading/layout.inpage.ts\";\nimport type { Picks } from \"./Layout.ts\";\nimport type { FindQuery } from \"./Page.ts\";\n\n/** A string, or a pattern sent to the page as its source and flags. */\nexport type Wanted = string | { readonly source: string; readonly flags: string };\n\nexport interface FindRequest {\n readonly selector: string | null;\n readonly state: \"visible\" | \"enabled\";\n readonly role: string | null;\n readonly name: Wanted | null;\n readonly text: Wanted | null;\n readonly near: string | null;\n readonly at: Point | null;\n readonly scope: \"viewport\" | \"document\";\n}\n\nconst wanted = (value: string | RegExp | undefined): Wanted | null =>\n value instanceof RegExp ? { source: value.source, flags: value.flags } : (value ?? null);\n\n/** A public query in its serializable, fully specified form. */\nexport const request = (query: FindQuery, scope: FindRequest[\"scope\"]): FindRequest => ({\n selector: query.selector ?? null,\n state: query.state ?? \"visible\",\n role: query.role ?? null,\n name: wanted(query.name),\n text: wanted(query.text),\n near: query.near ?? null,\n at: query.at ?? null,\n scope: query.scope ?? scope,\n});\n\n/** Layout picks in their serializable form. */\nexport const pickRequests = (picks: Picks): ReadonlyArray<PickRequest> =>\n Object.entries(picks).map(([id, pick]) => ({\n ...request(pick, \"document\"),\n id,\n choose: pick.choose ?? \"first\",\n words: wanted(pick.words),\n }));\n\n/** What a query is matched against, read only when a rule needs it. */\nexport interface Candidate {\n readonly role: string | null;\n readonly name: () => string;\n readonly text: () => string;\n readonly context: () => SubjectContext;\n}\n\nexport const match = () => {\n /**\n * How names, text and context compare: one Unicode form, without invisible format characters,\n * spaces collapsed, and case folded upper first, so that \"ß\" and \"SS\" read the same.\n */\n const normalize = (value: string): string =>\n value\n .normalize(\"NFKC\")\n .replace(/\\p{Cf}/gu, \"\")\n .replace(/\\s+/g, \" \")\n .trim()\n .toUpperCase()\n .toLowerCase();\n\n /** A string that reads the same, or, unless `whole`, appears within; or a pattern found within. */\n const rule = (wanted: Wanted, whole: boolean) => {\n if (typeof wanted !== \"string\") {\n // `g` and `y` keep a position from one test to the next, so one pattern would answer\n // differently for each element. A pattern is tried on the text as the page shows it.\n const found = new RegExp(wanted.source, wanted.flags.replace(/[gy]/g, \"\"));\n\n return (value: string) => found.test(value.replace(/\\s+/g, \" \").trim());\n }\n const target = normalize(wanted);\n\n return whole\n ? (value: string) => normalize(value) === target\n : (value: string) => normalize(value).includes(target);\n };\n\n /** Whether a value's words appear, whole and in order, among a text's: \"BTC\" not in \"WBTC\". */\n const holds = (text: string, value: string) =>\n ` ${normalize(text)} `.includes(` ${normalize(value)} `);\n\n /** Whether a candidate meets every rule a query gives; a rule left out always holds. */\n const compile = (request: Pick<FindRequest, \"role\" | \"name\" | \"text\" | \"near\">) => {\n const role = request.role === null ? null : normalize(request.role);\n const name = request.name === null ? null : rule(request.name, true);\n const text = request.text === null ? null : rule(request.text, false);\n const { near } = request;\n\n return (candidate: Candidate): boolean => {\n if (role !== null && normalize(candidate.role ?? \"\") !== role) return false;\n if (text !== null && !text(candidate.text())) return false;\n if (name !== null && !name(candidate.name())) return false;\n if (near === null) return true;\n const { row, column, label, heading } = candidate.context();\n\n return [row, column, label, heading].some(\n (value) => value !== undefined && holds(value, near),\n );\n };\n };\n\n /** A comparison token for ordered observations, without retaining their text. */\n const mark = (observations: ReadonlyArray<string>): string => {\n let hash = 0x811c9dc5;\n\n for (const shown of observations)\n for (let index = 0; index < shown.length; index++)\n hash = Math.imul(hash ^ shown.charCodeAt(index), 0x01000193);\n\n return `${observations.length}:${(hash >>> 0).toString(16)}`;\n };\n\n return { compile, holds, normalize, mark };\n};\n\nexport type Match = ReturnType<typeof match>;\n"],"mappings":";AA+BA,MAAM,UAAU,UACd,iBAAiB,SAAS;CAAE,QAAQ,MAAM;CAAQ,OAAO,MAAM;AAAM,IAAK,SAAS;;AAGrF,MAAa,WAAW,OAAkB,WAA8C;CACtF,UAAU,MAAM,YAAY;CAC5B,OAAO,MAAM,SAAS;CACtB,MAAM,MAAM,QAAQ;CACpB,MAAM,OAAO,MAAM,IAAI;CACvB,MAAM,OAAO,MAAM,IAAI;CACvB,MAAM,MAAM,QAAQ;CACpB,IAAI,MAAM,MAAM;CAChB,OAAO,MAAM,SAAS;AACxB;;AAGA,MAAa,gBAAgB,UAC3B,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,WAAW;CACzC,GAAG,QAAQ,MAAM,UAAU;CAC3B;CACA,QAAQ,KAAK,UAAU;CACvB,OAAO,OAAO,KAAK,KAAK;AAC1B,EAAE;AAUJ,MAAa,cAAc;;;;;CAKzB,MAAM,aAAa,UACjB,MACG,UAAU,MAAM,CAAC,CACjB,QAAQ,YAAY,EAAE,CAAC,CACvB,QAAQ,QAAQ,GAAG,CAAC,CACpB,KAAK,CAAC,CACN,YAAY,CAAC,CACb,YAAY;;CAGjB,MAAM,QAAQ,QAAgB,UAAmB;EAC/C,IAAI,OAAO,WAAW,UAAU;GAG9B,MAAM,QAAQ,IAAI,OAAO,OAAO,QAAQ,OAAO,MAAM,QAAQ,SAAS,EAAE,CAAC;GAEzE,QAAQ,UAAkB,MAAM,KAAK,MAAM,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC;EACxE;EACA,MAAM,SAAS,UAAU,MAAM;EAE/B,OAAO,SACF,UAAkB,UAAU,KAAK,MAAM,UACvC,UAAkB,UAAU,KAAK,CAAC,CAAC,SAAS,MAAM;CACzD;;CAGA,MAAM,SAAS,MAAc,UAC3B,IAAI,UAAU,IAAI,EAAE,GAAG,SAAS,IAAI,UAAU,KAAK,EAAE,EAAE;;CAGzD,MAAM,WAAW,YAAkE;EACjF,MAAM,OAAO,QAAQ,SAAS,OAAO,OAAO,UAAU,QAAQ,IAAI;EAClE,MAAM,OAAO,QAAQ,SAAS,OAAO,OAAO,KAAK,QAAQ,MAAM,IAAI;EACnE,MAAM,OAAO,QAAQ,SAAS,OAAO,OAAO,KAAK,QAAQ,MAAM,KAAK;EACpE,MAAM,EAAE,SAAS;EAEjB,QAAQ,cAAkC;GACxC,IAAI,SAAS,QAAQ,UAAU,UAAU,QAAQ,EAAE,MAAM,MAAM,OAAO;GACtE,IAAI,SAAS,QAAQ,CAAC,KAAK,UAAU,KAAK,CAAC,GAAG,OAAO;GACrD,IAAI,SAAS,QAAQ,CAAC,KAAK,UAAU,KAAK,CAAC,GAAG,OAAO;GACrD,IAAI,SAAS,MAAM,OAAO;GAC1B,MAAM,EAAE,KAAK,QAAQ,OAAO,YAAY,UAAU,QAAQ;GAE1D,OAAO;IAAC;IAAK;IAAQ;IAAO;GAAO,CAAC,CAAC,MAClC,UAAU,UAAU,KAAA,KAAa,MAAM,OAAO,IAAI,CACrD;EACF;CACF;;CAGA,MAAM,QAAQ,iBAAgD;EAC5D,IAAI,OAAO;EAEX,KAAK,MAAM,SAAS,cAClB,KAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SACxC,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,KAAK,GAAG,QAAU;EAE/D,OAAO,GAAG,aAAa,OAAO,IAAI,SAAS,EAAA,CAAG,SAAS,EAAE;CAC3D;CAEA,OAAO;EAAE;EAAS;EAAO;EAAW;CAAK;AAC3C"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { t as BrowserError } from "./BrowserError-BlcmLVzn.mjs";
|
|
2
|
-
import { r as Box } from "./BrowserEvent-C2p-NwuU.mjs";
|
|
3
|
-
import { Effect, Schema } from "effect";
|
|
4
|
-
declare namespace Overlay_d_exports {
|
|
5
|
-
export { Content, Overlay };
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* What the overlay shows. `Svg` is an SVG document sized to the viewport, whose own `viewBox` maps
|
|
9
|
-
* any design space onto it; its scripts and event handlers are dropped. `Empty` shows nothing.
|
|
10
|
-
*/
|
|
11
|
-
declare const Content: Schema.TaggedUnion<{
|
|
12
|
-
readonly Empty: Schema.TaggedStruct<"Empty", {}>;
|
|
13
|
-
readonly Svg: Schema.TaggedStruct<"Svg", {
|
|
14
|
-
readonly markup: Schema.String;
|
|
15
|
-
}>;
|
|
16
|
-
}>;
|
|
17
|
-
type Content = typeof Content.Type;
|
|
18
|
-
interface Overlay {
|
|
19
|
-
/**
|
|
20
|
-
* Show `content` in place of what was shown, in one call to the page, after the actions asked
|
|
21
|
-
* before it. Says where the drawing's top-level parts are, in viewport CSS pixels.
|
|
22
|
-
*/
|
|
23
|
-
readonly draw: (content: Content) => Effect.Effect<ReadonlyArray<Box>, BrowserError>;
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
|
-
export { Overlay as n, Overlay_d_exports as r, Content as t };
|
|
27
|
-
//# sourceMappingURL=Overlay-CoGw5tL_.d.mts.map
|