File size: 573 Bytes
0ad74ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import docs_json from "./docs.json";

let docs: { [key: string]: any } = docs_json.docs;

export function get_object(name: string) {
	let obj: any;
	if (name === "events" || name === "events_matrix") {
		obj = docs["gradio"][name];
		return obj;
	}
	for (const library in docs) {
		for (const key in docs[library]) {
			if (key === name && key !== "chatinterface") {
				obj = docs[library][key];
				break;
			} else {
				for (const o in docs[library][key]) {
					if (o === name) {
						obj = docs[library][key][o];
						break;
					}
				}
			}
		}
	}
	return obj;
}