diff --git a/report/types/report-renderer.d.ts b/report/types/report-renderer.d.ts index e9efa855ab33..6d3448400b00 100644 --- a/report/types/report-renderer.d.ts +++ b/report/types/report-renderer.d.ts @@ -24,6 +24,32 @@ declare module Renderer { * Flow report uses this to convert `#seo` to `#index=0&anchor=seo`. */ onPageAnchorRendered?: (link: HTMLAnchorElement) => void; + + /** If defined, the 'Save as Gist' item in the topbar dropdown will be shown and when clicked, will run this function. */ + onSaveGist?: (lhr: LH.Result) => string; + + /** If defined, when the 'Save/Copy as HTML' items are clicked, this fn will be used instead of `documentElement.outerHTML`. */ + getStandaloneReportHTML?: () => string; + + /** If defined, renderer will call this when printing is invoked instead of window.print() */ + onPrintOverride?: (rootEl: HTMLElement) => Promise; + + /** If defined, renderer will call this rather than using a `.click()>` to trigger a JSON/HTML download. Blob will be either json or html. */ + onSaveFileOverride?: (blob: Blob, lhr: LH.Result) => Promise; + + /** + * DOM element that will the overlay DOM should be a child of. + * Between stacking contexts and z-index, the overlayParentEl should have a stacking/paint order high enough to cover all elements that the overlay should paint above. + * Defaults to the containerEl, but will be set in PSI to avoid being under the sticky header. + * @see https://philipwalton.com/articles/what-no-one-told-you-about-z-index/ */ + overlayParentEl?: HTMLElement; + + /** Callback running after a DOM element (like .lh-node or .lh-source-location) has been created */ + onDetailsItemRendered?: ( + type: LH.Audit.Details['type'], + el: HTMLElement, + value: LH.Audit.Details + ) => void; } }