forked from huangx916/GameplayFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfbutil.d.ts
148 lines (124 loc) · 3.73 KB
/
fbutil.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
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
147
148
declare interface PlayerManager
{
setNumData(key, data): void;
getNumData(key): number;
addNumData(key, data): void;
setObjData(key, data): void;
getObjData(key): any;
loadAllData(keys: string[], callback: Function): void;
compareSaveTime(server, local): 1|2;
getDataAuto(data, key): any;
playerData: any = {};
}
declare const playerManager: PlayerManager;
declare interface ShareType
{
offline;
newdragon;
task;
angry;
}
declare interface GlobalManager
{
canShare(type: string, args: any): boolean;
shareType: ShareType;
publicConfig: any = {};
}
declare const globalManager: GlobalManager;
declare interface PlayerInfo
{
playerId: string;
playerName: string;
photo: string;
}
declare interface Fbinstant_util
{
startGame(callback: Function): void;
getPlayerInfo(): PlayerInfo;
getPlayerFrineds(callback: Function, err?: Function): void;
getPlayerFriendIds(callback: Function, err?: Function): void;
requestRewardAd(callback?: Function, err?: Function): void;
showRewardAd(callback: Function, err?: Function): void;
requestInterstitialAd(callback?: Function): void;
showInterstitialAd(callback: Function, err?: Function): void;
chooseContext(callback: Function, err?: Function): void;
updateContext(callback: Function, err?: Function, ext?: object, img?: string, text?: string, strategy?: string, isAuto?: boolean): void;
createShortcut(callback?: Function): void;
getEntryPointData(): any;
share(callback: Function, icon: string, ext: object): void;
getContextID(): string;
captureScreen(node: cc.node, width: number, height: number, callback: Function, t?, h?);
}
declare interface RankInfo
{
id: string;
photo: string;
name: string;
score: number;
level: number;
coins: number;
index: number;
}
declare interface Server_util
{
login(username: string, pid: string, photo: string, callback: Function): void;
setRankInfo(score, level, coins): void;
getFriendsRank(friends, callback): void;
getGlobalRank(callback): void;
publicConfig(callback): void;
getActivityList(callback: Function): void;
taskReceive(taskId: string, callback: Function): void;
saveInviter(inviterId: string, contextId: string, callback: Function): void;
}
declare const server_util: Server_util
declare interface Webimg_util
{
load_webimg(url: string, sprite: cc.Sprite): void;
load_web_image_cache(url: string, callback: Function, data): void;
}
declare interface Number_util
{
unit_format(number: number): string;
millisecondToDate(millisecond: number): string;
isOneDay(perTime: number, nowTime: number): boolean;
}
declare interface Analytics_util
{
login_page_event(): void;
game_page_event(): void;
new_player_link_click_event(type: string): void;
create_shortcut_event(): void;
watch_video_event(type: string): void;
watch_video_success_event(type: string): void;
fish_times_event(): void;
bot_recall_event(param: string): void;
length_id_event(type: string): void;
strength_id_event(type: string): void;
new_player_switch_click_event(type: string): void;
share_type_event(type: string): void;
upgrade_type_event(type: string): void;
}
declare interface ServerTaskReward
{
reward_id: number;
reward_type: number;
reward_title: string;
reward_desc: string;
number: number;
}
declare interface ServerTaskData
{
task_id: number;
task_title: string;
task_desc: string;
task_obj_type: number;
total_progress: number;
total_task_times: number;
scene: number;
config: object;
reward: ServerTaskReward[];
// 本地存储
//progress: number;
//task_times: number;
//reward_num: number;
}