@akylas/nativescript 8.6.4 → 8.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/abortcontroller/abortsignal.js.map +1 -1
- package/abortcontroller/index.js.map +1 -1
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/accessibility-css-helper.js.map +1 -1
- package/accessibility/accessibility-properties.d.ts +1 -1
- package/accessibility/accessibility-properties.js +5 -1
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/accessibility-service-common.js.map +1 -1
- package/accessibility/accessibility-service.android.js +8 -4
- package/accessibility/accessibility-service.android.js.map +1 -1
- package/accessibility/accessibility-service.ios.js.map +1 -1
- package/accessibility/accessibility-types.d.ts +27 -27
- package/accessibility/accessibility-types.js +28 -28
- package/accessibility/accessibility-types.js.map +1 -1
- package/accessibility/font-scale-common.js +1 -1
- package/accessibility/font-scale-common.js.map +1 -1
- package/accessibility/font-scale.android.js.map +1 -1
- package/accessibility/font-scale.ios.js.map +1 -1
- package/accessibility/index.android.d.ts +1 -1
- package/accessibility/index.android.js +72 -239
- package/accessibility/index.android.js.map +1 -1
- package/accessibility/index.d.ts +1 -1
- package/accessibility/index.ios.d.ts +1 -1
- package/accessibility/index.ios.js.map +1 -1
- package/animation-frame/index.js +3 -3
- package/animation-frame/index.js.map +1 -1
- package/application/application-common.js +7 -3
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +3 -2
- package/application/application.android.js.map +1 -1
- package/application/application.ios.d.ts +1 -0
- package/application/application.ios.js +50 -15
- package/application/application.ios.js.map +1 -1
- package/application-settings/application-settings-common.d.ts +2 -2
- package/application-settings/application-settings-common.js +6 -2
- package/application-settings/application-settings-common.js.map +1 -1
- package/application-settings/index.android.js +74 -18
- package/application-settings/index.android.js.map +1 -1
- package/application-settings/index.ios.js +61 -13
- package/application-settings/index.ios.js.map +1 -1
- package/bundle-entry-points.js.map +1 -1
- package/color/color-common.js.map +1 -1
- package/color/index.ios.js.map +1 -1
- package/color/known-colors.js.map +1 -1
- package/connectivity/index.android.js.map +1 -1
- package/connectivity/index.ios.js.map +1 -1
- package/core-types/index.d.ts +8 -4
- package/core-types/index.js +8 -4
- package/core-types/index.js.map +1 -1
- package/css/CSS3Parser.js.map +1 -1
- package/css/CSSNativeScript.js.map +1 -1
- package/css/css-tree-parser.js.map +1 -1
- package/css/parser.js.map +1 -1
- package/css/system-classes.js.map +1 -1
- package/data/observable/index.d.ts +10 -4
- package/data/observable/index.js +101 -99
- package/data/observable/index.js.map +1 -1
- package/data/observable-array/index.d.ts +1 -1
- package/data/observable-array/index.js.map +1 -1
- package/data/virtual-array/index.d.ts +1 -1
- package/data/virtual-array/index.js.map +1 -1
- package/debugger/{InspectorBackendCommands.ios.js → InspectorBackendCommands.js} +1 -1
- package/debugger/InspectorBackendCommands.js.map +1 -0
- package/debugger/devtools-elements.common.js.map +1 -1
- package/debugger/devtools-elements.d.ts +5 -23
- package/debugger/{devtools-elements.ios.js → devtools-elements.js} +1 -1
- package/debugger/devtools-elements.js.map +1 -0
- package/debugger/dom-node.js.map +1 -1
- package/debugger/index.js.map +1 -1
- package/debugger/{webinspector-css.ios.d.ts → webinspector-css.d.ts} +1 -1
- package/debugger/{webinspector-css.ios.js → webinspector-css.js} +1 -1
- package/debugger/webinspector-css.js.map +1 -0
- package/debugger/{webinspector-dom.ios.d.ts → webinspector-dom.d.ts} +1 -1
- package/debugger/{webinspector-dom.ios.js → webinspector-dom.js} +1 -1
- package/debugger/webinspector-dom.js.map +1 -0
- package/debugger/webinspector-network.android.d.ts +79 -0
- package/debugger/webinspector-network.android.js +207 -0
- package/debugger/webinspector-network.android.js.map +1 -0
- package/debugger/webinspector-network.ios.d.ts +1 -1
- package/debugger/webinspector-network.ios.js +1 -1
- package/debugger/webinspector-network.ios.js.map +1 -1
- package/file-system/file-system-access.android.d.ts +28 -12
- package/file-system/file-system-access.android.js +356 -285
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.d.ts +42 -4
- package/file-system/file-system-access.ios.d.ts +2 -2
- package/file-system/file-system-access.ios.js +8 -6
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.d.ts +5 -4
- package/file-system/index.js +49 -100
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.android.js.map +1 -1
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/fps-meter/index.js.map +1 -1
- package/global-types.d.ts +4 -0
- package/globals/index.js.map +1 -1
- package/http/http-request/http-request-common.js.map +1 -1
- package/http/http-request/index.android.js +65 -7
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.ios.js +22 -0
- package/http/http-request/index.ios.js.map +1 -1
- package/http/index.js.map +1 -1
- package/image-asset/image-asset-common.d.ts +1 -0
- package/image-asset/image-asset-common.js +6 -4
- package/image-asset/image-asset-common.js.map +1 -1
- package/image-asset/index.android.d.ts +1 -0
- package/image-asset/index.android.js +13 -4
- package/image-asset/index.android.js.map +1 -1
- package/image-asset/index.d.ts +4 -1
- package/image-asset/index.ios.d.ts +1 -0
- package/image-asset/index.ios.js +27 -0
- package/image-asset/index.ios.js.map +1 -1
- package/image-source/image-source-common.js.map +1 -1
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js.map +1 -1
- package/{inspector_modules.ios.js → inspector_modules.js} +1 -1
- package/inspector_modules.js.map +1 -0
- package/matrix/index.js.map +1 -1
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
- package/package.json +11 -1
- package/platform/common.d.ts +1 -0
- package/platform/common.js +1 -0
- package/platform/common.js.map +1 -1
- package/platform/index.android.js.map +1 -1
- package/platform/index.d.ts +5 -0
- package/platform/index.ios.d.ts +2 -1
- package/platform/index.ios.js +15 -2
- package/platform/index.ios.js.map +1 -1
- package/platforms/android/widgets-release.aar +0 -0
- package/platforms/ios/TNSWidgets.xcframework/Info.plist +45 -4
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +6 -6
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +6 -6
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +77 -77
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +77 -77
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +3 -3
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +77 -77
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +77 -77
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSData+Async.h +24 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSString+Async.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSLabel.h +16 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSProcess.h +29 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSWidgets.h +25 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIImage+TNSBlocks.h +26 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Headers/UIView+PassThroughParent.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/Modules/module.modulemap +6 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/NSObject+Swizzling.h +17 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/PrivateHeaders/UIView+PropertyBag.h +18 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +223 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Info.plist +20 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/aarch64/TNSWidgets.yml +82 -0
- package/platforms/ios/TNSWidgets.xcframework/xros-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/Relocations/x86_64/TNSWidgets.yml +82 -0
- package/platforms/ios/src/NativeScriptEmbedder.h +5 -0
- package/platforms/ios/src/NativeScriptEmbedder.m +26 -2
- package/platforms/ios/src/NativeScriptMainWindow.swift +179 -0
- package/profiling/index.js.map +1 -1
- package/text/text-common.js.map +1 -1
- package/timer/index.android.js.map +1 -1
- package/timer/index.ios.js.map +1 -1
- package/trace/index.js.map +1 -1
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.js +3 -34
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +1 -1
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/index.android.js +2 -1
- package/ui/activity-indicator/index.android.js.map +1 -1
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/animation-common.d.ts +1 -1
- package/ui/animation/animation-common.js +8 -5
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.ios.d.ts +4 -4
- package/ui/animation/index.ios.js +131 -105
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +1 -1
- package/ui/animation/keyframe-animation.js +11 -6
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/binding-builder.js.map +1 -1
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.d.ts +1 -0
- package/ui/builder/index.js +1 -0
- package/ui/builder/index.js.map +1 -1
- package/ui/builder/xml2ui.js +2 -2
- package/ui/builder/xml2ui.js.map +1 -1
- package/ui/button/button-common.d.ts +2 -0
- package/ui/button/button-common.js +5 -0
- package/ui/button/button-common.js.map +1 -1
- package/ui/button/index.android.d.ts +0 -1
- package/ui/button/index.android.js +0 -7
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.js.map +1 -1
- package/ui/content-view/index.js +1 -1
- package/ui/content-view/index.js.map +1 -1
- package/ui/core/bindable/bindable-expressions.js.map +1 -1
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/control-state-change/index.ios.js.map +1 -1
- package/ui/core/properties/index.d.ts +7 -6
- package/ui/core/properties/index.js +107 -84
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.d.ts +0 -1
- package/ui/core/view/index.android.js +85 -130
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +6 -6
- package/ui/core/view/index.ios.js +71 -39
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +9 -3
- package/ui/core/view/view-common.js +41 -9
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.js +5 -7
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +2 -0
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view-base/index.d.ts +5 -10
- package/ui/core/view-base/index.js +27 -39
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/core/weak-event-listener/index.js.map +1 -1
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/date-picker/index.ios.js +2 -2
- package/ui/date-picker/index.ios.js.map +1 -1
- package/ui/dialogs/dialogs-common.js +3 -3
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/dialogs/index.android.js.map +1 -1
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/editable-text-base/index.android.d.ts +0 -1
- package/ui/editable-text-base/index.android.js +6 -19
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/editable-text-base/index.ios.js.map +1 -1
- package/ui/frame/activity.android.js.map +1 -1
- package/ui/frame/fragment.android.js.map +1 -1
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +2 -2
- package/ui/frame/frame-common.js +53 -32
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/frame-interfaces.d.ts +3 -0
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.js +8 -6
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +9 -0
- package/ui/frame/index.ios.d.ts +2 -0
- package/ui/frame/index.ios.js +6 -3
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.d.ts +2 -2
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.d.ts +29 -0
- package/ui/gestures/touch-manager.js +66 -2
- package/ui/gestures/touch-manager.js.map +1 -1
- package/ui/html-view/index.android.d.ts +0 -1
- package/ui/html-view/index.android.js +0 -4
- package/ui/html-view/index.android.js.map +1 -1
- package/ui/html-view/index.ios.js.map +1 -1
- package/ui/image/image-common.js +1 -1
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.d.ts +0 -1
- package/ui/image/index.android.js +3 -7
- package/ui/image/index.android.js.map +1 -1
- package/ui/image/index.ios.js.map +1 -1
- package/ui/image-cache/image-cache-common.js.map +1 -1
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/index.d.ts +1 -1
- package/ui/label/index.android.js +0 -1
- package/ui/label/index.android.js.map +1 -1
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
- package/ui/layouts/absolute-layout/index.android.js.map +1 -1
- package/ui/layouts/dock-layout/dock-layout-common.js +1 -1
- package/ui/layouts/dock-layout/dock-layout-common.js.map +1 -1
- package/ui/layouts/dock-layout/index.android.js.map +1 -1
- package/ui/layouts/dock-layout/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +5 -5
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.d.ts +0 -1
- package/ui/layouts/flexbox-layout/index.android.js +23 -42
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/grid-layout/grid-layout-common.d.ts +6 -10
- package/ui/layouts/grid-layout/grid-layout-common.js +4 -51
- package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -1
- package/ui/layouts/grid-layout/index.android.d.ts +0 -1
- package/ui/layouts/grid-layout/index.android.js +6 -16
- package/ui/layouts/grid-layout/index.android.js.map +1 -1
- package/ui/layouts/grid-layout/index.ios.js +0 -1
- package/ui/layouts/grid-layout/index.ios.js.map +1 -1
- package/ui/layouts/layout-base-common.js +1 -1
- package/ui/layouts/layout-base-common.js.map +1 -1
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/layout-base.ios.js +0 -3
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/layouts/root-layout/index.android.js.map +1 -1
- package/ui/layouts/root-layout/index.ios.js.map +1 -1
- package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js +2 -0
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/stack-layout/stack-layout-common.js +1 -1
- package/ui/layouts/stack-layout/stack-layout-common.js.map +1 -1
- package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js +3 -3
- package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-picker/index.ios.js.map +1 -1
- package/ui/list-picker/list-picker-common.js.map +1 -1
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.ios.js +6 -6
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +1 -1
- package/ui/page/page-common.js +2 -2
- package/ui/page/page-common.js.map +1 -1
- package/ui/placeholder/placeholder-common.d.ts +2 -1
- package/ui/progress/index.android.js.map +1 -1
- package/ui/proxy-view-container/index.js.map +1 -1
- package/ui/repeater/index.js.map +1 -1
- package/ui/scroll-view/index.android.js +1 -1
- package/ui/scroll-view/index.android.js.map +1 -1
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/search-bar/index.android.js +1 -12
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/search-bar/search-bar-common.js +1 -1
- package/ui/search-bar/search-bar-common.js.map +1 -1
- package/ui/segmented-bar/index.android.d.ts +2 -0
- package/ui/segmented-bar/index.android.js +49 -3
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.d.ts +10 -0
- package/ui/segmented-bar/index.ios.d.ts +2 -0
- package/ui/segmented-bar/index.ios.js +30 -5
- package/ui/segmented-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/segmented-bar-common.d.ts +3 -0
- package/ui/segmented-bar/segmented-bar-common.js +14 -0
- package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
- package/ui/slider/index.android.d.ts +0 -1
- package/ui/slider/index.android.js +0 -7
- package/ui/slider/index.android.js.map +1 -1
- package/ui/slider/index.ios.js.map +1 -1
- package/ui/slider/slider-common.d.ts +2 -0
- package/ui/slider/slider-common.js +8 -3
- package/ui/slider/slider-common.js.map +1 -1
- package/ui/styling/background-common.d.ts +2 -1
- package/ui/styling/background-common.js +30 -42
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.js +26 -24
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.ios.js +9 -0
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/converters.js.map +1 -1
- package/ui/styling/css-animation-parser.js.map +1 -1
- package/ui/styling/css-selector.js.map +1 -1
- package/ui/styling/css-shadow.js.map +1 -1
- package/ui/styling/css-stroke.js.map +1 -1
- package/ui/styling/css-utils.js +1 -0
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font-common.d.ts +11 -8
- package/ui/styling/font-common.js +50 -2
- package/ui/styling/font-common.js.map +1 -1
- package/ui/styling/font.android.d.ts +1 -8
- package/ui/styling/font.android.js +1 -19
- package/ui/styling/font.android.js.map +1 -1
- package/ui/styling/font.d.ts +4 -0
- package/ui/styling/font.ios.d.ts +1 -7
- package/ui/styling/font.ios.js +1 -19
- package/ui/styling/font.ios.js.map +1 -1
- package/ui/styling/linear-gradient.js.map +1 -1
- package/ui/styling/style/index.d.ts +1 -0
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.d.ts +1 -1
- package/ui/styling/style-properties.js +121 -130
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/switch/switch-common.js.map +1 -1
- package/ui/tab-view/index.android.d.ts +0 -1
- package/ui/tab-view/index.android.js +0 -7
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.js +10 -11
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.js +2 -2
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/formatted-string.js.map +1 -1
- package/ui/text-base/index.android.d.ts +0 -8
- package/ui/text-base/index.android.js +22 -60
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.d.ts +10 -11
- package/ui/text-base/index.ios.d.ts +2 -0
- package/ui/text-base/index.ios.js +47 -28
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/span.js.map +1 -1
- package/ui/text-base/text-base-common.d.ts +3 -2
- package/ui/text-base/text-base-common.js +22 -10
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-field/index.android.d.ts +0 -5
- package/ui/text-field/index.android.js +16 -37
- package/ui/text-field/index.android.js.map +1 -1
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-view/index.android.d.ts +0 -1
- package/ui/text-view/index.android.js +0 -4
- package/ui/text-view/index.android.js.map +1 -1
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/time-picker/index.ios.js +2 -2
- package/ui/time-picker/index.ios.js.map +1 -1
- package/ui/time-picker/time-picker-common.js.map +1 -1
- package/ui/transition/fade-transition.android.js.map +1 -1
- package/ui/transition/flip-transition.android.js.map +1 -1
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.js +5 -0
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.js +1 -1
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.android.js.map +1 -1
- package/ui/utils.ios.js.map +1 -1
- package/ui/web-view/index.android.js.map +1 -1
- package/ui/web-view/index.ios.js.map +1 -1
- package/ui/web-view/web-view-common.js.map +1 -1
- package/ui/web-view/web-view-interfaces.d.ts +2 -1
- package/utils/android/index.js.map +1 -1
- package/utils/common.js.map +1 -1
- package/utils/debug.js.map +1 -1
- package/utils/index.android.d.ts +1 -0
- package/utils/index.android.js +15 -4
- package/utils/index.android.js.map +1 -1
- package/utils/index.d.ts +5 -0
- package/utils/index.ios.d.ts +1 -0
- package/utils/index.ios.js +17 -10
- package/utils/index.ios.js.map +1 -1
- package/utils/ios/index.d.ts +4 -0
- package/utils/ios/index.js +42 -2
- package/utils/ios/index.js.map +1 -1
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.ios.js +4 -3
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/layout-helper/layout-helper-common.js.map +1 -1
- package/utils/macrotask-scheduler.js.map +1 -1
- package/utils/mainthread-helper.android.js.map +1 -1
- package/utils/mainthread-helper.ios.js.map +1 -1
- package/utils/module-merge.js.map +1 -1
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/platform-check.js.map +1 -1
- package/utils/types.js.map +1 -1
- package/xhr/index.js.map +1 -1
- package/xml/index.js.map +1 -1
- package/debugger/InspectorBackendCommands.ios.js.map +0 -1
- package/debugger/devtools-elements.android.d.ts +0 -5
- package/debugger/devtools-elements.android.js +0 -25
- package/debugger/devtools-elements.android.js.map +0 -1
- package/debugger/devtools-elements.ios.d.ts +0 -5
- package/debugger/devtools-elements.ios.js.map +0 -1
- package/debugger/webinspector-css.ios.js.map +0 -1
- package/debugger/webinspector-dom.ios.js.map +0 -1
- package/inspector_modules.ios.js.map +0 -1
- package/platforms/dist/package/platforms/android/widgets-release.aar +0 -0
- /package/debugger/{InspectorBackendCommands.ios.d.ts → InspectorBackendCommands.d.ts} +0 -0
- /package/{inspector_modules.ios.d.ts → inspector_modules.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as textModule from '../text';
|
|
2
2
|
import { Application } from '../application';
|
|
3
|
-
import { getFileExtension } from '../utils';
|
|
3
|
+
import { getFileExtension, wrapNativeException } from '../utils';
|
|
4
4
|
import { SDK_VERSION } from '../utils/constants';
|
|
5
5
|
let applicationContext;
|
|
6
6
|
function getApplicationContext() {
|
|
@@ -12,6 +12,9 @@ function getApplicationContext() {
|
|
|
12
12
|
function getOrSetHelper(path) {
|
|
13
13
|
return org.nativescript.widgets.FileHelper.fromString(getApplicationContext(), path);
|
|
14
14
|
}
|
|
15
|
+
function getOrSetFolderHelper(path) {
|
|
16
|
+
return org.nativescript.widgets.FolderHelper.fromString(getApplicationContext(), path);
|
|
17
|
+
}
|
|
15
18
|
function isContentUri(path) {
|
|
16
19
|
if (typeof path === 'string' && path.startsWith('content:')) {
|
|
17
20
|
return true;
|
|
@@ -54,16 +57,31 @@ export class FileSystemAccess {
|
|
|
54
57
|
return undefined;
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
|
-
getFile(path, onError) {
|
|
58
|
-
|
|
60
|
+
getFile(path, onError, create = true) {
|
|
61
|
+
if (create) {
|
|
62
|
+
return this.ensureFile(new java.io.File(path), false, onError);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
return {
|
|
66
|
+
path: path,
|
|
67
|
+
name: path.split('/').pop(),
|
|
68
|
+
extension: path.split('.').pop(),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
59
71
|
}
|
|
60
|
-
getFolder(path, onError) {
|
|
72
|
+
getFolder(path, onError, create = true) {
|
|
61
73
|
const javaFile = new java.io.File(path);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
if (create) {
|
|
75
|
+
const dirInfo = this.ensureFile(javaFile, true, onError);
|
|
76
|
+
if (!dirInfo) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
return { path: dirInfo.path, name: dirInfo.name };
|
|
65
80
|
}
|
|
66
|
-
return {
|
|
81
|
+
return {
|
|
82
|
+
path,
|
|
83
|
+
name: path.split('/').pop(),
|
|
84
|
+
};
|
|
67
85
|
}
|
|
68
86
|
eachEntity(path, onEntity, onError) {
|
|
69
87
|
if (!onEntity) {
|
|
@@ -115,10 +133,8 @@ export class FileSystemAccess {
|
|
|
115
133
|
}
|
|
116
134
|
}
|
|
117
135
|
}
|
|
118
|
-
catch (
|
|
119
|
-
|
|
120
|
-
onError(exception);
|
|
121
|
-
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
onError?.(wrapNativeException(error));
|
|
122
138
|
}
|
|
123
139
|
}
|
|
124
140
|
deleteFolder(path, onError) {
|
|
@@ -140,30 +156,22 @@ export class FileSystemAccess {
|
|
|
140
156
|
}
|
|
141
157
|
}
|
|
142
158
|
}
|
|
143
|
-
catch (
|
|
144
|
-
|
|
145
|
-
onError(exception);
|
|
146
|
-
}
|
|
159
|
+
catch (error) {
|
|
160
|
+
onError?.(wrapNativeException(error));
|
|
147
161
|
}
|
|
148
162
|
}
|
|
149
163
|
emptyFolder(path, onError) {
|
|
150
164
|
try {
|
|
151
165
|
const javaFile = new java.io.File(path);
|
|
152
166
|
if (!javaFile.getCanonicalFile().isDirectory()) {
|
|
153
|
-
|
|
154
|
-
onError({
|
|
155
|
-
message: 'The specified parameter is not a Folder entity.',
|
|
156
|
-
});
|
|
157
|
-
}
|
|
167
|
+
onError?.(new Error('The specified parameter is not a Folder entity.'));
|
|
158
168
|
return;
|
|
159
169
|
}
|
|
160
170
|
// TODO: Asynchronous
|
|
161
171
|
this.deleteFolderContent(javaFile);
|
|
162
172
|
}
|
|
163
|
-
catch (
|
|
164
|
-
|
|
165
|
-
onError(exception);
|
|
166
|
-
}
|
|
173
|
+
catch (error) {
|
|
174
|
+
onError?.(wrapNativeException(error));
|
|
167
175
|
}
|
|
168
176
|
}
|
|
169
177
|
rename(path, newPath, onError) {
|
|
@@ -218,44 +226,32 @@ export class FileSystemAccess {
|
|
|
218
226
|
return org.nativescript.widgets.Async.File.copySync(src, dest, getApplicationContext());
|
|
219
227
|
}
|
|
220
228
|
catch (error) {
|
|
221
|
-
|
|
222
|
-
onError(exception);
|
|
223
|
-
}
|
|
229
|
+
onError?.(wrapNativeException(error));
|
|
224
230
|
}
|
|
225
231
|
return false;
|
|
226
232
|
}
|
|
227
233
|
copyAsync(src, dest) {
|
|
228
234
|
return new Promise((resolve, reject) => {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
}), getApplicationContext());
|
|
238
|
-
}
|
|
239
|
-
catch (ex) {
|
|
240
|
-
reject(ex);
|
|
241
|
-
}
|
|
235
|
+
org.nativescript.widgets.Async.File.copy(src, dest, new org.nativescript.widgets.Async.CompleteCallback({
|
|
236
|
+
onComplete: (result) => {
|
|
237
|
+
resolve(result);
|
|
238
|
+
},
|
|
239
|
+
onError: reject,
|
|
240
|
+
}), getApplicationContext());
|
|
241
|
+
}).catch((ex) => {
|
|
242
|
+
throw wrapNativeException(ex);
|
|
242
243
|
});
|
|
243
244
|
}
|
|
244
245
|
readBufferAsync(path) {
|
|
245
246
|
return new Promise((resolve, reject) => {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}), null);
|
|
255
|
-
}
|
|
256
|
-
catch (ex) {
|
|
257
|
-
reject(ex);
|
|
258
|
-
}
|
|
247
|
+
org.nativescript.widgets.Async.File.readBuffer(path, new org.nativescript.widgets.Async.CompleteCallback({
|
|
248
|
+
onComplete: (result) => {
|
|
249
|
+
resolve(ArrayBuffer.from(result));
|
|
250
|
+
},
|
|
251
|
+
onError: reject,
|
|
252
|
+
}), null);
|
|
253
|
+
}).catch((ex) => {
|
|
254
|
+
throw wrapNativeException(ex);
|
|
259
255
|
});
|
|
260
256
|
}
|
|
261
257
|
readBufferSync(path, onError) {
|
|
@@ -267,27 +263,20 @@ export class FileSystemAccess {
|
|
|
267
263
|
channel.read(buffer);
|
|
268
264
|
return buffer;
|
|
269
265
|
}
|
|
270
|
-
catch (
|
|
271
|
-
|
|
272
|
-
onError(exception);
|
|
273
|
-
}
|
|
266
|
+
catch (error) {
|
|
267
|
+
onError?.(wrapNativeException(error));
|
|
274
268
|
}
|
|
275
269
|
}
|
|
276
270
|
readAsync(path) {
|
|
277
271
|
return new Promise((resolve, reject) => {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
}), null);
|
|
287
|
-
}
|
|
288
|
-
catch (ex) {
|
|
289
|
-
reject(ex);
|
|
290
|
-
}
|
|
272
|
+
org.nativescript.widgets.Async.File.read(path, new org.nativescript.widgets.Async.CompleteCallback({
|
|
273
|
+
onComplete: (result) => {
|
|
274
|
+
resolve(result);
|
|
275
|
+
},
|
|
276
|
+
onError: reject,
|
|
277
|
+
}), null);
|
|
278
|
+
}).catch((ex) => {
|
|
279
|
+
throw wrapNativeException(ex);
|
|
291
280
|
});
|
|
292
281
|
}
|
|
293
282
|
readSync(path, onError) {
|
|
@@ -299,10 +288,8 @@ export class FileSystemAccess {
|
|
|
299
288
|
dataInputStream.readFully(bytes);
|
|
300
289
|
return bytes;
|
|
301
290
|
}
|
|
302
|
-
catch (
|
|
303
|
-
|
|
304
|
-
onError(exception);
|
|
305
|
-
}
|
|
291
|
+
catch (error) {
|
|
292
|
+
onError?.(wrapNativeException(error));
|
|
306
293
|
}
|
|
307
294
|
}
|
|
308
295
|
static getBuffer(buffer) {
|
|
@@ -315,19 +302,14 @@ export class FileSystemAccess {
|
|
|
315
302
|
}
|
|
316
303
|
appendBufferAsync(path, buffer) {
|
|
317
304
|
return new Promise((resolve, reject) => {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}), null);
|
|
327
|
-
}
|
|
328
|
-
catch (ex) {
|
|
329
|
-
reject(ex);
|
|
330
|
-
}
|
|
305
|
+
org.nativescript.widgets.Async.File.appendBuffer(path, FileSystemAccess.getBuffer(buffer), new org.nativescript.widgets.Async.CompleteCallback({
|
|
306
|
+
onComplete: () => {
|
|
307
|
+
resolve();
|
|
308
|
+
},
|
|
309
|
+
onError: reject,
|
|
310
|
+
}), null);
|
|
311
|
+
}).catch((ex) => {
|
|
312
|
+
throw wrapNativeException(ex);
|
|
331
313
|
});
|
|
332
314
|
}
|
|
333
315
|
appendBufferSync(path, buffer, onError) {
|
|
@@ -338,27 +320,20 @@ export class FileSystemAccess {
|
|
|
338
320
|
channel.write(FileSystemAccess.getBuffer(buffer));
|
|
339
321
|
stream.close();
|
|
340
322
|
}
|
|
341
|
-
catch (
|
|
342
|
-
|
|
343
|
-
onError(exception);
|
|
344
|
-
}
|
|
323
|
+
catch (error) {
|
|
324
|
+
onError?.(wrapNativeException(error));
|
|
345
325
|
}
|
|
346
326
|
}
|
|
347
327
|
appendAsync(path, bytes) {
|
|
348
328
|
return new Promise((resolve, reject) => {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}), null);
|
|
358
|
-
}
|
|
359
|
-
catch (ex) {
|
|
360
|
-
reject(ex);
|
|
361
|
-
}
|
|
329
|
+
org.nativescript.widgets.Async.File.append(path, bytes, new org.nativescript.widgets.Async.CompleteCallback({
|
|
330
|
+
onComplete: () => {
|
|
331
|
+
resolve();
|
|
332
|
+
},
|
|
333
|
+
onError: reject,
|
|
334
|
+
}), null);
|
|
335
|
+
}).catch((ex) => {
|
|
336
|
+
throw wrapNativeException(ex);
|
|
362
337
|
});
|
|
363
338
|
}
|
|
364
339
|
appendSync(path, bytes, onError) {
|
|
@@ -368,27 +343,20 @@ export class FileSystemAccess {
|
|
|
368
343
|
stream.write(bytes, 0, bytes.length);
|
|
369
344
|
stream.close();
|
|
370
345
|
}
|
|
371
|
-
catch (
|
|
372
|
-
|
|
373
|
-
onError(exception);
|
|
374
|
-
}
|
|
346
|
+
catch (error) {
|
|
347
|
+
onError?.(wrapNativeException(error));
|
|
375
348
|
}
|
|
376
349
|
}
|
|
377
350
|
writeBufferAsync(path, buffer) {
|
|
378
351
|
return new Promise((resolve, reject) => {
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
}), null);
|
|
388
|
-
}
|
|
389
|
-
catch (ex) {
|
|
390
|
-
reject(ex);
|
|
391
|
-
}
|
|
352
|
+
org.nativescript.widgets.Async.File.writeBuffer(path, FileSystemAccess.getBuffer(buffer), new org.nativescript.widgets.Async.CompleteCallback({
|
|
353
|
+
onComplete: () => {
|
|
354
|
+
resolve();
|
|
355
|
+
},
|
|
356
|
+
onError: reject,
|
|
357
|
+
}), null);
|
|
358
|
+
}).catch((ex) => {
|
|
359
|
+
throw wrapNativeException(ex);
|
|
392
360
|
});
|
|
393
361
|
}
|
|
394
362
|
writeBufferSync(path, buffer, onError) {
|
|
@@ -399,27 +367,20 @@ export class FileSystemAccess {
|
|
|
399
367
|
channel.write(FileSystemAccess.getBuffer(buffer));
|
|
400
368
|
stream.close();
|
|
401
369
|
}
|
|
402
|
-
catch (
|
|
403
|
-
|
|
404
|
-
onError(exception);
|
|
405
|
-
}
|
|
370
|
+
catch (error) {
|
|
371
|
+
onError?.(wrapNativeException(error));
|
|
406
372
|
}
|
|
407
373
|
}
|
|
408
374
|
writeAsync(path, bytes) {
|
|
409
375
|
return new Promise((resolve, reject) => {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}), null);
|
|
419
|
-
}
|
|
420
|
-
catch (ex) {
|
|
421
|
-
reject(ex);
|
|
422
|
-
}
|
|
376
|
+
org.nativescript.widgets.Async.File.write(path, bytes, new org.nativescript.widgets.Async.CompleteCallback({
|
|
377
|
+
onComplete: () => {
|
|
378
|
+
resolve();
|
|
379
|
+
},
|
|
380
|
+
onError: reject,
|
|
381
|
+
}), null);
|
|
382
|
+
}).catch((ex) => {
|
|
383
|
+
throw wrapNativeException(ex);
|
|
423
384
|
});
|
|
424
385
|
}
|
|
425
386
|
writeSync(path, bytes, onError) {
|
|
@@ -429,10 +390,8 @@ export class FileSystemAccess {
|
|
|
429
390
|
stream.write(bytes, 0, bytes.length);
|
|
430
391
|
stream.close();
|
|
431
392
|
}
|
|
432
|
-
catch (
|
|
433
|
-
|
|
434
|
-
onError(exception);
|
|
435
|
-
}
|
|
393
|
+
catch (error) {
|
|
394
|
+
onError?.(wrapNativeException(error));
|
|
436
395
|
}
|
|
437
396
|
}
|
|
438
397
|
readTextAsync(path, encoding) {
|
|
@@ -441,23 +400,18 @@ export class FileSystemAccess {
|
|
|
441
400
|
actualEncoding = textModule.encoding.UTF_8;
|
|
442
401
|
}
|
|
443
402
|
return new Promise((resolve, reject) => {
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
}), null);
|
|
457
|
-
}
|
|
458
|
-
catch (ex) {
|
|
459
|
-
reject(ex);
|
|
460
|
-
}
|
|
403
|
+
org.nativescript.widgets.Async.File.readText(path, actualEncoding, new org.nativescript.widgets.Async.CompleteCallback({
|
|
404
|
+
onComplete: (result) => {
|
|
405
|
+
if (actualEncoding === textModule.encoding.UTF_8) {
|
|
406
|
+
// Remove UTF8 BOM if present. http://www.rgagnon.com/javadetails/java-handle-utf8-file-with-bom.html
|
|
407
|
+
result = FileSystemAccess._removeUtf8Bom(result);
|
|
408
|
+
}
|
|
409
|
+
resolve(result);
|
|
410
|
+
},
|
|
411
|
+
onError: reject,
|
|
412
|
+
}), null);
|
|
413
|
+
}).catch((ex) => {
|
|
414
|
+
throw wrapNativeException(ex);
|
|
461
415
|
});
|
|
462
416
|
}
|
|
463
417
|
readTextSync(path, onError, encoding) {
|
|
@@ -493,10 +447,8 @@ export class FileSystemAccess {
|
|
|
493
447
|
bufferedReader.close();
|
|
494
448
|
return result;
|
|
495
449
|
}
|
|
496
|
-
catch (
|
|
497
|
-
|
|
498
|
-
onError(exception);
|
|
499
|
-
}
|
|
450
|
+
catch (error) {
|
|
451
|
+
onError?.(wrapNativeException(error));
|
|
500
452
|
}
|
|
501
453
|
}
|
|
502
454
|
static _removeUtf8Bom(s) {
|
|
@@ -512,19 +464,14 @@ export class FileSystemAccess {
|
|
|
512
464
|
actualEncoding = textModule.encoding.UTF_8;
|
|
513
465
|
}
|
|
514
466
|
return new Promise((resolve, reject) => {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
}), null);
|
|
524
|
-
}
|
|
525
|
-
catch (ex) {
|
|
526
|
-
reject(ex);
|
|
527
|
-
}
|
|
467
|
+
org.nativescript.widgets.Async.File.appendText(path, content, actualEncoding, new org.nativescript.widgets.Async.CompleteCallback({
|
|
468
|
+
onComplete: () => {
|
|
469
|
+
resolve();
|
|
470
|
+
},
|
|
471
|
+
onError: reject,
|
|
472
|
+
}), null);
|
|
473
|
+
}).catch((ex) => {
|
|
474
|
+
throw wrapNativeException(ex);
|
|
528
475
|
});
|
|
529
476
|
}
|
|
530
477
|
appendTextSync(path, content, onError, encoding) {
|
|
@@ -539,10 +486,8 @@ export class FileSystemAccess {
|
|
|
539
486
|
writer.write(content);
|
|
540
487
|
writer.close();
|
|
541
488
|
}
|
|
542
|
-
catch (
|
|
543
|
-
|
|
544
|
-
onError(exception);
|
|
545
|
-
}
|
|
489
|
+
catch (error) {
|
|
490
|
+
onError?.(wrapNativeException(error));
|
|
546
491
|
}
|
|
547
492
|
}
|
|
548
493
|
writeTextAsync(path, content, encoding) {
|
|
@@ -551,19 +496,14 @@ export class FileSystemAccess {
|
|
|
551
496
|
actualEncoding = textModule.encoding.UTF_8;
|
|
552
497
|
}
|
|
553
498
|
return new Promise((resolve, reject) => {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
}), null);
|
|
563
|
-
}
|
|
564
|
-
catch (ex) {
|
|
565
|
-
reject(ex);
|
|
566
|
-
}
|
|
499
|
+
org.nativescript.widgets.Async.File.writeText(path, content, actualEncoding, new org.nativescript.widgets.Async.CompleteCallback({
|
|
500
|
+
onComplete: () => {
|
|
501
|
+
resolve();
|
|
502
|
+
},
|
|
503
|
+
onError: reject,
|
|
504
|
+
}), null);
|
|
505
|
+
}).catch((ex) => {
|
|
506
|
+
throw wrapNativeException(ex);
|
|
567
507
|
});
|
|
568
508
|
}
|
|
569
509
|
writeTextSync(path, content, onError, encoding) {
|
|
@@ -578,10 +518,8 @@ export class FileSystemAccess {
|
|
|
578
518
|
writer.write(content);
|
|
579
519
|
writer.close();
|
|
580
520
|
}
|
|
581
|
-
catch (
|
|
582
|
-
|
|
583
|
-
onError(exception);
|
|
584
|
-
}
|
|
521
|
+
catch (error) {
|
|
522
|
+
onError?.(wrapNativeException(error));
|
|
585
523
|
}
|
|
586
524
|
}
|
|
587
525
|
deleteFolderContent(file) {
|
|
@@ -615,11 +553,8 @@ export class FileSystemAccess {
|
|
|
615
553
|
created = javaFile.createNewFile();
|
|
616
554
|
}
|
|
617
555
|
if (!created) {
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
onError('Failed to create new java File for path ' + javaFile.getAbsolutePath());
|
|
621
|
-
}
|
|
622
|
-
return undefined;
|
|
556
|
+
onError?.(new Error('Failed to create new java File for path ' + javaFile.getAbsolutePath()));
|
|
557
|
+
return;
|
|
623
558
|
}
|
|
624
559
|
else {
|
|
625
560
|
javaFile.setReadable(true);
|
|
@@ -633,12 +568,9 @@ export class FileSystemAccess {
|
|
|
633
568
|
extension: this.getFileExtension(path),
|
|
634
569
|
};
|
|
635
570
|
}
|
|
636
|
-
catch (
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
onError(exception);
|
|
640
|
-
}
|
|
641
|
-
return undefined;
|
|
571
|
+
catch (error) {
|
|
572
|
+
onError?.(wrapNativeException(error));
|
|
573
|
+
return;
|
|
642
574
|
}
|
|
643
575
|
}
|
|
644
576
|
// TODO: This method is the same as in the iOS implementation.
|
|
@@ -650,9 +582,7 @@ export class FileSystemAccess {
|
|
|
650
582
|
try {
|
|
651
583
|
let javaFile = new java.io.File(path);
|
|
652
584
|
if (!javaFile.getCanonicalFile().isDirectory()) {
|
|
653
|
-
|
|
654
|
-
onError('There is no folder existing at path ' + path);
|
|
655
|
-
}
|
|
585
|
+
onError?.(new Error('There is no folder existing at path ' + path));
|
|
656
586
|
return;
|
|
657
587
|
}
|
|
658
588
|
const filesList = javaFile.listFiles();
|
|
@@ -674,10 +604,8 @@ export class FileSystemAccess {
|
|
|
674
604
|
}
|
|
675
605
|
}
|
|
676
606
|
}
|
|
677
|
-
catch (
|
|
678
|
-
|
|
679
|
-
onError(exception);
|
|
680
|
-
}
|
|
607
|
+
catch (error) {
|
|
608
|
+
onError?.(wrapNativeException(error));
|
|
681
609
|
}
|
|
682
610
|
}
|
|
683
611
|
getPathSeparator() {
|
|
@@ -742,11 +670,24 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
742
670
|
}
|
|
743
671
|
getParent(path, onError) {
|
|
744
672
|
if (isContentUri(path)) {
|
|
673
|
+
try {
|
|
674
|
+
const parent = getOrSetFolderHelper(path).getParent();
|
|
675
|
+
if (parent) {
|
|
676
|
+
return {
|
|
677
|
+
path: parent.getUri().toString(),
|
|
678
|
+
name: parent.getName(),
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
catch (e) {
|
|
683
|
+
onError?.(wrapNativeException(e));
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
745
686
|
return null;
|
|
746
687
|
}
|
|
747
688
|
return super.getParent(path, onError);
|
|
748
689
|
}
|
|
749
|
-
getFile(path, onError) {
|
|
690
|
+
getFile(path, onError, create = true) {
|
|
750
691
|
if (isContentUri(path)) {
|
|
751
692
|
try {
|
|
752
693
|
const file = getOrSetHelper(path);
|
|
@@ -757,31 +698,61 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
757
698
|
};
|
|
758
699
|
}
|
|
759
700
|
catch (e) {
|
|
760
|
-
|
|
761
|
-
onError(e);
|
|
762
|
-
}
|
|
701
|
+
onError?.(wrapNativeException(e));
|
|
763
702
|
return;
|
|
764
703
|
}
|
|
765
704
|
}
|
|
766
705
|
return super.getFile(path, onError);
|
|
767
706
|
}
|
|
768
|
-
getFolder(path, onError) {
|
|
707
|
+
getFolder(path, onError, create = true) {
|
|
708
|
+
console.log('getFolder', path, isContentUri(path));
|
|
769
709
|
if (isContentUri(path)) {
|
|
710
|
+
const folder = getOrSetFolderHelper(path);
|
|
711
|
+
console.log('folder', folder, folder.getDocumentFile(), folder?.getName());
|
|
712
|
+
if (folder) {
|
|
713
|
+
return {
|
|
714
|
+
path,
|
|
715
|
+
name: folder.getName(),
|
|
716
|
+
};
|
|
717
|
+
}
|
|
770
718
|
return null;
|
|
771
719
|
}
|
|
772
|
-
return super.getFolder(path, onError);
|
|
720
|
+
return super.getFolder(path, onError, create);
|
|
773
721
|
}
|
|
774
|
-
|
|
775
|
-
if (isContentUri(path)) {
|
|
776
|
-
return
|
|
722
|
+
enumEntities(path, callback, onError) {
|
|
723
|
+
if (!isContentUri(path)) {
|
|
724
|
+
return super.enumEntities(path, callback);
|
|
777
725
|
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
726
|
+
try {
|
|
727
|
+
const folder = getOrSetFolderHelper(path);
|
|
728
|
+
if (!folder) {
|
|
729
|
+
onError?.(new Error('There is no folder existing at path ' + path));
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
const documentFolder = folder.getDocumentFile();
|
|
733
|
+
const filesList = documentFolder.listFiles();
|
|
734
|
+
const length = filesList.length;
|
|
735
|
+
let info;
|
|
736
|
+
let retVal;
|
|
737
|
+
let documentFile;
|
|
738
|
+
for (let i = 0; i < length; i++) {
|
|
739
|
+
documentFile = filesList[i];
|
|
740
|
+
info = {
|
|
741
|
+
path: documentFile.getUri().toString(),
|
|
742
|
+
name: documentFile.getName(),
|
|
743
|
+
};
|
|
744
|
+
if (documentFile.isFile()) {
|
|
745
|
+
info.extension = this.getFileExtension(info.path);
|
|
746
|
+
}
|
|
747
|
+
retVal = callback(info);
|
|
748
|
+
if (retVal === false) {
|
|
749
|
+
break;
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
catch (error) {
|
|
754
|
+
onError?.(wrapNativeException(error));
|
|
783
755
|
}
|
|
784
|
-
super.eachEntity(path, onEntity);
|
|
785
756
|
}
|
|
786
757
|
fileExists(path) {
|
|
787
758
|
if (isContentUri(path)) {
|
|
@@ -791,7 +762,7 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
791
762
|
}
|
|
792
763
|
folderExists(path) {
|
|
793
764
|
if (isContentUri(path)) {
|
|
794
|
-
return
|
|
765
|
+
return org.nativescript.widgets.FolderHelper.exists(applicationContext, path);
|
|
795
766
|
}
|
|
796
767
|
return super.folderExists(path);
|
|
797
768
|
}
|
|
@@ -801,7 +772,7 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
801
772
|
getOrSetHelper(path).delete(applicationContext);
|
|
802
773
|
}
|
|
803
774
|
catch (e) {
|
|
804
|
-
onError?.(e);
|
|
775
|
+
onError?.(wrapNativeException(e));
|
|
805
776
|
}
|
|
806
777
|
}
|
|
807
778
|
else {
|
|
@@ -809,12 +780,55 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
809
780
|
}
|
|
810
781
|
}
|
|
811
782
|
deleteFolder(path, onError) {
|
|
812
|
-
if (
|
|
783
|
+
if (isContentUri(path)) {
|
|
784
|
+
try {
|
|
785
|
+
getOrSetFolderHelper(path).delete(applicationContext);
|
|
786
|
+
}
|
|
787
|
+
catch (e) {
|
|
788
|
+
onError?.(wrapNativeException(e));
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
else {
|
|
813
792
|
super.deleteFolder(path, onError);
|
|
814
793
|
}
|
|
815
794
|
}
|
|
795
|
+
deleteDocumentUriFolderContent(documentFile) {
|
|
796
|
+
if (!documentFile.isDirectory()) {
|
|
797
|
+
return false;
|
|
798
|
+
}
|
|
799
|
+
const filesList = documentFile.listFiles();
|
|
800
|
+
if (filesList.length === 0) {
|
|
801
|
+
return true; // Nothing to delete, so success!
|
|
802
|
+
}
|
|
803
|
+
let childFile;
|
|
804
|
+
let success = false;
|
|
805
|
+
for (let i = 0; i < filesList.length; i++) {
|
|
806
|
+
childFile = filesList[i];
|
|
807
|
+
if (childFile.isDirectory()) {
|
|
808
|
+
success = this.deleteDocumentUriFolderContent(childFile);
|
|
809
|
+
if (!success) {
|
|
810
|
+
break;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
success = childFile.delete();
|
|
814
|
+
}
|
|
815
|
+
return success;
|
|
816
|
+
}
|
|
816
817
|
emptyFolder(path, onError) {
|
|
817
|
-
if (
|
|
818
|
+
if (isContentUri(path)) {
|
|
819
|
+
try {
|
|
820
|
+
const documentFile = getOrSetFolderHelper(path)?.getDocumentFile();
|
|
821
|
+
if (!documentFile?.isDirectory()) {
|
|
822
|
+
onError?.(new Error('The specified parameter is not a Folder entity.'));
|
|
823
|
+
return;
|
|
824
|
+
}
|
|
825
|
+
this.deleteDocumentUriFolderContent(documentFile);
|
|
826
|
+
}
|
|
827
|
+
catch (error) {
|
|
828
|
+
onError?.(wrapNativeException(error));
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
else {
|
|
818
832
|
super.emptyFolder(path, onError);
|
|
819
833
|
}
|
|
820
834
|
}
|
|
@@ -824,8 +838,8 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
824
838
|
if (typeof onError === 'function') {
|
|
825
839
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
826
840
|
onSuccess(result) { },
|
|
827
|
-
onError(
|
|
828
|
-
onError(
|
|
841
|
+
onError(ex) {
|
|
842
|
+
onError(wrapNativeException(ex));
|
|
829
843
|
},
|
|
830
844
|
});
|
|
831
845
|
}
|
|
@@ -841,10 +855,10 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
841
855
|
onSuccess(result) {
|
|
842
856
|
resolve();
|
|
843
857
|
},
|
|
844
|
-
onError
|
|
845
|
-
reject(error);
|
|
846
|
-
},
|
|
858
|
+
onError: reject,
|
|
847
859
|
}));
|
|
860
|
+
}).catch((ex) => {
|
|
861
|
+
throw wrapNativeException(ex);
|
|
848
862
|
});
|
|
849
863
|
}
|
|
850
864
|
getDocumentsFolderPath() {
|
|
@@ -866,10 +880,10 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
866
880
|
onSuccess(result) {
|
|
867
881
|
resolve();
|
|
868
882
|
},
|
|
869
|
-
onError
|
|
870
|
-
reject(error);
|
|
871
|
-
},
|
|
883
|
+
onError: reject,
|
|
872
884
|
}));
|
|
885
|
+
}).catch((ex) => {
|
|
886
|
+
throw wrapNativeException(ex);
|
|
873
887
|
});
|
|
874
888
|
}
|
|
875
889
|
return super.appendAsync(path, content);
|
|
@@ -880,8 +894,8 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
880
894
|
if (typeof onError === 'function') {
|
|
881
895
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
882
896
|
onSuccess(result) { },
|
|
883
|
-
onError(
|
|
884
|
-
onError(
|
|
897
|
+
onError(ex) {
|
|
898
|
+
onError(wrapNativeException(ex));
|
|
885
899
|
},
|
|
886
900
|
});
|
|
887
901
|
}
|
|
@@ -898,10 +912,10 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
898
912
|
onSuccess(result) {
|
|
899
913
|
resolve();
|
|
900
914
|
},
|
|
901
|
-
onError
|
|
902
|
-
reject(error);
|
|
903
|
-
},
|
|
915
|
+
onError: reject,
|
|
904
916
|
}));
|
|
917
|
+
}).catch((ex) => {
|
|
918
|
+
throw wrapNativeException(ex);
|
|
905
919
|
});
|
|
906
920
|
}
|
|
907
921
|
return super.appendAsync(path, content);
|
|
@@ -912,8 +926,8 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
912
926
|
if (typeof onError === 'function') {
|
|
913
927
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
914
928
|
onSuccess(result) { },
|
|
915
|
-
onError(
|
|
916
|
-
onError(
|
|
929
|
+
onError(ex) {
|
|
930
|
+
onError(wrapNativeException(ex));
|
|
917
931
|
},
|
|
918
932
|
});
|
|
919
933
|
}
|
|
@@ -930,10 +944,10 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
930
944
|
onSuccess(result) {
|
|
931
945
|
resolve();
|
|
932
946
|
},
|
|
933
|
-
onError
|
|
934
|
-
reject(error);
|
|
935
|
-
},
|
|
947
|
+
onError: reject,
|
|
936
948
|
}));
|
|
949
|
+
}).catch((ex) => {
|
|
950
|
+
throw wrapNativeException(ex);
|
|
937
951
|
});
|
|
938
952
|
}
|
|
939
953
|
return super.appendTextAsync(path, content, encoding);
|
|
@@ -944,8 +958,8 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
944
958
|
if (typeof onError === 'function') {
|
|
945
959
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
946
960
|
onSuccess(result) { },
|
|
947
|
-
onError(
|
|
948
|
-
onError(
|
|
961
|
+
onError(ex) {
|
|
962
|
+
onError(wrapNativeException(ex));
|
|
949
963
|
},
|
|
950
964
|
});
|
|
951
965
|
}
|
|
@@ -962,10 +976,10 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
962
976
|
onSuccess(result) {
|
|
963
977
|
resolve(result);
|
|
964
978
|
},
|
|
965
|
-
onError
|
|
966
|
-
reject(error);
|
|
967
|
-
},
|
|
979
|
+
onError: reject,
|
|
968
980
|
}));
|
|
981
|
+
}).catch((ex) => {
|
|
982
|
+
throw wrapNativeException(ex);
|
|
969
983
|
});
|
|
970
984
|
}
|
|
971
985
|
return super.readTextAsync(path, encoding);
|
|
@@ -976,8 +990,8 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
976
990
|
if (typeof onError === 'function') {
|
|
977
991
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
978
992
|
onSuccess(result) { },
|
|
979
|
-
onError(
|
|
980
|
-
onError(
|
|
993
|
+
onError(ex) {
|
|
994
|
+
onError(wrapNativeException(ex));
|
|
981
995
|
},
|
|
982
996
|
});
|
|
983
997
|
}
|
|
@@ -994,10 +1008,10 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
994
1008
|
onSuccess(result) {
|
|
995
1009
|
resolve(result);
|
|
996
1010
|
},
|
|
997
|
-
onError
|
|
998
|
-
reject(error);
|
|
999
|
-
},
|
|
1011
|
+
onError: reject,
|
|
1000
1012
|
}));
|
|
1013
|
+
}).catch((ex) => {
|
|
1014
|
+
throw wrapNativeException(ex);
|
|
1001
1015
|
});
|
|
1002
1016
|
}
|
|
1003
1017
|
return super.readBufferAsync(path);
|
|
@@ -1008,8 +1022,8 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
1008
1022
|
if (typeof onError === 'function') {
|
|
1009
1023
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
1010
1024
|
onSuccess(result) { },
|
|
1011
|
-
onError(
|
|
1012
|
-
onError(
|
|
1025
|
+
onError(ex) {
|
|
1026
|
+
onError(wrapNativeException(ex));
|
|
1013
1027
|
},
|
|
1014
1028
|
});
|
|
1015
1029
|
}
|
|
@@ -1028,10 +1042,10 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
1028
1042
|
onSuccess(result) {
|
|
1029
1043
|
resolve(result);
|
|
1030
1044
|
},
|
|
1031
|
-
onError
|
|
1032
|
-
reject(error);
|
|
1033
|
-
},
|
|
1045
|
+
onError: reject,
|
|
1034
1046
|
}));
|
|
1047
|
+
}).catch((ex) => {
|
|
1048
|
+
throw wrapNativeException(ex);
|
|
1035
1049
|
});
|
|
1036
1050
|
}
|
|
1037
1051
|
return super.readAsync(path);
|
|
@@ -1042,8 +1056,8 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
1042
1056
|
if (typeof onError === 'function') {
|
|
1043
1057
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
1044
1058
|
onSuccess(result) { },
|
|
1045
|
-
onError(
|
|
1046
|
-
onError(
|
|
1059
|
+
onError(ex) {
|
|
1060
|
+
onError(wrapNativeException(ex));
|
|
1047
1061
|
},
|
|
1048
1062
|
});
|
|
1049
1063
|
}
|
|
@@ -1058,10 +1072,10 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
1058
1072
|
onSuccess(result) {
|
|
1059
1073
|
resolve();
|
|
1060
1074
|
},
|
|
1061
|
-
onError
|
|
1062
|
-
reject(error);
|
|
1063
|
-
},
|
|
1075
|
+
onError: reject,
|
|
1064
1076
|
}));
|
|
1077
|
+
}).catch((ex) => {
|
|
1078
|
+
throw wrapNativeException(ex);
|
|
1065
1079
|
});
|
|
1066
1080
|
}
|
|
1067
1081
|
return super.writeTextAsync(path, content, encoding);
|
|
@@ -1072,8 +1086,8 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
1072
1086
|
if (typeof onError === 'function') {
|
|
1073
1087
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
1074
1088
|
onSuccess(result) { },
|
|
1075
|
-
onError(
|
|
1076
|
-
onError(
|
|
1089
|
+
onError(ex) {
|
|
1090
|
+
onError(wrapNativeException(ex));
|
|
1077
1091
|
},
|
|
1078
1092
|
});
|
|
1079
1093
|
}
|
|
@@ -1090,10 +1104,10 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
1090
1104
|
onSuccess(result) {
|
|
1091
1105
|
resolve();
|
|
1092
1106
|
},
|
|
1093
|
-
onError
|
|
1094
|
-
reject(error);
|
|
1095
|
-
},
|
|
1107
|
+
onError: reject,
|
|
1096
1108
|
}));
|
|
1109
|
+
}).catch((ex) => {
|
|
1110
|
+
throw wrapNativeException(ex);
|
|
1097
1111
|
});
|
|
1098
1112
|
}
|
|
1099
1113
|
return super.writeAsync(path, content);
|
|
@@ -1104,8 +1118,8 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
1104
1118
|
if (typeof onError === 'function') {
|
|
1105
1119
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
1106
1120
|
onSuccess(result) { },
|
|
1107
|
-
onError(
|
|
1108
|
-
onError(
|
|
1121
|
+
onError(ex) {
|
|
1122
|
+
onError(wrapNativeException(ex));
|
|
1109
1123
|
},
|
|
1110
1124
|
});
|
|
1111
1125
|
}
|
|
@@ -1122,10 +1136,10 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
1122
1136
|
onSuccess(result) {
|
|
1123
1137
|
resolve();
|
|
1124
1138
|
},
|
|
1125
|
-
onError
|
|
1126
|
-
reject(error);
|
|
1127
|
-
},
|
|
1139
|
+
onError: reject,
|
|
1128
1140
|
}));
|
|
1141
|
+
}).catch((ex) => {
|
|
1142
|
+
throw wrapNativeException(ex);
|
|
1129
1143
|
});
|
|
1130
1144
|
}
|
|
1131
1145
|
return super.writeAsync(path, content);
|
|
@@ -1136,8 +1150,8 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
1136
1150
|
if (typeof onError === 'function') {
|
|
1137
1151
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
1138
1152
|
onSuccess(result) { },
|
|
1139
|
-
onError(
|
|
1140
|
-
onError(
|
|
1153
|
+
onError(ex) {
|
|
1154
|
+
onError(wrapNativeException(ex));
|
|
1141
1155
|
},
|
|
1142
1156
|
});
|
|
1143
1157
|
}
|
|
@@ -1165,5 +1179,62 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
1165
1179
|
joinPaths(paths) {
|
|
1166
1180
|
return super.joinPaths(paths);
|
|
1167
1181
|
}
|
|
1182
|
+
contains(path, fileName) {
|
|
1183
|
+
if (isContentUri(path)) {
|
|
1184
|
+
return getOrSetFolderHelper(path).containsFileOrFolder(fileName);
|
|
1185
|
+
}
|
|
1186
|
+
else {
|
|
1187
|
+
const subPath = this.joinPath(path, fileName);
|
|
1188
|
+
if (this.fileExists(subPath)) {
|
|
1189
|
+
return true;
|
|
1190
|
+
}
|
|
1191
|
+
return this.folderExists(subPath);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
getOrCreateFile(path, fileName, create) {
|
|
1195
|
+
console.log('getOrCreateFile', path, fileName);
|
|
1196
|
+
if (isContentUri(path)) {
|
|
1197
|
+
const documentFile = getOrSetFolderHelper(path).getOrCreateFile(fileName, create);
|
|
1198
|
+
console.log('documentFile', documentFile);
|
|
1199
|
+
const subPath = documentFile.getUri().toString();
|
|
1200
|
+
return documentFile
|
|
1201
|
+
? {
|
|
1202
|
+
path: subPath,
|
|
1203
|
+
name: documentFile.getName(),
|
|
1204
|
+
extension: getOrSetHelper(subPath).getExtension(),
|
|
1205
|
+
}
|
|
1206
|
+
: undefined;
|
|
1207
|
+
}
|
|
1208
|
+
else {
|
|
1209
|
+
const subPath = this.joinPath(path, fileName);
|
|
1210
|
+
return super.getFile(subPath, (error) => {
|
|
1211
|
+
throw error;
|
|
1212
|
+
}, create);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
/**
|
|
1216
|
+
*get a file inside a folder.
|
|
1217
|
+
* @param path folder path.
|
|
1218
|
+
* @param fileName filename to check
|
|
1219
|
+
* Returns boolean
|
|
1220
|
+
*/
|
|
1221
|
+
getOrCreateFolder(path, fileName, create) {
|
|
1222
|
+
if (isContentUri(path)) {
|
|
1223
|
+
const documentFile = getOrSetFolderHelper(path).getOrCreateFolder(fileName, create);
|
|
1224
|
+
const subPath = documentFile.getUri().toString();
|
|
1225
|
+
return documentFile
|
|
1226
|
+
? {
|
|
1227
|
+
path: subPath,
|
|
1228
|
+
name: documentFile.getName(),
|
|
1229
|
+
}
|
|
1230
|
+
: undefined;
|
|
1231
|
+
}
|
|
1232
|
+
else {
|
|
1233
|
+
const subPath = this.joinPath(path, fileName);
|
|
1234
|
+
return super.getFolder(subPath, (error) => {
|
|
1235
|
+
throw error;
|
|
1236
|
+
}, create);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1168
1239
|
}
|
|
1169
1240
|
//# sourceMappingURL=file-system-access.android.js.map
|