mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: format
This commit is contained in:
@@ -1,81 +1,205 @@
|
||||
// apply polyfills first
|
||||
import { initGlobal, hasInitGlobal } from './globals';
|
||||
import { initGlobal, hasInitGlobal } from "./globals";
|
||||
if (!hasInitGlobal) {
|
||||
initGlobal();
|
||||
initGlobal();
|
||||
}
|
||||
|
||||
// Export all interfaces from "application" module
|
||||
export {
|
||||
ApplicationEventData, LaunchEventData, OrientationChangedEventData,
|
||||
UnhandledErrorEventData, DiscardedErrorEventData, CssChangedEventData, LoadAppCSSEventData,
|
||||
|
||||
iOSApplication, AndroidApplication,
|
||||
|
||||
AndroidActivityEventData, AndroidActivityBundleEventData,
|
||||
AndroidActivityRequestPermissionsEventData, AndroidActivityResultEventData,
|
||||
AndroidActivityNewIntentEventData, AndroidActivityBackPressedEventData
|
||||
ApplicationEventData,
|
||||
LaunchEventData,
|
||||
OrientationChangedEventData,
|
||||
UnhandledErrorEventData,
|
||||
DiscardedErrorEventData,
|
||||
CssChangedEventData,
|
||||
LoadAppCSSEventData,
|
||||
iOSApplication,
|
||||
AndroidApplication,
|
||||
AndroidActivityEventData,
|
||||
AndroidActivityBundleEventData,
|
||||
AndroidActivityRequestPermissionsEventData,
|
||||
AndroidActivityResultEventData,
|
||||
AndroidActivityNewIntentEventData,
|
||||
AndroidActivityBackPressedEventData,
|
||||
} from "./application";
|
||||
|
||||
// Export all methods and fields from "application" as Application
|
||||
import {
|
||||
launchEvent, displayedEvent, uncaughtErrorEvent, discardedErrorEvent,
|
||||
suspendEvent, resumeEvent, exitEvent, lowMemoryEvent, orientationChangedEvent,
|
||||
|
||||
getMainEntry, getRootView, setResources, setCssFileName, getCssFileName, loadAppCss, addCss,
|
||||
on, off, run, orientation, getNativeApplication, hasLaunched,
|
||||
android, ios,
|
||||
launchEvent,
|
||||
displayedEvent,
|
||||
uncaughtErrorEvent,
|
||||
discardedErrorEvent,
|
||||
suspendEvent,
|
||||
resumeEvent,
|
||||
exitEvent,
|
||||
lowMemoryEvent,
|
||||
orientationChangedEvent,
|
||||
getMainEntry,
|
||||
getRootView,
|
||||
setResources,
|
||||
setCssFileName,
|
||||
getCssFileName,
|
||||
loadAppCss,
|
||||
addCss,
|
||||
on,
|
||||
off,
|
||||
run,
|
||||
orientation,
|
||||
getNativeApplication,
|
||||
hasLaunched,
|
||||
android,
|
||||
ios,
|
||||
} from "./application";
|
||||
export const Application = {
|
||||
launchEvent, displayedEvent, uncaughtErrorEvent, discardedErrorEvent,
|
||||
suspendEvent, resumeEvent, exitEvent, lowMemoryEvent, orientationChangedEvent,
|
||||
launchEvent,
|
||||
displayedEvent,
|
||||
uncaughtErrorEvent,
|
||||
discardedErrorEvent,
|
||||
suspendEvent,
|
||||
resumeEvent,
|
||||
exitEvent,
|
||||
lowMemoryEvent,
|
||||
orientationChangedEvent,
|
||||
|
||||
getMainEntry, getRootView, setResources, setCssFileName, getCssFileName, loadAppCss, addCss,
|
||||
on, off, run, orientation, getNativeApplication, hasLaunched,
|
||||
getMainEntry,
|
||||
getRootView,
|
||||
setResources,
|
||||
setCssFileName,
|
||||
getCssFileName,
|
||||
loadAppCss,
|
||||
addCss,
|
||||
on,
|
||||
off,
|
||||
run,
|
||||
orientation,
|
||||
getNativeApplication,
|
||||
hasLaunched,
|
||||
|
||||
android: android, ios: ios,
|
||||
android: android,
|
||||
ios: ios,
|
||||
};
|
||||
|
||||
// Export all methods from "application-settings" as ApplicationSettings
|
||||
import { setString, getString, clear, flush, getAllKeys, getBoolean, getNumber, hasKey, remove, setBoolean, setNumber } from "./application-settings";
|
||||
export const ApplicationSettings = { clear, flush, hasKey, remove, setString, getString, getAllKeys, getBoolean, setBoolean, getNumber, setNumber };
|
||||
import {
|
||||
setString,
|
||||
getString,
|
||||
clear,
|
||||
flush,
|
||||
getAllKeys,
|
||||
getBoolean,
|
||||
getNumber,
|
||||
hasKey,
|
||||
remove,
|
||||
setBoolean,
|
||||
setNumber,
|
||||
} from "./application-settings";
|
||||
export const ApplicationSettings = {
|
||||
clear,
|
||||
flush,
|
||||
hasKey,
|
||||
remove,
|
||||
setString,
|
||||
getString,
|
||||
getAllKeys,
|
||||
getBoolean,
|
||||
setBoolean,
|
||||
getNumber,
|
||||
setNumber,
|
||||
};
|
||||
|
||||
export { Color } from "./color";
|
||||
|
||||
import { connectionType, getConnectionType, startMonitoring, stopMonitoring } from "./connectivity";
|
||||
export const Connectivity = { connectionType, getConnectionType, startMonitoring, stopMonitoring };
|
||||
import {
|
||||
connectionType,
|
||||
getConnectionType,
|
||||
startMonitoring,
|
||||
stopMonitoring,
|
||||
} from "./connectivity";
|
||||
export const Connectivity = {
|
||||
connectionType,
|
||||
getConnectionType,
|
||||
startMonitoring,
|
||||
stopMonitoring,
|
||||
};
|
||||
|
||||
export { ObservableArray, ChangeType, ChangedData } from "./data/observable-array";
|
||||
export {
|
||||
ObservableArray,
|
||||
ChangeType,
|
||||
ChangedData,
|
||||
} from "./data/observable-array";
|
||||
export { Observable, PropertyChangeData, EventData } from "./data/observable";
|
||||
export { File, FileSystemEntity, Folder, knownFolders, path } from "./file-system";
|
||||
export {
|
||||
File,
|
||||
FileSystemEntity,
|
||||
Folder,
|
||||
knownFolders,
|
||||
path,
|
||||
} from "./file-system";
|
||||
|
||||
// Export all interfaces from "http" module
|
||||
export { HttpRequestOptions, HttpResponse, Headers, HttpResponseEncoding, HttpContent } from "./http";
|
||||
export {
|
||||
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 = { getFile, getImage, getJSON, getString: httpGetString, request };
|
||||
import {
|
||||
getFile,
|
||||
getImage,
|
||||
getJSON,
|
||||
getString as httpGetString,
|
||||
request,
|
||||
} from "./http";
|
||||
export const Http = {
|
||||
getFile,
|
||||
getImage,
|
||||
getJSON,
|
||||
getString: httpGetString,
|
||||
request,
|
||||
};
|
||||
|
||||
export { ImageAsset, ImageAssetOptions } from "./image-asset";
|
||||
|
||||
export { ImageSource } from "./image-source";
|
||||
export { isAndroid, isIOS, screen as Screen, device as Device } from "./platform";
|
||||
export {
|
||||
isAndroid,
|
||||
isIOS,
|
||||
screen as Screen,
|
||||
device as Device,
|
||||
} from "./platform";
|
||||
|
||||
// Export interfaces from "profiling" module
|
||||
export { InstrumentationMode, TimerInfo } from "./profiling";
|
||||
// Export methods from "profiling" module
|
||||
import {
|
||||
enable as profilingEnable, disable as profilingDisable,
|
||||
time, uptime,
|
||||
start, stop, isRunning,
|
||||
dumpProfiles, resetProfiles,
|
||||
profile, startCPUProfile, stopCPUProfile,
|
||||
enable as profilingEnable,
|
||||
disable as profilingDisable,
|
||||
time,
|
||||
uptime,
|
||||
start,
|
||||
stop,
|
||||
isRunning,
|
||||
dumpProfiles,
|
||||
resetProfiles,
|
||||
profile,
|
||||
startCPUProfile,
|
||||
stopCPUProfile,
|
||||
} from "./profiling";
|
||||
export const Profiling = {
|
||||
enable: profilingEnable,
|
||||
disable: profilingDisable,
|
||||
time, uptime,
|
||||
start, stop, isRunning,
|
||||
dumpProfiles, resetProfiles,
|
||||
profile, startCPUProfile, stopCPUProfile,
|
||||
enable: profilingEnable,
|
||||
disable: profilingDisable,
|
||||
time,
|
||||
uptime,
|
||||
start,
|
||||
stop,
|
||||
isRunning,
|
||||
dumpProfiles,
|
||||
resetProfiles,
|
||||
profile,
|
||||
startCPUProfile,
|
||||
stopCPUProfile,
|
||||
};
|
||||
|
||||
export { encoding } from "./text";
|
||||
@@ -85,21 +209,43 @@ export * from "./trace";
|
||||
export * from "./ui";
|
||||
|
||||
import {
|
||||
GC, isFontIconURI, isDataURI, isFileOrResourcePath,
|
||||
executeOnMainThread, mainThreadify, isMainThread, dispatchToMainThread, releaseNativeObject,
|
||||
getModuleName,
|
||||
openFile, openUrl, isRealDevice,
|
||||
layout, ad as androidUtils, ios as iosUtils
|
||||
GC,
|
||||
isFontIconURI,
|
||||
isDataURI,
|
||||
isFileOrResourcePath,
|
||||
executeOnMainThread,
|
||||
mainThreadify,
|
||||
isMainThread,
|
||||
dispatchToMainThread,
|
||||
releaseNativeObject,
|
||||
getModuleName,
|
||||
openFile,
|
||||
openUrl,
|
||||
isRealDevice,
|
||||
layout,
|
||||
ad as androidUtils,
|
||||
ios as iosUtils,
|
||||
} from "./utils/utils";
|
||||
|
||||
export const Utils = {
|
||||
GC, isFontIconURI, isDataURI, isFileOrResourcePath,
|
||||
executeOnMainThread, mainThreadify, isMainThread, dispatchToMainThread, releaseNativeObject,
|
||||
GC,
|
||||
isFontIconURI,
|
||||
isDataURI,
|
||||
isFileOrResourcePath,
|
||||
executeOnMainThread,
|
||||
mainThreadify,
|
||||
isMainThread,
|
||||
dispatchToMainThread,
|
||||
releaseNativeObject,
|
||||
|
||||
getModuleName,
|
||||
openFile, openUrl, isRealDevice,
|
||||
getModuleName,
|
||||
openFile,
|
||||
openUrl,
|
||||
isRealDevice,
|
||||
|
||||
layout, android: androidUtils, ios: iosUtils
|
||||
layout,
|
||||
android: androidUtils,
|
||||
ios: iosUtils,
|
||||
};
|
||||
|
||||
export { XmlParser, ParserEventType, ParserEvent } from "./xml";
|
||||
|
||||
Reference in New Issue
Block a user