UNPKG

974 BTypeScriptView Raw
1import type { WindowCapacitor } from './definitions-internal';
2export declare enum ExceptionCode {
3 /**
4 * API is not implemented.
5 *
6 * This usually means the API can't be used because it is not implemented for
7 * the current platform.
8 */
9 Unimplemented = "UNIMPLEMENTED",
10 /**
11 * API is not available.
12 *
13 * This means the API can't be used right now because:
14 * - it is currently missing a prerequisite, such as network connectivity
15 * - it requires a particular platform or browser version
16 */
17 Unavailable = "UNAVAILABLE"
18}
19export interface ExceptionData {
20 [key: string]: any;
21}
22export declare class CapacitorException extends Error {
23 readonly message: string;
24 readonly code?: ExceptionCode;
25 readonly data?: ExceptionData;
26 constructor(message: string, code?: ExceptionCode, data?: ExceptionData);
27}
28export declare const getPlatformId: (win: WindowCapacitor) => 'android' | 'ios' | 'web';