{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAAA,wCAAwC","sourcesContent":["/// \n\nimport type { PluginListenerHandle } from '@capacitor/core';\n\ndeclare module '@capacitor/cli' {\n export interface PluginsConfig {\n App?: {\n /**\n * Disable the plugin's default back button handling.\n *\n * Only available for Android.\n *\n * @since 7.1.0\n * @default false\n * @example true\n */\n disableBackButtonHandler?: boolean;\n };\n }\n}\n\nexport interface AppInfo {\n /**\n * The name of the app.\n *\n * @since 1.0.0\n */\n name: string;\n\n /**\n * The identifier of the app.\n * On iOS it's the Bundle Identifier.\n * On Android it's the Application ID\n *\n * @since 1.0.0\n */\n id: string;\n\n /**\n * The build version.\n * On iOS it's the CFBundleVersion.\n * On Android it's the versionCode.\n *\n * @since 1.0.0\n */\n build: string;\n\n /**\n * The app version.\n * On iOS it's the CFBundleShortVersionString.\n * On Android it's package's versionName.\n *\n * @since 1.0.0\n */\n version: string;\n}\n\nexport interface AppState {\n /**\n * Whether the app is active or not.\n *\n * @since 1.0.0\n */\n isActive: boolean;\n}\n\nexport interface URLOpenListenerEvent {\n /**\n * The URL the app was opened with.\n *\n * @since 1.0.0\n */\n url: string;\n\n /**\n * The source application opening the app (iOS only)\n * https://developer.apple.com/documentation/uikit/uiapplicationopenurloptionskey/1623128-sourceapplication\n *\n * @since 1.0.0\n */\n iosSourceApplication?: any;\n /**\n * Whether the app should open the passed document in-place\n * or must copy it first.\n * https://developer.apple.com/documentation/uikit/uiapplicationopenurloptionskey/1623123-openinplace\n *\n * @since 1.0.0\n */\n iosOpenInPlace?: boolean;\n}\n\nexport interface AppLaunchUrl {\n /**\n * The url used to open the app.\n *\n * @since 1.0.0\n */\n url: string;\n}\n\nexport interface RestoredListenerEvent {\n /**\n * The pluginId this result corresponds to. For example, `Camera`.\n *\n * @since 1.0.0\n */\n pluginId: string;\n /**\n * The methodName this result corresponds to. For example, `getPhoto`\n *\n * @since 1.0.0\n */\n methodName: string;\n /**\n * The result data passed from the plugin. This would be the result you'd\n * expect from normally calling the plugin method. For example, `CameraPhoto`\n *\n * @since 1.0.0\n */\n data?: any;\n /**\n * Boolean indicating if the plugin call succeeded.\n *\n * @since 1.0.0\n */\n success: boolean;\n /**\n * If the plugin call didn't succeed, it will contain the error message.\n *\n * @since 1.0.0\n */\n error?: {\n message: string;\n };\n}\n\nexport interface BackButtonListenerEvent {\n /**\n * Indicates whether the browser can go back in history.\n * False when the history stack is on the first entry.\n *\n * @since 1.0.0\n */\n canGoBack: boolean;\n}\n\nexport interface ToggleBackButtonHandlerOptions {\n /**\n * Indicates whether to enable or disable default back button handling.\n *\n * @since 7.1.0\n */\n enabled: boolean;\n}\n\nexport type StateChangeListener = (state: AppState) => void;\nexport type URLOpenListener = (event: URLOpenListenerEvent) => void;\nexport type RestoredListener = (event: RestoredListenerEvent) => void;\nexport type BackButtonListener = (event: BackButtonListenerEvent) => void;\n\nexport interface AppLanguageCode {\n /**\n * Two or Three character language code.\n *\n * @since 8.1.0\n */\n value: string;\n}\n\nexport interface AppPlugin {\n /**\n * Force exit the app. This should only be used in conjunction with the `backButton` handler for Android to\n * exit the app when navigation is complete.\n *\n * Ionic handles this itself so you shouldn't need to call this if using Ionic.\n *\n * @since 1.0.0\n */\n exitApp(): Promise;\n\n /**\n * Return information about the app.\n *\n * @since 1.0.0\n */\n getInfo(): Promise;\n\n /**\n * Gets the current app state.\n *\n * @since 1.0.0\n */\n getState(): Promise;\n\n /**\n * Get the URL the app was launched with, if any.\n *\n * @since 1.0.0\n */\n getLaunchUrl(): Promise;\n\n /**\n * Minimizes the application.\n *\n * Only available for Android.\n *\n * @since 1.1.0\n */\n minimizeApp(): Promise;\n\n /**\n * Get the app specific language locale code.\n *\n * @since 8.1.0\n */\n getAppLanguage(): Promise;\n\n /**\n * Enables or disables the plugin's back button handling during runtime.\n *\n * Only available for Android.\n *\n * @since 7.1.0\n */\n toggleBackButtonHandler(options: ToggleBackButtonHandlerOptions): Promise;\n\n /**\n * Listen for changes in the app or the activity states.\n *\n * On iOS it's fired when the native [UIApplication.willResignActiveNotification](https://developer.apple.com/documentation/uikit/uiapplication/1622973-willresignactivenotification) and\n * [UIApplication.didBecomeActiveNotification](https://developer.apple.com/documentation/uikit/uiapplication/1622953-didbecomeactivenotification) events get fired.\n * On Android it's fired when the Capacitor's Activity [onResume](https://developer.android.com/reference/android/app/Activity#onResume()) and [onStop](https://developer.android.com/reference/android/app/Activity#onStop()) methods gets called.\n * On Web it's fired when the document's visibilitychange gets fired.\n *\n * @since 1.0.0\n */\n addListener(eventName: 'appStateChange', listenerFunc: StateChangeListener): Promise;\n\n /**\n * Listen for when the app or the activity are paused.\n *\n * On iOS it's fired when the native [UIApplication.didEnterBackgroundNotification](https://developer.apple.com/documentation/uikit/uiapplication/1623071-didenterbackgroundnotification) event gets fired.\n * On Android it's fired when the Capacitor's Activity [onPause](https://developer.android.com/reference/android/app/Activity#onPause()) method gets called.\n * On Web it's fired when the document's visibilitychange gets fired and document.hidden is true.\n *\n * @since 4.1.0\n */\n addListener(eventName: 'pause', listenerFunc: () => void): Promise;\n\n /**\n * Listen for when the app or activity are resumed.\n *\n * On iOS it's fired when the native [UIApplication.willEnterForegroundNotification](https://developer.apple.com/documentation/uikit/uiapplication/1622944-willenterforegroundnotification) event gets fired.\n * On Android it's fired when the Capacitor's Activity [onResume](https://developer.android.com/reference/android/app/Activity#onResume()) method gets called,\n * but only after resume has fired first.\n * On Web it's fired when the document's visibilitychange gets fired and document.hidden is false.\n *\n * @since 4.1.0\n */\n addListener(eventName: 'resume', listenerFunc: () => void): Promise;\n\n /**\n * Listen for url open events for the app. This handles both custom URL scheme links as well\n * as URLs your app handles (Universal Links on iOS and App Links on Android)\n *\n * @since 1.0.0\n */\n addListener(eventName: 'appUrlOpen', listenerFunc: URLOpenListener): Promise;\n\n /**\n * If the app was launched with previously persisted plugin call data, such as on Android\n * when an activity returns to an app that was closed, this call will return any data\n * the app was launched with, converted into the form of a result from a plugin call.\n *\n * On Android, due to memory constraints on low-end devices, it's possible\n * that, if your app launches a new activity, your app will be terminated by\n * the operating system in order to reduce memory consumption.\n *\n * For example, that means the Camera API, which launches a new Activity to\n * take a photo, may not be able to return data back to your app.\n *\n * To avoid this, Capacitor stores all restored activity results on launch.\n * You should add a listener for `appRestoredResult` in order to handle any\n * plugin call results that were delivered when your app was not running.\n *\n * Once you have that result (if any), you can update the UI to restore a\n * logical experience for the user, such as navigating or selecting the\n * proper tab.\n *\n * We recommend every Android app using plugins that rely on external\n * Activities (for example, Camera) to have this event and process handled.\n *\n * @since 1.0.0\n */\n addListener(eventName: 'appRestoredResult', listenerFunc: RestoredListener): Promise;\n\n /**\n * Listen for the hardware back button event (Android only). Listening for this event will disable the\n * default back button behaviour, so you might want to call `window.history.back()` manually.\n * If you want to close the app, call `App.exitApp()`.\n *\n * @since 1.0.0\n */\n addListener(eventName: 'backButton', listenerFunc: BackButtonListener): Promise;\n\n /**\n * Remove all native listeners for this plugin\n *\n * @since 1.0.0\n */\n removeAllListeners(): Promise;\n}\n"]}