diff options
| author | Ralf Jung <post@ralfj.de> | 2025-04-02 23:54:22 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2025-04-02 23:54:22 +0200 |
| commit | e435ba32d85057070dba3f07fa8afd96799a0cfb (patch) | |
| tree | c989d04f4bcd32bcd93ed62208af68e1dbe36b6d /src/librustdoc/html/static/js/rustdoc.d.ts | |
| parent | a3af09faa39d5a8d303a4cc2f80182e0f01baa7c (diff) | |
| parent | 64b58dd13b06a23d8429a73c225347b4cd3b2c3c (diff) | |
Merge from rustc
Diffstat (limited to 'src/librustdoc/html/static/js/rustdoc.d.ts')
| -rw-r--r-- | src/librustdoc/html/static/js/rustdoc.d.ts | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/js/rustdoc.d.ts b/src/librustdoc/html/static/js/rustdoc.d.ts index 4b43c00730d..91a58fab86e 100644 --- a/src/librustdoc/html/static/js/rustdoc.d.ts +++ b/src/librustdoc/html/static/js/rustdoc.d.ts @@ -4,6 +4,12 @@ /* eslint-disable */ declare global { + /** Map from crate name to directory structure, for source view */ + declare var srcIndex: Map<string, rustdoc.Dir>; + /** Defined and documented in `storage.js` */ + declare function nonnull(x: T|null, msg: string|undefined); + /** Defined and documented in `storage.js` */ + declare function nonundef(x: T|undefined, msg: string|undefined); interface Window { /** Make the current theme easy to find */ currentTheme: HTMLLinkElement|null; @@ -41,6 +47,23 @@ declare global { */ rustdocShowSourceSidebar: function(), /** + * Close the sidebar in source code view + */ + rustdocCloseSourceSidebar?: function(), + /** + * Shows the sidebar in source code view + */ + rustdocShowSourceSidebar?: function(), + /** + * Toggles the sidebar in source code view + */ + rustdocToggleSrcSidebar?: function(), + /** + * create's the sidebar in source code view. + * called in generated `src-files.js`. + */ + createSrcSidebar?: function(), + /** * Set up event listeners for a scraped source example. */ updateScrapedExample?: function(HTMLElement, HTMLElement), @@ -234,13 +257,21 @@ declare namespace rustdoc { ty: number, type?: FunctionSearchType, paramNames?: string[], - displayType: Promise<Array<Array<string>>>|null, - displayTypeMappedNames: Promise<Array<[string, Array<string>]>>|null, + displayTypeSignature: Promise<rustdoc.DisplayTypeSignature> | null, item: Row, dontValidate?: boolean, } /** + * output of `formatDisplayTypeSignature` + */ + interface DisplayTypeSignature { + type: Array<string>, + mappedNames: Map<string, string>, + whereClause: Map<string, Array<string>>, + } + + /** * A pair of [inputs, outputs], or 0 for null. This is stored in the search index. * The JavaScript deserializes this into FunctionSearchType. * @@ -438,4 +469,12 @@ declare namespace rustdoc { type TypeImpls = { [cratename: string]: Array<Array<string|0>> } + + /** + * Directory structure for source code view, + * defined in generated `src-files.js`. + * + * is a tuple of (filename, subdirs, filenames). + */ + type Dir = [string, rustdoc.Dir[], string[]] } |
