-
Notifications
You must be signed in to change notification settings - Fork 0
/
globals.d.ts
58 lines (51 loc) · 1.32 KB
/
globals.d.ts
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import type * as cytoscape from 'cytoscape'
declare global {
// TODO
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const Deno: any
}
declare module 'cytoscape' {
interface CoreExport extends cytoscape.CoreExport {
json(): cytoscape.CytoscapeOptions
}
interface ElementDataDefinition extends cytoscape.ElementDataDefinition {
label?: string
}
interface SingularData extends cytoscape.SingularData {
/**
* Get the entire data object.
*/
data(): cytoscape.ElementDataDefinition
/**
* Get a particular data field for the element.
*
* @param name The name of the field to get.
*/
data(name: string)
/**
* Set a particular data field for the element.
*
* @param name The name of the field to set.
* @param value The value to set for the field.
*/
data(name: string, value: unknown)
/**
* Update multiple data fields at once via an object.
*
* @param obj The object containing name-value pairs to update data fields.
*/
data(obj: Record<string, unknown>)
/**
* Removes all mutable data fields for the elements.
*/
removeData()
/**
* Removes the specified mutable data fields for the elements.
*
* @param names A space-separated list of fields to delete.
*/
removeData(names: string)
json(): cytoscape.ElementDefinition
}
}
export {}