UNPKG

2.03 kBTypeScriptView Raw
1import { CordovaOptions } from './interfaces';
2export declare const ERR_CORDOVA_NOT_AVAILABLE: {
3 error: string;
4};
5export declare const ERR_PLUGIN_NOT_INSTALLED: {
6 error: string;
7};
8export declare function getPromise<T>(callback: (resolve: Function, reject?: Function) => any): Promise<T>;
9export declare function wrapPromise(pluginObj: any, methodName: string, args: any[], opts?: CordovaOptions): Promise<unknown>;
10/**
11 * Checks if plugin/cordova is available
12 * @return {boolean | { error: string } }
13 * @private
14 */
15export declare function checkAvailability(pluginRef: string, methodName?: string, pluginName?: string): boolean | {
16 error: string;
17};
18export declare function checkAvailability(pluginObj: any, methodName?: string, pluginName?: string): boolean | {
19 error: string;
20};
21/**
22 * Checks if _objectInstance exists and has the method/property
23 * @private
24 */
25export declare function instanceAvailability(pluginObj: any, methodName?: string): boolean;
26export declare function setIndex(args: any[], opts?: any, resolve?: Function, reject?: Function): any;
27export declare function callCordovaPlugin(pluginObj: any, methodName: string, args: any[], opts?: any, resolve?: Function, reject?: Function): any;
28export declare function callInstance(pluginObj: any, methodName: string, args: any[], opts?: any, resolve?: Function, reject?: Function): any;
29export declare function getPlugin(pluginRef: string): any;
30export declare function get(element: Element | Window, path: string): any;
31export declare function pluginWarn(pluginName: string, plugin?: string, method?: string): void;
32/**
33 * @private
34 * @param pluginName
35 * @param method
36 */
37export declare function cordovaWarn(pluginName: string, method?: string): void;
38export declare type WrapFn = (...args: any[]) => any;
39/**
40 * @private
41 */
42export declare const wrap: (pluginObj: any, methodName: string, opts?: CordovaOptions) => WrapFn;
43/**
44 * @private
45 */
46export declare function wrapInstance(pluginObj: any, methodName: string, opts?: any): Function;