Merge branch 'master' into CB-7179

This commit is contained in:
Jan Piotrowski 2018-10-03 17:37:28 +02:00 committed by GitHub
commit cbfa195f7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 186 deletions

View File

@ -19,11 +19,10 @@ matrix:
os: linux os: linux
language: node_js language: node_js
node_js: '4.2' node_js: '4.2'
# TBD SKIP for now: - env: PLATFORM=browser-safari
# - env: PLATFORM=browser-safari os: linux
# os: linux language: node_js
# language: node_js node_js: '4.2'
# node_js: '4.2'
- env: PLATFORM=browser-edge - env: PLATFORM=browser-edge
os: linux os: linux
language: node_js language: node_js
@ -38,9 +37,6 @@ matrix:
osx_image: xcode8.3 osx_image: xcode8.3
language: node_js language: node_js
node_js: '4.2' node_js: '4.2'
# FUTURE TBD:
# - env: PLATFORM=ios-11.4
# ...
- env: PLATFORM=android-4.4 - env: PLATFORM=android-4.4
os: linux os: linux
language: android language: android
@ -51,40 +47,36 @@ matrix:
- platform-tools - platform-tools
- tools - tools
- build-tools-26.0.2 - build-tools-26.0.2
# TBD SKIP for now: - env: PLATFORM=android-5.1
# - env: PLATFORM=android-5.1 os: linux
# os: linux language: android
# language: android jdk: oraclejdk8
# jdk: oraclejdk8 android:
# android: components:
# components: - tools
# - tools - platform-tools
# - platform-tools - tools
# - tools - build-tools-26.0.2
# - build-tools-26.0.2 - env: PLATFORM=android-6.0
# - env: PLATFORM=android-6.0 os: linux
# os: linux language: android
# language: android jdk: oraclejdk8
# jdk: oraclejdk8 android:
# android: components:
# components: - tools
# - tools - platform-tools
# - platform-tools - tools
# - tools - build-tools-26.0.2
# - build-tools-26.0.2 - env: PLATFORM=android-7.0
# - env: PLATFORM=android-7.0 os: linux
# os: linux language: android
# language: android jdk: oraclejdk8
# jdk: oraclejdk8 android:
# android: components:
# components: - tools
# - tools - platform-tools
# - platform-tools - tools
# - tools - build-tools-26.0.2
# - build-tools-26.0.2
# FUTURE TBD:
# - env: PLATFORM=android-8.?
# ...
before_install: before_install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm
@ -93,7 +85,7 @@ before_install:
- node --version - node --version
- if [[ "$PLATFORM" =~ android ]]; then gradle --version; fi - if [[ "$PLATFORM" =~ android ]]; then gradle --version; fi
- if [[ "$PLATFORM" =~ ios ]]; then npm install -g ios-deploy; fi - if [[ "$PLATFORM" =~ ios ]]; then npm install -g ios-deploy; fi
- if [[ "$PLATFORM" =~ android ]]; then echo y | android update sdk -u --filter android-22,android-23,android-24,android-25,android-26; - if [[ "$PLATFORM" =~ android ]]; then echo y | android update sdk -u --filter android-22,android-23,android-24,android-25,android-26,android-27;
fi fi
- git clone https://github.com/apache/cordova-paramedic /tmp/paramedic && pushd /tmp/paramedic - git clone https://github.com/apache/cordova-paramedic /tmp/paramedic && pushd /tmp/paramedic
&& npm install && popd && npm install && popd

168
types/index.d.ts vendored
View File

@ -2,38 +2,13 @@
// Project: https://github.com/apache/cordova-plugin-inappbrowser // Project: https://github.com/apache/cordova-plugin-inappbrowser
// Definitions by: Microsoft Open Technologies Inc <http://msopentech.com> // Definitions by: Microsoft Open Technologies Inc <http://msopentech.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// //
// Copyright (c) Microsoft Open Technologies Inc // Copyright (c) Microsoft Open Technologies Inc
// Licensed under the MIT license. // Licensed under the MIT license.
// TypeScript Version: 2.3
type channel = "loadstart" | "loadstop" | "loaderror" | "exit";
interface Window { interface Window {
/**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
* @param url The URL to load.
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
* The options string must not contain any blank space, and each feature's
* name/value pairs must be separated by a comma. Feature names are case insensitive.
*/
open(url: string, target?: "_self", options?: string): InAppBrowser;
/**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
* @param url The URL to load.
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
* The options string must not contain any blank space, and each feature's
* name/value pairs must be separated by a comma. Feature names are case insensitive.
*/
open(url: string, target?: "_blank", options?: string): InAppBrowser;
/**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
* @param url The URL to load.
* @param target The target in which to load the URL, an optional parameter that defaults to _self.
* @param options Options for the InAppBrowser. Optional, defaulting to: location=yes.
* The options string must not contain any blank space, and each feature's
* name/value pairs must be separated by a comma. Feature names are case insensitive.
*/
open(url: string, target?: "_system", options?: string): InAppBrowser;
/** /**
* Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser. * Opens a URL in a new InAppBrowser instance, the current browser instance, or the system browser.
* @param url The URL to load. * @param url The URL to load.
@ -50,66 +25,21 @@ interface Window {
* NOTE: The InAppBrowser window behaves like a standard web browser, and can't access Cordova APIs. * NOTE: The InAppBrowser window behaves like a standard web browser, and can't access Cordova APIs.
*/ */
interface InAppBrowser extends Window { interface InAppBrowser extends Window {
onloadstart: (type: InAppBrowserEvent) => void; onloadstart(type: Event): void;
onloadstop: (type: InAppBrowserEvent) => void; onloadstop(type: InAppBrowserEvent): void;
onloaderror: (type: InAppBrowserEvent) => void; onloaderror(type: InAppBrowserEvent): void;
onexit: (type: InAppBrowserEvent) => void; onexit(type: InAppBrowserEvent): void;
// addEventListener overloads // addEventListener overloads
/** /**
* Adds a listener for an event from the InAppBrowser. * Adds a listener for an event from the InAppBrowser.
* @param type the event to listen for * @param type loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL. * loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL. * loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed. * exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is * @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter. * passed an InAppBrowserEvent object as a parameter.
*/ */
addEventListener(type: "loadstart", callback: (event: InAppBrowserEvent) => void): void; addEventListener(type: channel, callback: InAppBrowserEventListenerOrEventListenerObject): void;
/**
* Adds a listener for an event from the InAppBrowser.
* @param type the event to listen for
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
addEventListener(type: "loadstop", callback: (event: InAppBrowserEvent) => void): void;
/**
* Adds a listener for an event from the InAppBrowser.
* @param type the event to listen for
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
addEventListener(type: "loaderror", callback: (event: InAppBrowserEvent) => void): void;
/**
* Adds a listener for an event from the InAppBrowser.
* @param type the event to listen for
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
addEventListener(type: "exit", callback: (event: InAppBrowserEvent) => void): void;
/**
* Adds a listener for an event from the InAppBrowser.
* @param type the event to listen for
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an Event object as a parameter.
*/
addEventListener(type: string, callback: (event: Event) => void): void;
// removeEventListener overloads // removeEventListener overloads
/** /**
* Removes a listener for an event from the InAppBrowser. * Removes a listener for an event from the InAppBrowser.
@ -121,51 +51,7 @@ interface InAppBrowser extends Window {
* @param callback the function that executes when the event fires. The function is * @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter. * passed an InAppBrowserEvent object as a parameter.
*/ */
removeEventListener(type: "loadstart", callback: (event: InAppBrowserEvent) => void): void; removeEventListener(type: channel, callback: InAppBrowserEventListenerOrEventListenerObject): void;
/**
* Removes a listener for an event from the InAppBrowser.
* @param type The event to stop listening for.
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
removeEventListener(type: "loadstop", callback: (event: InAppBrowserEvent) => void): void;
/**
* Removes a listener for an event from the InAppBrowser.
* @param type The event to stop listening for.
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
removeEventListener(type: "loaderror", callback: (event: InAppBrowserEvent) => void): void;
/**
* Removes a listener for an event from the InAppBrowser.
* @param type The event to stop listening for.
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an InAppBrowserEvent object as a parameter.
*/
removeEventListener(type: "exit", callback: (event: InAppBrowserEvent) => void): void;
/**
* Removes a listener for an event from the InAppBrowser.
* @param type The event to stop listening for.
* loadstart: event fires when the InAppBrowser starts to load a URL.
* loadstop: event fires when the InAppBrowser finishes loading a URL.
* loaderror: event fires when the InAppBrowser encounters an error when loading a URL.
* exit: event fires when the InAppBrowser window is closed.
* @param callback the function that executes when the event fires. The function is
* passed an Event object as a parameter.
*/
removeEventListener(type: string, callback: (event: Event) => void): void;
/** Closes the InAppBrowser window. */ /** Closes the InAppBrowser window. */
close(): void; close(): void;
/** Hides the InAppBrowser window. Calling this has no effect if the InAppBrowser was already hidden. */ /** Hides the InAppBrowser window. Calling this has no effect if the InAppBrowser was already hidden. */
@ -184,29 +70,21 @@ interface InAppBrowser extends Window {
* For multi-line scripts, this is the return value of the last statement, * For multi-line scripts, this is the return value of the last statement,
* or the last expression evaluated. * or the last expression evaluated.
*/ */
executeScript(script: { code: string }, callback: (result: any) => void): void; executeScript(script: { code: string } | { file: string }, callback: (result: any) => void): void;
/**
* Injects JavaScript code into the InAppBrowser window.
* @param script Details of the script to run, specifying either a file or code key.
* @param callback The function that executes after the JavaScript code is injected.
* If the injected script is of type code, the callback executes with
* a single parameter, which is the return value of the script, wrapped in an Array.
* For multi-line scripts, this is the return value of the last statement,
* or the last expression evaluated.
*/
executeScript(script: { file: string }, callback: (result: any) => void): void;
/** /**
* Injects CSS into the InAppBrowser window. * Injects CSS into the InAppBrowser window.
* @param css Details of the script to run, specifying either a file or code key. * @param css Details of the script to run, specifying either a file or code key.
* @param callback The function that executes after the CSS is injected. * @param callback The function that executes after the CSS is injected.
*/ */
insertCSS(css: { code: string }, callback: () => void): void; insertCSS(css: { code: string } | { file: string }, callback: () => void): void;
/** }
* Injects CSS into the InAppBrowser window.
* @param css Details of the script to run, specifying either a file or code key. type InAppBrowserEventListenerOrEventListenerObject = InAppBrowserEventListener | InAppBrowserEventListenerObject;
* @param callback The function that executes after the CSS is injected.
*/ type InAppBrowserEventListener = (evt: InAppBrowserEvent) => void;
insertCSS(css: { file: string }, callback: () => void): void;
interface InAppBrowserEventListenerObject {
handleEvent(evt: InAppBrowserEvent): void;
} }
interface InAppBrowserEvent extends Event { interface InAppBrowserEvent extends Event {
@ -218,4 +96,8 @@ interface InAppBrowserEvent extends Event {
code: number; code: number;
/** the error message, only in the case of loaderror. */ /** the error message, only in the case of loaderror. */
message: string; message: string;
} }
interface Cordova {
InAppBrowser: InAppBrowser;
}