forked from vtyrtov/types-bitrix24-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
74 lines (58 loc) · 1.33 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
// Type definitions for JS SDK REST API Bitrix24
// Project: https://training.bitrix24.com/rest_help/
// Definitions by: Vladimir Tyrtov <https://bitbucket.org/b24help/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace BX24 {
interface Result {
error(): boolean|string
data(): Object|Array<string>
}
interface PlacementOptions {
ENTITY_ID: string
ENTITY_VALUE_ID: string
}
interface PlacementOptionsUserFieldType extends PlacementOptions{
FIELD_NAME: string
MANDATORY: string
MODE: 'edit'|'view'
MULTIPLE: 'Y'|'N'
VALUE: string[]|string
XML_ID: string
}
interface Api {
placement: {
info(): {
placement: string
options: PlacementOptions|PlacementOptionsUserFieldType
}
call(
method: string,
result: string|string[]|Function
): void
}
init(callback?: Function): void
callMethod(
method: string,
params: Object,
callback: Function
): void
fitWindow(): void
isAdmin(): void
getDomain(): string
selectCRM(
params: {
entityType: string[],
multiple: Boolean,
value?: Object
},
callback: Function
): void
resizeWindow(
width: number,
height: number,
callback?: Function
): void
getScrollSize(): {scrollWidth: number, scrollHeight: number}
}
}
declare interface Window { BX24: BX24.Api }