mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup reexporting and TS 3.9 support
This commit is contained in:
6
nativescript-core/index.d.ts
vendored
6
nativescript-core/index.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
/// <reference path="./tns-core-modules.d.ts" />
|
||||
|
||||
export { ApplicationEventData, LaunchEventData, OrientationChangedEventData, UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData, iOSApplication, AndroidApplication, AndroidActivityEventData, AndroidActivityBundleEventData, AndroidActivityRequestPermissionsEventData, AndroidActivityResultEventData, AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData, } from "./application";
|
||||
import { getMainEntry, getRootView, setResources, setCssFileName, getCssFileName, loadAppCss, addCss, on, off, run, orientation, getNativeApplication, hasLaunched } from "./application";
|
||||
import { getMainEntry, getRootView, setResources, setCssFileName, getCssFileName, loadAppCss, addCss, on, off, run, orientation, getNativeApplication, hasLaunched, AndroidApplication, iOSApplication } from "./application";
|
||||
export declare const Application: {
|
||||
launchEvent: string;
|
||||
displayedEvent: string;
|
||||
@@ -25,8 +25,8 @@ export declare const Application: {
|
||||
orientation: typeof orientation;
|
||||
getNativeApplication: typeof getNativeApplication;
|
||||
hasLaunched: typeof hasLaunched;
|
||||
android: import("./application/application").AndroidApplication;
|
||||
ios: import("./application/application").iOSApplication;
|
||||
android: AndroidApplication;
|
||||
ios: iOSApplication;
|
||||
};
|
||||
import { setString, getString, clear, flush, getAllKeys, getBoolean, getNumber, hasKey, remove, setBoolean, setNumber } from "./application-settings";
|
||||
export declare const ApplicationSettings: {
|
||||
|
||||
@@ -9,7 +9,7 @@ export {
|
||||
|
||||
AndroidActivityEventData, AndroidActivityBundleEventData,
|
||||
AndroidActivityRequestPermissionsEventData, AndroidActivityResultEventData,
|
||||
AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData,
|
||||
AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData
|
||||
} from "./application";
|
||||
|
||||
// Export all methods and fields from "application" as Application
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
|
||||
getMainEntry, getRootView, setResources, setCssFileName, getCssFileName, loadAppCss, addCss,
|
||||
on, off, run, orientation, getNativeApplication, hasLaunched,
|
||||
|
||||
android, ios,
|
||||
} from "./application";
|
||||
export const Application = {
|
||||
@@ -29,7 +28,7 @@ export const Application = {
|
||||
getMainEntry, getRootView, setResources, setCssFileName, getCssFileName, loadAppCss, addCss,
|
||||
on, off, run, orientation, getNativeApplication, hasLaunched,
|
||||
|
||||
android, ios,
|
||||
android: android, ios: ios,
|
||||
};
|
||||
|
||||
// Export all methods from "application-settings" as ApplicationSettings
|
||||
|
||||
@@ -19,11 +19,6 @@ import { getTransformedText } from "../text-base";
|
||||
// TODO: Impl trace
|
||||
// import { isEnabled as traceEnabled, write as traceWrite } from "../../../trace";
|
||||
|
||||
export * from "../tab-navigation-base/tab-content-item";
|
||||
export * from "../tab-navigation-base/tab-navigation-base";
|
||||
export * from "../tab-navigation-base/tab-strip";
|
||||
export * from "../tab-navigation-base/tab-strip-item";
|
||||
|
||||
const PRIMARY_COLOR = "colorPrimary";
|
||||
const DEFAULT_ELEVATION = 8;
|
||||
|
||||
|
||||
@@ -8,11 +8,6 @@ import { TabContentItem } from "../tab-navigation-base/tab-content-item";
|
||||
import { TabStrip } from "../tab-navigation-base/tab-strip";
|
||||
import { Property, CoercibleProperty, EventData } from "../core/view";
|
||||
|
||||
export * from "../tab-navigation-base/tab-content-item";
|
||||
export * from "../tab-navigation-base/tab-navigation-base";
|
||||
export * from "../tab-navigation-base/tab-strip";
|
||||
export * from "../tab-navigation-base/tab-strip-item";
|
||||
|
||||
/**
|
||||
* Defines the data for the TabView.selectedIndexChanged event.
|
||||
*/
|
||||
|
||||
@@ -20,11 +20,6 @@ import { getTransformedText } from "../text-base";
|
||||
// TODO:
|
||||
// import { profile } from "../../profiling";
|
||||
|
||||
export * from "../tab-navigation-base/tab-content-item";
|
||||
export * from "../tab-navigation-base/tab-navigation-base";
|
||||
export * from "../tab-navigation-base/tab-strip";
|
||||
export * from "../tab-navigation-base/tab-strip-item";
|
||||
|
||||
const maxTabsCount = 5;
|
||||
const majorVersion = iosUtils.MajorVersion;
|
||||
const isPhone = device.deviceType === "Phone";
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { Button as ButtonDefinition } from ".";
|
||||
import { TextBase, booleanConverter, CSSType } from "../text-base";
|
||||
|
||||
export * from "../text-base";
|
||||
|
||||
@CSSType("Button")
|
||||
export abstract class ButtonBase extends TextBase implements ButtonDefinition {
|
||||
public static tapEvent = "tap";
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { ContentView as ContentViewDefinition } from ".";
|
||||
import { View, CustomLayoutView, AddChildFromBuilder, layout, isIOS } from "../core/view";
|
||||
|
||||
export * from "../core/view";
|
||||
|
||||
export class ContentView extends CustomLayoutView implements ContentViewDefinition, AddChildFromBuilder {
|
||||
private _content: View;
|
||||
|
||||
|
||||
@@ -21,11 +21,6 @@ import * as types from "../../../utils/types";
|
||||
import * as bindableResources from "./bindable-resources";
|
||||
import * as polymerExpressions from "../../../js-libs/polymer-expressions";
|
||||
|
||||
export {
|
||||
Observable, WrappedValue, PropertyChangeData, EventData,
|
||||
traceEnabled, traceWrite, traceError, traceCategories, traceNotifyEvent, traceMessageType, isCategorySet
|
||||
};
|
||||
|
||||
const contextKey = "context";
|
||||
// this regex is used to get parameters inside [] for example:
|
||||
// from $parents['ListView'] will return 'ListView'
|
||||
|
||||
@@ -16,8 +16,6 @@ import { Style } from "../../styling/style";
|
||||
|
||||
import { profile } from "../../../profiling";
|
||||
|
||||
export { Style };
|
||||
|
||||
export const unsetValue: any = new Object();
|
||||
|
||||
let cssPropertyNames: string[] = [];
|
||||
|
||||
@@ -10,21 +10,14 @@ import { Property, CssProperty, CssAnimationProperty, InheritedProperty, Style,
|
||||
import { getSystemCssClasses, MODAL_ROOT_VIEW_CSS_CLASS, ROOT_VIEW_CSS_CLASS } from "../../../css/system-classes";
|
||||
import { Source } from "../../../utils/debug";
|
||||
import { Binding, BindingOptions, Observable, WrappedValue, PropertyChangeData, traceEnabled, traceWrite, traceCategories } from "../bindable";
|
||||
import { isIOS, isAndroid } from "../../../platform";
|
||||
import { layout } from "../../../utils/utils";
|
||||
import { isAndroid } from "../../../platform";
|
||||
import { Length, paddingTopProperty, paddingRightProperty, paddingBottomProperty, paddingLeftProperty } from "../../styling/style-properties";
|
||||
|
||||
// TODO: Remove this import!
|
||||
import * as types from "../../../utils/types";
|
||||
|
||||
import { Color } from "../../../color";
|
||||
import { getClass } from "../../../utils/types";
|
||||
|
||||
import { profile } from "../../../profiling";
|
||||
|
||||
export { isIOS, isAndroid, layout, Color };
|
||||
export * from "../bindable";
|
||||
export * from "../properties";
|
||||
|
||||
import * as dnm from "../../../debugger/dom-node";
|
||||
import * as ssm from "../../styling/style-scope";
|
||||
|
||||
@@ -278,7 +271,7 @@ export abstract class ViewBase extends Observable implements ViewBaseDefinition
|
||||
|
||||
// TODO: Use Type.prototype.typeName instead.
|
||||
get typeName(): string {
|
||||
return types.getClass(this);
|
||||
return getClass(this);
|
||||
}
|
||||
|
||||
get style(): Style {
|
||||
|
||||
@@ -28,10 +28,6 @@ import { LinearGradient } from "../../styling/linear-gradient";
|
||||
import { BackgroundRepeat } from "../../styling/style-properties";
|
||||
import { TextTransform } from "../../text-base";
|
||||
|
||||
export * from "../../styling/style-properties";
|
||||
export * from "../view-base";
|
||||
export { LinearGradient };
|
||||
|
||||
import * as am from "../../animation";
|
||||
|
||||
let animationModule: typeof am;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { DatePicker as DatePickerDefinition } from ".";
|
||||
import { View, Property, CSSType } from "../core/view";
|
||||
|
||||
export * from "../core/view";
|
||||
|
||||
const defaultDate = new Date();
|
||||
const dateComparer = (x: Date, y: Date): boolean => (x <= y && x >= y);
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { EditableTextBase as EditableTextBaseDefinition, KeyboardType, ReturnKeyType, UpdateTextTrigger, AutocapitalizationType } from ".";
|
||||
import { TextBase, Property, CssProperty, Style, Color, booleanConverter, makeValidator, makeParser, PseudoClassHandler } from "../text-base";
|
||||
|
||||
export * from "../text-base";
|
||||
|
||||
export abstract class EditableTextBase extends TextBase implements EditableTextBaseDefinition {
|
||||
public static blurEvent = "blur";
|
||||
public static focusEvent = "focus";
|
||||
|
||||
@@ -12,7 +12,6 @@ import { sanitizeModuleName } from "../builder/module-name-sanitizer";
|
||||
import { profile } from "../../profiling";
|
||||
|
||||
export * from "./frame-interfaces";
|
||||
export * from "../core/view";
|
||||
|
||||
function buildEntryFromArgs(arg: any): NavigationEntry {
|
||||
let entry: NavigationEntry;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { Color } from "../../color";
|
||||
import { Style, CssProperty } from "../core/properties";
|
||||
import { Style, CssProperty } from "../core/properties";
|
||||
import { View, Property, CSSType } from "../core/view";
|
||||
import { Color } from "../../color";
|
||||
import { HtmlView as HtmlViewDefinition } from ".";
|
||||
|
||||
export * from "../core/view";
|
||||
|
||||
@CSSType("HtmlView")
|
||||
export class HtmlViewBase extends View implements HtmlViewDefinition {
|
||||
public html: string;
|
||||
|
||||
@@ -13,7 +13,7 @@ export { DatePicker } from "./date-picker";
|
||||
// import { action, alert, confirm, login, prompt } from "./dialogs";
|
||||
// export const nsDialogs = { action, alert, confirm, login, prompt };
|
||||
|
||||
export { EditableTextBase } from "./editable-text-base";
|
||||
export * from "./editable-text-base";
|
||||
export { Frame, NavigationEntry, NavigationContext, NavigationTransition, BackstackEntry, ViewEntry } from "./frame";
|
||||
|
||||
export {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* @module "ui/styling/style"
|
||||
*/ /** */
|
||||
|
||||
import { Length, PercentLength, ViewBase, Observable, BackgroundRepeat, Visibility, HorizontalAlignment, VerticalAlignment, dip } from "../../core/view";
|
||||
import { Color } from "../../../color";
|
||||
import { Length, PercentLength, ViewBase, Observable, BackgroundRepeat, Visibility, HorizontalAlignment, VerticalAlignment, dip } from "../../core/view";
|
||||
import { Background } from "../background";
|
||||
import { Font, FontStyle, FontWeight } from "../font";
|
||||
import { TextAlignment, TextDecoration, TextTransform, WhiteSpace } from "../../text-base";
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { TextField as TextFieldDefinition } from ".";
|
||||
import { EditableTextBase, Property, booleanConverter, CSSType } from "../editable-text-base";
|
||||
|
||||
export * from "../editable-text-base";
|
||||
|
||||
@CSSType("TextField")
|
||||
export class TextFieldBase extends EditableTextBase implements TextFieldDefinition {
|
||||
public static returnPressEvent = "returnPress";
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import { TimePicker as TimePickerDefinition } from ".";
|
||||
import { View, Property, CSSType } from "../core/view";
|
||||
|
||||
export * from "../core/view";
|
||||
|
||||
interface Time {
|
||||
hour: number;
|
||||
minute: number;
|
||||
|
||||
@@ -5,7 +5,6 @@ import { File, knownFolders, path } from "../../file-system";
|
||||
|
||||
export { File, knownFolders, path };
|
||||
export * from "./web-view-interfaces";
|
||||
export * from "../core/view";
|
||||
|
||||
export const srcProperty = new Property<WebViewBase, string>({ name: "src" });
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { WebViewBase, knownFolders, traceEnabled, traceWrite, traceCategories, WebViewClient } from "./web-view-common";
|
||||
import { WebViewBase, knownFolders, WebViewClient } from "./web-view-common";
|
||||
import { isEnabled, write, categories } from '../../trace';
|
||||
|
||||
export * from "./web-view-common";
|
||||
|
||||
@@ -18,8 +19,8 @@ function initializeWebViewClient(): void {
|
||||
}
|
||||
|
||||
public shouldOverrideUrlLoading(view: android.webkit.WebView, url: string) {
|
||||
if (traceEnabled()) {
|
||||
traceWrite("WebViewClientClass.shouldOverrideUrlLoading(" + url + ")", traceCategories.Debug);
|
||||
if (isEnabled()) {
|
||||
write("WebViewClientClass.shouldOverrideUrlLoading(" + url + ")", categories.Debug);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -29,8 +30,8 @@ function initializeWebViewClient(): void {
|
||||
super.onPageStarted(view, url, favicon);
|
||||
const owner = this.owner;
|
||||
if (owner) {
|
||||
if (traceEnabled()) {
|
||||
traceWrite("WebViewClientClass.onPageStarted(" + url + ", " + favicon + ")", traceCategories.Debug);
|
||||
if (isEnabled()) {
|
||||
write("WebViewClientClass.onPageStarted(" + url + ", " + favicon + ")", categories.Debug);
|
||||
}
|
||||
owner._onLoadStarted(url, undefined);
|
||||
}
|
||||
@@ -40,8 +41,8 @@ function initializeWebViewClient(): void {
|
||||
super.onPageFinished(view, url);
|
||||
const owner = this.owner;
|
||||
if (owner) {
|
||||
if (traceEnabled()) {
|
||||
traceWrite("WebViewClientClass.onPageFinished(" + url + ")", traceCategories.Debug);
|
||||
if (isEnabled()) {
|
||||
write("WebViewClientClass.onPageFinished(" + url + ")", categories.Debug);
|
||||
}
|
||||
owner._onLoadFinished(url, undefined);
|
||||
}
|
||||
@@ -59,8 +60,8 @@ function initializeWebViewClient(): void {
|
||||
|
||||
const owner = this.owner;
|
||||
if (owner) {
|
||||
if (traceEnabled()) {
|
||||
traceWrite("WebViewClientClass.onReceivedError(" + errorCode + ", " + description + ", " + failingUrl + ")", traceCategories.Debug);
|
||||
if (isEnabled()) {
|
||||
write("WebViewClientClass.onReceivedError(" + errorCode + ", " + description + ", " + failingUrl + ")", categories.Debug);
|
||||
}
|
||||
owner._onLoadFinished(failingUrl, description + "(" + errorCode + ")");
|
||||
}
|
||||
@@ -75,8 +76,8 @@ function initializeWebViewClient(): void {
|
||||
|
||||
const owner = this.owner;
|
||||
if (owner) {
|
||||
if (traceEnabled()) {
|
||||
traceWrite("WebViewClientClass.onReceivedError(" + error.getErrorCode() + ", " + error.getDescription() + ", " + (error.getUrl && error.getUrl()) + ")", traceCategories.Debug);
|
||||
if (isEnabled()) {
|
||||
write("WebViewClientClass.onReceivedError(" + error.getErrorCode() + ", " + error.getDescription() + ", " + (error.getUrl && error.getUrl()) + ")", categories.Debug);
|
||||
}
|
||||
owner._onLoadFinished(error.getUrl && error.getUrl(), error.getDescription() + "(" + error.getErrorCode() + ")");
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { NavigationType } from ".";
|
||||
import { WebViewBase, knownFolders, traceWrite, traceEnabled, traceCategories } from "./web-view-common";
|
||||
import { WebViewBase, knownFolders } from "./web-view-common";
|
||||
import { profile } from "../../profiling";
|
||||
import { isEnabled, write, categories } from '../../trace';
|
||||
export * from "./web-view-common";
|
||||
|
||||
class WKNavigationDelegateImpl extends NSObject
|
||||
@@ -38,22 +39,22 @@ class WKNavigationDelegateImpl extends NSObject
|
||||
}
|
||||
decisionHandler(WKNavigationActionPolicy.Allow);
|
||||
|
||||
if (traceEnabled()) {
|
||||
traceWrite("WKNavigationDelegateClass.webViewDecidePolicyForNavigationActionDecisionHandler(" + navigationAction.request.URL.absoluteString + ", " + navigationAction.navigationType + ")", traceCategories.Debug);
|
||||
if (isEnabled()) {
|
||||
write("WKNavigationDelegateClass.webViewDecidePolicyForNavigationActionDecisionHandler(" + navigationAction.request.URL.absoluteString + ", " + navigationAction.navigationType + ")", categories.Debug);
|
||||
}
|
||||
owner._onLoadStarted(navigationAction.request.URL.absoluteString, navType);
|
||||
}
|
||||
}
|
||||
|
||||
public webViewDidStartProvisionalNavigation(webView: WKWebView, navigation: WKNavigation): void {
|
||||
if (traceEnabled()) {
|
||||
traceWrite("WKNavigationDelegateClass.webViewDidStartProvisionalNavigation(" + webView.URL + ")", traceCategories.Debug);
|
||||
if (isEnabled()) {
|
||||
write("WKNavigationDelegateClass.webViewDidStartProvisionalNavigation(" + webView.URL + ")", categories.Debug);
|
||||
}
|
||||
}
|
||||
|
||||
public webViewDidFinishNavigation(webView: WKWebView, navigation: WKNavigation): void {
|
||||
if (traceEnabled()) {
|
||||
traceWrite("WKNavigationDelegateClass.webViewDidFinishNavigation(" + webView.URL + ")", traceCategories.Debug);
|
||||
if (isEnabled()) {
|
||||
write("WKNavigationDelegateClass.webViewDidFinishNavigation(" + webView.URL + ")", categories.Debug);
|
||||
}
|
||||
const owner = this._owner.get();
|
||||
if (owner) {
|
||||
@@ -72,8 +73,8 @@ class WKNavigationDelegateImpl extends NSObject
|
||||
if (webView.URL) {
|
||||
src = webView.URL.absoluteString;
|
||||
}
|
||||
if (traceEnabled()) {
|
||||
traceWrite("WKNavigationDelegateClass.webViewDidFailNavigationWithError(" + error.localizedDescription + ")", traceCategories.Debug);
|
||||
if (isEnabled()) {
|
||||
write("WKNavigationDelegateClass.webViewDidFailNavigationWithError(" + error.localizedDescription + ")", categories.Debug);
|
||||
}
|
||||
owner._onLoadFinished(src, error.localizedDescription);
|
||||
}
|
||||
@@ -86,8 +87,8 @@ class WKNavigationDelegateImpl extends NSObject
|
||||
if (webView.URL) {
|
||||
src = webView.URL.absoluteString;
|
||||
}
|
||||
if (traceEnabled()) {
|
||||
traceWrite("WKNavigationDelegateClass.webViewDidFailProvisionalNavigationWithError(" + error.localizedDescription + ")", traceCategories.Debug);
|
||||
if (isEnabled()) {
|
||||
write("WKNavigationDelegateClass.webViewDidFailProvisionalNavigationWithError(" + error.localizedDescription + ")", categories.Debug);
|
||||
}
|
||||
owner._onLoadFinished(src, error.localizedDescription);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user