diff --git a/packages/core/index.d.ts b/packages/core/index.d.ts deleted file mode 100644 index 02238aeeb..000000000 --- a/packages/core/index.d.ts +++ /dev/null @@ -1,117 +0,0 @@ -/// -export { ApplicationEventData, LaunchEventData, OrientationChangedEventData, UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData, iOSApplication, AndroidApplication, AndroidActivityEventData, AndroidActivityBundleEventData, AndroidActivityRequestPermissionsEventData, AndroidActivityResultEventData, AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData } from './application'; -import { getMainEntry, getRootView, _resetRootView, getResources, setResources, setCssFileName, getCssFileName, loadAppCss, addCss, on, off, run, orientation, getNativeApplication, hasLaunched, AndroidApplication, iOSApplication } from './application'; -export declare const Application: { - launchEvent: string; - displayedEvent: string; - uncaughtErrorEvent: string; - discardedErrorEvent: string; - suspendEvent: string; - resumeEvent: string; - exitEvent: string; - lowMemoryEvent: string; - orientationChangedEvent: string; - getMainEntry: typeof getMainEntry; - getRootView: typeof getRootView; - resetRootView: typeof _resetRootView; - getResources: typeof getResources; - setResources: typeof setResources; - setCssFileName: typeof setCssFileName; - getCssFileName: typeof getCssFileName; - loadAppCss: typeof loadAppCss; - addCss: typeof addCss; - on: typeof on; - off: typeof off; - run: typeof run; - orientation: typeof orientation; - getNativeApplication: typeof getNativeApplication; - hasLaunched: typeof hasLaunched; - android: AndroidApplication; - ios: iOSApplication; -}; -import { setString, getString, clear, flush, getAllKeys, getBoolean, getNumber, hasKey, remove, setBoolean, setNumber } from './application-settings'; -export declare const ApplicationSettings: { - clear: typeof clear; - flush: typeof flush; - hasKey: typeof hasKey; - remove: typeof remove; - setString: typeof setString; - getString: typeof getString; - getAllKeys: typeof getAllKeys; - getBoolean: typeof getBoolean; - setBoolean: typeof setBoolean; - getNumber: typeof getNumber; - setNumber: typeof setNumber; -}; -export { Color } from './color'; -import { connectionType, getConnectionType, startMonitoring, stopMonitoring } from './connectivity'; -export declare const Connectivity: { - connectionType: typeof connectionType; - getConnectionType: typeof getConnectionType; - startMonitoring: typeof startMonitoring; - stopMonitoring: typeof stopMonitoring; -}; -export { CSSUtils } from './css/system-classes'; -export { ObservableArray, ChangeType, ChangedData } from './data/observable-array'; -export { Observable, PropertyChangeData, EventData, WrappedValue, fromObject, fromObjectRecursive } from './data/observable'; -export { VirtualArray, ItemsLoading } from './data/virtual-array'; -export { File, FileSystemEntity, Folder, knownFolders, path } from './file-system'; -export { HttpRequestOptions, HttpResponse, Headers, HttpResponseEncoding, HttpContent } from './http'; -import { getFile, getImage, getJSON, getString as httpGetString, request } from './http'; -export declare const Http: { - getFile: typeof getFile; - getImage: typeof getImage; - getJSON: typeof getJSON; - getString: typeof httpGetString; - request: typeof request; -}; -export { ImageAsset, ImageAssetOptions } from './image-asset'; -export { ImageSource } from './image-source'; -export { ModuleNameResolver, ModuleListProvider, PlatformContext, _setResolver } from './module-name-resolver'; -export { isAndroid, isIOS, Screen, IDevice, Device, platformNames } from './platform'; -// Profiling -export { InstrumentationMode, TimerInfo, profile, enable as profilingEnable, disable as profilingDisable, time as profilingTime, uptime as profilingUptime, start as profilingStart, stop as profilingStop, isRunning as profilingIsRunning, dumpProfiles as profilingDumpProfiles, resetProfiles as profilingResetProfiles, startCPUProfile as profilingStartCPU, stopCPUProfile as profilingStopCPU } from './profiling'; -export { encoding } from './text'; -export * from './trace'; - -export * from './ui'; -import { GC, isFontIconURI, isDataURI, isFileOrResourcePath, executeOnMainThread, mainThreadify, isMainThread, dispatchToMainThread, releaseNativeObject, getModuleName, openFile, openUrl, isRealDevice, layout, ad as androidUtils, iOSNativeHelper as iosUtils, Source, RESOURCE_PREFIX, FILE_PREFIX } from './utils'; -import { ClassInfo, getClass, getBaseClasses, getClassInfo, isBoolean, isDefined, isFunction, isNullOrUndefined, isNumber, isObject, isString, isUndefined, toUIString, verifyCallback } from './utils/types'; -export declare const Utils: { - GC: typeof GC; - RESOURCE_PREFIX: typeof RESOURCE_PREFIX; - FILE_PREFIX: typeof FILE_PREFIX; - isFontIconURI: typeof isFontIconURI; - isDataURI: typeof isDataURI; - isFileOrResourcePath: typeof isFileOrResourcePath; - executeOnMainThread: typeof executeOnMainThread; - mainThreadify: typeof mainThreadify; - isMainThread: typeof isMainThread; - dispatchToMainThread: typeof dispatchToMainThread; - releaseNativeObject: typeof releaseNativeObject; - getModuleName: typeof getModuleName; - openFile: typeof openFile; - openUrl: typeof openUrl; - isRealDevice: typeof isRealDevice; - layout: typeof layout; - android: typeof androidUtils; - // legacy (a lot of plugins use the shorthand "ad" Utils.ad instead of Utils.android) - ad: typeof androidUtils; - ios: typeof iosUtils; - Source: typeof Source; - ClassInfo: typeof ClassInfo; - getClass: typeof getClass; - getBaseClasses: typeof getBaseClasses; - getClassInfo: typeof getClassInfo; - isBoolean: typeof isBoolean; - isDefined: typeof isDefined; - isFunction: typeof isFunction; - isNullOrUndefined: typeof isNullOrUndefined; - isNumber: typeof isNumber; - isObject: typeof isObject; - isString: typeof isString; - isUndefined: typeof isUndefined; - toUIString: typeof toUIString; - verifyCallback: typeof verifyCallback; -}; -export { XmlParser, ParserEventType, ParserEvent } from './xml'; diff --git a/packages/core/index.ts b/packages/core/index.ts index 4289d38f5..8d8494c7d 100644 --- a/packages/core/index.ts +++ b/packages/core/index.ts @@ -68,13 +68,16 @@ export const Connectivity = { export { CSSUtils } from './css/system-classes'; -export { ObservableArray, ChangeType, ChangedData } from './data/observable-array'; -export { Observable, PropertyChangeData, EventData, WrappedValue, fromObject, fromObjectRecursive } from './data/observable'; -export { VirtualArray, ItemsLoading } from './data/virtual-array'; +export { ObservableArray, ChangeType } from './data/observable-array'; +export type { ChangedData } from './data/observable-array'; +export { Observable, WrappedValue, fromObject, fromObjectRecursive } from './data/observable'; +export type { PropertyChangeData, EventData } from './data/observable'; +export { VirtualArray } from './data/virtual-array'; +export type { ItemsLoading } from './data/virtual-array'; export { File, FileSystemEntity, Folder, knownFolders, path } from './file-system'; // Export all interfaces from "http" module -export { HttpRequestOptions, HttpResponse, Headers, HttpResponseEncoding, HttpContent } from './http'; +export type { HttpRequestOptions, HttpResponse, Headers, HttpResponseEncoding, HttpContent } from './http'; // Export all methods from "http" as Http import { getFile, getImage, getJSON, getString as httpGetString, request } from './http'; export const Http = { @@ -85,14 +88,18 @@ export const Http = { request, }; -export { ImageAsset, ImageAssetOptions } from './image-asset'; +export { ImageAsset } from './image-asset'; +export type { ImageAssetOptions } from './image-asset'; export { ImageSource } from './image-source'; -export { ModuleNameResolver, ModuleListProvider, PlatformContext, _setResolver } from './module-name-resolver'; -export { isAndroid, isIOS, Screen, IDevice, Device, platformNames } from './platform'; +export { ModuleNameResolver, _setResolver } from './module-name-resolver'; +export type { ModuleListProvider, PlatformContext } from './module-name-resolver'; +export { isAndroid, isIOS, Screen, Device, platformNames } from './platform'; +export type { IDevice } from './platform'; // Profiling -export { InstrumentationMode, TimerInfo, profile, enable as profilingEnable, disable as profilingDisable, time as profilingTime, uptime as profilingUptime, start as profilingStart, stop as profilingStop, isRunning as profilingIsRunning, dumpProfiles as profilingDumpProfiles, resetProfiles as profilingResetProfiles, startCPUProfile as profilingStartCPU, stopCPUProfile as profilingStopCPU } from './profiling'; +export { profile, enable as profilingEnable, disable as profilingDisable, time as profilingTime, uptime as profilingUptime, start as profilingStart, stop as profilingStop, isRunning as profilingIsRunning, dumpProfiles as profilingDumpProfiles, resetProfiles as profilingResetProfiles, startCPUProfile as profilingStartCPU, stopCPUProfile as profilingStopCPU } from './profiling'; +export type { InstrumentationMode, TimerInfo } from './profiling'; export { encoding } from './text'; diff --git a/packages/core/inspector_modules.ios.ts b/packages/core/inspector_modules.ios.ts index 103692323..5bc188a5a 100644 --- a/packages/core/inspector_modules.ios.ts +++ b/packages/core/inspector_modules.ios.ts @@ -1,6 +1,6 @@ console.log('Loading inspector modules...'); import { initGlobal } from './globals'; -if (global.NativeScriptHasInitGlobal) { +if (!global.NativeScriptHasInitGlobal) { initGlobal(); } require('./debugger/webinspector-network'); diff --git a/packages/core/module-name-resolver/index.ts b/packages/core/module-name-resolver/index.ts index 35ded3c87..abbb423f1 100644 --- a/packages/core/module-name-resolver/index.ts +++ b/packages/core/module-name-resolver/index.ts @@ -4,7 +4,7 @@ import { PlatformContext, findMatch, stripQualifiers } from './qualifier-matcher import { registerModulesFromFileSystem } from './non-bundle-workflow-compat'; import { Trace } from '../trace'; -export { PlatformContext } from './qualifier-matcher'; +export type { PlatformContext } from './qualifier-matcher'; export type ModuleListProvider = () => string[]; diff --git a/packages/core/ui/builder/component-builder/index.d.ts b/packages/core/ui/builder/component-builder/index.d.ts deleted file mode 100644 index f2c658c25..000000000 --- a/packages/core/ui/builder/component-builder/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { View } from '../../core/view'; - -export interface ComponentModule { - component: View; - exports: any; -} - -export function getComponentModule(elementName: string, namespace: string, attributes: Object, exports: Object, moduleNamePath?: string, isRootComponent?: boolean): ComponentModule; -export function setPropertyValue(instance: View, instanceModuleExports: Object, pageExports: Object, propertyName: string, propertyValue: any): void; diff --git a/packages/core/ui/builder/component-builder/index.ts b/packages/core/ui/builder/component-builder/index.ts index 1361108e8..d82c25988 100644 --- a/packages/core/ui/builder/component-builder/index.ts +++ b/packages/core/ui/builder/component-builder/index.ts @@ -15,18 +15,6 @@ export interface ComponentModule { exports: any; } -const UI_PATH = 'ui/'; -const MODULES = { - TabViewItem: 'ui/tab-view', - TabStrip: 'ui/tab-navigation-base/tab-strip', - TabStripItem: 'ui/tab-navigation-base/tab-strip-item', - TabContentItem: 'ui/tab-navigation-base/tab-content-item', - FormattedString: 'ui/text-base/formatted-string', - Span: 'ui/text-base/span', - ActionItem: 'ui/action-bar', - NavigationButton: 'ui/action-bar', - SegmentedBarItem: 'ui/segmented-bar', -}; const legacyShortBarrels = [ 'text/formatted-string', 'text/span', diff --git a/packages/core/ui/builder/index.ts b/packages/core/ui/builder/index.ts index 4d222f6d7..4a218fe97 100644 --- a/packages/core/ui/builder/index.ts +++ b/packages/core/ui/builder/index.ts @@ -8,7 +8,8 @@ import { Page } from '../page'; import { debug, ScopeError, SourceError, Source } from '../../utils/debug'; import * as xml from '../../xml'; import { isString, isObject, isDefined } from '../../utils/types'; -import { ComponentModule, setPropertyValue, getComponentModule } from './component-builder'; +import { setPropertyValue, getComponentModule } from './component-builder'; +import type { ComponentModule } from './component-builder'; import { platformNames, Device } from '../../platform'; import { profile } from '../../profiling'; import { sanitizeModuleName } from './module-name-sanitizer'; diff --git a/packages/core/ui/core/view/view-helper/index.android.ts b/packages/core/ui/core/view/view-helper/index.android.ts index 6a340e728..396f529cc 100644 --- a/packages/core/ui/core/view/view-helper/index.android.ts +++ b/packages/core/ui/core/view/view-helper/index.android.ts @@ -1 +1,2 @@ export * from './view-helper-common'; +export const IOSHelper = 0; diff --git a/packages/core/ui/frame/frame-common.ts b/packages/core/ui/frame/frame-common.ts index 1ca5cdf19..0fdb212e1 100644 --- a/packages/core/ui/frame/frame-common.ts +++ b/packages/core/ui/frame/frame-common.ts @@ -1,11 +1,9 @@ -// Types. -import { BackstackEntry, NavigationContext, NavigationEntry, NavigationTransition, NavigationType } from './frame-interfaces'; +import type { BackstackEntry, NavigationContext, NavigationEntry, NavigationTransition } from './frame-interfaces'; +import { NavigationType } from './frame-interfaces'; import { Page } from '../page'; import { View, CustomLayoutView, CSSType } from '../core/view'; import { Property } from '../core/properties'; import { Trace } from '../../trace'; - -// Requires. import { frameStack, topmost as frameStackTopmost, _pushInFrameStack, _popFromFrameStack, _removeFromFrameStack } from './frame-stack'; import { viewMatchesModuleContext } from '../core/view/view-common'; import { getAncestor } from '../core/view-base'; @@ -13,7 +11,8 @@ import { Builder } from '../builder'; import { sanitizeModuleName } from '../builder/module-name-sanitizer'; import { profile } from '../../profiling'; -export * from './frame-interfaces'; +export { NavigationType } from './frame-interfaces'; +export type { AndroidActivityCallbacks, AndroidFragmentCallbacks, AndroidFrame, BackstackEntry, NavigationContext, NavigationEntry, NavigationTransition, TransitionState, ViewEntry, iOSFrame } from './frame-interfaces'; function buildEntryFromArgs(arg: any): NavigationEntry { let entry: NavigationEntry; diff --git a/packages/core/ui/frame/index.ios.ts b/packages/core/ui/frame/index.ios.ts index fda9e4f3a..ddb115d66 100644 --- a/packages/core/ui/frame/index.ios.ts +++ b/packages/core/ui/frame/index.ios.ts @@ -668,3 +668,5 @@ class iOSFrame implements iOSFrameDefinition { this._navBarVisibility = value; } } + +export function setActivityCallbacks(activity: any): void {} diff --git a/packages/core/ui/index.d.ts b/packages/core/ui/index.d.ts deleted file mode 100644 index fa3b8a740..000000000 --- a/packages/core/ui/index.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -export { ActionBar, ActionItem, ActionItems, NavigationButton } from './action-bar'; -export { ActivityIndicator } from './activity-indicator'; -export { Animation, AnimationDefinition, KeyframeAnimation, KeyframeAnimationInfo, KeyframeDeclaration, KeyframeInfo } from './animation'; -export { BottomNavigation, SelectedIndexChangedEventData } from './bottom-navigation'; -export { Builder, LoadOptions } from './builder'; -export { sanitizeModuleName } from './builder/module-name-sanitizer'; -export { Button } from './button'; -export { ContentView } from './content-view'; -export { Binding, BindingOptions } from './core/bindable'; -export { ControlStateChangeListener } from './core/control-state-change'; -export { ViewBase, ShowModalOptions, eachDescendant, getAncestor, getViewById, booleanConverter } from './core/view-base'; -export { View, Template, KeyedTemplate, ShownModallyData, CSSType, ContainerView, ViewHelper, IOSHelper, isUserInteractionEnabledProperty } from './core/view'; -export { Property, CoercibleProperty, InheritedProperty, CssProperty, InheritedCssProperty, ShorthandProperty, CssAnimationProperty, unsetValue, makeParser, makeValidator } from './core/properties'; -export { addWeakEventListener, removeWeakEventListener } from './core/weak-event-listener'; -export { DatePicker } from './date-picker'; - -// No need go export dialogs, they are already export exported globally -export { action, alert, confirm, login, prompt, getCurrentPage, Dialogs, DialogStrings, DialogOptions, CancelableOptions, AlertOptions, PromptResult, PromptOptions, ActionOptions, ConfirmOptions, LoginResult, LoginOptions, inputType, capitalizationType } from './dialogs'; - -export * from './editable-text-base'; -export { Enums } from './enums'; -export { Frame, NavigationEntry, NavigationContext, NavigationTransition, BackstackEntry, ViewEntry, AndroidActivityCallbacks, setActivityCallbacks } from './frame'; - -export { GestureEventData, GestureEventDataWithState, GestureStateTypes, GestureTypes, GesturesObserver, TapGestureEventData, PanGestureEventData, PinchGestureEventData, RotationGestureEventData, SwipeDirection, SwipeGestureEventData, TouchGestureEventData, TouchAction } from './gestures'; - -export { HtmlView } from './html-view'; -export { Image } from './image'; -export { Cache as ImageCache, DownloadError, DownloadRequest, DownloadedData } from './image-cache'; -export { Label } from './label'; - -export * from './layouts'; // barrel export - -export { ListPicker } from './list-picker'; -export { ListView, ItemEventData, TemplatedItemsView, ItemsSource } from './list-view'; -export { Page, NavigatedData, PageBase } from './page'; -export { Placeholder, CreateViewEventData } from './placeholder'; -export { Progress } from './progress'; -export { ProxyViewContainer } from './proxy-view-container'; -export { Repeater } from './repeater'; -export { ScrollView, ScrollEventData } from './scroll-view'; -export { SearchBar } from './search-bar'; -export { SegmentedBar, SegmentedBarItem } from './segmented-bar'; -export { Slider } from './slider'; - -export { addTaggedAdditionalCSS, removeTaggedAdditionalCSS, resolveFileNameFromUrl } from './styling/style-scope'; -export { Background, CacheMode } from './styling/background'; -export { animationTimingFunctionConverter, timeConverter } from './styling/converters'; -export { Font } from './styling/font'; -export { Style, CommonLayoutParams } from './styling/style'; -export * from './styling/style-properties'; -export { CssAnimationParser, parseKeyframeDeclarations } from './styling/css-animation-parser'; -export { CSSHelper } from './styling/css-selector'; - -export { Switch } from './switch'; -export { TabContentItem } from './tab-navigation-base/tab-content-item'; -export { TabNavigationBase, getIconSpecSize, tabStripProperty } from './tab-navigation-base/tab-navigation-base'; -export { TabStrip, TabStripItemEventData } from './tab-navigation-base/tab-strip'; -export { TabStripItem } from './tab-navigation-base/tab-strip-item'; -export { TabView, TabViewItem } from './tab-view'; -export { Tabs } from './tabs'; -export { TextBase, TextTransform, getTransformedText } from './text-base'; -export { FormattedString } from './text-base/formatted-string'; -export { Span } from './text-base/span'; -export { TextField } from './text-field'; -export { TextView } from './text-view'; -export { TimePicker } from './time-picker'; -export { Transition } from './transition'; -export { WebView, LoadEventData, WebViewNavigationType } from './web-view'; diff --git a/packages/core/ui/index.ts b/packages/core/ui/index.ts index fa3b8a740..74d06f856 100644 --- a/packages/core/ui/index.ts +++ b/packages/core/ui/index.ts @@ -1,52 +1,67 @@ export { ActionBar, ActionItem, ActionItems, NavigationButton } from './action-bar'; export { ActivityIndicator } from './activity-indicator'; export { Animation, AnimationDefinition, KeyframeAnimation, KeyframeAnimationInfo, KeyframeDeclaration, KeyframeInfo } from './animation'; -export { BottomNavigation, SelectedIndexChangedEventData } from './bottom-navigation'; -export { Builder, LoadOptions } from './builder'; +export { BottomNavigation } from './bottom-navigation'; +export type { SelectedIndexChangedEventData } from './bottom-navigation'; +export { Builder } from './builder'; +export type { LoadOptions } from './builder'; +export type { ComponentModule } from './builder/component-builder'; export { sanitizeModuleName } from './builder/module-name-sanitizer'; export { Button } from './button'; export { ContentView } from './content-view'; -export { Binding, BindingOptions } from './core/bindable'; +export { Binding } from './core/bindable'; +export type { BindingOptions } from './core/bindable'; export { ControlStateChangeListener } from './core/control-state-change'; -export { ViewBase, ShowModalOptions, eachDescendant, getAncestor, getViewById, booleanConverter } from './core/view-base'; -export { View, Template, KeyedTemplate, ShownModallyData, CSSType, ContainerView, ViewHelper, IOSHelper, isUserInteractionEnabledProperty } from './core/view'; +export { ViewBase, eachDescendant, getAncestor, getViewById, booleanConverter } from './core/view-base'; +export type { ShowModalOptions } from './core/view-base'; +export { View, CSSType, ContainerView, ViewHelper, IOSHelper, isUserInteractionEnabledProperty } from './core/view'; +export type { Template, KeyedTemplate, ShownModallyData } from './core/view'; export { Property, CoercibleProperty, InheritedProperty, CssProperty, InheritedCssProperty, ShorthandProperty, CssAnimationProperty, unsetValue, makeParser, makeValidator } from './core/properties'; export { addWeakEventListener, removeWeakEventListener } from './core/weak-event-listener'; export { DatePicker } from './date-picker'; // No need go export dialogs, they are already export exported globally -export { action, alert, confirm, login, prompt, getCurrentPage, Dialogs, DialogStrings, DialogOptions, CancelableOptions, AlertOptions, PromptResult, PromptOptions, ActionOptions, ConfirmOptions, LoginResult, LoginOptions, inputType, capitalizationType } from './dialogs'; +export { action, alert, confirm, login, prompt, getCurrentPage, Dialogs } from './dialogs'; +export type { DialogStrings, DialogOptions, CancelableOptions, AlertOptions, PromptResult, PromptOptions, ActionOptions, ConfirmOptions, LoginResult, LoginOptions, inputType, capitalizationType } from './dialogs'; export * from './editable-text-base'; export { Enums } from './enums'; -export { Frame, NavigationEntry, NavigationContext, NavigationTransition, BackstackEntry, ViewEntry, AndroidActivityCallbacks, setActivityCallbacks } from './frame'; +export { Frame, setActivityCallbacks } from './frame'; +export type { NavigationEntry, NavigationContext, NavigationTransition, BackstackEntry, ViewEntry, AndroidActivityCallbacks } from './frame'; -export { GestureEventData, GestureEventDataWithState, GestureStateTypes, GestureTypes, GesturesObserver, TapGestureEventData, PanGestureEventData, PinchGestureEventData, RotationGestureEventData, SwipeDirection, SwipeGestureEventData, TouchGestureEventData, TouchAction } from './gestures'; +export { GesturesObserver, TouchAction } from './gestures'; +export type { GestureEventData, GestureEventDataWithState, GestureStateTypes, GestureTypes, TapGestureEventData, PanGestureEventData, PinchGestureEventData, RotationGestureEventData, SwipeDirection, SwipeGestureEventData, TouchGestureEventData } from './gestures'; export { HtmlView } from './html-view'; export { Image } from './image'; -export { Cache as ImageCache, DownloadError, DownloadRequest, DownloadedData } from './image-cache'; +export { Cache as ImageCache } from './image-cache'; +export type { DownloadError, DownloadRequest, DownloadedData } from './image-cache'; export { Label } from './label'; export * from './layouts'; // barrel export export { ListPicker } from './list-picker'; -export { ListView, ItemEventData, TemplatedItemsView, ItemsSource } from './list-view'; -export { Page, NavigatedData, PageBase } from './page'; +export { ListView } from './list-view'; +export type { ItemEventData, TemplatedItemsView, ItemsSource } from './list-view'; +export { Page, PageBase } from './page'; +export type { NavigatedData } from './page'; export { Placeholder, CreateViewEventData } from './placeholder'; export { Progress } from './progress'; export { ProxyViewContainer } from './proxy-view-container'; export { Repeater } from './repeater'; -export { ScrollView, ScrollEventData } from './scroll-view'; +export { ScrollView } from './scroll-view'; +export type { ScrollEventData } from './scroll-view'; export { SearchBar } from './search-bar'; export { SegmentedBar, SegmentedBarItem } from './segmented-bar'; export { Slider } from './slider'; export { addTaggedAdditionalCSS, removeTaggedAdditionalCSS, resolveFileNameFromUrl } from './styling/style-scope'; -export { Background, CacheMode } from './styling/background'; +export { Background } from './styling/background'; +export type { CacheMode } from './styling/background'; export { animationTimingFunctionConverter, timeConverter } from './styling/converters'; export { Font } from './styling/font'; -export { Style, CommonLayoutParams } from './styling/style'; +export { Style } from './styling/style'; +export type { CommonLayoutParams } from './styling/style'; export * from './styling/style-properties'; export { CssAnimationParser, parseKeyframeDeclarations } from './styling/css-animation-parser'; export { CSSHelper } from './styling/css-selector'; @@ -54,15 +69,18 @@ export { CSSHelper } from './styling/css-selector'; export { Switch } from './switch'; export { TabContentItem } from './tab-navigation-base/tab-content-item'; export { TabNavigationBase, getIconSpecSize, tabStripProperty } from './tab-navigation-base/tab-navigation-base'; -export { TabStrip, TabStripItemEventData } from './tab-navigation-base/tab-strip'; +export { TabStrip } from './tab-navigation-base/tab-strip'; +export type { TabStripItemEventData } from './tab-navigation-base/tab-strip'; export { TabStripItem } from './tab-navigation-base/tab-strip-item'; export { TabView, TabViewItem } from './tab-view'; export { Tabs } from './tabs'; -export { TextBase, TextTransform, getTransformedText } from './text-base'; +export { TextBase, getTransformedText } from './text-base'; +export type { TextTransform } from './text-base'; export { FormattedString } from './text-base/formatted-string'; export { Span } from './text-base/span'; export { TextField } from './text-field'; export { TextView } from './text-view'; export { TimePicker } from './time-picker'; export { Transition } from './transition'; -export { WebView, LoadEventData, WebViewNavigationType } from './web-view'; +export { WebView } from './web-view'; +export type { LoadEventData, WebViewNavigationType } from './web-view'; diff --git a/packages/core/ui/page/index.ios.ts b/packages/core/ui/page/index.ios.ts index 30a22e51f..f7ea82a6a 100644 --- a/packages/core/ui/page/index.ios.ts +++ b/packages/core/ui/page/index.ios.ts @@ -1,6 +1,5 @@ // Definitions. -import { Frame, BackstackEntry } from '../frame'; -import { NavigationType } from '../frame/frame-common'; +import { Frame, BackstackEntry, NavigationType } from '../frame'; // Types. import { View, IOSHelper } from '../core/view'; diff --git a/packages/core/utils/index.android.ts b/packages/core/utils/index.android.ts index 0a1d08d5f..2f0a3f5bc 100644 --- a/packages/core/utils/index.android.ts +++ b/packages/core/utils/index.android.ts @@ -3,7 +3,7 @@ import { Device } from '../platform'; import { FileSystemAccess } from '../file-system/file-system-access'; import { Trace } from '../trace'; -export { ad } from './native-helper'; +export { ad, iOSNativeHelper } from './native-helper'; export * from './utils-common'; export { Source } from './debug'; diff --git a/packages/core/utils/index.ios.ts b/packages/core/utils/index.ios.ts index 87646e1b1..90bc24dc2 100644 --- a/packages/core/utils/index.ios.ts +++ b/packages/core/utils/index.ios.ts @@ -46,3 +46,5 @@ export function openUrl(location: string): boolean { export function isRealDevice(): boolean { return iOSNativeHelper.isRealDevice(); } + +export const ad = 0; diff --git a/packages/core/utils/native-helper.android.ts b/packages/core/utils/native-helper.android.ts index 86ba7ae13..750810781 100644 --- a/packages/core/utils/native-helper.android.ts +++ b/packages/core/utils/native-helper.android.ts @@ -154,3 +154,5 @@ export namespace ad { return fingerprint != null && (fingerprint.indexOf('vbox') > -1 || fingerprint.indexOf('generic') > -1); } } + +export const iOSNativeHelper = 0; diff --git a/packages/webpack/templates/webpack.angular.js b/packages/webpack/templates/webpack.angular.js index d6840c7d7..cc820c969 100644 --- a/packages/webpack/templates/webpack.angular.js +++ b/packages/webpack/templates/webpack.angular.js @@ -58,6 +58,7 @@ module.exports = env => { hiddenSourceMap, // --env.hiddenSourceMap hmr, // --env.hmr, unitTesting, // --env.unitTesting + testing, // --env.testing verbose, // --env.verbose ci, // --env.ci snapshotInDocker, // --env.snapshotInDocker @@ -77,7 +78,7 @@ module.exports = env => { const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf('@nativescript') > -1); - if (platform === 'ios' && !areCoreModulesExternal) { + if (platform === 'ios' && !areCoreModulesExternal && !testing) { entries['tns_modules/@nativescript/core/inspector_modules'] = 'inspector_modules'; } diff --git a/packages/webpack/templates/webpack.javascript.js b/packages/webpack/templates/webpack.javascript.js index 4c5dad35e..5c36c2ce0 100644 --- a/packages/webpack/templates/webpack.javascript.js +++ b/packages/webpack/templates/webpack.javascript.js @@ -49,6 +49,7 @@ module.exports = env => { hiddenSourceMap, // --env.hiddenSourceMap hmr, // --env.hmr, unitTesting, // --env.unitTesting, + testing, // --env.testing verbose, // --env.verbose snapshotInDocker, // --env.snapshotInDocker skipSnapshotTools, // --env.skipSnapshotTools @@ -82,7 +83,7 @@ module.exports = env => { entries.bundle = entryPath; const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf("@nativescript") > -1); - if (platform === "ios" && !areCoreModulesExternal) { + if (platform === "ios" && !areCoreModulesExternal && !testing) { entries["tns_modules/@nativescript/core/inspector_modules"] = "inspector_modules"; }; @@ -293,9 +294,5 @@ module.exports = env => { config.plugins.push(new webpack.HotModuleReplacementPlugin()); } - config.stats = { - warnings: false - }; - return config; }; diff --git a/packages/webpack/templates/webpack.typescript.js b/packages/webpack/templates/webpack.typescript.js index 7c8067d6c..bf922b812 100644 --- a/packages/webpack/templates/webpack.typescript.js +++ b/packages/webpack/templates/webpack.typescript.js @@ -52,6 +52,7 @@ module.exports = env => { hiddenSourceMap, // --env.hiddenSourceMap hmr, // --env.hmr, unitTesting, // --env.unitTesting, + testing, // --env.testing verbose, // --env.verbose snapshotInDocker, // --env.snapshotInDocker skipSnapshotTools, // --env.skipSnapshotTools @@ -88,7 +89,7 @@ module.exports = env => { const tsConfigPath = resolve(projectRoot, "tsconfig.json"); const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf("@nativescript") > -1); - if (platform === "ios" && !areCoreModulesExternal) { + if (platform === "ios" && !areCoreModulesExternal && !testing) { entries["tns_modules/@nativescript/core/inspector_modules"] = "inspector_modules"; }; @@ -333,9 +334,5 @@ module.exports = env => { config.plugins.push(new webpack.HotModuleReplacementPlugin()); } - config.stats = { - warnings: false - }; - return config; }; diff --git a/packages/webpack/templates/webpack.vue.js b/packages/webpack/templates/webpack.vue.js index 0dc4da83a..6e4bf6ff8 100644 --- a/packages/webpack/templates/webpack.vue.js +++ b/packages/webpack/templates/webpack.vue.js @@ -52,6 +52,7 @@ module.exports = env => { sourceMap, // --env.sourceMap hiddenSourceMap, // --env.hiddenSourceMap unitTesting, // --env.unitTesting + testing, // --env.testing verbose, // --env.verbose snapshotInDocker, // --env.snapshotInDocker skipSnapshotTools, // --env.skipSnapshotTools @@ -87,7 +88,7 @@ module.exports = env => { entries.bundle = entryPath; const areCoreModulesExternal = Array.isArray(env.externals) && env.externals.some(e => e.indexOf("@nativescript") > -1); - if (platform === "ios" && !areCoreModulesExternal) { + if (platform === "ios" && !areCoreModulesExternal && !testing) { entries["tns_modules/@nativescript/core/inspector_modules"] = "inspector_modules"; }; console.log(`Bundling application for entryPath ${entryPath}...`); diff --git a/workspace.json b/workspace.json index a7e144eb4..c617f5ddc 100644 --- a/workspace.json +++ b/workspace.json @@ -12,7 +12,7 @@ "options": { "commands": [ { - "command": "tns debug ios --no-hmr --emulator" + "command": "tns debug ios --no-hmr --emulator --env.testing" } ], "cwd": "apps/automated", @@ -24,7 +24,7 @@ "options": { "commands": [ { - "command": "tns debug android --no-hmr --emulator" + "command": "tns debug android --no-hmr --emulator --env.testing" } ], "cwd": "apps/automated", @@ -62,7 +62,7 @@ "options": { "commands": [ { - "command": "tns debug ios --no-hmr --emulator" + "command": "tns debug ios --no-hmr --emulator --env.testing" } ], "cwd": "apps/playground", @@ -74,7 +74,7 @@ "options": { "commands": [ { - "command": "tns debug android --no-hmr --emulator" + "command": "tns debug android --no-hmr --emulator --env.testing" } ], "cwd": "apps/playground", @@ -112,7 +112,7 @@ "options": { "commands": [ { - "command": "tns debug ios --no-hmr --emulator" + "command": "tns debug ios --no-hmr --emulator --env.testing" } ], "cwd": "apps/ui", @@ -124,7 +124,7 @@ "options": { "commands": [ { - "command": "tns debug android --no-hmr --emulator" + "command": "tns debug android --no-hmr --emulator --env.testing" } ], "cwd": "apps/ui",