forked from finos/openfin-react-hooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
87 lines (70 loc) · 2.61 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
87
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";
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 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 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";