feat(core): export additional properties for plugin usage (#8835)

This commit is contained in:
Nathan Walker
2020-09-09 09:15:57 -07:00
committed by GitHub
parent c7623839f9
commit a2e1aa246e
4 changed files with 26 additions and 27 deletions

View File

@ -8,7 +8,7 @@
export type { NativeScriptConfig } from './config'; export type { NativeScriptConfig } from './config';
export { iOSApplication, AndroidApplication } from './application'; export { iOSApplication, AndroidApplication } from './application';
export type { ApplicationEventData, LaunchEventData, OrientationChangedEventData, UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData, AndroidActivityEventData, AndroidActivityBundleEventData, AndroidActivityRequestPermissionsEventData, AndroidActivityResultEventData, AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData, SystemAppearanceChangedEventData } from './application'; export type { ApplicationEventData, LaunchEventData, OrientationChangedEventData, UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData, AndroidActivityEventData, AndroidActivityBundleEventData, AndroidActivityRequestPermissionsEventData, AndroidActivityResultEventData, AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData, SystemAppearanceChangedEventData } from './application';
import { systemAppearanceChanged, getMainEntry, getRootView, _resetRootView, getResources, setResources, setCssFileName, getCssFileName, loadAppCss, addCss, on, off, run, orientation, getNativeApplication, hasLaunched, systemAppearance } from './application'; import { systemAppearanceChanged, getMainEntry, getRootView, _resetRootView, getResources, setResources, setCssFileName, getCssFileName, loadAppCss, addCss, on, off, notify, hasListeners, run, orientation, getNativeApplication, hasLaunched, systemAppearance } from './application';
export declare const Application: { export declare const Application: {
launchEvent: string; launchEvent: string;
displayedEvent: string; displayedEvent: string;
@ -32,6 +32,8 @@ export declare const Application: {
addCss: typeof addCss; addCss: typeof addCss;
on: typeof on; on: typeof on;
off: typeof off; off: typeof off;
notify: typeof notify;
hasListeners: typeof hasListeners;
run: typeof run; run: typeof run;
orientation: typeof orientation; orientation: typeof orientation;
getNativeApplication: typeof getNativeApplication; getNativeApplication: typeof getNativeApplication;
@ -113,6 +115,10 @@ export declare const Utils: {
android: typeof androidUtils; android: typeof androidUtils;
ad: typeof androidUtils; ad: typeof androidUtils;
ios: typeof iosUtils; ios: typeof iosUtils;
setTimeout: typeof setTimeout;
setInterval: typeof setInterval;
clearInterval: typeof clearInterval;
clearTimeout: typeof clearTimeout;
Source: typeof Source; Source: typeof Source;
ClassInfo: typeof ClassInfo; ClassInfo: typeof ClassInfo;
getClass: typeof getClass; getClass: typeof getClass;

View File

@ -6,7 +6,7 @@ nsGlobals.initGlobal();
export { iOSApplication, AndroidApplication } from './application'; export { iOSApplication, AndroidApplication } from './application';
export type { ApplicationEventData, LaunchEventData, OrientationChangedEventData, UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData, AndroidActivityEventData, AndroidActivityBundleEventData, AndroidActivityRequestPermissionsEventData, AndroidActivityResultEventData, AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData, SystemAppearanceChangedEventData } from './application'; export type { ApplicationEventData, LaunchEventData, OrientationChangedEventData, UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData, AndroidActivityEventData, AndroidActivityBundleEventData, AndroidActivityRequestPermissionsEventData, AndroidActivityResultEventData, AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData, SystemAppearanceChangedEventData } from './application';
import { launchEvent, displayedEvent, uncaughtErrorEvent, discardedErrorEvent, suspendEvent, resumeEvent, exitEvent, lowMemoryEvent, orientationChangedEvent, systemAppearanceChanged, systemAppearanceChangedEvent, getMainEntry, getRootView, _resetRootView, getResources, setResources, setCssFileName, getCssFileName, loadAppCss, addCss, on, off, run, orientation, getNativeApplication, hasLaunched, android as appAndroid, ios as iosApp, systemAppearance } from './application'; import { launchEvent, displayedEvent, uncaughtErrorEvent, discardedErrorEvent, suspendEvent, resumeEvent, exitEvent, lowMemoryEvent, orientationChangedEvent, systemAppearanceChanged, systemAppearanceChangedEvent, getMainEntry, getRootView, _resetRootView, getResources, setResources, setCssFileName, getCssFileName, loadAppCss, addCss, on, off, notify, hasListeners, run, orientation, getNativeApplication, hasLaunched, android as appAndroid, ios as iosApp, systemAppearance } from './application';
export const Application = { export const Application = {
launchEvent, launchEvent,
displayedEvent, displayedEvent,
@ -31,6 +31,8 @@ export const Application = {
addCss, addCss,
on, on,
off, off,
notify,
hasListeners,
run, run,
orientation, orientation,
getNativeApplication, getNativeApplication,
@ -103,7 +105,8 @@ export { profile, enable as profilingEnable, disable as profilingDisable, time a
export type { InstrumentationMode, TimerInfo } from './profiling'; export type { InstrumentationMode, TimerInfo } from './profiling';
export { encoding } from './text'; export { encoding } from './text';
// for developers to be explicit if they desire around globals (allows access via Utils below)
import { setTimeout, setInterval, clearInterval, clearTimeout } from './timer';
export * from './trace'; export * from './trace';
export * from './ui'; export * from './ui';
@ -134,6 +137,10 @@ export const Utils = {
// legacy (a lot of plugins use the shorthand "ad" Utils.ad instead of Utils.android) // legacy (a lot of plugins use the shorthand "ad" Utils.ad instead of Utils.android)
ad: androidUtils, ad: androidUtils,
ios: iosUtils, ios: iosUtils,
setTimeout,
setInterval,
clearInterval,
clearTimeout,
Source, Source,
ClassInfo, ClassInfo,
getClass, getClass,

View File

@ -74,7 +74,7 @@ export type { TabStripItemEventData } from './tab-navigation-base/tab-strip';
export { TabStripItem } from './tab-navigation-base/tab-strip-item'; export { TabStripItem } from './tab-navigation-base/tab-strip-item';
export { TabView, TabViewItem } from './tab-view'; export { TabView, TabViewItem } from './tab-view';
export { Tabs } from './tabs'; export { Tabs } from './tabs';
export { TextBase, getTransformedText } from './text-base'; export { TextBase, getTransformedText, letterSpacingProperty, textAlignmentProperty, textDecorationProperty, textTransformProperty, whiteSpaceProperty, lineHeightProperty } from './text-base';
export type { TextTransform } from './text-base'; export type { TextTransform } from './text-base';
export { FormattedString } from './text-base/formatted-string'; export { FormattedString } from './text-base/formatted-string';
export { Span } from './text-base/span'; export { Span } from './text-base/span';

View File

@ -300,12 +300,8 @@
"builder": "@nrwl/workspace:run-commands", "builder": "@nrwl/workspace:run-commands",
"options": { "options": {
"commands": [ "commands": [
{ "./build.sh",
"command": "./build.sh" "cp -R dist/package/platforms/* ../../packages/core/platforms"
},
{
"command": "cp -R dist/package/platforms/* ../../packages/core/platforms"
}
], ],
"cwd": "packages/ui-mobile-base", "cwd": "packages/ui-mobile-base",
"parallel": false "parallel": false
@ -337,12 +333,8 @@
"builder": "@nrwl/workspace:run-commands", "builder": "@nrwl/workspace:run-commands",
"options": { "options": {
"commands": [ "commands": [
{ "npm run tsc",
"command": "npm run tsc" "npm run jasmine"
},
{
"command": "npm run jasmine"
}
], ],
"cwd": "packages/webpack", "cwd": "packages/webpack",
"parallel": false "parallel": false
@ -353,15 +345,9 @@
"outputs": ["dist/packages"], "outputs": ["dist/packages"],
"options": { "options": {
"commands": [ "commands": [
{ "npm run setup",
"command": "npm run setup" "mkdir -p ../../dist/packages",
}, "mv \"$(npm pack | tail -n 1)\" ../../dist/packages/nativescript-webpack.tgz"
{
"command": "mkdir -p ../../dist/packages"
},
{
"command": "mv \"$(npm pack | tail -n 1)\" ../../dist/packages/nativescript-webpack.tgz"
}
], ],
"cwd": "packages/webpack", "cwd": "packages/webpack",
"parallel": false "parallel": false