forked from finos/openfin-react-hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
146 lines (125 loc) · 3.33 KB
/
index.d.ts
File metadata and controls
146 lines (125 loc) · 3.33 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import { Action } from "openfin/_v2/api/interappbus/channel/channel";
import { ChannelClient } from "openfin/_v2/api/interappbus/channel/client";
import { ChannelProvider } from "openfin/_v2/api/interappbus/channel/provider";
import Bounds from "openfin/_v2/api/window/bounds";
import { _Window } from "openfin/_v2/api/window/window";
import { WindowOption } from "openfin/_v2/api/window/windowOption";
import { Identity } from "openfin/_v2/identity";
import { ScreenEdge } from "./src/ScreenEdge";
import CHILD_WINDOW_STATE from "./src/utils/types/enums/ChildWindowState";
export interface IDimensions {
dockedWidth: number;
dockedHeight: number;
}
export interface IUseDockWindowOptions {
undockPosition?: {
left: number;
top: number;
};
undockSize?: {
height: number;
width: number;
};
}
export interface IChannelAction {
topic: string;
action: Action;
}
export interface IChildWindow {
close: () => void;
launch: (windowOptions?: WindowOption) => void;
populate: (jsx: JSX.Element) => void;
state: CHILD_WINDOW_STATE;
windowRef: _Window;
}
export interface IUseChildWindowOptions {
name: string;
windowOptions?: WindowOption;
parentDocument?: HTMLDocument;
cssUrl?: string;
shouldClosePreviousOnLaunch?: boolean;
shouldInheritCss?: boolean;
shouldInheritScripts?: boolean;
jsx?: JSX.Element;
}
export const useBounds: (target?: _Window) => Bounds;
export const useChannelClient: (
channelName: string,
) => {
client: ChannelClient;
error: Error;
};
export const useChannelProvider: (
channelName: string,
channelActions: IChannelAction[],
) => {
provider: ChannelProvider;
error: Error;
};
export enum enums {
CHILD_WINDOW_STATE,
}
export const useChildWindow: (
useChildWindowOptions: IUseChildWindowOptions,
) => IChildWindow;
export const useDocked: () => [boolean, () => Promise<void>];
export const useDockWindow: (initialEdge?: ScreenEdge, toMove?: _Window, allowUserToUndock?: boolean,
stretchToFit?: IDimensions,
options?: IUseDockWindowOptions) => [ScreenEdge, {
dockBottom: () => void;
dockLeft: () => void;
dockNone: () => void;
dockRight: () => void;
dockTop: () => void;
}
];
export const useFocus: (
target?: _Window,
) => [
boolean,
(newFocus: boolean) => Promise<void>,
() => Promise<void>,
() => Promise<void>
];
export const useInterApplicationBusPublish: <T>(
topic: string,
message: T,
) => {
success: boolean;
error: Error;
};
export const useInterApplicationBusSend: <T>(
identity: Identity,
topic: string,
message: T,
) => {
success: boolean;
error: Error;
};
export const useInterApplicationBusSubscribe: <T>(
identity: Identity,
topic: string,
) => {
data: {
message: T;
name: string;
uuid: string;
};
subscribeError: unknown;
isSubscribed: boolean;
};
export const useMaximized: () => [
boolean,
(shouldMaximize: boolean) => Promise<void>
];
export const useOptions: (
target?: _Window,
) => [WindowOption, (options: WindowOption) => Promise<void>];
export const useUserMovement: (
target?: _Window,
initialValue?: boolean,
) => [boolean, (toEnable: boolean) => Promise<void>];
export const useZoom: (
target?: _Window,
) => [number, (newZoom: number) => Promise<void>];
export { ScreenEdge } from "./src/ScreenEdge";