1 // This file contains type definitions that are processed by the Closure Compiler but are
2 // not put into the JavaScript we include as part of the documentation. It is used for
3 // type checking. See README.md in this directory for more info.
7 function initSearch(searchIndex){}
12 * fullPath: Array<string>,
13 * pathWithoutLast: Array<string>,
15 * generics: Array<QueryElement>,
24 * typeFilter: (null|string),
35 * elems: Array<QueryElement>,
36 * args: Array<QueryElement>,
37 * returned: Array<QueryElement>,
49 * normalizedName: string,
50 * parent: (Object|null|undefined),
52 * ty: (Number|null|number),
53 * type: (Array<?>|null)
60 * in_args: Array<Object>,
61 * returned: Array<Object>,
62 * others: Array<Object>,
71 * displayPath: string,
77 * normalizedName: string,
78 * parent: (Object|undefined),
86 * A pair of [inputs, outputs], or 0 for null. This is stored in the search index.
87 * The JavaScript deserializes this into FunctionSearchType.
89 * Numeric IDs are *ONE-indexed* into the paths array (`p`). Zero is used as a sentinel for `null`
90 * because `null` is four bytes while `0` is one byte.
92 * An input or output can be encoded as just a number if there is only one of them, AND
93 * it has no generics. The no generics rule exists to avoid ambiguity: imagine if you had
94 * a function with a single output, and that output had a single generic:
96 * fn something() -> Result<usize, usize>
98 * If output was allowed to be any RawFunctionType, it would look like this
102 * The problem is that the above output could be interpreted as either a type with ID 50 and two
103 * generics, or it could be interpreted as a pair of types, the first one with ID 50 and the second
104 * with ID 3 and a single generic parameter that is also ID 3. We avoid this ambiguity by choosing
105 * in favor of the pair of types interpretation. This is why the `(number|Array<RawFunctionType>)`
106 * is used instead of `(RawFunctionType|Array<RawFunctionType>)`.
110 * [(number|Array<RawFunctionType>)] |
111 * [(number|Array<RawFunctionType>), (number|Array<RawFunctionType>)]
114 let RawFunctionSearchType;
117 * A single function input or output type. This is either a single path ID, or a pair of
118 * [path ID, generics].
120 * Numeric IDs are *ONE-indexed* into the paths array (`p`). Zero is used as a sentinel for `null`
121 * because `null` is four bytes while `0` is one byte.
123 * @typedef {number | [number, Array<RawFunctionType>]}
129 * inputs: Array<FunctionType>,
130 * outputs: Array<FunctionType>,
133 let FunctionSearchType;
137 * name: (null|string),
139 * generics: Array<FunctionType>,