forked from davetayls/cordova_proxies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcordova_proxies.d.ts
206 lines (190 loc) · 7.52 KB
/
cordova_proxies.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
// Generated by dts-bundle v0.2.0
// Dependencies for this module:
// ../typings/backbone/backbone.d.ts
declare module 'cordova_proxies' {
export import browser = require('__cordova_proxies/browser');
export import camera = require('__cordova_proxies/camera');
export import core = require('__cordova_proxies/core');
export import device = require('__cordova_proxies/device');
export import dialogs = require('__cordova_proxies/dialogs');
export import file = require('__cordova_proxies/file');
export import keyboard = require('__cordova_proxies/keyboard');
export import ready = require('__cordova_proxies/ready');
export import media = require('__cordova_proxies/media');
export import pushNotification = require('__cordova_proxies/pushNotification');
export import splashscreen = require('__cordova_proxies/splashscreen');
export import statusbar = require('__cordova_proxies/statusbar');
}
declare module '__cordova_proxies/browser' {
import EventedClass = require('__cordova_proxies/EventedClass');
export interface IRequestWindow extends Window {
show(): void;
}
export interface IPostMessageEvent extends Event {
data: any;
origin: string;
source: Window;
}
export class BrowserRequest extends EventedClass.EventedClass {
constructor(url: string);
url: string;
windowTarget: string;
windowOptions: string[];
openDelay: number;
window: IRequestWindow;
windowShowTimeout: number;
windowCheckClosedIntervalLength: number;
_addWindowEvents(): void;
removeWindowEvents(): void;
_onLoadStart(e: InAppBrowserEvent): void;
_onLoadStop(e: InAppBrowserEvent): void;
_onLoadError(e: InAppBrowserEvent): void;
_onPostMessage(e: IPostMessageEvent): void;
_onExit(e: InAppBrowserEvent): void;
open(url?: string): number;
close(): void;
show(): any;
}
}
declare module '__cordova_proxies/camera' {
export function isAvailable(): boolean;
export function getPicture(success: (url: string) => void, error: (errString: string) => void, options: CameraOptions): void;
export function getVideoMediaStream(width: number, height: number): HTMLVideoElement;
}
declare module '__cordova_proxies/core' {
export function isAvailable(): boolean;
}
declare module '__cordova_proxies/device' {
export function isIOS(): boolean;
export function isAndroid(): boolean;
export function isAmazonFireOS(): boolean;
export function isAndroidBased(): boolean;
}
declare module '__cordova_proxies/dialogs' {
/**
* Dialogs helpers
*
* Requires:
* cordova plugin add cordova-plugin-dialogs --save
*/
export function alert(message: string, cb: () => void, title?: string, buttonName?: string): void;
export function confirm(message: string, confirmCallback: (choice: number) => void, title?: string, buttonLabels?: string[]): void;
}
declare module '__cordova_proxies/file' {
export function syncLocal(name: string, url: string, opts: any, cb: (err: FileTransferError, url?: string) => void): void;
export function createFileFromDataUrl(fs: FileSystem, fileName: string, dataUrl: string, successHandler: (fileSystemUrl: string) => void, errorHandler: (error: any) => void): void;
/**
* Creates and returns a blob from a data URL (either base64 encoded or not).
*
* @param {string} dataURL The data URL to convert.
* @return {Blob} A blob representing the array buffer data.
*/
export function dataURLToBlob(dataURL: string): Blob;
}
declare module '__cordova_proxies/keyboard' {
import EventedClass = require('__cordova_proxies/EventedClass');
export var CHANGED_EVENT: string;
export class KeyboardState extends EventedClass.EventedClass {
constructor();
keyboardIsOpen: boolean;
keyboardHeight: number;
focusedElement: JQuery;
}
export var currentState: KeyboardState;
export var activeEl: Element;
/**
* Hide the keyboard accessory bar with the next, previous and done buttons.
*
* @param hide
*/
export function hideKeyboardAccessoryBar(hide: boolean): void;
/**
* Close the keyboard if it is open.
*/
export function close(): void;
/**
* Disable native scrolling, useful if you are using JavaScript to scroll
*
* @param disbale
*/
export function disableScroll(disable: boolean): void;
/**
* Whether or not the keyboard is currently visible.
*/
export function isVisible(): boolean;
export interface IKeyboardShowEvent extends Event {
keyboardHeight: number;
}
export function listenToShow(listener: (e: IKeyboardShowEvent) => void): void;
export function listenToHide(listener: (e: Event) => void): void;
export function listenToChanged(listener: (state: KeyboardState) => void): void;
export function stopListeningToChanged(listener: (state: KeyboardState) => void): void;
}
declare module '__cordova_proxies/ready' {
export var whenReady: JQueryPromise<{}>;
}
declare module '__cordova_proxies/media' {
export interface IMediaPlayable {
play: () => any;
pause: () => any;
stop?: () => any;
release?: () => any;
}
export class MediaProxy {
static MEDIA_NONE: number;
static MEDIA_STARTING: number;
static MEDIA_RUNNING: number;
static MEDIA_PAUSED: number;
static MEDIA_STOPPED: number;
constructor(url: string, mediaSuccess: () => void, mediaError: (error: MediaError) => any, mediaStatus: (status: number) => void);
media: IMediaPlayable;
audio: HTMLAudioElement;
url: string;
mediaSuccess: () => void;
mediaError: (error: MediaError) => any;
mediaStatus: (status: number) => void;
currentStatus: number;
protected normalizeUrl(): string;
protected statusChange(status: number): void;
play(): void;
pause(): void;
stop(): void;
release(): void;
}
}
declare module '__cordova_proxies/pushNotification' {
/***
* Push notification helpers
*
* Requires:
* https://github.com/phonegap-build/PushPlugin
* https://github.com/apache/cordova-plugin-device
*/
export var noop: () => void;
}
declare module '__cordova_proxies/splashscreen' {
/***
* Splash screen helpers
*
* Requires:
* http://plugins.cordova.io/#/package/org.apache.cordova.splashscreen
*/
export function show(): void;
export function hide(): void;
}
declare module '__cordova_proxies/statusbar' {
}
declare module '__cordova_proxies/EventedClass' {
import Backbone = require('backbone');
export class EventedClass implements Backbone.Events {
on: (eventName: string, callback?: Function, context?: any) => any;
off: (eventName?: string, callback?: Function, context?: any) => any;
trigger: (eventName: string, ...args: any[]) => any;
bind: (eventName: string, callback: Function, context?: any) => any;
unbind: (eventName?: string, callback?: Function, context?: any) => any;
once: (events: string, callback: Function, context?: any) => any;
listenTo: (object: any, events: string, callback: Function) => any;
listenToOnce: (object: any, events: string, callback: Function) => any;
stopListening: (object?: any, events?: string, callback?: Function) => any;
}
}