Skip to content

Commit 2e1c8f0

Browse files
committed
rustdoc.d.ts: window.SIDEBAR_ITEMS may exist.
1 parent ab180c2 commit 2e1c8f0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/librustdoc/html/static/js/main.js

-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,6 @@ function preLoadCss(cssUrl) {
585585
document.addEventListener("keydown", handleShortcut);
586586

587587
function addSidebarItems() {
588-
// @ts-expect-error
589588
if (!window.SIDEBAR_ITEMS) {
590589
return;
591590
}

src/librustdoc/html/static/js/rustdoc.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ declare global {
77
interface Window {
88
/** Make the current theme easy to find */
99
currentTheme: HTMLLinkElement|null;
10+
/** Generated in `render/context.rs` */
11+
SIDEBAR_ITEMS?: { [key: string]: string[] };
1012
/** Used by the popover tooltip code. */
1113
RUSTDOC_TOOLTIP_HOVER_MS: number;
1214
/** Used by the popover tooltip code. */

0 commit comments

Comments
 (0)