@nativescript/core 8.9.0-napi-es5.0 → 8.9.0-napi.1
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 +16 -23
- package/abortcontroller/abortsignal.js.map +1 -1
- package/abortcontroller/index.js +14 -20
- package/abortcontroller/index.js.map +1 -1
- package/accessibility/accessibility-common.js +8 -8
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/accessibility-css-helper.js +27 -27
- package/accessibility/accessibility-css-helper.js.map +1 -1
- package/accessibility/accessibility-properties.js +22 -23
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/accessibility-service-common.js +12 -22
- package/accessibility/accessibility-service-common.js.map +1 -1
- package/accessibility/accessibility-service.android.js +27 -39
- package/accessibility/accessibility-service.android.js.map +1 -1
- package/accessibility/accessibility-service.ios.js +14 -17
- package/accessibility/accessibility-service.ios.js.map +1 -1
- package/accessibility/font-scale-common.js +2 -2
- package/accessibility/font-scale-common.js.map +1 -1
- package/accessibility/font-scale.android.js +7 -8
- package/accessibility/font-scale.android.js.map +1 -1
- package/accessibility/font-scale.ios.js +9 -10
- package/accessibility/font-scale.ios.js.map +1 -1
- package/accessibility/index.android.js +77 -83
- package/accessibility/index.android.js.map +1 -1
- package/accessibility/index.ios.js +34 -36
- package/accessibility/index.ios.js.map +1 -1
- package/animation-frame/animation-native.ios.js +1 -1
- package/animation-frame/animation-native.ios.js.map +1 -1
- package/animation-frame/index.js +16 -16
- package/animation-frame/index.js.map +1 -1
- package/application/application-common.js +196 -214
- package/application/application-common.js.map +1 -1
- package/application/application-shims.js +39 -39
- package/application/application-shims.js.map +1 -1
- package/application/application.android.js +110 -149
- package/application/application.android.js.map +1 -1
- package/application/application.ios.js +162 -197
- package/application/application.ios.js.map +1 -1
- package/application-settings/index.android.js +11 -11
- package/application-settings/index.android.js.map +1 -1
- package/application-settings/index.ios.js +1 -1
- package/application-settings/index.ios.js.map +1 -1
- package/bundle-entry-points.js +1 -1
- package/bundle-entry-points.js.map +1 -1
- package/color/color-common.js +157 -200
- package/color/color-common.js.map +1 -1
- package/color/index.android.js +4 -14
- package/color/index.android.js.map +1 -1
- package/color/index.ios.js +14 -24
- package/color/index.ios.js.map +1 -1
- package/color/known-colors.js +144 -144
- package/color/known-colors.js.map +1 -1
- package/connectivity/index.android.js +23 -23
- package/connectivity/index.android.js.map +1 -1
- package/connectivity/index.ios.js +25 -25
- package/connectivity/index.ios.js.map +1 -1
- package/console/index.js +20 -24
- package/console/index.js.map +1 -1
- package/core-types/index.js +38 -38
- package/core-types/index.js.map +1 -1
- package/css/CSS3Parser.js +104 -106
- package/css/CSS3Parser.js.map +1 -1
- package/css/CSSNativeScript.js +29 -34
- package/css/CSSNativeScript.js.map +1 -1
- package/css/css-tree-parser.js.map +1 -1
- package/css/parser.js +158 -178
- package/css/parser.js.map +1 -1
- package/css/system-classes.js +9 -9
- package/css/system-classes.js.map +1 -1
- package/css-mediaquery/index.js +27 -29
- package/css-mediaquery/index.js.map +1 -1
- package/data/observable/index.js +115 -124
- package/data/observable/index.js.map +1 -1
- package/data/observable-array/index.js +119 -176
- package/data/observable-array/index.js.map +1 -1
- package/data/virtual-array/index.js +61 -74
- package/data/virtual-array/index.js.map +1 -1
- package/debugger/InspectorBackendCommands.js +137 -161
- package/debugger/InspectorBackendCommands.js.map +1 -1
- package/debugger/devtools-elements.common.js +20 -20
- package/debugger/devtools-elements.common.js.map +1 -1
- package/debugger/devtools-elements.js +2 -2
- package/debugger/devtools-elements.js.map +1 -1
- package/debugger/dom-node.js +61 -73
- package/debugger/dom-node.js.map +1 -1
- package/debugger/index.js +19 -19
- package/debugger/index.js.map +1 -1
- package/debugger/webinspector-css.js +25 -30
- package/debugger/webinspector-css.js.map +1 -1
- package/debugger/webinspector-dom.js +38 -43
- package/debugger/webinspector-dom.js.map +1 -1
- package/debugger/webinspector-network.android.js +103 -132
- package/debugger/webinspector-network.android.js.map +1 -1
- package/debugger/webinspector-network.ios.js +100 -128
- package/debugger/webinspector-network.ios.js.map +1 -1
- package/file-system/file-system-access.android.js +414 -421
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.ios.js +203 -213
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.js +294 -372
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.android.js +15 -18
- package/fps-meter/fps-native.android.js.map +1 -1
- package/fps-meter/fps-native.ios.js +9 -11
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/fps-meter/index.js +11 -11
- package/fps-meter/index.js.map +1 -1
- package/globals/index.js +88 -112
- package/globals/index.js.map +1 -1
- package/http/http-request/http-request-common.js +5 -5
- package/http/http-request/http-request-common.js.map +1 -1
- package/http/http-request/index.android.js +53 -54
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.ios.js +56 -58
- package/http/http-request/index.ios.js.map +1 -1
- package/http/index.js +19 -19
- package/http/index.js.map +1 -1
- package/image-asset/image-asset-common.js +25 -37
- package/image-asset/image-asset-common.js.map +1 -1
- package/image-asset/index.android.js +17 -25
- package/image-asset/index.android.js.map +1 -1
- package/image-asset/index.ios.js +25 -35
- package/image-asset/index.ios.js.map +1 -1
- package/image-source/image-source-common.js +2 -2
- package/image-source/image-source-common.js.map +1 -1
- package/image-source/index.android.js +152 -178
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js +177 -203
- package/image-source/index.ios.js.map +1 -1
- package/index.js +4 -8
- package/index.js.map +1 -1
- package/matrix/index.js +17 -27
- package/matrix/index.js.map +1 -1
- package/media-query-list/index.js +61 -87
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/index.js +21 -24
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js +24 -24
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/module-name-resolver/qualifier-matcher/index.js +46 -46
- package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
- package/package.json +1 -1
- package/platform/common.js +5 -5
- package/platform/common.js.map +1 -1
- package/platform/device/index.android.js +68 -107
- package/platform/device/index.android.js.map +1 -1
- package/platform/device/index.ios.js +62 -101
- package/platform/device/index.ios.js.map +1 -1
- package/platform/screen/index.android.js +32 -63
- package/platform/screen/index.android.js.map +1 -1
- package/platform/screen/index.ios.js +29 -60
- package/platform/screen/index.ios.js.map +1 -1
- package/profiling/index.js +40 -47
- package/profiling/index.js.map +1 -1
- package/text/text-common.js +36 -49
- package/text/text-common.js.map +1 -1
- package/timer/index.android.js +20 -30
- package/timer/index.android.js.map +1 -1
- package/timer/index.ios.js +12 -22
- package/timer/index.ios.js.map +1 -1
- package/trace/index.js +26 -36
- package/trace/index.js.map +1 -1
- package/ui/action-bar/action-bar-common.js +193 -252
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.js +170 -212
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +208 -251
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/activity-indicator-common.js +6 -11
- package/ui/activity-indicator/activity-indicator-common.js.map +1 -1
- package/ui/activity-indicator/index.android.js +20 -26
- package/ui/activity-indicator/index.android.js.map +1 -1
- package/ui/activity-indicator/index.ios.js +23 -31
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/animation-common.js +43 -50
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/animation-interfaces.js +3 -5
- package/ui/animation/animation-interfaces.js.map +1 -1
- package/ui/animation/index.android.js +90 -94
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.ios.js +225 -191
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.js +67 -89
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/binding-builder.js +31 -31
- package/ui/builder/binding-builder.js.map +1 -1
- package/ui/builder/component-builder/index.js +37 -37
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.js +54 -59
- package/ui/builder/index.js.map +1 -1
- package/ui/builder/xml2ui.js +128 -158
- package/ui/builder/xml2ui.js.map +1 -1
- package/ui/button/button-common.js +18 -25
- package/ui/button/button-common.js.map +1 -1
- package/ui/button/index.android.js +69 -80
- package/ui/button/index.android.js.map +1 -1
- package/ui/button/index.ios.js +103 -114
- package/ui/button/index.ios.js.map +1 -1
- package/ui/content-view/index.js +60 -78
- package/ui/content-view/index.js.map +1 -1
- package/ui/core/bindable/bindable-expressions.js +93 -101
- package/ui/core/bindable/bindable-expressions.js.map +1 -1
- package/ui/core/bindable/bindable-resources.js +1 -1
- package/ui/core/bindable/index.js +136 -141
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/control-state-change/index.android.js +5 -7
- package/ui/core/control-state-change/index.android.js.map +1 -1
- package/ui/core/control-state-change/index.ios.js +9 -13
- package/ui/core/control-state-change/index.ios.js.map +1 -1
- package/ui/core/properties/index.js +440 -489
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/view/index.android.js +348 -384
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.ios.js +364 -400
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.js +655 -944
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.android.js +15 -19
- package/ui/core/view/view-helper/index.android.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.js +81 -85
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +44 -49
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view-base/index.js +371 -426
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/core/weak-event-listener/index.js +25 -26
- package/ui/core/weak-event-listener/index.js.map +1 -1
- package/ui/date-picker/date-picker-common.js +30 -35
- package/ui/date-picker/date-picker-common.js.map +1 -1
- package/ui/date-picker/index.android.js +43 -51
- package/ui/date-picker/index.android.js.map +1 -1
- package/ui/date-picker/index.ios.js +51 -61
- package/ui/date-picker/index.ios.js.map +1 -1
- package/ui/dialogs/dialogs-common.js +18 -18
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/dialogs/index.android.js +86 -98
- package/ui/dialogs/index.android.js.map +1 -1
- package/ui/dialogs/index.ios.js +67 -80
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/editable-text-base/editable-text-base-common.js +29 -35
- package/ui/editable-text-base/editable-text-base-common.js.map +1 -1
- package/ui/editable-text-base/index.android.js +106 -112
- package/ui/editable-text-base/index.android.js.map +1 -1
- package/ui/editable-text-base/index.ios.js +47 -53
- package/ui/editable-text-base/index.ios.js.map +1 -1
- package/ui/embedding/index.android.js +2 -3
- package/ui/embedding/index.android.js.map +1 -1
- package/ui/frame/activity.android.js +44 -44
- package/ui/frame/activity.android.js.map +1 -1
- package/ui/frame/callbacks/activity-callbacks.js +118 -123
- package/ui/frame/callbacks/activity-callbacks.js.map +1 -1
- package/ui/frame/callbacks/fragment-callbacks.js +139 -141
- package/ui/frame/callbacks/fragment-callbacks.js.map +1 -1
- package/ui/frame/fragment.android.js +21 -21
- package/ui/frame/fragment.android.js.map +1 -1
- package/ui/frame/fragment.ios.js +1 -1
- package/ui/frame/fragment.transitions.android.js +105 -114
- package/ui/frame/fragment.transitions.android.js.map +1 -1
- package/ui/frame/frame-common.d.ts +1 -1
- package/ui/frame/frame-common.js +249 -285
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/frame-helpers.js +1 -1
- package/ui/frame/frame-helpers.js.map +1 -1
- package/ui/frame/frame-stack.js +4 -4
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.js +239 -291
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.ios.js +133 -167
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.js +15 -29
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/index.android.js +108 -124
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.ios.js +108 -121
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.js +42 -48
- package/ui/gestures/touch-manager.js.map +1 -1
- package/ui/html-view/html-view-common.js +9 -14
- package/ui/html-view/html-view-common.js.map +1 -1
- package/ui/html-view/index.android.js +37 -43
- package/ui/html-view/index.android.js.map +1 -1
- package/ui/html-view/index.ios.js +62 -73
- package/ui/html-view/index.ios.js.map +1 -1
- package/ui/image/image-common.js +47 -57
- package/ui/image/image-common.js.map +1 -1
- package/ui/image/index.android.js +54 -59
- package/ui/image/index.android.js.map +1 -1
- package/ui/image/index.ios.js +65 -72
- package/ui/image/index.ios.js.map +1 -1
- package/ui/image/symbol-effects-common.js +2 -6
- package/ui/image/symbol-effects-common.js.map +1 -1
- package/ui/image/symbol-effects.android.js +4 -10
- package/ui/image/symbol-effects.android.js.map +1 -1
- package/ui/image/symbol-effects.ios.js +7 -11
- package/ui/image/symbol-effects.ios.js.map +1 -1
- package/ui/image-cache/image-cache-common.js +57 -61
- package/ui/image-cache/image-cache-common.js.map +1 -1
- package/ui/image-cache/index.android.js +23 -27
- package/ui/image-cache/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js +24 -29
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/label/index.android.js +29 -38
- package/ui/label/index.android.js.map +1 -1
- package/ui/label/index.ios.js +89 -102
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js +25 -30
- package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
- package/ui/layouts/absolute-layout/index.android.js +6 -12
- package/ui/layouts/absolute-layout/index.android.js.map +1 -1
- package/ui/layouts/absolute-layout/index.ios.js +32 -40
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
- package/ui/layouts/dock-layout/dock-layout-common.js +16 -21
- package/ui/layouts/dock-layout/dock-layout-common.js.map +1 -1
- package/ui/layouts/dock-layout/index.android.js +11 -17
- package/ui/layouts/dock-layout/index.android.js.map +1 -1
- package/ui/layouts/dock-layout/index.ios.js +45 -53
- package/ui/layouts/dock-layout/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +90 -115
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.js +92 -97
- package/ui/layouts/flexbox-layout/index.android.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.ios.js +366 -427
- package/ui/layouts/flexbox-layout/index.ios.js.map +1 -1
- package/ui/layouts/grid-layout/grid-layout-common.js +159 -211
- package/ui/layouts/grid-layout/grid-layout-common.js.map +1 -1
- package/ui/layouts/grid-layout/index.android.js +49 -55
- package/ui/layouts/grid-layout/index.android.js.map +1 -1
- package/ui/layouts/grid-layout/index.ios.js +340 -348
- package/ui/layouts/grid-layout/index.ios.js.map +1 -1
- package/ui/layouts/layout-base-common.js +78 -106
- package/ui/layouts/layout-base-common.js.map +1 -1
- package/ui/layouts/layout-base.android.js +25 -31
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/layout-base.ios.js +21 -27
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/layouts/root-layout/index.android.js +47 -46
- package/ui/layouts/root-layout/index.android.js.map +1 -1
- package/ui/layouts/root-layout/index.ios.js +54 -53
- package/ui/layouts/root-layout/index.ios.js.map +1 -1
- package/ui/layouts/root-layout/root-layout-common.js +186 -190
- package/ui/layouts/root-layout/root-layout-common.js.map +1 -1
- package/ui/layouts/stack-layout/index.android.js +6 -12
- package/ui/layouts/stack-layout/index.android.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js +62 -69
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/stack-layout/stack-layout-common.js +7 -12
- package/ui/layouts/stack-layout/stack-layout-common.js.map +1 -1
- package/ui/layouts/wrap-layout/index.android.js +10 -16
- package/ui/layouts/wrap-layout/index.android.js.map +1 -1
- package/ui/layouts/wrap-layout/index.ios.js +70 -76
- package/ui/layouts/wrap-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js +13 -18
- package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
- package/ui/list-picker/index.android.js +42 -48
- package/ui/list-picker/index.android.js.map +1 -1
- package/ui/list-picker/index.ios.js +26 -36
- package/ui/list-picker/index.ios.js.map +1 -1
- package/ui/list-picker/list-picker-common.js +27 -32
- package/ui/list-picker/list-picker-common.js.map +1 -1
- package/ui/list-view/index.android.js +98 -110
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.ios.js +121 -137
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.js +100 -116
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/index.android.js +57 -65
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.ios.js +98 -107
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.js +113 -145
- package/ui/page/page-common.js.map +1 -1
- package/ui/placeholder/index.android.js +10 -16
- package/ui/placeholder/index.android.js.map +1 -1
- package/ui/placeholder/index.js +6 -12
- package/ui/placeholder/index.js.map +1 -1
- package/ui/progress/index.android.js +28 -34
- package/ui/progress/index.android.js.map +1 -1
- package/ui/progress/index.ios.js +29 -39
- package/ui/progress/index.ios.js.map +1 -1
- package/ui/progress/progress-common.js +11 -16
- package/ui/progress/progress-common.js.map +1 -1
- package/ui/proxy-view-container/index.js +90 -111
- package/ui/proxy-view-container/index.js.map +1 -1
- package/ui/repeater/index.js +100 -112
- package/ui/repeater/index.js.map +1 -1
- package/ui/scroll-view/index.android.d.ts +1 -1
- package/ui/scroll-view/index.android.js +75 -95
- package/ui/scroll-view/index.android.js.map +1 -1
- package/ui/scroll-view/index.ios.js +72 -92
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/scroll-view/scroll-view-common.js +45 -65
- package/ui/scroll-view/scroll-view-common.js.map +1 -1
- package/ui/search-bar/index.android.js +88 -94
- package/ui/search-bar/index.android.js.map +1 -1
- package/ui/search-bar/index.ios.js +74 -88
- package/ui/search-bar/index.ios.js.map +1 -1
- package/ui/search-bar/search-bar-common.js +13 -18
- package/ui/search-bar/search-bar-common.js.map +1 -1
- package/ui/segmented-bar/index.android.js +98 -112
- package/ui/segmented-bar/index.android.js.map +1 -1
- package/ui/segmented-bar/index.ios.js +63 -80
- package/ui/segmented-bar/index.ios.js.map +1 -1
- package/ui/segmented-bar/segmented-bar-common.js +61 -81
- package/ui/segmented-bar/segmented-bar-common.js.map +1 -1
- package/ui/slider/index.android.js +43 -49
- package/ui/slider/index.android.js.map +1 -1
- package/ui/slider/index.ios.js +49 -59
- package/ui/slider/index.ios.js.map +1 -1
- package/ui/slider/slider-common.js +28 -35
- package/ui/slider/slider-common.js.map +1 -1
- package/ui/styling/background-common.js +98 -100
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.js +35 -38
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.ios.js +252 -258
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/box-shadow.js +2 -6
- package/ui/styling/box-shadow.js.map +1 -1
- package/ui/styling/converters.js +7 -7
- package/ui/styling/converters.js.map +1 -1
- package/ui/styling/css-animation-parser.js +56 -69
- package/ui/styling/css-animation-parser.js.map +1 -1
- package/ui/styling/css-selector.js +425 -522
- package/ui/styling/css-selector.js.map +1 -1
- package/ui/styling/css-shadow.js +2 -2
- package/ui/styling/css-shadow.js.map +1 -1
- package/ui/styling/css-stroke.js +3 -3
- package/ui/styling/css-stroke.js.map +1 -1
- package/ui/styling/css-utils.js +22 -22
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font-common.js +44 -59
- package/ui/styling/font-common.js.map +1 -1
- package/ui/styling/font.android.js +34 -42
- package/ui/styling/font.android.js.map +1 -1
- package/ui/styling/font.ios.js +49 -54
- package/ui/styling/font.ios.js.map +1 -1
- package/ui/styling/linear-gradient.js +13 -17
- package/ui/styling/linear-gradient.js.map +1 -1
- package/ui/styling/style/index.js +36 -47
- package/ui/styling/style/index.js.map +1 -1
- package/ui/styling/style-properties.js +291 -306
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.js +377 -416
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/switch/index.android.js +41 -47
- package/ui/switch/index.android.js.map +1 -1
- package/ui/switch/index.ios.js +57 -66
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/switch/switch-common.js +11 -16
- package/ui/switch/switch-common.js.map +1 -1
- package/ui/tab-view/index.android.js +187 -206
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/tab-view/index.ios.js +161 -177
- package/ui/tab-view/index.ios.js.map +1 -1
- package/ui/tab-view/tab-view-common.js +143 -197
- package/ui/tab-view/tab-view-common.js.map +1 -1
- package/ui/text-base/formatted-string.js +105 -158
- package/ui/text-base/formatted-string.js.map +1 -1
- package/ui/text-base/index.android.js +130 -136
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.ios.js +112 -120
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/span.js +102 -158
- package/ui/text-base/span.js.map +1 -1
- package/ui/text-base/text-base-common.js +181 -268
- package/ui/text-base/text-base-common.js.map +1 -1
- package/ui/text-field/index.android.js +18 -24
- package/ui/text-field/index.android.js.map +1 -1
- package/ui/text-field/index.ios.js +70 -80
- package/ui/text-field/index.ios.js.map +1 -1
- package/ui/text-field/text-field-common.js +8 -13
- package/ui/text-field/text-field-common.js.map +1 -1
- package/ui/text-view/index.android.js +13 -19
- package/ui/text-view/index.android.js.map +1 -1
- package/ui/text-view/index.ios.js +116 -124
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/text-view/text-view-common.js +3 -9
- package/ui/text-view/text-view-common.js.map +1 -1
- package/ui/time-picker/index.android.js +18 -24
- package/ui/time-picker/index.android.js.map +1 -1
- package/ui/time-picker/index.ios.js +61 -69
- package/ui/time-picker/index.ios.js.map +1 -1
- package/ui/time-picker/time-picker-common.js +37 -42
- package/ui/time-picker/time-picker-common.js.map +1 -1
- package/ui/transition/fade-transition.android.js +8 -14
- package/ui/transition/fade-transition.android.js.map +1 -1
- package/ui/transition/fade-transition.ios.js +4 -10
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/flip-transition.android.js +14 -18
- package/ui/transition/flip-transition.android.js.map +1 -1
- package/ui/transition/index.android.js +24 -27
- package/ui/transition/index.android.js.map +1 -1
- package/ui/transition/index.ios.js +18 -22
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.android.js +4 -10
- package/ui/transition/modal-transition.android.js.map +1 -1
- package/ui/transition/modal-transition.ios.js +18 -25
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.js +57 -71
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js +19 -27
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.android.js +8 -12
- package/ui/transition/shared-transition-helper.android.js.map +1 -1
- package/ui/transition/shared-transition-helper.ios.js +442 -539
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.js +77 -76
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.android.js +17 -22
- package/ui/transition/slide-transition.android.js.map +1 -1
- package/ui/transition/slide-transition.ios.js +7 -11
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/ui/utils.ios.js +13 -13
- package/ui/utils.ios.js.map +1 -1
- package/ui/web-view/index.android.js +50 -64
- package/ui/web-view/index.android.js.map +1 -1
- package/ui/web-view/index.ios.js +50 -73
- package/ui/web-view/index.ios.js.map +1 -1
- package/ui/web-view/web-view-common.js +29 -43
- package/ui/web-view/web-view-common.js.map +1 -1
- package/utils/android/index.js +26 -27
- package/utils/android/index.js.map +1 -1
- package/utils/common.js +49 -65
- package/utils/common.js.map +1 -1
- package/utils/constants.android.js +1 -1
- package/utils/constants.android.js.map +1 -1
- package/utils/constants.ios.js +1 -1
- package/utils/constants.ios.js.map +1 -1
- package/utils/debug.js +32 -54
- package/utils/debug.js.map +1 -1
- package/utils/index.android.js +40 -36
- package/utils/index.android.js.map +1 -1
- package/utils/index.ios.js +9 -9
- package/utils/index.ios.js.map +1 -1
- package/utils/ios/index.js +45 -42
- package/utils/ios/index.js.map +1 -1
- package/utils/layout-helper/index.android.js +4 -4
- package/utils/layout-helper/index.android.js.map +1 -1
- package/utils/layout-helper/index.ios.js +2 -2
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/layout-helper/layout-helper-common.js +13 -13
- package/utils/layout-helper/layout-helper-common.js.map +1 -1
- package/utils/lazy.js +2 -2
- package/utils/lazy.js.map +1 -1
- package/utils/macrotask-scheduler.js +6 -6
- package/utils/macrotask-scheduler.js.map +1 -1
- package/utils/mainthread-helper.android.js +4 -4
- package/utils/mainthread-helper.android.js.map +1 -1
- package/utils/mainthread-helper.ios.js +1 -1
- package/utils/mainthread-helper.ios.js.map +1 -1
- package/utils/module-merge.js +1 -1
- package/utils/module-merge.js.map +1 -1
- package/utils/native-helper.android.js +19 -19
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.ios.js +16 -23
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/number-utils.js +3 -3
- package/utils/number-utils.js.map +1 -1
- package/utils/platform-check.js +6 -6
- package/utils/platform-check.js.map +1 -1
- package/utils/types.js +33 -43
- package/utils/types.js.map +1 -1
- package/wgc/crypto/SubtleCrypto.js +132 -167
- package/wgc/crypto/SubtleCrypto.js.map +1 -1
- package/wgc/crypto/index.d.ts +1 -1
- package/wgc/crypto/index.js +10 -18
- package/wgc/crypto/index.js.map +1 -1
- package/xhr/index.js +226 -308
- package/xhr/index.js.map +1 -1
- package/xml/index.js +78 -118
- package/xml/index.js.map +1 -1
|
@@ -2,7 +2,7 @@ import * as textModule from '../text';
|
|
|
2
2
|
import { Application } from '../application';
|
|
3
3
|
import { getFileExtension } from '../utils';
|
|
4
4
|
import { SDK_VERSION } from '../utils/constants';
|
|
5
|
-
|
|
5
|
+
let applicationContext;
|
|
6
6
|
function getApplicationContext() {
|
|
7
7
|
if (!applicationContext) {
|
|
8
8
|
applicationContext = Application.android.getNativeApplication().getApplicationContext();
|
|
@@ -18,8 +18,8 @@ function isContentUri(path) {
|
|
|
18
18
|
}
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
export class FileSystemAccess {
|
|
22
|
+
constructor() {
|
|
23
23
|
this._pathSeparator = '/';
|
|
24
24
|
this.copy = this.copySync.bind(this);
|
|
25
25
|
this.readBuffer = this.readBufferSync.bind(this);
|
|
@@ -32,19 +32,19 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
32
32
|
this.appendText = this.appendTextSync.bind(this);
|
|
33
33
|
this.writeText = this.writeTextSync.bind(this);
|
|
34
34
|
}
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
getLastModified(path) {
|
|
36
|
+
const javaFile = new java.io.File(path);
|
|
37
37
|
return new Date(javaFile.lastModified());
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
}
|
|
39
|
+
getFileSize(path) {
|
|
40
|
+
const javaFile = new java.io.File(path);
|
|
41
41
|
return javaFile.length();
|
|
42
|
-
}
|
|
43
|
-
|
|
42
|
+
}
|
|
43
|
+
getParent(path, onError) {
|
|
44
44
|
try {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return { path:
|
|
45
|
+
const javaFile = new java.io.File(path);
|
|
46
|
+
const parent = javaFile.getParentFile();
|
|
47
|
+
return { path: parent.getAbsolutePath(), name: parent.getName() };
|
|
48
48
|
}
|
|
49
49
|
catch (exception) {
|
|
50
50
|
// TODO: unified approach for error messages
|
|
@@ -53,32 +53,32 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
53
53
|
}
|
|
54
54
|
return undefined;
|
|
55
55
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
56
|
+
}
|
|
57
|
+
getFile(path, onError) {
|
|
58
58
|
return this.ensureFile(new java.io.File(path), false, onError);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
}
|
|
60
|
+
getFolder(path, onError) {
|
|
61
|
+
const javaFile = new java.io.File(path);
|
|
62
|
+
const dirInfo = this.ensureFile(javaFile, true, onError);
|
|
63
63
|
if (!dirInfo) {
|
|
64
64
|
return undefined;
|
|
65
65
|
}
|
|
66
66
|
return { path: dirInfo.path, name: dirInfo.name };
|
|
67
|
-
}
|
|
68
|
-
|
|
67
|
+
}
|
|
68
|
+
eachEntity(path, onEntity, onError) {
|
|
69
69
|
if (!onEntity) {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
this.enumEntities(path, onEntity, onError);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
}
|
|
74
|
+
getEntities(path, onError) {
|
|
75
|
+
const fileInfos = new Array();
|
|
76
|
+
const onEntity = function (entity) {
|
|
77
77
|
fileInfos.push(entity);
|
|
78
78
|
return true;
|
|
79
79
|
};
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
let errorOccurred;
|
|
81
|
+
const localError = function (error) {
|
|
82
82
|
if (onError) {
|
|
83
83
|
onError(error);
|
|
84
84
|
}
|
|
@@ -89,18 +89,18 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
89
89
|
return fileInfos;
|
|
90
90
|
}
|
|
91
91
|
return null;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
}
|
|
93
|
+
fileExists(path) {
|
|
94
|
+
const file = new java.io.File(path);
|
|
95
95
|
return file.exists();
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
}
|
|
97
|
+
folderExists(path) {
|
|
98
|
+
const file = new java.io.File(path);
|
|
99
99
|
return file.exists() && file.isDirectory();
|
|
100
|
-
}
|
|
101
|
-
|
|
100
|
+
}
|
|
101
|
+
deleteFile(path, onError) {
|
|
102
102
|
try {
|
|
103
|
-
|
|
103
|
+
const javaFile = new java.io.File(path);
|
|
104
104
|
if (!javaFile.isFile()) {
|
|
105
105
|
if (onError) {
|
|
106
106
|
onError({
|
|
@@ -120,10 +120,10 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
120
120
|
onError(exception);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
}
|
|
124
|
-
|
|
123
|
+
}
|
|
124
|
+
deleteFolder(path, onError) {
|
|
125
125
|
try {
|
|
126
|
-
|
|
126
|
+
const javaFile = new java.io.File(path);
|
|
127
127
|
if (!javaFile.getCanonicalFile().isDirectory()) {
|
|
128
128
|
if (onError) {
|
|
129
129
|
onError({
|
|
@@ -145,10 +145,10 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
145
145
|
onError(exception);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
}
|
|
149
|
-
|
|
148
|
+
}
|
|
149
|
+
emptyFolder(path, onError) {
|
|
150
150
|
try {
|
|
151
|
-
|
|
151
|
+
const javaFile = new java.io.File(path);
|
|
152
152
|
if (!javaFile.getCanonicalFile().isDirectory()) {
|
|
153
153
|
if (onError) {
|
|
154
154
|
onError({
|
|
@@ -165,16 +165,16 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
165
165
|
onError(exception);
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
168
|
+
}
|
|
169
|
+
rename(path, newPath, onError) {
|
|
170
|
+
const javaFile = new java.io.File(path);
|
|
171
171
|
if (!javaFile.exists()) {
|
|
172
172
|
if (onError) {
|
|
173
173
|
onError(new Error('The file to rename does not exist'));
|
|
174
174
|
}
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
const newFile = new java.io.File(newPath);
|
|
178
178
|
if (newFile.exists()) {
|
|
179
179
|
if (onError) {
|
|
180
180
|
onError(new Error('A file with the same name already exists.'));
|
|
@@ -186,14 +186,14 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
186
186
|
onError(new Error("Failed to rename file '" + path + "' to '" + newPath + "'"));
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
}
|
|
190
|
+
getDocumentsFolderPath() {
|
|
191
|
+
const dir = getApplicationContext().getFilesDir();
|
|
192
192
|
return dir.getAbsolutePath();
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
}
|
|
194
|
+
getExternalDocumentsFolderPath() {
|
|
195
|
+
const dirs = getApplicationContext().getExternalFilesDirs(null);
|
|
196
|
+
let dir;
|
|
197
197
|
if (dirs && dirs.length > 1) {
|
|
198
198
|
dir = dirs[dirs.length - 1];
|
|
199
199
|
}
|
|
@@ -201,19 +201,19 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
201
201
|
dir = getApplicationContext().getExternalFilesDir(null);
|
|
202
202
|
}
|
|
203
203
|
return dir.getAbsolutePath();
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
}
|
|
205
|
+
getLogicalRootPath() {
|
|
206
|
+
const dir = getApplicationContext().getFilesDir();
|
|
207
207
|
return dir.getCanonicalPath();
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
}
|
|
209
|
+
getTempFolderPath() {
|
|
210
|
+
const dir = getApplicationContext().getCacheDir();
|
|
211
211
|
return dir.getAbsolutePath();
|
|
212
|
-
}
|
|
213
|
-
|
|
212
|
+
}
|
|
213
|
+
getCurrentAppPath() {
|
|
214
214
|
return this.getLogicalRootPath() + '/app';
|
|
215
|
-
}
|
|
216
|
-
|
|
215
|
+
}
|
|
216
|
+
copySync(src, dest, onError) {
|
|
217
217
|
try {
|
|
218
218
|
return org.nativescript.widgets.Async.File.copySync(src, dest, getApplicationContext());
|
|
219
219
|
}
|
|
@@ -223,15 +223,15 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
return false;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return new Promise(
|
|
226
|
+
}
|
|
227
|
+
copyAsync(src, dest) {
|
|
228
|
+
return new Promise((resolve, reject) => {
|
|
229
229
|
try {
|
|
230
230
|
org.nativescript.widgets.Async.File.copy(src, dest, new org.nativescript.widgets.Async.CompleteCallback({
|
|
231
|
-
onComplete:
|
|
231
|
+
onComplete: (result) => {
|
|
232
232
|
resolve(result);
|
|
233
233
|
},
|
|
234
|
-
onError:
|
|
234
|
+
onError: (err) => {
|
|
235
235
|
reject(err);
|
|
236
236
|
},
|
|
237
237
|
}), getApplicationContext());
|
|
@@ -240,15 +240,15 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
240
240
|
reject(ex);
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
return new Promise(
|
|
243
|
+
}
|
|
244
|
+
readBufferAsync(path) {
|
|
245
|
+
return new Promise((resolve, reject) => {
|
|
246
246
|
try {
|
|
247
247
|
org.nativescript.widgets.Async.File.readBuffer(path, new org.nativescript.widgets.Async.CompleteCallback({
|
|
248
|
-
onComplete:
|
|
248
|
+
onComplete: (result) => {
|
|
249
249
|
resolve(ArrayBuffer.from(result));
|
|
250
250
|
},
|
|
251
|
-
onError:
|
|
251
|
+
onError: (err) => {
|
|
252
252
|
reject(err);
|
|
253
253
|
},
|
|
254
254
|
}), null);
|
|
@@ -257,13 +257,13 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
257
257
|
reject(ex);
|
|
258
258
|
}
|
|
259
259
|
});
|
|
260
|
-
}
|
|
261
|
-
|
|
260
|
+
}
|
|
261
|
+
readBufferSync(path, onError) {
|
|
262
262
|
try {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
263
|
+
const javaFile = new java.io.File(path);
|
|
264
|
+
const stream = new java.io.FileInputStream(javaFile);
|
|
265
|
+
const channel = stream.getChannel();
|
|
266
|
+
const buffer = new ArrayBuffer(javaFile.length());
|
|
267
267
|
channel.read(buffer);
|
|
268
268
|
return buffer;
|
|
269
269
|
}
|
|
@@ -272,15 +272,15 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
272
272
|
onError(exception);
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
return new Promise(
|
|
275
|
+
}
|
|
276
|
+
readAsync(path) {
|
|
277
|
+
return new Promise((resolve, reject) => {
|
|
278
278
|
try {
|
|
279
279
|
org.nativescript.widgets.Async.File.read(path, new org.nativescript.widgets.Async.CompleteCallback({
|
|
280
|
-
onComplete:
|
|
280
|
+
onComplete: (result) => {
|
|
281
281
|
resolve(result);
|
|
282
282
|
},
|
|
283
|
-
onError:
|
|
283
|
+
onError: (err) => {
|
|
284
284
|
reject(err);
|
|
285
285
|
},
|
|
286
286
|
}), null);
|
|
@@ -289,13 +289,13 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
289
289
|
reject(ex);
|
|
290
290
|
}
|
|
291
291
|
});
|
|
292
|
-
}
|
|
293
|
-
|
|
292
|
+
}
|
|
293
|
+
readSync(path, onError) {
|
|
294
294
|
try {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
295
|
+
const javaFile = new java.io.File(path);
|
|
296
|
+
const stream = new java.io.FileInputStream(javaFile);
|
|
297
|
+
const bytes = Array.create('byte', javaFile.length());
|
|
298
|
+
const dataInputStream = new java.io.DataInputStream(stream);
|
|
299
299
|
dataInputStream.readFully(bytes);
|
|
300
300
|
return bytes;
|
|
301
301
|
}
|
|
@@ -304,24 +304,23 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
304
304
|
onError(exception);
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
var _a;
|
|
307
|
+
}
|
|
308
|
+
static getBuffer(buffer) {
|
|
310
309
|
if (buffer instanceof ArrayBuffer) {
|
|
311
310
|
return buffer.nativeObject || buffer;
|
|
312
311
|
}
|
|
313
312
|
else {
|
|
314
|
-
return
|
|
313
|
+
return buffer?.buffer?.nativeObject || buffer;
|
|
315
314
|
}
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
return new Promise(
|
|
315
|
+
}
|
|
316
|
+
appendBufferAsync(path, buffer) {
|
|
317
|
+
return new Promise((resolve, reject) => {
|
|
319
318
|
try {
|
|
320
319
|
org.nativescript.widgets.Async.File.appendBuffer(path, FileSystemAccess.getBuffer(buffer), new org.nativescript.widgets.Async.CompleteCallback({
|
|
321
|
-
onComplete:
|
|
320
|
+
onComplete: () => {
|
|
322
321
|
resolve();
|
|
323
322
|
},
|
|
324
|
-
onError:
|
|
323
|
+
onError: (err) => {
|
|
325
324
|
reject(err);
|
|
326
325
|
},
|
|
327
326
|
}), null);
|
|
@@ -330,12 +329,12 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
330
329
|
reject(ex);
|
|
331
330
|
}
|
|
332
331
|
});
|
|
333
|
-
}
|
|
334
|
-
|
|
332
|
+
}
|
|
333
|
+
appendBufferSync(path, buffer, onError) {
|
|
335
334
|
try {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
335
|
+
const javaFile = new java.io.File(path);
|
|
336
|
+
const stream = new java.io.FileOutputStream(javaFile);
|
|
337
|
+
const channel = stream.getChannel();
|
|
339
338
|
channel.write(FileSystemAccess.getBuffer(buffer));
|
|
340
339
|
stream.close();
|
|
341
340
|
}
|
|
@@ -344,15 +343,15 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
344
343
|
onError(exception);
|
|
345
344
|
}
|
|
346
345
|
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
return new Promise(
|
|
346
|
+
}
|
|
347
|
+
appendAsync(path, bytes) {
|
|
348
|
+
return new Promise((resolve, reject) => {
|
|
350
349
|
try {
|
|
351
350
|
org.nativescript.widgets.Async.File.append(path, bytes, new org.nativescript.widgets.Async.CompleteCallback({
|
|
352
|
-
onComplete:
|
|
351
|
+
onComplete: () => {
|
|
353
352
|
resolve();
|
|
354
353
|
},
|
|
355
|
-
onError:
|
|
354
|
+
onError: (err) => {
|
|
356
355
|
reject(err);
|
|
357
356
|
},
|
|
358
357
|
}), null);
|
|
@@ -361,11 +360,11 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
361
360
|
reject(ex);
|
|
362
361
|
}
|
|
363
362
|
});
|
|
364
|
-
}
|
|
365
|
-
|
|
363
|
+
}
|
|
364
|
+
appendSync(path, bytes, onError) {
|
|
366
365
|
try {
|
|
367
|
-
|
|
368
|
-
|
|
366
|
+
const javaFile = new java.io.File(path);
|
|
367
|
+
const stream = new java.io.FileOutputStream(javaFile, true);
|
|
369
368
|
stream.write(bytes, 0, bytes.length);
|
|
370
369
|
stream.close();
|
|
371
370
|
}
|
|
@@ -374,15 +373,15 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
374
373
|
onError(exception);
|
|
375
374
|
}
|
|
376
375
|
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
return new Promise(
|
|
376
|
+
}
|
|
377
|
+
writeBufferAsync(path, buffer) {
|
|
378
|
+
return new Promise((resolve, reject) => {
|
|
380
379
|
try {
|
|
381
380
|
org.nativescript.widgets.Async.File.writeBuffer(path, FileSystemAccess.getBuffer(buffer), new org.nativescript.widgets.Async.CompleteCallback({
|
|
382
|
-
onComplete:
|
|
381
|
+
onComplete: () => {
|
|
383
382
|
resolve();
|
|
384
383
|
},
|
|
385
|
-
onError:
|
|
384
|
+
onError: (err) => {
|
|
386
385
|
reject(err);
|
|
387
386
|
},
|
|
388
387
|
}), null);
|
|
@@ -391,12 +390,12 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
391
390
|
reject(ex);
|
|
392
391
|
}
|
|
393
392
|
});
|
|
394
|
-
}
|
|
395
|
-
|
|
393
|
+
}
|
|
394
|
+
writeBufferSync(path, buffer, onError) {
|
|
396
395
|
try {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
396
|
+
const javaFile = new java.io.File(path);
|
|
397
|
+
const stream = new java.io.FileOutputStream(javaFile);
|
|
398
|
+
const channel = stream.getChannel();
|
|
400
399
|
channel.write(FileSystemAccess.getBuffer(buffer));
|
|
401
400
|
stream.close();
|
|
402
401
|
}
|
|
@@ -405,15 +404,15 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
405
404
|
onError(exception);
|
|
406
405
|
}
|
|
407
406
|
}
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
return new Promise(
|
|
407
|
+
}
|
|
408
|
+
writeAsync(path, bytes) {
|
|
409
|
+
return new Promise((resolve, reject) => {
|
|
411
410
|
try {
|
|
412
411
|
org.nativescript.widgets.Async.File.write(path, bytes, new org.nativescript.widgets.Async.CompleteCallback({
|
|
413
|
-
onComplete:
|
|
412
|
+
onComplete: () => {
|
|
414
413
|
resolve();
|
|
415
414
|
},
|
|
416
|
-
onError:
|
|
415
|
+
onError: (err) => {
|
|
417
416
|
reject(err);
|
|
418
417
|
},
|
|
419
418
|
}), null);
|
|
@@ -422,11 +421,11 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
422
421
|
reject(ex);
|
|
423
422
|
}
|
|
424
423
|
});
|
|
425
|
-
}
|
|
426
|
-
|
|
424
|
+
}
|
|
425
|
+
writeSync(path, bytes, onError) {
|
|
427
426
|
try {
|
|
428
|
-
|
|
429
|
-
|
|
427
|
+
const javaFile = new java.io.File(path);
|
|
428
|
+
const stream = new java.io.FileOutputStream(javaFile);
|
|
430
429
|
stream.write(bytes, 0, bytes.length);
|
|
431
430
|
stream.close();
|
|
432
431
|
}
|
|
@@ -435,23 +434,23 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
435
434
|
onError(exception);
|
|
436
435
|
}
|
|
437
436
|
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
|
|
437
|
+
}
|
|
438
|
+
readTextAsync(path, encoding) {
|
|
439
|
+
let actualEncoding = encoding;
|
|
441
440
|
if (!actualEncoding) {
|
|
442
441
|
actualEncoding = textModule.encoding.UTF_8;
|
|
443
442
|
}
|
|
444
|
-
return new Promise(
|
|
443
|
+
return new Promise((resolve, reject) => {
|
|
445
444
|
try {
|
|
446
445
|
org.nativescript.widgets.Async.File.readText(path, actualEncoding, new org.nativescript.widgets.Async.CompleteCallback({
|
|
447
|
-
onComplete:
|
|
446
|
+
onComplete: (result) => {
|
|
448
447
|
if (actualEncoding === textModule.encoding.UTF_8) {
|
|
449
448
|
// Remove UTF8 BOM if present. http://www.rgagnon.com/javadetails/java-handle-utf8-file-with-bom.html
|
|
450
449
|
result = FileSystemAccess._removeUtf8Bom(result);
|
|
451
450
|
}
|
|
452
451
|
resolve(result);
|
|
453
452
|
},
|
|
454
|
-
onError:
|
|
453
|
+
onError: (err) => {
|
|
455
454
|
reject(err);
|
|
456
455
|
},
|
|
457
456
|
}), null);
|
|
@@ -460,21 +459,21 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
460
459
|
reject(ex);
|
|
461
460
|
}
|
|
462
461
|
});
|
|
463
|
-
}
|
|
464
|
-
|
|
462
|
+
}
|
|
463
|
+
readTextSync(path, onError, encoding) {
|
|
465
464
|
try {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
465
|
+
const javaFile = new java.io.File(path);
|
|
466
|
+
const stream = new java.io.FileInputStream(javaFile);
|
|
467
|
+
let actualEncoding = encoding;
|
|
469
468
|
if (!actualEncoding) {
|
|
470
469
|
actualEncoding = textModule.encoding.UTF_8;
|
|
471
470
|
}
|
|
472
|
-
|
|
473
|
-
|
|
471
|
+
const reader = new java.io.InputStreamReader(stream, actualEncoding);
|
|
472
|
+
const bufferedReader = new java.io.BufferedReader(reader);
|
|
474
473
|
// TODO: We will need to read the entire file to a CharBuffer instead of reading it line by line
|
|
475
474
|
// TODO: bufferedReader.read(CharBuffer) does not currently work
|
|
476
|
-
|
|
477
|
-
|
|
475
|
+
let line = undefined;
|
|
476
|
+
let result = '';
|
|
478
477
|
while (line !== null) {
|
|
479
478
|
line = bufferedReader.readLine();
|
|
480
479
|
if (line === null) {
|
|
@@ -499,26 +498,26 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
499
498
|
onError(exception);
|
|
500
499
|
}
|
|
501
500
|
}
|
|
502
|
-
}
|
|
503
|
-
|
|
501
|
+
}
|
|
502
|
+
static _removeUtf8Bom(s) {
|
|
504
503
|
if (s.charCodeAt(0) === 0xfeff) {
|
|
505
504
|
s = s.slice(1);
|
|
506
505
|
//console.log("Removed UTF8 BOM.");
|
|
507
506
|
}
|
|
508
507
|
return s;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
|
|
508
|
+
}
|
|
509
|
+
appendTextAsync(path, content, encoding) {
|
|
510
|
+
let actualEncoding = encoding;
|
|
512
511
|
if (!actualEncoding) {
|
|
513
512
|
actualEncoding = textModule.encoding.UTF_8;
|
|
514
513
|
}
|
|
515
|
-
return new Promise(
|
|
514
|
+
return new Promise((resolve, reject) => {
|
|
516
515
|
try {
|
|
517
516
|
org.nativescript.widgets.Async.File.appendText(path, content, actualEncoding, new org.nativescript.widgets.Async.CompleteCallback({
|
|
518
|
-
onComplete:
|
|
517
|
+
onComplete: () => {
|
|
519
518
|
resolve();
|
|
520
519
|
},
|
|
521
|
-
onError:
|
|
520
|
+
onError: (err) => {
|
|
522
521
|
reject(err);
|
|
523
522
|
},
|
|
524
523
|
}), null);
|
|
@@ -527,16 +526,16 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
527
526
|
reject(ex);
|
|
528
527
|
}
|
|
529
528
|
});
|
|
530
|
-
}
|
|
531
|
-
|
|
529
|
+
}
|
|
530
|
+
appendTextSync(path, content, onError, encoding) {
|
|
532
531
|
try {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
532
|
+
const javaFile = new java.io.File(path);
|
|
533
|
+
const stream = new java.io.FileOutputStream(javaFile, true);
|
|
534
|
+
let actualEncoding = encoding;
|
|
536
535
|
if (!actualEncoding) {
|
|
537
536
|
actualEncoding = textModule.encoding.UTF_8;
|
|
538
537
|
}
|
|
539
|
-
|
|
538
|
+
const writer = new java.io.OutputStreamWriter(stream, actualEncoding);
|
|
540
539
|
writer.write(content);
|
|
541
540
|
writer.close();
|
|
542
541
|
}
|
|
@@ -545,19 +544,19 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
545
544
|
onError(exception);
|
|
546
545
|
}
|
|
547
546
|
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
|
|
547
|
+
}
|
|
548
|
+
writeTextAsync(path, content, encoding) {
|
|
549
|
+
let actualEncoding = encoding;
|
|
551
550
|
if (!actualEncoding) {
|
|
552
551
|
actualEncoding = textModule.encoding.UTF_8;
|
|
553
552
|
}
|
|
554
|
-
return new Promise(
|
|
553
|
+
return new Promise((resolve, reject) => {
|
|
555
554
|
try {
|
|
556
555
|
org.nativescript.widgets.Async.File.writeText(path, content, actualEncoding, new org.nativescript.widgets.Async.CompleteCallback({
|
|
557
|
-
onComplete:
|
|
556
|
+
onComplete: () => {
|
|
558
557
|
resolve();
|
|
559
558
|
},
|
|
560
|
-
onError:
|
|
559
|
+
onError: (err) => {
|
|
561
560
|
reject(err);
|
|
562
561
|
},
|
|
563
562
|
}), null);
|
|
@@ -566,16 +565,16 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
566
565
|
reject(ex);
|
|
567
566
|
}
|
|
568
567
|
});
|
|
569
|
-
}
|
|
570
|
-
|
|
568
|
+
}
|
|
569
|
+
writeTextSync(path, content, onError, encoding) {
|
|
571
570
|
try {
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
571
|
+
const javaFile = new java.io.File(path);
|
|
572
|
+
const stream = new java.io.FileOutputStream(javaFile);
|
|
573
|
+
let actualEncoding = encoding;
|
|
575
574
|
if (!actualEncoding) {
|
|
576
575
|
actualEncoding = textModule.encoding.UTF_8;
|
|
577
576
|
}
|
|
578
|
-
|
|
577
|
+
const writer = new java.io.OutputStreamWriter(stream, actualEncoding);
|
|
579
578
|
writer.write(content);
|
|
580
579
|
writer.close();
|
|
581
580
|
}
|
|
@@ -584,15 +583,15 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
584
583
|
onError(exception);
|
|
585
584
|
}
|
|
586
585
|
}
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
|
|
586
|
+
}
|
|
587
|
+
deleteFolderContent(file) {
|
|
588
|
+
const filesList = file.listFiles();
|
|
590
589
|
if (filesList.length === 0) {
|
|
591
590
|
return true; // Nothing to delete, so success!
|
|
592
591
|
}
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
for (
|
|
592
|
+
let childFile;
|
|
593
|
+
let success = false;
|
|
594
|
+
for (let i = 0; i < filesList.length; i++) {
|
|
596
595
|
childFile = filesList[i];
|
|
597
596
|
if (childFile.getCanonicalFile().isDirectory()) {
|
|
598
597
|
success = this.deleteFolderContent(childFile);
|
|
@@ -603,11 +602,11 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
603
602
|
success = childFile.delete();
|
|
604
603
|
}
|
|
605
604
|
return success;
|
|
606
|
-
}
|
|
607
|
-
|
|
605
|
+
}
|
|
606
|
+
ensureFile(javaFile, isFolder, onError) {
|
|
608
607
|
try {
|
|
609
608
|
if (!javaFile.exists()) {
|
|
610
|
-
|
|
609
|
+
let created;
|
|
611
610
|
if (isFolder) {
|
|
612
611
|
created = javaFile.mkdirs();
|
|
613
612
|
}
|
|
@@ -627,7 +626,7 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
627
626
|
javaFile.setWritable(true);
|
|
628
627
|
}
|
|
629
628
|
}
|
|
630
|
-
|
|
629
|
+
const path = javaFile.getAbsolutePath();
|
|
631
630
|
return {
|
|
632
631
|
path: path,
|
|
633
632
|
name: javaFile.getName(),
|
|
@@ -641,26 +640,26 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
641
640
|
}
|
|
642
641
|
return undefined;
|
|
643
642
|
}
|
|
644
|
-
}
|
|
643
|
+
}
|
|
645
644
|
// TODO: This method is the same as in the iOS implementation.
|
|
646
645
|
// Make it in a separate file / module so it can be reused from both implementations.
|
|
647
|
-
|
|
646
|
+
getFileExtension(path) {
|
|
648
647
|
return getFileExtension(path);
|
|
649
|
-
}
|
|
650
|
-
|
|
648
|
+
}
|
|
649
|
+
enumEntities(path, callback, onError) {
|
|
651
650
|
try {
|
|
652
|
-
|
|
651
|
+
let javaFile = new java.io.File(path);
|
|
653
652
|
if (!javaFile.getCanonicalFile().isDirectory()) {
|
|
654
653
|
if (onError) {
|
|
655
654
|
onError('There is no folder existing at path ' + path);
|
|
656
655
|
}
|
|
657
656
|
return;
|
|
658
657
|
}
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
for (
|
|
658
|
+
const filesList = javaFile.listFiles();
|
|
659
|
+
const length = filesList.length;
|
|
660
|
+
let info;
|
|
661
|
+
let retVal;
|
|
662
|
+
for (let i = 0; i < length; i++) {
|
|
664
663
|
javaFile = filesList[i];
|
|
665
664
|
info = {
|
|
666
665
|
path: javaFile.getAbsolutePath(),
|
|
@@ -680,11 +679,11 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
680
679
|
onError(exception);
|
|
681
680
|
}
|
|
682
681
|
}
|
|
683
|
-
}
|
|
684
|
-
|
|
682
|
+
}
|
|
683
|
+
getPathSeparator() {
|
|
685
684
|
return this._pathSeparator;
|
|
686
|
-
}
|
|
687
|
-
|
|
685
|
+
}
|
|
686
|
+
normalizePath(path) {
|
|
688
687
|
if (SDK_VERSION >= 26) {
|
|
689
688
|
// the [''] is a trick to not have to create a android.net.URI
|
|
690
689
|
// and use the method with string signature
|
|
@@ -692,71 +691,67 @@ var FileSystemAccess = /** @class */ (function () {
|
|
|
692
691
|
}
|
|
693
692
|
else {
|
|
694
693
|
// for now it wont work on pre 26 as File does not normalize
|
|
695
|
-
|
|
694
|
+
const file = new java.io.File(path);
|
|
696
695
|
return file.getAbsolutePath();
|
|
697
696
|
}
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
697
|
+
}
|
|
698
|
+
joinPath(left, right) {
|
|
699
|
+
const file1 = new java.io.File(left);
|
|
700
|
+
const file2 = new java.io.File(file1, right);
|
|
702
701
|
return file2.getPath();
|
|
703
|
-
}
|
|
704
|
-
|
|
702
|
+
}
|
|
703
|
+
joinPaths(paths) {
|
|
705
704
|
if (!paths || paths.length === 0) {
|
|
706
705
|
return '';
|
|
707
706
|
}
|
|
708
707
|
if (paths.length === 1) {
|
|
709
708
|
return paths[0];
|
|
710
709
|
}
|
|
711
|
-
|
|
712
|
-
for (
|
|
710
|
+
let result = paths[0];
|
|
711
|
+
for (let i = 1; i < paths.length; i++) {
|
|
713
712
|
result = this.joinPath(result, paths[i]);
|
|
714
713
|
}
|
|
715
714
|
return result;
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
_this.write = _this.writeSync.bind(_this);
|
|
734
|
-
return _this;
|
|
735
|
-
}
|
|
736
|
-
FileSystemAccess29.prototype.getLastModified = function (path) {
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
export class FileSystemAccess29 extends FileSystemAccess {
|
|
718
|
+
constructor() {
|
|
719
|
+
super(...arguments);
|
|
720
|
+
this.__skip = true;
|
|
721
|
+
this.appendBuffer = this.appendBufferSync.bind(this);
|
|
722
|
+
this.append = this.appendSync.bind(this);
|
|
723
|
+
this.appendText = this.appendTextSync.bind(this);
|
|
724
|
+
this.readText = this.readTextSync.bind(this);
|
|
725
|
+
this.readBuffer = this.readBufferSync.bind(this);
|
|
726
|
+
this.read = this.readSync.bind(this);
|
|
727
|
+
this.writeText = this.writeTextSync.bind(this);
|
|
728
|
+
this.writeBuffer = this.writeBufferSync.bind(this);
|
|
729
|
+
this.write = this.writeSync.bind(this);
|
|
730
|
+
}
|
|
731
|
+
getLastModified(path) {
|
|
737
732
|
if (isContentUri(path)) {
|
|
738
733
|
return new Date(getOrSetHelper(path).getLastModified() * 1000);
|
|
739
734
|
}
|
|
740
|
-
return
|
|
741
|
-
}
|
|
742
|
-
|
|
735
|
+
return super.getLastModified(path);
|
|
736
|
+
}
|
|
737
|
+
getFileSize(path) {
|
|
743
738
|
if (isContentUri(path)) {
|
|
744
739
|
return getOrSetHelper(path).getSize();
|
|
745
740
|
}
|
|
746
|
-
return
|
|
747
|
-
}
|
|
748
|
-
|
|
741
|
+
return super.getFileSize(path);
|
|
742
|
+
}
|
|
743
|
+
getParent(path, onError) {
|
|
749
744
|
if (isContentUri(path)) {
|
|
750
745
|
return null;
|
|
751
746
|
}
|
|
752
|
-
return
|
|
753
|
-
}
|
|
754
|
-
|
|
747
|
+
return super.getParent(path, onError);
|
|
748
|
+
}
|
|
749
|
+
getFile(path, onError) {
|
|
755
750
|
if (isContentUri(path)) {
|
|
756
751
|
try {
|
|
757
|
-
|
|
752
|
+
const file = getOrSetHelper(path);
|
|
758
753
|
return {
|
|
759
|
-
path
|
|
754
|
+
path,
|
|
760
755
|
name: file.getName(),
|
|
761
756
|
extension: file.getExtension(),
|
|
762
757
|
};
|
|
@@ -768,68 +763,68 @@ var FileSystemAccess29 = /** @class */ (function (_super) {
|
|
|
768
763
|
return;
|
|
769
764
|
}
|
|
770
765
|
}
|
|
771
|
-
return
|
|
772
|
-
}
|
|
773
|
-
|
|
766
|
+
return super.getFile(path, onError);
|
|
767
|
+
}
|
|
768
|
+
getFolder(path, onError) {
|
|
774
769
|
if (isContentUri(path)) {
|
|
775
770
|
return null;
|
|
776
771
|
}
|
|
777
|
-
return
|
|
778
|
-
}
|
|
779
|
-
|
|
772
|
+
return super.getFolder(path, onError);
|
|
773
|
+
}
|
|
774
|
+
getEntities(path, onError) {
|
|
780
775
|
if (isContentUri(path)) {
|
|
781
776
|
return null;
|
|
782
777
|
}
|
|
783
|
-
return
|
|
784
|
-
}
|
|
785
|
-
|
|
778
|
+
return super.getEntities(path, onError);
|
|
779
|
+
}
|
|
780
|
+
eachEntity(path, onEntity, onError) {
|
|
786
781
|
if (isContentUri(path)) {
|
|
787
782
|
return null;
|
|
788
783
|
}
|
|
789
|
-
|
|
790
|
-
}
|
|
791
|
-
|
|
784
|
+
super.eachEntity(path, onEntity);
|
|
785
|
+
}
|
|
786
|
+
fileExists(path) {
|
|
792
787
|
if (isContentUri(path)) {
|
|
793
788
|
return org.nativescript.widgets.FileHelper.exists(applicationContext, path);
|
|
794
789
|
}
|
|
795
|
-
return
|
|
796
|
-
}
|
|
797
|
-
|
|
790
|
+
return super.fileExists(path);
|
|
791
|
+
}
|
|
792
|
+
folderExists(path) {
|
|
798
793
|
if (isContentUri(path)) {
|
|
799
794
|
return null;
|
|
800
795
|
}
|
|
801
|
-
return
|
|
802
|
-
}
|
|
803
|
-
|
|
796
|
+
return super.folderExists(path);
|
|
797
|
+
}
|
|
798
|
+
deleteFile(path, onError) {
|
|
804
799
|
if (isContentUri(path)) {
|
|
805
800
|
try {
|
|
806
801
|
getOrSetHelper(path).delete(applicationContext);
|
|
807
802
|
}
|
|
808
803
|
catch (e) {
|
|
809
|
-
onError
|
|
804
|
+
onError?.(e);
|
|
810
805
|
}
|
|
811
806
|
}
|
|
812
807
|
else {
|
|
813
|
-
|
|
808
|
+
super.deleteFile(path, onError);
|
|
814
809
|
}
|
|
815
|
-
}
|
|
816
|
-
|
|
810
|
+
}
|
|
811
|
+
deleteFolder(path, onError) {
|
|
817
812
|
if (!isContentUri(path)) {
|
|
818
|
-
|
|
813
|
+
super.deleteFolder(path, onError);
|
|
819
814
|
}
|
|
820
|
-
}
|
|
821
|
-
|
|
815
|
+
}
|
|
816
|
+
emptyFolder(path, onError) {
|
|
822
817
|
if (!isContentUri(path)) {
|
|
823
|
-
|
|
818
|
+
super.emptyFolder(path, onError);
|
|
824
819
|
}
|
|
825
|
-
}
|
|
826
|
-
|
|
820
|
+
}
|
|
821
|
+
rename(path, newPath, onError) {
|
|
827
822
|
if (isContentUri(path)) {
|
|
828
|
-
|
|
823
|
+
let callback = null;
|
|
829
824
|
if (typeof onError === 'function') {
|
|
830
825
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
831
|
-
onSuccess
|
|
832
|
-
onError
|
|
826
|
+
onSuccess(result) { },
|
|
827
|
+
onError(error) {
|
|
833
828
|
onError(error);
|
|
834
829
|
},
|
|
835
830
|
});
|
|
@@ -837,55 +832,55 @@ var FileSystemAccess29 = /** @class */ (function (_super) {
|
|
|
837
832
|
getOrSetHelper(path).renameSync(applicationContext, newPath, callback);
|
|
838
833
|
}
|
|
839
834
|
else {
|
|
840
|
-
|
|
835
|
+
super.rename(path, newPath, onError);
|
|
841
836
|
}
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
return new Promise(
|
|
837
|
+
}
|
|
838
|
+
renameAsync(path, newPath) {
|
|
839
|
+
return new Promise((resolve, reject) => {
|
|
845
840
|
getOrSetHelper(path).renameSync(applicationContext, newPath, new org.nativescript.widgets.FileHelper.Callback({
|
|
846
|
-
onSuccess
|
|
841
|
+
onSuccess(result) {
|
|
847
842
|
resolve();
|
|
848
843
|
},
|
|
849
|
-
onError
|
|
844
|
+
onError(error) {
|
|
850
845
|
reject(error);
|
|
851
846
|
},
|
|
852
847
|
}));
|
|
853
848
|
});
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
return
|
|
857
|
-
}
|
|
858
|
-
|
|
859
|
-
return
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
return
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
return
|
|
866
|
-
}
|
|
867
|
-
|
|
849
|
+
}
|
|
850
|
+
getDocumentsFolderPath() {
|
|
851
|
+
return super.getDocumentsFolderPath();
|
|
852
|
+
}
|
|
853
|
+
getTempFolderPath() {
|
|
854
|
+
return super.getTempFolderPath();
|
|
855
|
+
}
|
|
856
|
+
getLogicalRootPath() {
|
|
857
|
+
return super.getLogicalRootPath();
|
|
858
|
+
}
|
|
859
|
+
getCurrentAppPath() {
|
|
860
|
+
return super.getCurrentAppPath();
|
|
861
|
+
}
|
|
862
|
+
appendBufferAsync(path, content) {
|
|
868
863
|
if (isContentUri(path)) {
|
|
869
|
-
return new Promise(
|
|
864
|
+
return new Promise((resolve, reject) => {
|
|
870
865
|
getOrSetHelper(path).appendBuffer(applicationContext, FileSystemAccess.getBuffer(content), new org.nativescript.widgets.FileHelper.Callback({
|
|
871
|
-
onSuccess
|
|
866
|
+
onSuccess(result) {
|
|
872
867
|
resolve();
|
|
873
868
|
},
|
|
874
|
-
onError
|
|
869
|
+
onError(error) {
|
|
875
870
|
reject(error);
|
|
876
871
|
},
|
|
877
872
|
}));
|
|
878
873
|
});
|
|
879
874
|
}
|
|
880
|
-
return
|
|
881
|
-
}
|
|
882
|
-
|
|
875
|
+
return super.appendAsync(path, content);
|
|
876
|
+
}
|
|
877
|
+
appendBufferSync(path, content, onError) {
|
|
883
878
|
if (isContentUri(path)) {
|
|
884
|
-
|
|
879
|
+
let callback = null;
|
|
885
880
|
if (typeof onError === 'function') {
|
|
886
881
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
887
|
-
onSuccess
|
|
888
|
-
onError
|
|
882
|
+
onSuccess(result) { },
|
|
883
|
+
onError(error) {
|
|
889
884
|
onError(error);
|
|
890
885
|
},
|
|
891
886
|
});
|
|
@@ -893,31 +888,31 @@ var FileSystemAccess29 = /** @class */ (function (_super) {
|
|
|
893
888
|
getOrSetHelper(path).appendSync(applicationContext, FileSystemAccess.getBuffer(content), callback);
|
|
894
889
|
}
|
|
895
890
|
else {
|
|
896
|
-
|
|
891
|
+
super.appendSync(path, content, onError);
|
|
897
892
|
}
|
|
898
|
-
}
|
|
899
|
-
|
|
893
|
+
}
|
|
894
|
+
appendAsync(path, content) {
|
|
900
895
|
if (isContentUri(path)) {
|
|
901
|
-
return new Promise(
|
|
896
|
+
return new Promise((resolve, reject) => {
|
|
902
897
|
getOrSetHelper(path).append(applicationContext, content, new org.nativescript.widgets.FileHelper.Callback({
|
|
903
|
-
onSuccess
|
|
898
|
+
onSuccess(result) {
|
|
904
899
|
resolve();
|
|
905
900
|
},
|
|
906
|
-
onError
|
|
901
|
+
onError(error) {
|
|
907
902
|
reject(error);
|
|
908
903
|
},
|
|
909
904
|
}));
|
|
910
905
|
});
|
|
911
906
|
}
|
|
912
|
-
return
|
|
913
|
-
}
|
|
914
|
-
|
|
907
|
+
return super.appendAsync(path, content);
|
|
908
|
+
}
|
|
909
|
+
appendSync(path, content, onError) {
|
|
915
910
|
if (isContentUri(path)) {
|
|
916
|
-
|
|
911
|
+
let callback = null;
|
|
917
912
|
if (typeof onError === 'function') {
|
|
918
913
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
919
|
-
onSuccess
|
|
920
|
-
onError
|
|
914
|
+
onSuccess(result) { },
|
|
915
|
+
onError(error) {
|
|
921
916
|
onError(error);
|
|
922
917
|
},
|
|
923
918
|
});
|
|
@@ -925,191 +920,191 @@ var FileSystemAccess29 = /** @class */ (function (_super) {
|
|
|
925
920
|
getOrSetHelper(path).appendSync(applicationContext, content, callback);
|
|
926
921
|
}
|
|
927
922
|
else {
|
|
928
|
-
|
|
923
|
+
super.appendSync(path, content, onError);
|
|
929
924
|
}
|
|
930
|
-
}
|
|
931
|
-
|
|
925
|
+
}
|
|
926
|
+
appendTextAsync(path, content, encoding) {
|
|
932
927
|
if (isContentUri(path)) {
|
|
933
|
-
return new Promise(
|
|
934
|
-
getOrSetHelper(path).appendText(applicationContext, content, encoding
|
|
935
|
-
onSuccess
|
|
928
|
+
return new Promise((resolve, reject) => {
|
|
929
|
+
getOrSetHelper(path).appendText(applicationContext, content, encoding ?? null, new org.nativescript.widgets.FileHelper.Callback({
|
|
930
|
+
onSuccess(result) {
|
|
936
931
|
resolve();
|
|
937
932
|
},
|
|
938
|
-
onError
|
|
933
|
+
onError(error) {
|
|
939
934
|
reject(error);
|
|
940
935
|
},
|
|
941
936
|
}));
|
|
942
937
|
});
|
|
943
938
|
}
|
|
944
|
-
return
|
|
945
|
-
}
|
|
946
|
-
|
|
939
|
+
return super.appendTextAsync(path, content, encoding);
|
|
940
|
+
}
|
|
941
|
+
appendTextSync(path, content, onError, encoding) {
|
|
947
942
|
if (isContentUri(path)) {
|
|
948
|
-
|
|
943
|
+
let callback = null;
|
|
949
944
|
if (typeof onError === 'function') {
|
|
950
945
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
951
|
-
onSuccess
|
|
952
|
-
onError
|
|
946
|
+
onSuccess(result) { },
|
|
947
|
+
onError(error) {
|
|
953
948
|
onError(error);
|
|
954
949
|
},
|
|
955
950
|
});
|
|
956
951
|
}
|
|
957
|
-
getOrSetHelper(path).appendTextSync(applicationContext, content, encoding
|
|
952
|
+
getOrSetHelper(path).appendTextSync(applicationContext, content, encoding ?? null, callback);
|
|
958
953
|
}
|
|
959
954
|
else {
|
|
960
|
-
|
|
955
|
+
super.appendTextSync(path, content, onError);
|
|
961
956
|
}
|
|
962
|
-
}
|
|
963
|
-
|
|
957
|
+
}
|
|
958
|
+
readTextAsync(path, encoding) {
|
|
964
959
|
if (isContentUri(path)) {
|
|
965
|
-
return new Promise(
|
|
966
|
-
getOrSetHelper(path).readText(applicationContext, encoding
|
|
967
|
-
onSuccess
|
|
960
|
+
return new Promise((resolve, reject) => {
|
|
961
|
+
getOrSetHelper(path).readText(applicationContext, encoding ?? null, new org.nativescript.widgets.FileHelper.Callback({
|
|
962
|
+
onSuccess(result) {
|
|
968
963
|
resolve(result);
|
|
969
964
|
},
|
|
970
|
-
onError
|
|
965
|
+
onError(error) {
|
|
971
966
|
reject(error);
|
|
972
967
|
},
|
|
973
968
|
}));
|
|
974
969
|
});
|
|
975
970
|
}
|
|
976
|
-
return
|
|
977
|
-
}
|
|
978
|
-
|
|
971
|
+
return super.readTextAsync(path, encoding);
|
|
972
|
+
}
|
|
973
|
+
readTextSync(path, onError, encoding) {
|
|
979
974
|
if (isContentUri(path)) {
|
|
980
|
-
|
|
975
|
+
let callback = null;
|
|
981
976
|
if (typeof onError === 'function') {
|
|
982
977
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
983
|
-
onSuccess
|
|
984
|
-
onError
|
|
978
|
+
onSuccess(result) { },
|
|
979
|
+
onError(error) {
|
|
985
980
|
onError(error);
|
|
986
981
|
},
|
|
987
982
|
});
|
|
988
983
|
}
|
|
989
|
-
return getOrSetHelper(path).readTextSync(applicationContext, encoding
|
|
984
|
+
return getOrSetHelper(path).readTextSync(applicationContext, encoding ?? null, callback);
|
|
990
985
|
}
|
|
991
986
|
else {
|
|
992
|
-
return
|
|
987
|
+
return super.readTextSync(path, onError, encoding);
|
|
993
988
|
}
|
|
994
|
-
}
|
|
995
|
-
|
|
989
|
+
}
|
|
990
|
+
readBufferAsync(path) {
|
|
996
991
|
if (isContentUri(path)) {
|
|
997
|
-
return new Promise(
|
|
992
|
+
return new Promise((resolve, reject) => {
|
|
998
993
|
getOrSetHelper(path).readBuffer(applicationContext, new org.nativescript.widgets.FileHelper.Callback({
|
|
999
|
-
onSuccess
|
|
994
|
+
onSuccess(result) {
|
|
1000
995
|
resolve(result);
|
|
1001
996
|
},
|
|
1002
|
-
onError
|
|
997
|
+
onError(error) {
|
|
1003
998
|
reject(error);
|
|
1004
999
|
},
|
|
1005
1000
|
}));
|
|
1006
1001
|
});
|
|
1007
1002
|
}
|
|
1008
|
-
return
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1003
|
+
return super.readBufferAsync(path);
|
|
1004
|
+
}
|
|
1005
|
+
readBufferSync(path, onError) {
|
|
1011
1006
|
if (isContentUri(path)) {
|
|
1012
|
-
|
|
1007
|
+
let callback = null;
|
|
1013
1008
|
if (typeof onError === 'function') {
|
|
1014
1009
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
1015
|
-
onSuccess
|
|
1016
|
-
onError
|
|
1010
|
+
onSuccess(result) { },
|
|
1011
|
+
onError(error) {
|
|
1017
1012
|
onError(error);
|
|
1018
1013
|
},
|
|
1019
1014
|
});
|
|
1020
1015
|
}
|
|
1021
|
-
|
|
1016
|
+
const ret = getOrSetHelper(path).readBufferSync(applicationContext, callback);
|
|
1022
1017
|
if (ret) {
|
|
1023
1018
|
return null;
|
|
1024
1019
|
}
|
|
1025
1020
|
return ArrayBuffer.from(ret);
|
|
1026
1021
|
}
|
|
1027
|
-
return
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1022
|
+
return super.readBufferSync(path, onError);
|
|
1023
|
+
}
|
|
1024
|
+
readAsync(path) {
|
|
1030
1025
|
if (isContentUri(path)) {
|
|
1031
|
-
return new Promise(
|
|
1026
|
+
return new Promise((resolve, reject) => {
|
|
1032
1027
|
getOrSetHelper(path).read(applicationContext, new org.nativescript.widgets.FileHelper.Callback({
|
|
1033
|
-
onSuccess
|
|
1028
|
+
onSuccess(result) {
|
|
1034
1029
|
resolve(result);
|
|
1035
1030
|
},
|
|
1036
|
-
onError
|
|
1031
|
+
onError(error) {
|
|
1037
1032
|
reject(error);
|
|
1038
1033
|
},
|
|
1039
1034
|
}));
|
|
1040
1035
|
});
|
|
1041
1036
|
}
|
|
1042
|
-
return
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1037
|
+
return super.readAsync(path);
|
|
1038
|
+
}
|
|
1039
|
+
readSync(path, onError) {
|
|
1045
1040
|
if (isContentUri(path)) {
|
|
1046
|
-
|
|
1041
|
+
let callback = null;
|
|
1047
1042
|
if (typeof onError === 'function') {
|
|
1048
1043
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
1049
|
-
onSuccess
|
|
1050
|
-
onError
|
|
1044
|
+
onSuccess(result) { },
|
|
1045
|
+
onError(error) {
|
|
1051
1046
|
onError(error);
|
|
1052
1047
|
},
|
|
1053
1048
|
});
|
|
1054
1049
|
}
|
|
1055
1050
|
return getOrSetHelper(path).readSync(applicationContext, callback);
|
|
1056
1051
|
}
|
|
1057
|
-
return
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1052
|
+
return super.readSync(path, onError);
|
|
1053
|
+
}
|
|
1054
|
+
writeTextAsync(path, content, encoding) {
|
|
1060
1055
|
if (isContentUri(path)) {
|
|
1061
|
-
return new Promise(
|
|
1062
|
-
getOrSetHelper(path).writeText(applicationContext, content, encoding
|
|
1063
|
-
onSuccess
|
|
1056
|
+
return new Promise((resolve, reject) => {
|
|
1057
|
+
getOrSetHelper(path).writeText(applicationContext, content, encoding ?? null, new org.nativescript.widgets.FileHelper.Callback({
|
|
1058
|
+
onSuccess(result) {
|
|
1064
1059
|
resolve();
|
|
1065
1060
|
},
|
|
1066
|
-
onError
|
|
1061
|
+
onError(error) {
|
|
1067
1062
|
reject(error);
|
|
1068
1063
|
},
|
|
1069
1064
|
}));
|
|
1070
1065
|
});
|
|
1071
1066
|
}
|
|
1072
|
-
return
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1067
|
+
return super.writeTextAsync(path, content, encoding);
|
|
1068
|
+
}
|
|
1069
|
+
writeTextSync(path, content, onError, encoding) {
|
|
1075
1070
|
if (isContentUri(path)) {
|
|
1076
|
-
|
|
1071
|
+
let callback = null;
|
|
1077
1072
|
if (typeof onError === 'function') {
|
|
1078
1073
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
1079
|
-
onSuccess
|
|
1080
|
-
onError
|
|
1074
|
+
onSuccess(result) { },
|
|
1075
|
+
onError(error) {
|
|
1081
1076
|
onError(error);
|
|
1082
1077
|
},
|
|
1083
1078
|
});
|
|
1084
1079
|
}
|
|
1085
|
-
getOrSetHelper(path).writeTextSync(applicationContext, content, encoding
|
|
1080
|
+
getOrSetHelper(path).writeTextSync(applicationContext, content, encoding ?? null, callback);
|
|
1086
1081
|
}
|
|
1087
1082
|
else {
|
|
1088
|
-
|
|
1083
|
+
super.writeTextSync(path, content, onError);
|
|
1089
1084
|
}
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1085
|
+
}
|
|
1086
|
+
writeBufferAsync(path, content) {
|
|
1092
1087
|
if (isContentUri(path)) {
|
|
1093
|
-
return new Promise(
|
|
1088
|
+
return new Promise((resolve, reject) => {
|
|
1094
1089
|
getOrSetHelper(path).writeBuffer(applicationContext, FileSystemAccess.getBuffer(content), new org.nativescript.widgets.FileHelper.Callback({
|
|
1095
|
-
onSuccess
|
|
1090
|
+
onSuccess(result) {
|
|
1096
1091
|
resolve();
|
|
1097
1092
|
},
|
|
1098
|
-
onError
|
|
1093
|
+
onError(error) {
|
|
1099
1094
|
reject(error);
|
|
1100
1095
|
},
|
|
1101
1096
|
}));
|
|
1102
1097
|
});
|
|
1103
1098
|
}
|
|
1104
|
-
return
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1099
|
+
return super.writeAsync(path, content);
|
|
1100
|
+
}
|
|
1101
|
+
writeBufferSync(path, content, onError) {
|
|
1107
1102
|
if (isContentUri(path)) {
|
|
1108
|
-
|
|
1103
|
+
let callback = null;
|
|
1109
1104
|
if (typeof onError === 'function') {
|
|
1110
1105
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
1111
|
-
onSuccess
|
|
1112
|
-
onError
|
|
1106
|
+
onSuccess(result) { },
|
|
1107
|
+
onError(error) {
|
|
1113
1108
|
onError(error);
|
|
1114
1109
|
},
|
|
1115
1110
|
});
|
|
@@ -1117,31 +1112,31 @@ var FileSystemAccess29 = /** @class */ (function (_super) {
|
|
|
1117
1112
|
getOrSetHelper(path).writeSync(applicationContext, FileSystemAccess.getBuffer(content), callback);
|
|
1118
1113
|
}
|
|
1119
1114
|
else {
|
|
1120
|
-
|
|
1115
|
+
super.writeSync(path, content, onError);
|
|
1121
1116
|
}
|
|
1122
|
-
}
|
|
1123
|
-
|
|
1117
|
+
}
|
|
1118
|
+
writeAsync(path, content) {
|
|
1124
1119
|
if (isContentUri(path)) {
|
|
1125
|
-
return new Promise(
|
|
1120
|
+
return new Promise((resolve, reject) => {
|
|
1126
1121
|
getOrSetHelper(path).write(applicationContext, content, new org.nativescript.widgets.FileHelper.Callback({
|
|
1127
|
-
onSuccess
|
|
1122
|
+
onSuccess(result) {
|
|
1128
1123
|
resolve();
|
|
1129
1124
|
},
|
|
1130
|
-
onError
|
|
1125
|
+
onError(error) {
|
|
1131
1126
|
reject(error);
|
|
1132
1127
|
},
|
|
1133
1128
|
}));
|
|
1134
1129
|
});
|
|
1135
1130
|
}
|
|
1136
|
-
return
|
|
1137
|
-
}
|
|
1138
|
-
|
|
1131
|
+
return super.writeAsync(path, content);
|
|
1132
|
+
}
|
|
1133
|
+
writeSync(path, content, onError) {
|
|
1139
1134
|
if (isContentUri(path)) {
|
|
1140
|
-
|
|
1135
|
+
let callback = null;
|
|
1141
1136
|
if (typeof onError === 'function') {
|
|
1142
1137
|
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
1143
|
-
onSuccess
|
|
1144
|
-
onError
|
|
1138
|
+
onSuccess(result) { },
|
|
1139
|
+
onError(error) {
|
|
1145
1140
|
onError(error);
|
|
1146
1141
|
},
|
|
1147
1142
|
});
|
|
@@ -1149,28 +1144,26 @@ var FileSystemAccess29 = /** @class */ (function (_super) {
|
|
|
1149
1144
|
getOrSetHelper(path).writeSync(applicationContext, content, callback);
|
|
1150
1145
|
}
|
|
1151
1146
|
else {
|
|
1152
|
-
|
|
1147
|
+
super.writeSync(path, content, onError);
|
|
1153
1148
|
}
|
|
1154
|
-
}
|
|
1155
|
-
|
|
1149
|
+
}
|
|
1150
|
+
getFileExtension(path) {
|
|
1156
1151
|
if (isContentUri(path)) {
|
|
1157
1152
|
return getOrSetHelper(path).getExtension();
|
|
1158
1153
|
}
|
|
1159
|
-
return
|
|
1160
|
-
}
|
|
1161
|
-
|
|
1162
|
-
return
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
return
|
|
1166
|
-
}
|
|
1167
|
-
|
|
1168
|
-
return
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
return
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
}(FileSystemAccess));
|
|
1175
|
-
export { FileSystemAccess29 };
|
|
1154
|
+
return super.getFileExtension(path);
|
|
1155
|
+
}
|
|
1156
|
+
getPathSeparator() {
|
|
1157
|
+
return super.getPathSeparator();
|
|
1158
|
+
}
|
|
1159
|
+
normalizePath(path) {
|
|
1160
|
+
return super.normalizePath(path);
|
|
1161
|
+
}
|
|
1162
|
+
joinPath(left, right) {
|
|
1163
|
+
return super.joinPath(left, right);
|
|
1164
|
+
}
|
|
1165
|
+
joinPaths(paths) {
|
|
1166
|
+
return super.joinPaths(paths);
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1176
1169
|
//# sourceMappingURL=file-system-access.android.js.map
|