|
1 | | -export as namespace WinBox; |
| 1 | +interface WinBoxControlType { |
| 2 | + class?: string; |
| 3 | + image?: string; |
| 4 | + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type |
| 5 | + click?: Function; |
| 6 | + index?: number; |
| 7 | +} |
2 | 8 |
|
3 | 9 | interface WinBox { |
| 10 | + id: string | number; |
| 11 | + title: string; |
4 | 12 | dom: Node; |
5 | | - background: string; |
| 13 | + window: Node; |
| 14 | + index: number; |
6 | 15 | body: HTMLElement; |
7 | | - border: string | number; |
| 16 | + header: number; |
8 | 17 |
|
9 | | - class: string | string[]; |
| 18 | + x: string | number; |
| 19 | + y: string | number; |
| 20 | + width: string | number; |
| 21 | + height: string | number; |
| 22 | + minwidth: string | number; |
| 23 | + minheight: string | number; |
| 24 | + maxwidth: string | number; |
| 25 | + maxheight: string | number; |
| 26 | + left: string | number; |
| 27 | + right: string | number; |
| 28 | + top: string | number; |
| 29 | + bottom: string | number; |
10 | 30 |
|
11 | | - html: string; |
12 | | - id: string | number; |
13 | | - index: number; |
| 31 | + overflow: boolean; |
| 32 | + min: boolean; |
14 | 33 | max: boolean; |
15 | | - modal: boolean; |
16 | | - root: Node; |
17 | | - title: string; |
18 | | - url: string; |
| 34 | + full: boolean; |
| 35 | + hidden: boolean; |
| 36 | + focused: boolean; |
| 37 | + |
| 38 | + onclose: (this: WinBox, force: boolean) => boolean; |
19 | 39 | onfocus: (this: WinBox) => void; |
20 | 40 | onblur: (this: WinBox) => void; |
21 | | - onresize: (this: WinBox, width: number, height: number) => void; |
22 | 41 | onmove: (this: WinBox, x: number, y: number) => void; |
23 | | - onclose: (this: WinBox, force: boolean) => boolean; |
| 42 | + onresize: (this: WinBox, width: number, height: number) => void; |
| 43 | + onfullscreen: (this: WinBox) => void; |
| 44 | + onmaximize: (this: WinBox) => void; |
| 45 | + onminimize: (this: WinBox) => void; |
| 46 | + onrestore: (this: WinBox) => void; |
| 47 | + onhide: (this: WinBox) => void; |
| 48 | + onshow: (this: WinBox) => void; |
| 49 | + |
24 | 50 | mount(src?: Element): WinBox; |
| 51 | + |
25 | 52 | unmount(dest?: Element): WinBox; |
| 53 | + |
26 | 54 | setTitle(title: string): WinBox; |
| 55 | + |
| 56 | + setIcon(url: string): WinBox; |
| 57 | + |
27 | 58 | setBackground(background: string): WinBox; |
| 59 | + |
28 | 60 | setUrl(url: string): WinBox; |
29 | | - focus(): WinBox; |
30 | | - hide(): WinBox; |
31 | | - show(): WinBox; |
| 61 | + |
| 62 | + focus(state?: boolean): WinBox; |
| 63 | + |
| 64 | + blur(state?: boolean): WinBox; |
| 65 | + |
| 66 | + hide(state?: boolean): WinBox; |
| 67 | + |
| 68 | + show(state?: boolean): WinBox; |
| 69 | + |
32 | 70 | minimize(state?: boolean): WinBox; |
| 71 | + |
| 72 | + restore(): WinBox; |
| 73 | + |
33 | 74 | maximize(state?: boolean): WinBox; |
| 75 | + |
34 | 76 | fullscreen(state?: boolean): WinBox; |
35 | | - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type |
36 | | - close(force?: boolean): boolean | void; |
| 77 | + |
| 78 | + close(force?: boolean): boolean | undefined; |
| 79 | + |
37 | 80 | move(x?: string | number, y?: string | number, skipUpdate?: boolean): WinBox; |
| 81 | + |
38 | 82 | resize(w?: string | number, h?: string | number, skipUpdate?: boolean): WinBox; |
| 83 | + |
| 84 | + addControl(control: WinBoxControlType): WinBox; |
| 85 | + |
| 86 | + removeControl(control: WinBoxControlType): WinBox; |
| 87 | + |
39 | 88 | addClass(classname: string): WinBox; |
| 89 | + |
40 | 90 | removeClass(classname: string): WinBox; |
| 91 | + |
| 92 | + hasClass(classname: string): WinBox; |
| 93 | + |
| 94 | + toggleClass(classname: string): WinBox; |
41 | 95 | } |
| 96 | + |
42 | 97 | declare namespace WinBox { |
43 | 98 | interface WinBoxConstructor { |
44 | 99 | (title: string, params?: Params): WinBox; |
| 100 | + |
45 | 101 | (params: Params): WinBox; |
| 102 | + |
46 | 103 | new(title: string, params?: Params): WinBox; |
| 104 | + |
47 | 105 | new(params: Params): WinBox; |
48 | 106 | } |
49 | 107 |
|
50 | 108 | interface Params { |
51 | | - background?: string | undefined; |
52 | | - body?: HTMLElement | undefined; |
53 | | - border?: string | number | undefined; |
54 | | - bottom?: string | number | undefined; |
55 | | - class?: string | string[] | undefined; |
56 | | - height?: string | number | undefined; |
57 | | - html?: string | undefined; |
58 | | - id?: string | number | undefined; |
59 | | - index?: number | undefined; |
60 | | - left?: string | number | undefined; |
61 | | - max?: boolean | undefined; |
62 | | - minheight?: string | number | undefined; |
63 | | - minwidth?: string | number | undefined; |
64 | | - modal?: boolean | undefined; |
65 | | - mount?: Node | undefined; |
66 | | - right?: string | number | undefined; |
67 | | - root?: Node | undefined; |
68 | | - splitscreen?: boolean | undefined; |
69 | | - title?: string | undefined; |
70 | | - top?: string | number | undefined; |
71 | | - url?: string | undefined; |
72 | | - width?: string | number | undefined; |
73 | | - x?: "right" | "center" | string | number | undefined; |
74 | | - y?: "bottom" | "center" | string | number | undefined; |
75 | | - onclose?: ((this: WinBox, force?: boolean) => boolean) | undefined; |
76 | | - onfocus?: ((this: WinBox) => void) | undefined; |
77 | | - onblur?: ((this: WinBox) => void) | undefined; |
78 | | - onresize?: ((this: WinBox, width: number, height: number) => void) | undefined; |
79 | | - onmove?: ((this: WinBox, x: number, y: number) => void) | undefined; |
80 | | - } |
| 109 | + id?: string; |
| 110 | + index?: number; |
| 111 | + root?: Node; |
| 112 | + tpl?: Node; |
| 113 | + title?: string; |
| 114 | + icon?: string; |
| 115 | + mount?: Node; |
| 116 | + html?: string; |
| 117 | + url?: string; |
81 | 118 |
|
82 | | - interface Params { |
83 | | - background?: string | undefined; |
84 | | - body?: HTMLElement | undefined; |
85 | | - border?: string | number | undefined; |
86 | | - bottom?: string | number | undefined; |
87 | | - class?: string | string[] | undefined; |
88 | | - height?: string | number | undefined; |
89 | | - html?: string | undefined; |
90 | | - id?: string | number | undefined; |
91 | | - index?: number | undefined; |
92 | | - left?: string | number | undefined; |
93 | | - max?: boolean | undefined; |
94 | | - modal?: boolean | undefined; |
95 | | - mount?: Node | undefined; |
96 | | - right?: string | number | undefined; |
97 | | - root?: Node | undefined; |
98 | | - title?: string | undefined; |
99 | | - top?: string | number | undefined; |
100 | | - url?: string | undefined; |
101 | | - width?: string | number | undefined; |
102 | | - x?: "right" | "center" | string | number | undefined; |
103 | | - y?: "bottom" | "center" | string | number | undefined; |
104 | | - onclose?: ((this: WinBox, force?: boolean) => boolean) | undefined; |
105 | | - onfocus?: ((this: WinBox) => void) | undefined; |
106 | | - onblur?: ((this: WinBox) => void) | undefined; |
107 | | - onresize?: ((this: WinBox, width: number, height: number) => void) | undefined; |
108 | | - onmove?: ((this: WinBox, x: number, y: number) => void) | undefined; |
| 119 | + x?: "right" | "center" | string | number; |
| 120 | + y?: "bottom" | "center" | string | number; |
| 121 | + width?: string | number; |
| 122 | + height?: string | number; |
| 123 | + minwidth?: string | number; |
| 124 | + minheight?: string | number; |
| 125 | + maxwidth?: string | number; |
| 126 | + maxheight?: string | number; |
| 127 | + left?: string | number; |
| 128 | + right?: string | number; |
| 129 | + top?: string | number; |
| 130 | + bottom?: string | number; |
| 131 | + |
| 132 | + min?: boolean; |
| 133 | + max?: boolean; |
| 134 | + hidden?: boolean; |
| 135 | + modal?: boolean; |
| 136 | + |
| 137 | + background?: string; |
| 138 | + border?: string | number; |
| 139 | + header?: number; |
| 140 | + class?: string | string[]; |
| 141 | + |
| 142 | + oncreate?: (this: WinBox, params?: Params) => void; |
| 143 | + onclose?: (this: WinBox, force?: boolean) => boolean; |
| 144 | + onfocus?: (this: WinBox) => void; |
| 145 | + onblur?: (this: WinBox) => void; |
| 146 | + onmove?: (this: WinBox, x: number, y: number) => void; |
| 147 | + onresize?: (this: WinBox, width: number, height: number) => void; |
| 148 | + onfullscreen?: (this: WinBox) => void; |
| 149 | + onminimize?: (this: WinBox) => void; |
| 150 | + onmaximize?: (this: WinBox) => void; |
| 151 | + onrestore?: (this: WinBox) => void; |
| 152 | + onhide?: (this: WinBox) => void; |
| 153 | + onshow?: (this: WinBox) => void; |
| 154 | + onload?: (this: WinBox) => void; |
109 | 155 | } |
110 | 156 | } |
111 | 157 |
|
|
0 commit comments