Files
replayweb.page/src/events.ts
T
sua yoo 17539f3084 feat: Add "not found" error detail on page load (#482)
Resolves https://github.com/webrecorder/replayweb.page/issues/481 with
workaround
Related to https://github.com/webrecorder/browsertrix/issues/2865

## Changes

- Includes `replayNotFoundError` in `"page-loading"` event when page is
finished loading as a workaround for the actual `replayNotFoundError`
value not being available on `urlchange`.
- Minor refactor to more strongly typed events.
2026-02-11 23:58:28 -08:00

26 lines
593 B
TypeScript

import type { EmbedReplayData, TabData } from "./item";
export type TabNavEvent = CustomEvent<{
data: TabData;
reload?: boolean;
replaceLoc?: boolean;
replayNotFoundError?: boolean;
}>;
export type RwpUrlChangeEvent = CustomEvent<
EmbedReplayData & {
type: "urlchange";
replayNotFoundError: boolean;
}
>;
export type ReplayLoadingDetail =
| { loading: true }
| { loading: false; replayNotFoundError: boolean };
export type RwpPageLoadingEvent = CustomEvent<
Required<Pick<EmbedReplayData, "url" | "ts">> & {
type: "page-loading";
} & ReplayLoadingDetail
>;