diff --git a/src/lib/components/events/booru-events.ts b/src/lib/components/events/booru-events.ts new file mode 100644 index 0000000..a726d9b --- /dev/null +++ b/src/lib/components/events/booru-events.ts @@ -0,0 +1,5 @@ +export const eventFetchComplete = 'fetchcomplete'; + +export interface BooruEventsMap { + [eventFetchComplete]: null; // Site sends the response, but extension will not get it due to isolation. +} diff --git a/src/lib/components/events/comms.ts b/src/lib/components/events/comms.ts index 30f4961..359e78d 100644 --- a/src/lib/components/events/comms.ts +++ b/src/lib/components/events/comms.ts @@ -1,12 +1,15 @@ import type { MaintenancePopupEventsMap } from "$lib/components/events/maintenance-popup-events"; import { BaseComponent } from "$lib/components/base/BaseComponent"; import type { FullscreenViewerEventsMap } from "$lib/components/events/fullscreen-viewer-events"; +import type { BooruEventsMap } from "$lib/components/events/booru-events"; -interface EventsMapping extends MaintenancePopupEventsMap, FullscreenViewerEventsMap { -} +type EventsMapping = + MaintenancePopupEventsMap + & FullscreenViewerEventsMap + & BooruEventsMap; type EventCallback = (event: CustomEvent) => void; -type UnsubscribeFunction = () => void; +export type UnsubscribeFunction = () => void; type ResolvableTarget = EventTarget | BaseComponent; function resolveTarget(componentOrElement: ResolvableTarget): EventTarget {