Skip to content

Commit

Permalink
chore: update replaywebpage type
Browse files Browse the repository at this point in the history
  • Loading branch information
SuaYoo committed Nov 26, 2024
1 parent 72b6bae commit 8f42464
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 2 additions & 3 deletions frontend/src/pages/org/collection-detail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class CollectionDetail extends BtrixElement {
private readonly descriptionExpandBtn?: HTMLElement | null;

@query("replay-web-page")
private readonly replayEmbed?: HTMLElement | null;
private readonly replayEmbed?: ReplayWebPage | null;

// Use to cancel requests
private getArchivedItemsController: AbortController | null = null;
Expand Down Expand Up @@ -233,8 +233,7 @@ export class CollectionDetail extends BtrixElement {
private refreshReplay() {
if (this.replayEmbed) {
try {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(this.replayEmbed as any).fullReload();
this.replayEmbed.fullReload();
} catch (e) {
console.warn("Full reload not available in RWP");
}
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/replayWebPage.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/**
* @TODO Import from replaywebpage once https://github.com/webrecorder/replayweb.page/issues/376 is addressed
*
* @attr {String} source
* @attr {String} coll
* @attr {String} config
Expand All @@ -7,7 +9,9 @@
* @attr {String} noCache
* @attr {String} url
*/
class ReplayWebPage {}
class ReplayWebPage {
fullReload(): void {}
}

declare global {
interface HTMLElementTagNameMap {
Expand Down

0 comments on commit 8f42464

Please sign in to comment.