-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
86 lines (77 loc) · 1.99 KB
/
index.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// This is manually built for now
import { LiveStore, NamedNode } from 'rdflib';
import { SolidLogic } from 'solid-logic';
declare const list: Array<PaneDefinition>
declare const paneForIcon: { [key: string]: PaneDefinition }
declare const paneForPredicate: {
[key: string]: {
pred: NamedNode
code: number
}
}
declare function register (
pane: PaneDefinition,
requireQueryButton?: boolean
): void
declare function byName (name: string): PaneDefinition | null
/**
* All of the knowledge that a user accumulates throughout the current session
*/
export type DataBrowserSession = {
paneRegistry: PaneRegistry
store: LiveStore
logic: SolidLogic
}
/**
* The current context that a view is rendered into
*/
export type DataBrowserContext = {
dom: HTMLDocument
getOutliner: (dom: HTMLDocument) => unknown // @@ TODO Remove the use of getOutliner - only here as an interim until we have better solution
session: DataBrowserSession
}
/**
* Only a placeholder until we get something better going
*/
declare type PaneRegistry = {
list
paneForIcon
paneForPredicate
register
byName
}
export interface PaneDefinition {
icon: string
global?: boolean
name: string
audience?: NamedNode[]
label: (subject: NamedNode, context: DataBrowserContext) => string | null
render: (
subject: NamedNode,
context: DataBrowserContext,
options?: unknown
) => HTMLElement
shouldGetFocus?: (subject: NamedNode) => boolean
requireQueryButton?: boolean
mintClass?: NamedNode
mintNew?: (
context: DataBrowserContext,
options: NewPaneOptions
) => Promise<NewPaneOptions & { newInstance: NamedNode }>
predicates?: { [key: string]: number }
classes?: { [key: string]: number }
}
interface NewPaneOptions {
appPathSegment?: string
div: HTMLElement
dom: HTMLDocument
folder: NamedNode
iconEle: HTMLImageElement
me?: NamedNode
newBase: string
newInstance?: NamedNode
noIndexHTML: boolean
noun: string
pane: PaneDefinition
refreshTarget?: HTMLTableElement
}