effect-browser 0.2.0-beta.9 → 0.3.0-beta.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 +849 -1161
- package/dist/Browser-S4kvpmqa.mjs +605 -0
- package/dist/Browser-S4kvpmqa.mjs.map +1 -0
- package/dist/Browser.d.mts +127 -3
- package/dist/Browser.mjs +2 -22
- package/dist/BrowserError-Coy7EW1N.d.mts +140 -0
- package/dist/BrowserError.d.mts +2 -0
- package/dist/BrowserError.mjs +211 -0
- package/dist/BrowserError.mjs.map +1 -0
- package/dist/BrowserEvent-BRu2juEz.d.mts +279 -0
- package/dist/BrowserEvent.d.mts +2 -0
- package/dist/BrowserEvent.mjs +297 -0
- package/dist/BrowserEvent.mjs.map +1 -0
- package/dist/Cdp.d.mts +32 -0
- package/dist/Cdp.mjs +61 -0
- package/dist/Cdp.mjs.map +1 -0
- package/dist/Change-DNvztNLu.mjs +138 -0
- package/dist/Change-DNvztNLu.mjs.map +1 -0
- package/dist/Change-iMlcuzVD.d.mts +71 -0
- package/dist/Change.d.mts +2 -0
- package/dist/Change.mjs +2 -0
- package/dist/Chromium.d.mts +29 -81
- package/dist/Chromium.mjs +57 -392
- package/dist/Chromium.mjs.map +1 -1
- package/dist/Expect.d.mts +62 -0
- package/dist/Expect.mjs +114 -0
- package/dist/Expect.mjs.map +1 -0
- package/dist/Frame-BERmf_gM.d.mts +117 -0
- package/dist/Frame.d.mts +2 -0
- package/dist/Frame.mjs +123 -0
- package/dist/Frame.mjs.map +1 -0
- package/dist/Moment.d.mts +2 -0
- package/dist/Moment.mjs +288 -0
- package/dist/Moment.mjs.map +1 -0
- package/dist/Motion.d.mts +40 -0
- package/dist/Motion.mjs +122 -0
- package/dist/Motion.mjs.map +1 -0
- package/dist/Page-B5cjaUp5.mjs +618 -0
- package/dist/Page-B5cjaUp5.mjs.map +1 -0
- package/dist/Page-BlPjfibv.d.mts +595 -0
- package/dist/Page.d.mts +2 -0
- package/dist/Page.mjs +2 -0
- package/dist/Plan-BI8XGvDu.d.mts +209 -0
- package/dist/Plan-D1wrJVs8.mjs +508 -0
- package/dist/Plan-D1wrJVs8.mjs.map +1 -0
- package/dist/Plan.d.mts +2 -3
- package/dist/Plan.mjs +2 -2
- package/dist/Policy.d.mts +76 -0
- package/dist/Policy.mjs +237 -0
- package/dist/Policy.mjs.map +1 -0
- package/dist/Presentation.d.mts +48 -0
- package/dist/Presentation.mjs +117 -0
- package/dist/Presentation.mjs.map +1 -0
- package/dist/Snapshot-B34hZ4Jl.d.mts +68 -0
- package/dist/Snapshot.d.mts +2 -0
- package/dist/Snapshot.mjs +79 -0
- package/dist/Snapshot.mjs.map +1 -0
- package/dist/Stage.d.mts +64 -0
- package/dist/Stage.mjs +237 -0
- package/dist/Stage.mjs.map +1 -0
- package/dist/Supervisor-CYWFK3vM.d.mts +280 -0
- package/dist/Supervisor-TNKNOVzu.mjs +599 -0
- package/dist/Supervisor-TNKNOVzu.mjs.map +1 -0
- package/dist/Supervisor.d.mts +2 -0
- package/dist/Supervisor.mjs +2 -0
- package/dist/context-B6xr8nVi.mjs +261 -0
- package/dist/context-B6xr8nVi.mjs.map +1 -0
- package/dist/index.d.mts +17 -14
- package/dist/index.mjs +18 -13
- package/dist/match.inpage-xOe9LNO0.mjs +48 -0
- package/dist/match.inpage-xOe9LNO0.mjs.map +1 -0
- package/dist/page-B8tUQELg.mjs +5073 -0
- package/dist/page-B8tUQELg.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/url-Cd04Okid.mjs +264 -0
- package/dist/url-Cd04Okid.mjs.map +1 -0
- package/package.json +96 -61
- package/src/Browser.ts +666 -0
- package/src/BrowserError.ts +234 -0
- package/src/BrowserEvent.ts +296 -0
- package/src/Cdp.ts +101 -0
- package/src/Change.ts +88 -0
- package/src/Chromium.ts +102 -0
- package/src/Expect.ts +180 -0
- package/src/Frame.ts +130 -0
- package/src/Moment.ts +479 -0
- package/src/Motion.ts +166 -0
- package/src/Page.ts +522 -0
- package/src/Plan.ts +663 -0
- package/src/Policy.ts +325 -0
- package/src/Presentation.ts +195 -0
- package/src/Snapshot.ts +89 -0
- package/src/Stage.ts +467 -0
- package/src/Supervisor.ts +599 -0
- package/src/index.ts +20 -0
- package/src/internal/input/actions.ts +610 -0
- package/src/internal/input/dispatch.ts +161 -0
- package/src/internal/input/edit.inpage.ts +162 -0
- package/src/internal/input/evidence.inpage.ts +164 -0
- package/src/internal/input/gate.ts +224 -0
- package/src/internal/input/guard.inpage.ts +605 -0
- package/src/internal/input/guard.ts +184 -0
- package/src/internal/input/keyboard.ts +112 -0
- package/src/internal/input/keys.ts +127 -0
- package/src/internal/input/perform.ts +376 -0
- package/src/internal/input/pointer.ts +153 -0
- package/src/internal/input/replies.ts +195 -0
- package/src/internal/input/settle.ts +50 -0
- package/src/internal/input/style.ts +186 -0
- package/src/internal/input/targets.inpage.ts +293 -0
- package/src/internal/input/targets.ts +148 -0
- package/src/internal/page/bridge.ts +386 -0
- package/src/internal/page/context.ts +312 -0
- package/src/internal/page/lane.ts +311 -0
- package/src/internal/page/navigation.ts +183 -0
- package/src/internal/page/openings.ts +87 -0
- package/src/internal/page/page.ts +165 -0
- package/src/internal/page/url.ts +100 -0
- package/src/internal/page/viewport.ts +43 -0
- package/src/internal/pictures/capture.ts +776 -0
- package/src/internal/pictures/clock.ts +141 -0
- package/src/internal/pictures/counts.ts +92 -0
- package/src/internal/pictures/pictures.ts +520 -0
- package/src/internal/pictures/transport.ts +242 -0
- package/src/internal/reading/choose.ts +100 -0
- package/src/internal/reading/context.inpage.ts +201 -0
- package/src/internal/reading/controls.inpage.ts +158 -0
- package/src/internal/reading/expect.inpage.ts +70 -0
- package/src/internal/reading/match.inpage.ts +92 -0
- package/src/internal/reading/names.inpage.ts +306 -0
- package/src/internal/reading/outline.inpage.ts +260 -0
- package/src/internal/reading/reading.ts +223 -0
- package/src/internal/reading/ready.inpage.ts +164 -0
- package/src/internal/reading/ready.ts +111 -0
- package/src/internal/reading/subjects.inpage.ts +188 -0
- package/src/internal/reading/text.inpage.ts +135 -0
- package/src/internal/reading/walk.inpage.ts +220 -0
- package/src/internal/supervisor/lifecycle.ts +416 -0
- package/src/internal/timeline/changes.inpage.ts +216 -0
- package/src/internal/timeline/changes.ts +100 -0
- package/src/internal/timeline/events.ts +94 -0
- package/src/internal/timeline/fold.inpage.ts +123 -0
- package/src/internal/timeline/history.inpage.ts +229 -0
- package/src/internal/timeline/marks.inpage.ts +207 -0
- package/src/internal/timeline/record.inpage.ts +133 -0
- package/src/internal/timeline/sight.inpage.ts +122 -0
- package/src/internal/timeline/window.ts +96 -0
- package/src/internal/timeline/words.ts +65 -0
- package/dist/Bootstrap-B9UUXsvF.d.mts +0 -183
- package/dist/Bootstrap-CeQOWBy6.mjs +0 -189
- package/dist/Bootstrap-CeQOWBy6.mjs.map +0 -1
- package/dist/Bootstrap.d.mts +0 -3
- package/dist/Bootstrap.mjs +0 -2
- package/dist/Browser-BF9_sORP.d.mts +0 -388
- package/dist/Browser.mjs.map +0 -1
- package/dist/BrowserData-CPIIIHol.d.mts +0 -585
- package/dist/BrowserData.d.mts +0 -3
- package/dist/BrowserData.mjs +0 -695
- package/dist/BrowserData.mjs.map +0 -1
- package/dist/BrowserRuntime-B6nT1G4X.d.mts +0 -148
- package/dist/BrowserRuntime-C1r2aSRK.mjs +0 -6820
- package/dist/BrowserRuntime-C1r2aSRK.mjs.map +0 -1
- package/dist/BrowserRuntime.d.mts +0 -3
- package/dist/BrowserRuntime.mjs +0 -3
- package/dist/Capture.d.mts +0 -56
- package/dist/Capture.mjs +0 -678
- package/dist/Capture.mjs.map +0 -1
- package/dist/CaptureData-CYriZHX1.mjs +0 -201
- package/dist/CaptureData-CYriZHX1.mjs.map +0 -1
- package/dist/CaptureData.d.mts +0 -219
- package/dist/CaptureData.mjs +0 -2
- package/dist/Errors.d.mts +0 -158
- package/dist/Errors.mjs +0 -207
- package/dist/Errors.mjs.map +0 -1
- package/dist/Images-yCG9BmRU.mjs +0 -76
- package/dist/Images-yCG9BmRU.mjs.map +0 -1
- package/dist/OperationOptions-DAeRS6O9.mjs +0 -55
- package/dist/OperationOptions-DAeRS6O9.mjs.map +0 -1
- package/dist/PageControl.d.mts +0 -15
- package/dist/PageControl.mjs +0 -34
- package/dist/PageControl.mjs.map +0 -1
- package/dist/PageRegistry-B3q9DS3g.mjs +0 -164
- package/dist/PageRegistry-B3q9DS3g.mjs.map +0 -1
- package/dist/Plan-Dyxu2q8C.mjs +0 -543
- package/dist/Plan-Dyxu2q8C.mjs.map +0 -1
- package/dist/PlanData-B668RxbQ.d.mts +0 -4831
- package/dist/PlanData.d.mts +0 -3
- package/dist/PlanData.mjs +0 -268
- package/dist/PlanData.mjs.map +0 -1
- package/dist/PlanInput-BJcPPncs.mjs +0 -75
- package/dist/PlanInput-BJcPPncs.mjs.map +0 -1
- package/dist/PublicSession-DCSMMqOj.mjs +0 -5602
- package/dist/PublicSession-DCSMMqOj.mjs.map +0 -1
- package/dist/Testing.d.mts +0 -479
- package/dist/Testing.mjs +0 -2147
- package/dist/Testing.mjs.map +0 -1
- package/dist/Timeline-fV22Xk-S.d.mts +0 -29
- package/dist/Timeline.d.mts +0 -4
- package/dist/Timeline.mjs +0 -20
- package/dist/Timeline.mjs.map +0 -1
- package/dist/TimelineData-BsOn-YGZ.d.mts +0 -3818
- package/dist/TimelineData.d.mts +0 -3
- package/dist/TimelineData.mjs +0 -482
- package/dist/TimelineData.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserError.mjs","names":[],"sources":["../src/BrowserError.ts"],"sourcesContent":["/**\n * The one error every browser operation fails with.\n *\n * `reason` says what went wrong and `dispatched` says whether the action's own input (a press,\n * key, wheel, selection or hover, not the pointer travelling toward a press) or a navigation\n * reached the browser first. `consequence` says what that leaves: what was lost, and whether the\n * call can be repeated. `message` is a sentence for operators.\n *\n * @since 0.3.0\n */\nimport { Schema } from \"effect\";\n\nimport { DisconnectCause } from \"./BrowserEvent.ts\";\n\n/** The operation did not finish in time. */\nexport class Timeout extends Schema.TaggedError<Timeout>()(\"Timeout\", {\n millis: Schema.Finite,\n}) {\n override get message() {\n return `timed out after ${this.millis} ms`;\n }\n}\n\n/**\n * The operation waited its turn behind others on its page and was not given one in time, or was\n * asked to fail fast: the page may be well, only busy.\n */\nexport class Busy extends Schema.TaggedError<Busy>()(\"Busy\", {\n waitedMillis: Schema.Finite,\n /** The operations ahead of it: those holding the page and those asked before it. */\n ahead: Schema.Int,\n}) {\n override get message() {\n const others = this.ahead === 1 ? \"operation\" : \"operations\";\n\n return `the page was busy: it waited ${this.waitedMillis} ms behind ${this.ahead} other ${others}`;\n }\n}\n\n/** Input is withheld by a scoped suspension; nothing was dispatched. */\nexport class Suspended extends Schema.TaggedError<Suspended>()(\"Suspended\", {}) {\n override get message() {\n return \"browser input is suspended\";\n }\n}\n\n/** The browser has as many pages open as `maxPages` allows, and none closed in time. */\nexport class Limit extends Schema.TaggedError<Limit>()(\"Limit\", {\n maxPages: Schema.Int,\n}) {\n override get message() {\n return `the browser already has ${this.maxPages} pages open, as many as it allows`;\n }\n}\n\n/** A ref from an earlier snapshot no longer names an element on the page. */\nexport class StaleRef extends Schema.TaggedError<StaleRef>()(\"StaleRef\", {\n ref: Schema.String,\n}) {\n override get message() {\n return `${this.ref} is not on the page any more`;\n }\n}\n\n/** What the operation looked for is not on the page. */\nexport class NotFound extends Schema.TaggedError<NotFound>()(\"NotFound\", {\n target: Schema.String,\n}) {\n override get message() {\n return `${this.target} was not found`;\n }\n}\n\n/** The element exists but cannot take this input: covered, disabled, hidden or the wrong kind. */\nexport class NotActionable extends Schema.TaggedError<NotActionable>()(\"NotActionable\", {\n detail: Schema.String,\n}) {\n override get message() {\n return this.detail;\n }\n}\n\n/** A navigation failed, for example on a DNS error or a refused connection. */\nexport class NavigationFailed extends Schema.TaggedError<NavigationFailed>()(\"NavigationFailed\", {\n url: Schema.String,\n detail: Schema.String,\n}) {\n override get message() {\n return `could not load ${this.url}: ${this.detail}`;\n }\n}\n\nconst closedBy = {\n page: \"the page was closed\",\n crashed: \"the page crashed\",\n connection: \"the connection to the browser was lost\",\n session: \"the browser's session ended\",\n released: \"the browser was released\",\n};\n\n/**\n * The page is gone: it was closed (`page`) or crashed, or its browser was lost for one of the\n * browser's `DisconnectCause`s.\n */\nexport class Closed extends Schema.TaggedError<Closed>()(\"Closed\", {\n cause: Schema.Literals([\"page\", \"crashed\", ...DisconnectCause.literals]),\n}) {\n override get message() {\n return closedBy[this.cause];\n }\n}\n\n/** The request itself is invalid, such as a ref that is not a ref or a point off the screen. */\nexport class InvalidRequest extends Schema.TaggedError<InvalidRequest>()(\"InvalidRequest\", {\n detail: Schema.String,\n}) {\n override get message() {\n return this.detail;\n }\n}\n\n/** The input policy refused the action before any input was sent. */\nexport class PolicyDenied extends Schema.TaggedError<PolicyDenied>()(\"PolicyDenied\", {\n detail: Schema.String,\n /** What made the policy deny, such as the failure of the judge it asked. */\n cause: Schema.optional(Schema.Defect()),\n}) {\n override get message() {\n return `the input policy denied this action: ${this.detail}`;\n }\n}\n\n/** The input policy did not release its hold within its own bound. */\nexport class PolicyTimeout extends Schema.TaggedError<PolicyTimeout>()(\"PolicyTimeout\", {\n millis: Schema.Finite,\n}) {\n override get message() {\n return `the input policy did not allow this action within ${this.millis} ms`;\n }\n}\n\n/** The requested event cursor fell behind the browser's bounded replay history. */\nexport class EventHistoryExpired extends Schema.TaggedError<EventHistoryExpired>()(\n \"EventHistoryExpired\",\n {\n after: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n oldest: Schema.Int.check(Schema.isGreaterThan(0)),\n latest: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n },\n) {\n override get message() {\n return `event history after ${this.after} expired; retained sequences are ${this.oldest}–${this.latest}`;\n }\n}\n\n/** The browser, the connection or the provider failed in a way the other reasons do not cover. */\nexport class Failed extends Schema.TaggedError<Failed>()(\"Failed\", {\n detail: Schema.String,\n}) {\n override get message() {\n return this.detail;\n }\n}\n\nexport const Reason = Schema.Union([\n Timeout,\n Busy,\n Suspended,\n Limit,\n StaleRef,\n NotFound,\n NotActionable,\n NavigationFailed,\n Closed,\n InvalidRequest,\n PolicyDenied,\n PolicyTimeout,\n EventHistoryExpired,\n Failed,\n]);\n\nexport type Reason = typeof Reason.Type;\n\nexport class BrowserError extends Schema.TaggedError<BrowserError>()(\"BrowserError\", {\n operation: Schema.String,\n reason: Reason,\n dispatched: Schema.Boolean,\n}) {\n override get message() {\n return `${this.operation} failed${this.dispatched ? \" after it was sent\" : \"\"}: ${this.reason.message}`;\n }\n}\n\n/**\n * What a failure leaves. `lost` is `\"page\"` when the page is gone and its browser stands, and\n * `\"session\"` when the browser is gone with its pages. `repeat` says whether the call can be made\n * again, on what still stands: `\"safe\"`, as nothing reached the browser; `\"check\"`, as it may have\n * taken effect, so look first, as an `Expect` attempt does; `\"pointless\"`, as it fails again unless\n * something changes, such as\n * a new ref; or `\"resume\"`, reading events again from a newer cursor.\n */\nexport interface Consequence {\n readonly lost: \"nothing\" | \"page\" | \"session\";\n readonly repeat: \"safe\" | \"check\" | \"pointless\" | \"resume\";\n}\n\n/** What `error` leaves, from its reason and whether it was dispatched alone. */\nexport const consequence = ({ reason, dispatched }: BrowserError): Consequence => {\n const repeat = dispatched ? \"check\" : \"safe\";\n\n switch (reason._tag) {\n case \"Closed\":\n return {\n lost: reason.cause === \"page\" || reason.cause === \"crashed\" ? \"page\" : \"session\",\n repeat,\n };\n case \"Busy\":\n case \"Suspended\":\n case \"Timeout\":\n case \"Failed\":\n case \"NavigationFailed\":\n return { lost: \"nothing\", repeat };\n case \"EventHistoryExpired\":\n return { lost: \"nothing\", repeat: \"resume\" };\n case \"StaleRef\":\n case \"NotFound\":\n case \"NotActionable\":\n case \"InvalidRequest\":\n case \"Limit\":\n case \"PolicyDenied\":\n case \"PolicyTimeout\":\n return { lost: \"nothing\", repeat: \"pointless\" };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AC,CAAC;CACA,IAAa,UAAU;EACrB,OAAO,uBAAuB,KAAK,MAAM,mCAAmC,KAAK,OAAO,GAAG,KAAK;CAClG;AACF;;AAGA,IAAa,SAAb,cAA4B,OAAO,YAAoB,CAAC,CAAC,UAAU,EACjE,QAAQ,OAAO,OACjB,CAAC,CAAC,CAAC;CACD,IAAa,UAAU;EACrB,OAAO,KAAK;CACd;AACF;AAEA,MAAa,SAAS,OAAO,MAAM;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAID,IAAa,eAAb,cAAkC,OAAO,YAA0B,CAAC,CAAC,gBAAgB;CACnF,WAAW,OAAO;CAClB,QAAQ;CACR,YAAY,OAAO;AACrB,CAAC,CAAC,CAAC;CACD,IAAa,UAAU;EACrB,OAAO,GAAG,KAAK,UAAU,SAAS,KAAK,aAAa,uBAAuB,GAAG,IAAI,KAAK,OAAO;CAChG;AACF;;AAgBA,MAAa,eAAe,EAAE,QAAQ,iBAA4C;CAChF,MAAM,SAAS,aAAa,UAAU;CAEtC,QAAQ,OAAO,MAAf;EACE,KAAK,UACH,OAAO;GACL,MAAM,OAAO,UAAU,UAAU,OAAO,UAAU,YAAY,SAAS;GACvE;EACF;EACF,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,oBACH,OAAO;GAAE,MAAM;GAAW;EAAO;EACnC,KAAK,uBACH,OAAO;GAAE,MAAM;GAAW,QAAQ;EAAS;EAC7C,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK,iBACH,OAAO;GAAE,MAAM;GAAW,QAAQ;EAAY;CAClD;AACF"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare namespace BrowserEvent_d_exports {
|
|
3
|
+
export { Action, ActionOptions, Box, BrowserEvent, CursorChanged, DialogShown, DisconnectCause, Disconnected, KeyChanged, Navigated, PageClosed, PageLoaded, PageOpened, PageUntracked, PointerPressed, PointerReleased, RecordedEvent, SessionEnding, Subject, SubjectContext, TextInserted, TrackEvent, TrackPerformed, TrackPlanned, WheelScrolled };
|
|
4
|
+
}
|
|
5
|
+
declare const PageOpened_base: Schema.Class<PageOpened, Schema.TaggedStruct<"PageOpened", {
|
|
6
|
+
readonly at: Schema.Finite;
|
|
7
|
+
readonly page: Schema.String;
|
|
8
|
+
readonly url: Schema.String;
|
|
9
|
+
readonly opener: Schema.optional<Schema.String>;
|
|
10
|
+
}>, {}>;
|
|
11
|
+
/** A page opened, and the page that opened it, as a link or `window.open` does, if one did. */
|
|
12
|
+
declare class PageOpened extends PageOpened_base {}
|
|
13
|
+
declare const PageClosed_base: Schema.Class<PageClosed, Schema.TaggedStruct<"PageClosed", {
|
|
14
|
+
readonly at: Schema.Finite;
|
|
15
|
+
readonly page: Schema.String;
|
|
16
|
+
readonly cause: Schema.Literals<readonly ["page", "crashed"]>;
|
|
17
|
+
}>, {}>;
|
|
18
|
+
/**
|
|
19
|
+
* The page closed (`page`), or crashed and was closed (`crashed`). A page lost with its browser
|
|
20
|
+
* has no event of its own: `Disconnected` stands for all of them.
|
|
21
|
+
*/
|
|
22
|
+
declare class PageClosed extends PageClosed_base {}
|
|
23
|
+
declare const PageUntracked_base: Schema.Class<PageUntracked, Schema.TaggedStruct<"PageUntracked", {
|
|
24
|
+
readonly at: Schema.Finite;
|
|
25
|
+
readonly url: Schema.String;
|
|
26
|
+
readonly detail: Schema.String;
|
|
27
|
+
}>, {}>;
|
|
28
|
+
/**
|
|
29
|
+
* A tab the site opened that the library could not track, as its registration failed with
|
|
30
|
+
* `detail`. A tab that closed as it opened has no event.
|
|
31
|
+
*/
|
|
32
|
+
declare class PageUntracked extends PageUntracked_base {}
|
|
33
|
+
declare const Navigated_base: Schema.Class<Navigated, Schema.TaggedStruct<"Navigated", {
|
|
34
|
+
readonly at: Schema.Finite;
|
|
35
|
+
readonly page: Schema.String;
|
|
36
|
+
readonly url: Schema.String;
|
|
37
|
+
/**
|
|
38
|
+
* The page's documents counted from 0, the one it had when this browser began tracking it, one
|
|
39
|
+
* more for each new document. The count belongs to the page within one `Browser` and starts at
|
|
40
|
+
* 0 again on a new connection, so compare it only with the same page's in the same browser.
|
|
41
|
+
*/
|
|
42
|
+
readonly document: Schema.Int;
|
|
43
|
+
readonly sameDocument: Schema.Boolean;
|
|
44
|
+
}>, {}>;
|
|
45
|
+
/**
|
|
46
|
+
* The page's main frame moved to `url`: into a new document, or within the current one
|
|
47
|
+
* (`sameDocument`), as `pushState` and fragment links do. Frames carry the document they followed.
|
|
48
|
+
*/
|
|
49
|
+
declare class Navigated extends Navigated_base {}
|
|
50
|
+
declare const PageLoaded_base: Schema.Class<PageLoaded, Schema.TaggedStruct<"PageLoaded", {
|
|
51
|
+
readonly at: Schema.Finite;
|
|
52
|
+
readonly page: Schema.String;
|
|
53
|
+
readonly state: Schema.Literals<readonly ["domcontentloaded", "load"]>;
|
|
54
|
+
}>, {}>;
|
|
55
|
+
/** The page's document finished parsing (`domcontentloaded`) or loading (`load`). */
|
|
56
|
+
declare class PageLoaded extends PageLoaded_base {}
|
|
57
|
+
/**
|
|
58
|
+
* Why a browser was lost to its owner: its connection dropped (`connection`), its provider ended
|
|
59
|
+
* its session, at or after the session's `expiresAt` (`session`), or its owner released it.
|
|
60
|
+
*/
|
|
61
|
+
declare const DisconnectCause: Schema.Literals<readonly ["connection", "session", "released"]>;
|
|
62
|
+
type DisconnectCause = typeof DisconnectCause.Type;
|
|
63
|
+
declare const Disconnected_base: Schema.Class<Disconnected, Schema.TaggedStruct<"Disconnected", {
|
|
64
|
+
readonly at: Schema.Finite;
|
|
65
|
+
readonly cause: Schema.Literals<readonly ["connection", "session", "released"]>;
|
|
66
|
+
}>, {}>;
|
|
67
|
+
/** The browser was lost to its owner, with every page in it. It happens once. */
|
|
68
|
+
declare class Disconnected extends Disconnected_base {}
|
|
69
|
+
declare const SessionEnding_base: Schema.Class<SessionEnding, Schema.TaggedStruct<"SessionEnding", {
|
|
70
|
+
readonly at: Schema.Finite;
|
|
71
|
+
readonly expiresAt: Schema.DateTimeUtc;
|
|
72
|
+
}>, {}>;
|
|
73
|
+
/** The provider ends this browser's session at `expiresAt`, a wall-clock instant. */
|
|
74
|
+
declare class SessionEnding extends SessionEnding_base {}
|
|
75
|
+
/**
|
|
76
|
+
* The words around a subject that say which one it is, each bound to it in the page rather than
|
|
77
|
+
* read off nearby text later. In a table, `row` is the row's header or first cell with text and
|
|
78
|
+
* `column` the header over it; elsewhere, `label` is the words just before it in its row, item,
|
|
79
|
+
* group or block, at most 40 characters. `heading` is the nearest heading above it, left out for
|
|
80
|
+
* what is pinned to the viewport. Row, column and heading are at most 60 characters.
|
|
81
|
+
*/
|
|
82
|
+
declare const SubjectContext: Schema.Struct<{
|
|
83
|
+
readonly row: Schema.optional<Schema.String>;
|
|
84
|
+
readonly column: Schema.optional<Schema.String>;
|
|
85
|
+
readonly label: Schema.optional<Schema.String>;
|
|
86
|
+
readonly heading: Schema.optional<Schema.String>;
|
|
87
|
+
}>;
|
|
88
|
+
type SubjectContext = typeof SubjectContext.Type;
|
|
89
|
+
declare const Subject_base: Schema.Class<Subject, Schema.Struct<{
|
|
90
|
+
readonly role: Schema.NullOr<Schema.String>;
|
|
91
|
+
readonly name: Schema.String;
|
|
92
|
+
readonly tag: Schema.String;
|
|
93
|
+
readonly context: Schema.Struct<{
|
|
94
|
+
readonly row: Schema.optional<Schema.String>;
|
|
95
|
+
readonly column: Schema.optional<Schema.String>;
|
|
96
|
+
readonly label: Schema.optional<Schema.String>;
|
|
97
|
+
readonly heading: Schema.optional<Schema.String>;
|
|
98
|
+
}>;
|
|
99
|
+
}>, {}>;
|
|
100
|
+
/**
|
|
101
|
+
* What an input acted on, or what `Page.find` found, as the page named it then: its role (null
|
|
102
|
+
* when it has none), its accessible name (empty when it has none), its lowercase tag and its
|
|
103
|
+
* context. For a point, it is the control under the point, or else the element painted there.
|
|
104
|
+
* Unlike a ref, it keeps its meaning after the page changes.
|
|
105
|
+
*/
|
|
106
|
+
declare class Subject extends Subject_base {}
|
|
107
|
+
/** An element's box in viewport CSS pixels; it may lie partly or wholly outside the viewport. */
|
|
108
|
+
declare const Box: Schema.Struct<{
|
|
109
|
+
readonly x: Schema.Finite;
|
|
110
|
+
readonly y: Schema.Finite;
|
|
111
|
+
readonly width: Schema.Finite;
|
|
112
|
+
readonly height: Schema.Finite;
|
|
113
|
+
}>;
|
|
114
|
+
type Box = typeof Box.Type;
|
|
115
|
+
/**
|
|
116
|
+
* What else an action was asked, where it changes what the action does: a click's button, count
|
|
117
|
+
* and hold, how `type` enters its text, how often and how long `press` holds its keys, how far
|
|
118
|
+
* `scroll` moves, and the options `select` chose. Only a completed action records them.
|
|
119
|
+
*/
|
|
120
|
+
declare const ActionOptions: Schema.Struct<{
|
|
121
|
+
readonly button: Schema.optional<Schema.Literals<readonly ["left", "right", "middle"]>>;
|
|
122
|
+
readonly clickCount: Schema.optional<Schema.Finite>;
|
|
123
|
+
readonly holdMillis: Schema.optional<Schema.Finite>;
|
|
124
|
+
readonly replace: Schema.optional<Schema.Boolean>;
|
|
125
|
+
readonly submit: Schema.optional<Schema.Boolean>;
|
|
126
|
+
readonly times: Schema.optional<Schema.Finite>;
|
|
127
|
+
readonly dx: Schema.optional<Schema.Finite>;
|
|
128
|
+
readonly dy: Schema.optional<Schema.Finite>;
|
|
129
|
+
readonly values: Schema.optional<Schema.$Array<Schema.String>>;
|
|
130
|
+
}>;
|
|
131
|
+
type ActionOptions = typeof ActionOptions.Type;
|
|
132
|
+
declare const Action_base: Schema.Class<Action, Schema.TaggedStruct<"Action", {
|
|
133
|
+
readonly at: Schema.Finite;
|
|
134
|
+
readonly startedAt: Schema.Finite;
|
|
135
|
+
readonly page: Schema.String;
|
|
136
|
+
readonly name: Schema.String;
|
|
137
|
+
/** The address when the action ended; absent in events recorded by older releases. */
|
|
138
|
+
readonly url: Schema.optional<Schema.String>;
|
|
139
|
+
readonly correlation: Schema.optional<Schema.String>;
|
|
140
|
+
readonly target: Schema.optional<Schema.String>;
|
|
141
|
+
readonly options: Schema.optional<Schema.Struct<{
|
|
142
|
+
readonly button: Schema.optional<Schema.Literals<readonly ["left", "right", "middle"]>>;
|
|
143
|
+
readonly clickCount: Schema.optional<Schema.Finite>;
|
|
144
|
+
readonly holdMillis: Schema.optional<Schema.Finite>;
|
|
145
|
+
readonly replace: Schema.optional<Schema.Boolean>;
|
|
146
|
+
readonly submit: Schema.optional<Schema.Boolean>;
|
|
147
|
+
readonly times: Schema.optional<Schema.Finite>;
|
|
148
|
+
readonly dx: Schema.optional<Schema.Finite>;
|
|
149
|
+
readonly dy: Schema.optional<Schema.Finite>;
|
|
150
|
+
readonly values: Schema.optional<Schema.$Array<Schema.String>>;
|
|
151
|
+
}>>;
|
|
152
|
+
readonly subject: Schema.optional<typeof Subject>;
|
|
153
|
+
readonly to: Schema.optional<typeof Subject>;
|
|
154
|
+
/** For an action at a point, the box of what it found there. */
|
|
155
|
+
readonly box: Schema.optional<Schema.Struct<{
|
|
156
|
+
readonly x: Schema.Finite;
|
|
157
|
+
readonly y: Schema.Finite;
|
|
158
|
+
readonly width: Schema.Finite;
|
|
159
|
+
readonly height: Schema.Finite;
|
|
160
|
+
}>>;
|
|
161
|
+
readonly text: Schema.optional<Schema.String>;
|
|
162
|
+
readonly x: Schema.optional<Schema.Finite>;
|
|
163
|
+
readonly y: Schema.optional<Schema.Finite>;
|
|
164
|
+
readonly ok: Schema.Boolean;
|
|
165
|
+
readonly dispatched: Schema.Boolean;
|
|
166
|
+
readonly error: Schema.optional<Schema.String>;
|
|
167
|
+
}>, {}>;
|
|
168
|
+
/**
|
|
169
|
+
* One page operation ended, including one its caller interrupted (`error: "interrupted"`).
|
|
170
|
+
* `target` is what the caller asked for: a ref, a point, a URL or keys, and `options` the rest.
|
|
171
|
+
* `subject` is what an element or point action found there, and `to` where a drag ended; an
|
|
172
|
+
* action that failed before finding its target has neither. Point actions carry the viewport
|
|
173
|
+
* point they used. `correlation` is the id its caller gave it with `Page.correlate`, such as a
|
|
174
|
+
* model's tool call id.
|
|
175
|
+
*/
|
|
176
|
+
declare class Action extends Action_base {}
|
|
177
|
+
declare const TrackPlanned_base: Schema.Class<TrackPlanned, Schema.TaggedStruct<"TrackPlanned", {
|
|
178
|
+
readonly at: Schema.Finite;
|
|
179
|
+
readonly page: Schema.String;
|
|
180
|
+
readonly from: Schema.Struct<{
|
|
181
|
+
readonly x: Schema.Finite;
|
|
182
|
+
readonly y: Schema.Finite;
|
|
183
|
+
}>;
|
|
184
|
+
readonly samples: Schema.$Array<Schema.Struct<{
|
|
185
|
+
readonly x: Schema.Finite;
|
|
186
|
+
readonly y: Schema.Finite;
|
|
187
|
+
readonly afterMillis: Schema.Finite;
|
|
188
|
+
}>>;
|
|
189
|
+
}>, {}>;
|
|
190
|
+
/** One whole glide, published before its first input. Offsets use the host monotonic clock. */
|
|
191
|
+
declare class TrackPlanned extends TrackPlanned_base {}
|
|
192
|
+
declare const TrackPerformed_base: Schema.Class<TrackPerformed, Schema.TaggedStruct<"TrackPerformed", {
|
|
193
|
+
readonly at: Schema.Finite;
|
|
194
|
+
readonly page: Schema.String;
|
|
195
|
+
readonly plan: Schema.Int;
|
|
196
|
+
readonly dispatched: Schema.Int;
|
|
197
|
+
readonly x: Schema.Finite;
|
|
198
|
+
readonly y: Schema.Finite;
|
|
199
|
+
readonly complete: Schema.Boolean;
|
|
200
|
+
}>, {}>;
|
|
201
|
+
/**
|
|
202
|
+
* The submitted prefix of a glide. `plan` is its TrackPlanned envelope sequence; `dispatched`
|
|
203
|
+
* counts samples. `complete` means every sample was submitted, not acknowledged by the browser.
|
|
204
|
+
* The terminal point clips a canceled plan so a compositor never draws its unrealized future.
|
|
205
|
+
*/
|
|
206
|
+
declare class TrackPerformed extends TrackPerformed_base {}
|
|
207
|
+
declare const PointerPressed_base: Schema.Class<PointerPressed, Schema.TaggedStruct<"PointerPressed", {
|
|
208
|
+
readonly at: Schema.Finite;
|
|
209
|
+
readonly page: Schema.String;
|
|
210
|
+
readonly x: Schema.Finite;
|
|
211
|
+
readonly y: Schema.Finite;
|
|
212
|
+
readonly button: Schema.Literals<readonly ["left", "right", "middle"]>;
|
|
213
|
+
readonly clickCount: Schema.Int;
|
|
214
|
+
}>, {}>;
|
|
215
|
+
declare class PointerPressed extends PointerPressed_base {}
|
|
216
|
+
declare const PointerReleased_base: Schema.Class<PointerReleased, Schema.TaggedStruct<"PointerReleased", {
|
|
217
|
+
readonly at: Schema.Finite;
|
|
218
|
+
readonly page: Schema.String;
|
|
219
|
+
readonly x: Schema.Finite;
|
|
220
|
+
readonly y: Schema.Finite;
|
|
221
|
+
readonly button: Schema.Literals<readonly ["left", "right", "middle"]>;
|
|
222
|
+
readonly clickCount: Schema.Int;
|
|
223
|
+
}>, {}>;
|
|
224
|
+
declare class PointerReleased extends PointerReleased_base {}
|
|
225
|
+
declare const WheelScrolled_base: Schema.Class<WheelScrolled, Schema.TaggedStruct<"WheelScrolled", {
|
|
226
|
+
readonly at: Schema.Finite;
|
|
227
|
+
readonly page: Schema.String;
|
|
228
|
+
readonly x: Schema.Finite;
|
|
229
|
+
readonly y: Schema.Finite;
|
|
230
|
+
readonly dx: Schema.Finite;
|
|
231
|
+
readonly dy: Schema.Finite;
|
|
232
|
+
}>, {}>;
|
|
233
|
+
declare class WheelScrolled extends WheelScrolled_base {}
|
|
234
|
+
declare const KeyChanged_base: Schema.Class<KeyChanged, Schema.TaggedStruct<"KeyChanged", {
|
|
235
|
+
readonly at: Schema.Finite;
|
|
236
|
+
readonly page: Schema.String;
|
|
237
|
+
readonly key: Schema.String;
|
|
238
|
+
readonly phase: Schema.Literals<readonly ["down", "up"]>;
|
|
239
|
+
}>, {}>;
|
|
240
|
+
declare class KeyChanged extends KeyChanged_base {}
|
|
241
|
+
declare const TextInserted_base: Schema.Class<TextInserted, Schema.TaggedStruct<"TextInserted", {
|
|
242
|
+
readonly at: Schema.Finite;
|
|
243
|
+
readonly page: Schema.String;
|
|
244
|
+
readonly text: Schema.String;
|
|
245
|
+
}>, {}>;
|
|
246
|
+
/** Literal text insertion has no corresponding key events, including Unicode and newlines. */
|
|
247
|
+
declare class TextInserted extends TextInserted_base {}
|
|
248
|
+
declare const CursorChanged_base: Schema.Class<CursorChanged, Schema.TaggedStruct<"CursorChanged", {
|
|
249
|
+
readonly at: Schema.Finite;
|
|
250
|
+
readonly page: Schema.String;
|
|
251
|
+
readonly cursor: Schema.String;
|
|
252
|
+
}>, {}>;
|
|
253
|
+
/** The target's CSS cursor, obtained during target resolution without another browser call. */
|
|
254
|
+
declare class CursorChanged extends CursorChanged_base {}
|
|
255
|
+
declare const TrackEvent: Schema.Union<readonly [typeof TrackPlanned, typeof TrackPerformed, typeof PointerPressed, typeof PointerReleased, typeof WheelScrolled, typeof KeyChanged, typeof TextInserted, typeof CursorChanged]>;
|
|
256
|
+
type TrackEvent = typeof TrackEvent.Type;
|
|
257
|
+
declare const DialogShown_base: Schema.Class<DialogShown, Schema.TaggedStruct<"DialogShown", {
|
|
258
|
+
readonly at: Schema.Finite;
|
|
259
|
+
readonly page: Schema.String;
|
|
260
|
+
readonly kind: Schema.String;
|
|
261
|
+
readonly message: Schema.String;
|
|
262
|
+
readonly answer: Schema.Literals<readonly ["accepted", "dismissed"]>;
|
|
263
|
+
}>, {}>;
|
|
264
|
+
/**
|
|
265
|
+
* A JavaScript dialog appeared and was answered: an alert or a leave-page prompt accepted, a
|
|
266
|
+
* confirm or a prompt dismissed, as if its Cancel were pressed.
|
|
267
|
+
*/
|
|
268
|
+
declare class DialogShown extends DialogShown_base {}
|
|
269
|
+
declare const BrowserEvent: Schema.Union<readonly [typeof PageOpened, typeof PageClosed, typeof PageUntracked, typeof Navigated, typeof PageLoaded, typeof Action, typeof TrackPlanned, typeof TrackPerformed, typeof PointerPressed, typeof PointerReleased, typeof WheelScrolled, typeof KeyChanged, typeof TextInserted, typeof CursorChanged, typeof DialogShown, typeof Disconnected, typeof SessionEnding]>;
|
|
270
|
+
type BrowserEvent = typeof BrowserEvent.Type;
|
|
271
|
+
declare const RecordedEvent_base: Schema.Class<RecordedEvent, Schema.Struct<{
|
|
272
|
+
readonly sequence: Schema.Int;
|
|
273
|
+
readonly event: Schema.Union<readonly [typeof PageOpened, typeof PageClosed, typeof PageUntracked, typeof Navigated, typeof PageLoaded, typeof Action, typeof TrackPlanned, typeof TrackPerformed, typeof PointerPressed, typeof PointerReleased, typeof WheelScrolled, typeof KeyChanged, typeof TextInserted, typeof CursorChanged, typeof DialogShown, typeof Disconnected, typeof SessionEnding]>;
|
|
274
|
+
}>, {}>;
|
|
275
|
+
/** A position in the browser's one replayable event history. Sequences begin at one. */
|
|
276
|
+
declare class RecordedEvent extends RecordedEvent_base {}
|
|
277
|
+
//#endregion
|
|
278
|
+
export { TrackEvent as C, WheelScrolled as E, TextInserted as S, TrackPlanned as T, PointerReleased as _, BrowserEvent_d_exports as a, Subject as b, DisconnectCause as c, Navigated as d, PageClosed as f, PointerPressed as g, PageUntracked as h, BrowserEvent as i, Disconnected as l, PageOpened as m, ActionOptions as n, CursorChanged as o, PageLoaded as p, Box as r, DialogShown as s, Action as t, KeyChanged as u, RecordedEvent as v, TrackPerformed as w, SubjectContext as x, SessionEnding as y };
|
|
279
|
+
//# sourceMappingURL=BrowserEvent-BRu2juEz.d.mts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as TrackEvent, E as WheelScrolled, S as TextInserted, T as TrackPlanned, _ as PointerReleased, b as Subject, c as DisconnectCause, d as Navigated, f as PageClosed, g as PointerPressed, h as PageUntracked, i as BrowserEvent, l as Disconnected, m as PageOpened, n as ActionOptions, o as CursorChanged, p as PageLoaded, r as Box, s as DialogShown, t as Action, u as KeyChanged, v as RecordedEvent, w as TrackPerformed, x as SubjectContext, y as SessionEnding } from "./BrowserEvent-BRu2juEz.mjs";
|
|
2
|
+
export { Action, ActionOptions, Box, BrowserEvent, CursorChanged, DialogShown, DisconnectCause, Disconnected, KeyChanged, Navigated, PageClosed, PageLoaded, PageOpened, PageUntracked, PointerPressed, PointerReleased, RecordedEvent, SessionEnding, Subject, SubjectContext, TextInserted, TrackEvent, TrackPerformed, TrackPlanned, WheelScrolled };
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { Plan, Point } from "./Motion.mjs";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
//#region src/BrowserEvent.ts
|
|
5
|
+
/**
|
|
6
|
+
* What happened in a browser, in order: pages and their documents, actions, pointer motion, and
|
|
7
|
+
* the browser's own end.
|
|
8
|
+
*
|
|
9
|
+
* Every event carries `at`, host monotonic milliseconds from the owning browser’s Effect `Clock`.
|
|
10
|
+
* This clock also stamps screencast frames’ `receivedAt` and moments, so wall-clock corrections
|
|
11
|
+
* cannot disturb their order. Compare stamps only within the same browser clock, not across hosts.
|
|
12
|
+
* A page is named by its CDP target id, which stays the same across reconnects, and every URL is
|
|
13
|
+
* reported without its userinfo or known secret parameters.
|
|
14
|
+
*
|
|
15
|
+
* @since 0.3.0
|
|
16
|
+
*/
|
|
17
|
+
var BrowserEvent_exports = /* @__PURE__ */ __exportAll({
|
|
18
|
+
Action: () => Action,
|
|
19
|
+
ActionOptions: () => ActionOptions,
|
|
20
|
+
Box: () => Box,
|
|
21
|
+
BrowserEvent: () => BrowserEvent,
|
|
22
|
+
CursorChanged: () => CursorChanged,
|
|
23
|
+
DialogShown: () => DialogShown,
|
|
24
|
+
DisconnectCause: () => DisconnectCause,
|
|
25
|
+
Disconnected: () => Disconnected,
|
|
26
|
+
KeyChanged: () => KeyChanged,
|
|
27
|
+
Navigated: () => Navigated,
|
|
28
|
+
PageClosed: () => PageClosed,
|
|
29
|
+
PageLoaded: () => PageLoaded,
|
|
30
|
+
PageOpened: () => PageOpened,
|
|
31
|
+
PageUntracked: () => PageUntracked,
|
|
32
|
+
PointerPressed: () => PointerPressed,
|
|
33
|
+
PointerReleased: () => PointerReleased,
|
|
34
|
+
RecordedEvent: () => RecordedEvent,
|
|
35
|
+
SessionEnding: () => SessionEnding,
|
|
36
|
+
Subject: () => Subject,
|
|
37
|
+
SubjectContext: () => SubjectContext,
|
|
38
|
+
TextInserted: () => TextInserted,
|
|
39
|
+
TrackEvent: () => TrackEvent,
|
|
40
|
+
TrackPerformed: () => TrackPerformed,
|
|
41
|
+
TrackPlanned: () => TrackPlanned,
|
|
42
|
+
WheelScrolled: () => WheelScrolled
|
|
43
|
+
});
|
|
44
|
+
/** A page opened, and the page that opened it, as a link or `window.open` does, if one did. */
|
|
45
|
+
var PageOpened = class extends Schema.TaggedClass()("PageOpened", {
|
|
46
|
+
at: Schema.Finite,
|
|
47
|
+
page: Schema.String,
|
|
48
|
+
url: Schema.String,
|
|
49
|
+
opener: Schema.optional(Schema.String)
|
|
50
|
+
}) {};
|
|
51
|
+
/**
|
|
52
|
+
* The page closed (`page`), or crashed and was closed (`crashed`). A page lost with its browser
|
|
53
|
+
* has no event of its own: `Disconnected` stands for all of them.
|
|
54
|
+
*/
|
|
55
|
+
var PageClosed = class extends Schema.TaggedClass()("PageClosed", {
|
|
56
|
+
at: Schema.Finite,
|
|
57
|
+
page: Schema.String,
|
|
58
|
+
cause: Schema.Literals(["page", "crashed"])
|
|
59
|
+
}) {};
|
|
60
|
+
/**
|
|
61
|
+
* A tab the site opened that the library could not track, as its registration failed with
|
|
62
|
+
* `detail`. A tab that closed as it opened has no event.
|
|
63
|
+
*/
|
|
64
|
+
var PageUntracked = class extends Schema.TaggedClass()("PageUntracked", {
|
|
65
|
+
at: Schema.Finite,
|
|
66
|
+
url: Schema.String,
|
|
67
|
+
detail: Schema.String
|
|
68
|
+
}) {};
|
|
69
|
+
/**
|
|
70
|
+
* The page's main frame moved to `url`: into a new document, or within the current one
|
|
71
|
+
* (`sameDocument`), as `pushState` and fragment links do. Frames carry the document they followed.
|
|
72
|
+
*/
|
|
73
|
+
var Navigated = class extends Schema.TaggedClass()("Navigated", {
|
|
74
|
+
at: Schema.Finite,
|
|
75
|
+
page: Schema.String,
|
|
76
|
+
url: Schema.String,
|
|
77
|
+
/**
|
|
78
|
+
* The page's documents counted from 0, the one it had when this browser began tracking it, one
|
|
79
|
+
* more for each new document. The count belongs to the page within one `Browser` and starts at
|
|
80
|
+
* 0 again on a new connection, so compare it only with the same page's in the same browser.
|
|
81
|
+
*/
|
|
82
|
+
document: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
|
|
83
|
+
sameDocument: Schema.Boolean
|
|
84
|
+
}) {};
|
|
85
|
+
/** The page's document finished parsing (`domcontentloaded`) or loading (`load`). */
|
|
86
|
+
var PageLoaded = class extends Schema.TaggedClass()("PageLoaded", {
|
|
87
|
+
at: Schema.Finite,
|
|
88
|
+
page: Schema.String,
|
|
89
|
+
state: Schema.Literals(["domcontentloaded", "load"])
|
|
90
|
+
}) {};
|
|
91
|
+
/**
|
|
92
|
+
* Why a browser was lost to its owner: its connection dropped (`connection`), its provider ended
|
|
93
|
+
* its session, at or after the session's `expiresAt` (`session`), or its owner released it.
|
|
94
|
+
*/
|
|
95
|
+
const DisconnectCause = Schema.Literals([
|
|
96
|
+
"connection",
|
|
97
|
+
"session",
|
|
98
|
+
"released"
|
|
99
|
+
]);
|
|
100
|
+
/** The browser was lost to its owner, with every page in it. It happens once. */
|
|
101
|
+
var Disconnected = class extends Schema.TaggedClass()("Disconnected", {
|
|
102
|
+
at: Schema.Finite,
|
|
103
|
+
cause: DisconnectCause
|
|
104
|
+
}) {};
|
|
105
|
+
/** The provider ends this browser's session at `expiresAt`, a wall-clock instant. */
|
|
106
|
+
var SessionEnding = class extends Schema.TaggedClass()("SessionEnding", {
|
|
107
|
+
at: Schema.Finite,
|
|
108
|
+
expiresAt: Schema.DateTimeUtc
|
|
109
|
+
}) {};
|
|
110
|
+
/**
|
|
111
|
+
* The words around a subject that say which one it is, each bound to it in the page rather than
|
|
112
|
+
* read off nearby text later. In a table, `row` is the row's header or first cell with text and
|
|
113
|
+
* `column` the header over it; elsewhere, `label` is the words just before it in its row, item,
|
|
114
|
+
* group or block, at most 40 characters. `heading` is the nearest heading above it, left out for
|
|
115
|
+
* what is pinned to the viewport. Row, column and heading are at most 60 characters.
|
|
116
|
+
*/
|
|
117
|
+
const SubjectContext = Schema.Struct({
|
|
118
|
+
row: Schema.optional(Schema.String),
|
|
119
|
+
column: Schema.optional(Schema.String),
|
|
120
|
+
label: Schema.optional(Schema.String),
|
|
121
|
+
heading: Schema.optional(Schema.String)
|
|
122
|
+
});
|
|
123
|
+
/**
|
|
124
|
+
* What an input acted on, or what `Page.find` found, as the page named it then: its role (null
|
|
125
|
+
* when it has none), its accessible name (empty when it has none), its lowercase tag and its
|
|
126
|
+
* context. For a point, it is the control under the point, or else the element painted there.
|
|
127
|
+
* Unlike a ref, it keeps its meaning after the page changes.
|
|
128
|
+
*/
|
|
129
|
+
var Subject = class extends Schema.Class("effect-browser/Subject")({
|
|
130
|
+
role: Schema.NullOr(Schema.String),
|
|
131
|
+
name: Schema.String,
|
|
132
|
+
tag: Schema.String,
|
|
133
|
+
context: SubjectContext
|
|
134
|
+
}) {};
|
|
135
|
+
const Button = Schema.Literals([
|
|
136
|
+
"left",
|
|
137
|
+
"right",
|
|
138
|
+
"middle"
|
|
139
|
+
]);
|
|
140
|
+
/** An element's box in viewport CSS pixels; it may lie partly or wholly outside the viewport. */
|
|
141
|
+
const Box = Schema.Struct({
|
|
142
|
+
x: Schema.Finite,
|
|
143
|
+
y: Schema.Finite,
|
|
144
|
+
width: Schema.Finite,
|
|
145
|
+
height: Schema.Finite
|
|
146
|
+
});
|
|
147
|
+
/**
|
|
148
|
+
* What else an action was asked, where it changes what the action does: a click's button, count
|
|
149
|
+
* and hold, how `type` enters its text, how often and how long `press` holds its keys, how far
|
|
150
|
+
* `scroll` moves, and the options `select` chose. Only a completed action records them.
|
|
151
|
+
*/
|
|
152
|
+
const ActionOptions = Schema.Struct({
|
|
153
|
+
button: Schema.optional(Button),
|
|
154
|
+
clickCount: Schema.optional(Schema.Finite),
|
|
155
|
+
holdMillis: Schema.optional(Schema.Finite),
|
|
156
|
+
replace: Schema.optional(Schema.Boolean),
|
|
157
|
+
submit: Schema.optional(Schema.Boolean),
|
|
158
|
+
times: Schema.optional(Schema.Finite),
|
|
159
|
+
dx: Schema.optional(Schema.Finite),
|
|
160
|
+
dy: Schema.optional(Schema.Finite),
|
|
161
|
+
values: Schema.optional(Schema.Array(Schema.String))
|
|
162
|
+
});
|
|
163
|
+
/**
|
|
164
|
+
* One page operation ended, including one its caller interrupted (`error: "interrupted"`).
|
|
165
|
+
* `target` is what the caller asked for: a ref, a point, a URL or keys, and `options` the rest.
|
|
166
|
+
* `subject` is what an element or point action found there, and `to` where a drag ended; an
|
|
167
|
+
* action that failed before finding its target has neither. Point actions carry the viewport
|
|
168
|
+
* point they used. `correlation` is the id its caller gave it with `Page.correlate`, such as a
|
|
169
|
+
* model's tool call id.
|
|
170
|
+
*/
|
|
171
|
+
var Action = class extends Schema.TaggedClass()("Action", {
|
|
172
|
+
at: Schema.Finite,
|
|
173
|
+
startedAt: Schema.Finite,
|
|
174
|
+
page: Schema.String,
|
|
175
|
+
name: Schema.String,
|
|
176
|
+
/** The address when the action ended; absent in events recorded by older releases. */
|
|
177
|
+
url: Schema.optional(Schema.String),
|
|
178
|
+
correlation: Schema.optional(Schema.String),
|
|
179
|
+
target: Schema.optional(Schema.String),
|
|
180
|
+
options: Schema.optional(ActionOptions),
|
|
181
|
+
subject: Schema.optional(Subject),
|
|
182
|
+
to: Schema.optional(Subject),
|
|
183
|
+
/** For an action at a point, the box of what it found there. */
|
|
184
|
+
box: Schema.optional(Box),
|
|
185
|
+
text: Schema.optional(Schema.String),
|
|
186
|
+
x: Schema.optional(Schema.Finite),
|
|
187
|
+
y: Schema.optional(Schema.Finite),
|
|
188
|
+
ok: Schema.Boolean,
|
|
189
|
+
dispatched: Schema.Boolean,
|
|
190
|
+
error: Schema.optional(Schema.String)
|
|
191
|
+
}) {};
|
|
192
|
+
const Sequence = Schema.Int.check(Schema.isGreaterThan(0));
|
|
193
|
+
/** One whole glide, published before its first input. Offsets use the host monotonic clock. */
|
|
194
|
+
var TrackPlanned = class extends Schema.TaggedClass()("TrackPlanned", {
|
|
195
|
+
at: Schema.Finite,
|
|
196
|
+
page: Schema.String,
|
|
197
|
+
from: Point,
|
|
198
|
+
samples: Plan
|
|
199
|
+
}) {};
|
|
200
|
+
/**
|
|
201
|
+
* The submitted prefix of a glide. `plan` is its TrackPlanned envelope sequence; `dispatched`
|
|
202
|
+
* counts samples. `complete` means every sample was submitted, not acknowledged by the browser.
|
|
203
|
+
* The terminal point clips a canceled plan so a compositor never draws its unrealized future.
|
|
204
|
+
*/
|
|
205
|
+
var TrackPerformed = class extends Schema.TaggedClass()("TrackPerformed", {
|
|
206
|
+
at: Schema.Finite,
|
|
207
|
+
page: Schema.String,
|
|
208
|
+
plan: Sequence,
|
|
209
|
+
dispatched: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
|
|
210
|
+
x: Schema.Finite,
|
|
211
|
+
y: Schema.Finite,
|
|
212
|
+
complete: Schema.Boolean
|
|
213
|
+
}) {};
|
|
214
|
+
var PointerPressed = class extends Schema.TaggedClass()("PointerPressed", {
|
|
215
|
+
at: Schema.Finite,
|
|
216
|
+
page: Schema.String,
|
|
217
|
+
x: Schema.Finite,
|
|
218
|
+
y: Schema.Finite,
|
|
219
|
+
button: Button,
|
|
220
|
+
clickCount: Schema.Int.check(Schema.isGreaterThan(0))
|
|
221
|
+
}) {};
|
|
222
|
+
var PointerReleased = class extends Schema.TaggedClass()("PointerReleased", {
|
|
223
|
+
at: Schema.Finite,
|
|
224
|
+
page: Schema.String,
|
|
225
|
+
x: Schema.Finite,
|
|
226
|
+
y: Schema.Finite,
|
|
227
|
+
button: Button,
|
|
228
|
+
clickCount: Schema.Int.check(Schema.isGreaterThan(0))
|
|
229
|
+
}) {};
|
|
230
|
+
var WheelScrolled = class extends Schema.TaggedClass()("WheelScrolled", {
|
|
231
|
+
at: Schema.Finite,
|
|
232
|
+
page: Schema.String,
|
|
233
|
+
x: Schema.Finite,
|
|
234
|
+
y: Schema.Finite,
|
|
235
|
+
dx: Schema.Finite,
|
|
236
|
+
dy: Schema.Finite
|
|
237
|
+
}) {};
|
|
238
|
+
var KeyChanged = class extends Schema.TaggedClass()("KeyChanged", {
|
|
239
|
+
at: Schema.Finite,
|
|
240
|
+
page: Schema.String,
|
|
241
|
+
key: Schema.String,
|
|
242
|
+
phase: Schema.Literals(["down", "up"])
|
|
243
|
+
}) {};
|
|
244
|
+
/** Literal text insertion has no corresponding key events, including Unicode and newlines. */
|
|
245
|
+
var TextInserted = class extends Schema.TaggedClass()("TextInserted", {
|
|
246
|
+
at: Schema.Finite,
|
|
247
|
+
page: Schema.String,
|
|
248
|
+
text: Schema.String
|
|
249
|
+
}) {};
|
|
250
|
+
/** The target's CSS cursor, obtained during target resolution without another browser call. */
|
|
251
|
+
var CursorChanged = class extends Schema.TaggedClass()("CursorChanged", {
|
|
252
|
+
at: Schema.Finite,
|
|
253
|
+
page: Schema.String,
|
|
254
|
+
cursor: Schema.String
|
|
255
|
+
}) {};
|
|
256
|
+
const TrackEvent = Schema.Union([
|
|
257
|
+
TrackPlanned,
|
|
258
|
+
TrackPerformed,
|
|
259
|
+
PointerPressed,
|
|
260
|
+
PointerReleased,
|
|
261
|
+
WheelScrolled,
|
|
262
|
+
KeyChanged,
|
|
263
|
+
TextInserted,
|
|
264
|
+
CursorChanged
|
|
265
|
+
]);
|
|
266
|
+
/**
|
|
267
|
+
* A JavaScript dialog appeared and was answered: an alert or a leave-page prompt accepted, a
|
|
268
|
+
* confirm or a prompt dismissed, as if its Cancel were pressed.
|
|
269
|
+
*/
|
|
270
|
+
var DialogShown = class extends Schema.TaggedClass()("DialogShown", {
|
|
271
|
+
at: Schema.Finite,
|
|
272
|
+
page: Schema.String,
|
|
273
|
+
kind: Schema.String,
|
|
274
|
+
message: Schema.String,
|
|
275
|
+
answer: Schema.Literals(["accepted", "dismissed"])
|
|
276
|
+
}) {};
|
|
277
|
+
const BrowserEvent = Schema.Union([
|
|
278
|
+
PageOpened,
|
|
279
|
+
PageClosed,
|
|
280
|
+
PageUntracked,
|
|
281
|
+
Navigated,
|
|
282
|
+
PageLoaded,
|
|
283
|
+
Action,
|
|
284
|
+
...TrackEvent.members,
|
|
285
|
+
DialogShown,
|
|
286
|
+
Disconnected,
|
|
287
|
+
SessionEnding
|
|
288
|
+
]);
|
|
289
|
+
/** A position in the browser's one replayable event history. Sequences begin at one. */
|
|
290
|
+
var RecordedEvent = class extends Schema.Class("effect-browser/RecordedEvent")({
|
|
291
|
+
sequence: Sequence,
|
|
292
|
+
event: BrowserEvent
|
|
293
|
+
}) {};
|
|
294
|
+
//#endregion
|
|
295
|
+
export { Action, ActionOptions, Box, BrowserEvent, CursorChanged, DialogShown, DisconnectCause, Disconnected, KeyChanged, Navigated, PageClosed, PageLoaded, PageOpened, PageUntracked, PointerPressed, PointerReleased, RecordedEvent, SessionEnding, Subject, SubjectContext, TextInserted, TrackEvent, TrackPerformed, TrackPlanned, WheelScrolled, BrowserEvent_exports as t };
|
|
296
|
+
|
|
297
|
+
//# sourceMappingURL=BrowserEvent.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserEvent.mjs","names":["Motion.Point","Motion.Plan"],"sources":["../src/BrowserEvent.ts"],"sourcesContent":["/**\n * What happened in a browser, in order: pages and their documents, actions, pointer motion, and\n * the browser's own end.\n *\n * Every event carries `at`, host monotonic milliseconds from the owning browser’s Effect `Clock`.\n * This clock also stamps screencast frames’ `receivedAt` and moments, so wall-clock corrections\n * cannot disturb their order. Compare stamps only within the same browser clock, not across hosts.\n * A page is named by its CDP target id, which stays the same across reconnects, and every URL is\n * reported without its userinfo or known secret parameters.\n *\n * @since 0.3.0\n */\nimport { Schema } from \"effect\";\n\nimport * as Motion from \"./Motion.ts\";\n\n/** A page opened, and the page that opened it, as a link or `window.open` does, if one did. */\nexport class PageOpened extends Schema.TaggedClass<PageOpened>()(\"PageOpened\", {\n at: Schema.Finite,\n page: Schema.String,\n url: Schema.String,\n opener: Schema.optional(Schema.String),\n}) {}\n\n/**\n * The page closed (`page`), or crashed and was closed (`crashed`). A page lost with its browser\n * has no event of its own: `Disconnected` stands for all of them.\n */\nexport class PageClosed extends Schema.TaggedClass<PageClosed>()(\"PageClosed\", {\n at: Schema.Finite,\n page: Schema.String,\n cause: Schema.Literals([\"page\", \"crashed\"]),\n}) {}\n\n/**\n * A tab the site opened that the library could not track, as its registration failed with\n * `detail`. A tab that closed as it opened has no event.\n */\nexport class PageUntracked extends Schema.TaggedClass<PageUntracked>()(\"PageUntracked\", {\n at: Schema.Finite,\n url: Schema.String,\n detail: Schema.String,\n}) {}\n\n/**\n * The page's main frame moved to `url`: into a new document, or within the current one\n * (`sameDocument`), as `pushState` and fragment links do. Frames carry the document they followed.\n */\nexport class Navigated extends Schema.TaggedClass<Navigated>()(\"Navigated\", {\n at: Schema.Finite,\n page: Schema.String,\n url: Schema.String,\n /**\n * The page's documents counted from 0, the one it had when this browser began tracking it, one\n * more for each new document. The count belongs to the page within one `Browser` and starts at\n * 0 again on a new connection, so compare it only with the same page's in the same browser.\n */\n document: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n sameDocument: Schema.Boolean,\n}) {}\n\n/** The page's document finished parsing (`domcontentloaded`) or loading (`load`). */\nexport class PageLoaded extends Schema.TaggedClass<PageLoaded>()(\"PageLoaded\", {\n at: Schema.Finite,\n page: Schema.String,\n state: Schema.Literals([\"domcontentloaded\", \"load\"]),\n}) {}\n\n/**\n * Why a browser was lost to its owner: its connection dropped (`connection`), its provider ended\n * its session, at or after the session's `expiresAt` (`session`), or its owner released it.\n */\nexport const DisconnectCause = Schema.Literals([\"connection\", \"session\", \"released\"]);\n\nexport type DisconnectCause = typeof DisconnectCause.Type;\n\n/** The browser was lost to its owner, with every page in it. It happens once. */\nexport class Disconnected extends Schema.TaggedClass<Disconnected>()(\"Disconnected\", {\n at: Schema.Finite,\n cause: DisconnectCause,\n}) {}\n\n/** The provider ends this browser's session at `expiresAt`, a wall-clock instant. */\nexport class SessionEnding extends Schema.TaggedClass<SessionEnding>()(\"SessionEnding\", {\n at: Schema.Finite,\n expiresAt: Schema.DateTimeUtc,\n}) {}\n\n/**\n * The words around a subject that say which one it is, each bound to it in the page rather than\n * read off nearby text later. In a table, `row` is the row's header or first cell with text and\n * `column` the header over it; elsewhere, `label` is the words just before it in its row, item,\n * group or block, at most 40 characters. `heading` is the nearest heading above it, left out for\n * what is pinned to the viewport. Row, column and heading are at most 60 characters.\n */\nexport const SubjectContext = Schema.Struct({\n row: Schema.optional(Schema.String),\n column: Schema.optional(Schema.String),\n label: Schema.optional(Schema.String),\n heading: Schema.optional(Schema.String),\n});\n\nexport type SubjectContext = typeof SubjectContext.Type;\n\n/**\n * What an input acted on, or what `Page.find` found, as the page named it then: its role (null\n * when it has none), its accessible name (empty when it has none), its lowercase tag and its\n * context. For a point, it is the control under the point, or else the element painted there.\n * Unlike a ref, it keeps its meaning after the page changes.\n */\nexport class Subject extends Schema.Class<Subject>(\"effect-browser/Subject\")({\n role: Schema.NullOr(Schema.String),\n name: Schema.String,\n tag: Schema.String,\n context: SubjectContext,\n}) {}\n\nconst Button = Schema.Literals([\"left\", \"right\", \"middle\"]);\n\n/** An element's box in viewport CSS pixels; it may lie partly or wholly outside the viewport. */\nexport const Box = Schema.Struct({\n x: Schema.Finite,\n y: Schema.Finite,\n width: Schema.Finite,\n height: Schema.Finite,\n});\n\nexport type Box = typeof Box.Type;\n\n/**\n * What else an action was asked, where it changes what the action does: a click's button, count\n * and hold, how `type` enters its text, how often and how long `press` holds its keys, how far\n * `scroll` moves, and the options `select` chose. Only a completed action records them.\n */\nexport const ActionOptions = Schema.Struct({\n button: Schema.optional(Button),\n clickCount: Schema.optional(Schema.Finite),\n holdMillis: Schema.optional(Schema.Finite),\n replace: Schema.optional(Schema.Boolean),\n submit: Schema.optional(Schema.Boolean),\n times: Schema.optional(Schema.Finite),\n dx: Schema.optional(Schema.Finite),\n dy: Schema.optional(Schema.Finite),\n values: Schema.optional(Schema.Array(Schema.String)),\n});\n\nexport type ActionOptions = typeof ActionOptions.Type;\n\n/**\n * One page operation ended, including one its caller interrupted (`error: \"interrupted\"`).\n * `target` is what the caller asked for: a ref, a point, a URL or keys, and `options` the rest.\n * `subject` is what an element or point action found there, and `to` where a drag ended; an\n * action that failed before finding its target has neither. Point actions carry the viewport\n * point they used. `correlation` is the id its caller gave it with `Page.correlate`, such as a\n * model's tool call id.\n */\nexport class Action extends Schema.TaggedClass<Action>()(\"Action\", {\n at: Schema.Finite,\n startedAt: Schema.Finite,\n page: Schema.String,\n name: Schema.String,\n /** The address when the action ended; absent in events recorded by older releases. */\n url: Schema.optional(Schema.String),\n correlation: Schema.optional(Schema.String),\n target: Schema.optional(Schema.String),\n options: Schema.optional(ActionOptions),\n subject: Schema.optional(Subject),\n to: Schema.optional(Subject),\n /** For an action at a point, the box of what it found there. */\n box: Schema.optional(Box),\n text: Schema.optional(Schema.String),\n x: Schema.optional(Schema.Finite),\n y: Schema.optional(Schema.Finite),\n ok: Schema.Boolean,\n dispatched: Schema.Boolean,\n error: Schema.optional(Schema.String),\n}) {}\n\nconst Sequence = Schema.Int.check(Schema.isGreaterThan(0));\n\n/** One whole glide, published before its first input. Offsets use the host monotonic clock. */\nexport class TrackPlanned extends Schema.TaggedClass<TrackPlanned>()(\"TrackPlanned\", {\n at: Schema.Finite,\n page: Schema.String,\n from: Motion.Point,\n samples: Motion.Plan,\n}) {}\n\n/**\n * The submitted prefix of a glide. `plan` is its TrackPlanned envelope sequence; `dispatched`\n * counts samples. `complete` means every sample was submitted, not acknowledged by the browser.\n * The terminal point clips a canceled plan so a compositor never draws its unrealized future.\n */\nexport class TrackPerformed extends Schema.TaggedClass<TrackPerformed>()(\"TrackPerformed\", {\n at: Schema.Finite,\n page: Schema.String,\n plan: Sequence,\n dispatched: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n x: Schema.Finite,\n y: Schema.Finite,\n complete: Schema.Boolean,\n}) {}\n\nexport class PointerPressed extends Schema.TaggedClass<PointerPressed>()(\"PointerPressed\", {\n at: Schema.Finite,\n page: Schema.String,\n x: Schema.Finite,\n y: Schema.Finite,\n button: Button,\n clickCount: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\nexport class PointerReleased extends Schema.TaggedClass<PointerReleased>()(\"PointerReleased\", {\n at: Schema.Finite,\n page: Schema.String,\n x: Schema.Finite,\n y: Schema.Finite,\n button: Button,\n clickCount: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\nexport class WheelScrolled extends Schema.TaggedClass<WheelScrolled>()(\"WheelScrolled\", {\n at: Schema.Finite,\n page: Schema.String,\n x: Schema.Finite,\n y: Schema.Finite,\n dx: Schema.Finite,\n dy: Schema.Finite,\n}) {}\n\nexport class KeyChanged extends Schema.TaggedClass<KeyChanged>()(\"KeyChanged\", {\n at: Schema.Finite,\n page: Schema.String,\n key: Schema.String,\n phase: Schema.Literals([\"down\", \"up\"]),\n}) {}\n\n/** Literal text insertion has no corresponding key events, including Unicode and newlines. */\nexport class TextInserted extends Schema.TaggedClass<TextInserted>()(\"TextInserted\", {\n at: Schema.Finite,\n page: Schema.String,\n text: Schema.String,\n}) {}\n\n/** The target's CSS cursor, obtained during target resolution without another browser call. */\nexport class CursorChanged extends Schema.TaggedClass<CursorChanged>()(\"CursorChanged\", {\n at: Schema.Finite,\n page: Schema.String,\n cursor: Schema.String,\n}) {}\n\nexport const TrackEvent = Schema.Union([\n TrackPlanned,\n TrackPerformed,\n PointerPressed,\n PointerReleased,\n WheelScrolled,\n KeyChanged,\n TextInserted,\n CursorChanged,\n]);\n\nexport type TrackEvent = typeof TrackEvent.Type;\n\n/**\n * A JavaScript dialog appeared and was answered: an alert or a leave-page prompt accepted, a\n * confirm or a prompt dismissed, as if its Cancel were pressed.\n */\nexport class DialogShown extends Schema.TaggedClass<DialogShown>()(\"DialogShown\", {\n at: Schema.Finite,\n page: Schema.String,\n kind: Schema.String,\n message: Schema.String,\n answer: Schema.Literals([\"accepted\", \"dismissed\"]),\n}) {}\n\nexport const BrowserEvent = Schema.Union([\n PageOpened,\n PageClosed,\n PageUntracked,\n Navigated,\n PageLoaded,\n Action,\n ...TrackEvent.members,\n DialogShown,\n Disconnected,\n SessionEnding,\n]);\n\nexport type BrowserEvent = typeof BrowserEvent.Type;\n\n/** A position in the browser's one replayable event history. Sequences begin at one. */\nexport class RecordedEvent extends Schema.Class<RecordedEvent>(\"effect-browser/RecordedEvent\")({\n sequence: Sequence,\n event: BrowserEvent,\n}) {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,IAAa,aAAb,cAAgC,OAAO,YAAwB,CAAC,CAAC,cAAc;CAC7E,IAAI,OAAO;CACX,MAAM,OAAO;CACb,KAAK,OAAO;CACZ,QAAQ,OAAO,SAAS,OAAO,MAAM;AACvC,CAAC,CAAC,CAAC,CAAC;;;;;AAMJ,IAAa,aAAb,cAAgC,OAAO,YAAwB,CAAC,CAAC,cAAc;CAC7E,IAAI,OAAO;CACX,MAAM,OAAO;CACb,OAAO,OAAO,SAAS,CAAC,QAAQ,SAAS,CAAC;AAC5C,CAAC,CAAC,CAAC,CAAC;;;;;AAMJ,IAAa,gBAAb,cAAmC,OAAO,YAA2B,CAAC,CAAC,iBAAiB;CACtF,IAAI,OAAO;CACX,KAAK,OAAO;CACZ,QAAQ,OAAO;AACjB,CAAC,CAAC,CAAC,CAAC;;;;;AAMJ,IAAa,YAAb,cAA+B,OAAO,YAAuB,CAAC,CAAC,aAAa;CAC1E,IAAI,OAAO;CACX,MAAM,OAAO;CACb,KAAK,OAAO;;;;;;CAMZ,UAAU,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;CAC3D,cAAc,OAAO;AACvB,CAAC,CAAC,CAAC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