Skip to content

Commit 5ea7dd7

Browse files
committed
Add TypeScript type for window.ALL_CRATES.
1 parent 98a4878 commit 5ea7dd7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

-2
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,6 @@ function preLoadCss(cssUrl) {
10041004
}
10051005

10061006
function addSidebarCrates() {
1007-
// @ts-expect-error
10081007
if (!window.ALL_CRATES) {
10091008
return;
10101009
}
@@ -1018,7 +1017,6 @@ function preLoadCss(cssUrl) {
10181017
const ul = document.createElement("ul");
10191018
ul.className = "block crate";
10201019

1021-
// @ts-expect-error
10221020
for (const crate of window.ALL_CRATES) {
10231021
const link = document.createElement("a");
10241022
link.href = window.rootPath + crate + "/index.html";

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+
/** List of all documented crates. */
11+
ALL_CRATES: string[]|undefined;
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)