rustdoc.d.ts: add window.{register_implementors,pending_implementors}
This commit is contained in:
parent
2e1c8f088a
commit
749b6bf79f
2 changed files with 17 additions and 3 deletions
|
@ -673,7 +673,6 @@ function preLoadCss(cssUrl) {
|
|||
}
|
||||
|
||||
// <https://github.com/search?q=repo%3Arust-lang%2Frust+[RUSTDOCIMPL]+trait.impl&type=code>
|
||||
// @ts-expect-error
|
||||
window.register_implementors = imp => {
|
||||
const implementors = document.getElementById("implementors-list");
|
||||
const synthetic_implementors = document.getElementById("synthetic-implementors-list");
|
||||
|
@ -765,9 +764,7 @@ function preLoadCss(cssUrl) {
|
|||
}
|
||||
}
|
||||
};
|
||||
// @ts-expect-error
|
||||
if (window.pending_implementors) {
|
||||
// @ts-expect-error
|
||||
window.register_implementors(window.pending_implementors);
|
||||
}
|
||||
|
||||
|
|
17
src/librustdoc/html/static/js/rustdoc.d.ts
vendored
17
src/librustdoc/html/static/js/rustdoc.d.ts
vendored
|
@ -44,6 +44,15 @@ declare global {
|
|||
* Set up event listeners for a scraped source example.
|
||||
*/
|
||||
updateScrapedExample?: function(HTMLElement, HTMLElement),
|
||||
/**
|
||||
* register trait implementors, called by code generated in
|
||||
* `write_shared.rs`
|
||||
*/
|
||||
register_implementors?: function(Implementors): void,
|
||||
/**
|
||||
* fallback in case `register_implementors` isn't defined yet.
|
||||
*/
|
||||
pending_implementors?: Implementors,
|
||||
}
|
||||
interface HTMLElement {
|
||||
/** Used by the popover tooltip code. */
|
||||
|
@ -415,4 +424,12 @@ declare namespace rustdoc {
|
|||
};
|
||||
|
||||
type VlqData = VlqData[] | number;
|
||||
|
||||
/**
|
||||
* Maps from crate names to trait implementation data.
|
||||
* Provied by generated `trait.impl` files.
|
||||
*/
|
||||
type Implementors = {
|
||||
[key: string]: Array<[string, number, Array<string>]>
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue