mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: expose more from web-view
This commit is contained in:
2
packages/core/ui/web-view/index.d.ts
vendored
2
packages/core/ui/web-view/index.d.ts
vendored
@@ -14,7 +14,7 @@ export const urlProperty: Property<WebView, string>;
|
||||
/**
|
||||
* Represents navigation type
|
||||
*/
|
||||
export type NavigationType = 'linkClicked' | 'formSubmitted' | 'backForward' | 'reload' | 'formResubmitted' | 'other' | undefined;
|
||||
export type WebViewNavigationType = 'linkClicked' | 'formSubmitted' | 'backForward' | 'reload' | 'formResubmitted' | 'other' | undefined;
|
||||
|
||||
/**
|
||||
* Represents a standard WebView widget.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { NavigationType } from '.';
|
||||
import { WebViewNavigationType } from '.';
|
||||
import { WebViewBase } from './web-view-common';
|
||||
import { profile } from '../../profiling';
|
||||
import { Trace } from '../../trace';
|
||||
@@ -18,7 +18,7 @@ class WKNavigationDelegateImpl extends NSObject implements WKNavigationDelegate
|
||||
public webViewDecidePolicyForNavigationActionDecisionHandler(webView: WKWebView, navigationAction: WKNavigationAction, decisionHandler: any): void {
|
||||
const owner = this._owner.get();
|
||||
if (owner && navigationAction.request.URL) {
|
||||
let navType: NavigationType = 'other';
|
||||
let navType: WebViewNavigationType = 'other';
|
||||
|
||||
switch (navigationAction.navigationType) {
|
||||
case WKNavigationType.LinkActivated:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LoadEventData, NavigationType } from './web-view-interfaces';
|
||||
import { LoadEventData, WebViewNavigationType } from './web-view-interfaces';
|
||||
import { ContainerView, CSSType } from '../core/view';
|
||||
import { Property } from '../core/properties';
|
||||
import { EventData } from '../../data/observable';
|
||||
@@ -27,7 +27,7 @@ export abstract class WebViewBase extends ContainerView {
|
||||
this.notify(<any>args);
|
||||
}
|
||||
|
||||
public _onLoadStarted(url: string, navigationType: NavigationType) {
|
||||
public _onLoadStarted(url: string, navigationType: WebViewNavigationType) {
|
||||
let args = <LoadEventData>{
|
||||
eventName: WebViewBase.loadStartedEvent,
|
||||
object: this,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { WebView } from '.';
|
||||
import { EventData } from '../../data/observable';
|
||||
|
||||
export type NavigationType = 'linkClicked' | 'formSubmitted' | 'backForward' | 'reload' | 'formResubmitted' | 'other' | undefined;
|
||||
export type WebViewNavigationType = 'linkClicked' | 'formSubmitted' | 'backForward' | 'reload' | 'formResubmitted' | 'other' | undefined;
|
||||
|
||||
export interface LoadEventData extends EventData {
|
||||
url: string;
|
||||
navigationType: NavigationType;
|
||||
navigationType: WebViewNavigationType;
|
||||
error: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user