Files
Hristo Deshev b45cbe929b No more ambient modules for tns-core-modules/* subpackages.
- Use path mappings in tsconfig.json to resolve module typings
- Only use ambient mobules for global API's
- Move single-file modules to a subdir with the same name so that
we can provide a hand-written typing next to it (via package.json)
- Delete all mentions of tns-core-modules.d.ts
- Delete reference d.ts assembly build steps. Not needed anymore.
- HACK! Use a <reference> for global typings in application.d.ts
to avoid publishing a separate @types/tns-core-modules package.
- Rename declarations.d.ts to tns-core-modules.d.ts to preserve
JS project mappings in references.d.ts (the only place we use those)
2017-03-07 17:59:02 +02:00

111 lines
3.0 KiB
TypeScript

/**
* Contains the WebView class, which represents a standard browser widget.
*/
import { View, Property, EventData } from "ui/core/view";
/**
* Represents the observable property backing the Url property of each WebView instance.
*/
export const urlProperty: Property<WebView, string>;
/**
* Represents a standard WebView widget.
*/
export class WebView extends View {
/**
* String value used when hooking to loadStarted event.
*/
public static loadStartedEvent: string;
/**
* String value used when hooking to loadFinished event.
*/
public static loadFinishedEvent: string;
/**
* Array of string values used when passing navigation types.
*/
public static navigationTypes: string[];
/**
* Gets the native [android widget](http://developer.android.com/reference/android/webkit/WebView.html) that represents the user interface for this component. Valid only when running on Android OS.
*/
android: any /* android.webkit.WebView */;
/**
* Gets the native [UIWebView](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIWebView_Class/) that represents the user interface for this component. Valid only when running on iOS.
*/
ios: any /* UIWebView */;
/**
* Gets or sets the url, local file path or HTML string.
*/
src: string;
/**
* Gets a value indicating whether the WebView can navigate back.
*/
canGoBack: boolean;
/**
* Gets a value indicating whether the WebView can navigate forward.
*/
canGoForward: boolean;
/**
* Stops loading the current content (if any).
*/
stopLoading(): void;
/**
* Navigates back.
*/
goBack();
/**
* Navigates forward.
*/
goForward();
/**
* Reload the current url.
*/
reload();
/**
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
* @param callback - Callback function which will be executed when event is raised.
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
*/
on(eventNames: string, callback: (data: EventData) => void, thisArg?: any);
/**
* Raised when a loadFinished event occurs.
*/
on(event: "loadFinished", callback: (args: LoadEventData) => void, thisArg?: any);
/**
* Raised when a loadStarted event occurs.
*/
on(event: "loadStarted", callback: (args: LoadEventData) => void, thisArg?: any);
}
/**
* Event data containing information for the loading events of a WebView.
*/
export interface LoadEventData extends EventData {
/**
* Gets the url of the web-view.
*/
url: string;
/**
* Gets the navigation type of the web-view.
*/
navigationType: string;
/**
* Gets the error (if any).
*/
error: string;
}