-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmyTypes.d.ts
More file actions
69 lines (60 loc) · 1.49 KB
/
Copy pathmyTypes.d.ts
File metadata and controls
69 lines (60 loc) · 1.49 KB
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
/// <reference no-default-lib="true" />
/// <reference types="../CTAutocomplete" />
/// <reference lib="es2015" />
import * as Elementa from 'Elementa/index';
declare global {
type Timeout = {
cancel(): void;
fn: () => void;
cancelled: boolean;
thread: Thread;
}
/**
* First is method to call when component is initialized.
* Second is to be called on cleanup.
*/
type DelicateComponent = [() => Elementa.UIContainer, () => void];
type TabComponentHandlerOptions = {
onClick: () => void;
onExit: () => void;
}
type TabComponentHandler = {
component: Elementa.UIComponent;
update(): void;
focused(): void;
unfocused(): void;
}
type Tab = {
page: Page,
getIndex(): number;
getName(): string;
setName(value: string): this;
getPinned(): boolean;
setPinned(value: boolean): this;
focused(): void;
unfocused(): void;
componentHandler: TabComponentHandler;
select(force?: boolean): this;
close(): void;
timeout?: Timeout;
}
type Page = ({
async: true;
loadingPromise: Promise<any>;
loadingRenderer: () => DelicateComponent;
} | {
async: false;
}) & {
renderer: (tab: Tab, data?: any) => Elementa.UIComponent;
tabComponentHandler: (tab: Tab, options: TabComponentHandlerOptions) => TabComponentHandler;
ids: string[];
}
type PitPandaItem = {
id: number,
count: number,
name: string,
desc: string[],
itemstack?: ItemStack,
meta: number,
}
}