@nativescript/core 9.0.0-next-07-26-2025-16544379102 → 9.0.0-preview.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/accessibility/accessibility-common.d.ts +264 -0
- package/accessibility/accessibility-common.js +352 -0
- package/accessibility/accessibility-common.js.map +1 -1
- package/accessibility/accessibility-properties.d.ts +1 -1
- package/accessibility/accessibility-properties.js +2 -2
- package/accessibility/accessibility-properties.js.map +1 -1
- package/accessibility/index.d.ts +0 -36
- package/accessibility/index.js +2 -0
- package/accessibility/index.js.map +1 -0
- package/application/application-common.d.ts +6 -8
- package/application/application-common.js +21 -14
- package/application/application-common.js.map +1 -1
- package/application/application-interfaces.d.ts +2 -3
- package/application/application.android.d.ts +14 -7
- package/application/application.android.js +754 -75
- package/application/application.android.js.map +1 -1
- package/application/application.d.ts +25 -0
- package/application/application.ios.d.ts +16 -18
- package/application/application.ios.js +455 -45
- package/application/application.ios.js.map +1 -1
- package/application/helpers-common.d.ts +50 -0
- package/application/helpers-common.js +153 -0
- package/application/helpers-common.js.map +1 -0
- package/application/helpers.android.d.ts +17 -0
- package/application/helpers.android.js +173 -0
- package/application/helpers.android.js.map +1 -0
- package/application/helpers.d.ts +25 -0
- package/application/helpers.ios.d.ts +27 -0
- package/application/helpers.ios.js +62 -0
- package/application/helpers.ios.js.map +1 -0
- package/application-settings/index.android.js +2 -2
- package/application-settings/index.android.js.map +1 -1
- package/color/color-common.d.ts +18 -19
- package/color/color-common.js +13 -14
- package/color/color-common.js.map +1 -1
- package/color/color-types.d.ts +49 -0
- package/color/color-types.js +3 -0
- package/color/color-types.js.map +1 -0
- package/color/index.ios.d.ts +2 -1
- package/color/index.ios.js.map +1 -1
- package/connectivity/index.android.js +5 -4
- package/connectivity/index.android.js.map +1 -1
- package/core-types/animation-types.d.ts +11 -0
- package/{ui/animation/animation-interfaces.js → core-types/animation-types.js} +1 -1
- package/core-types/animation-types.js.map +1 -0
- package/core-types/index.d.ts +1 -1
- package/core-types/index.js +2 -2
- package/core-types/index.js.map +1 -1
- package/core-types/validators.d.ts +2 -0
- package/core-types/validators.js +18 -0
- package/core-types/validators.js.map +1 -0
- package/css/css-tree-parser.js +17 -21
- package/css/css-tree-parser.js.map +1 -1
- package/css/lib/parse/index.d.ts +1 -0
- package/css/lib/parse/index.js +475 -577
- package/css/lib/parse/index.js.map +1 -0
- package/css/reworkcss.d.ts +25 -28
- package/css/reworkcss.js +5 -1
- package/css/reworkcss.js.map +1 -0
- package/css-mediaquery/index.js +1 -1
- package/css-mediaquery/index.js.map +1 -1
- package/css-value/reworkcss-value.d.ts +31 -8
- package/css-value/reworkcss-value.js +89 -111
- package/css-value/reworkcss-value.js.map +1 -0
- package/debugger/devtools-elements-interfaces.d.ts +1 -1
- package/debugger/devtools-elements.common.js +17 -8
- package/debugger/devtools-elements.common.js.map +1 -1
- package/debugger/devtools-elements.js +1 -1
- package/debugger/devtools-elements.js.map +1 -1
- package/debugger/dom-types.d.ts +24 -0
- package/debugger/{dom-node.js → dom-types.js} +11 -9
- package/debugger/dom-types.js.map +1 -0
- package/debugger/webinspector-css.d.ts +18 -18
- package/debugger/webinspector-css.js +1 -1
- package/debugger/webinspector-css.js.map +1 -1
- package/debugger/webinspector-dom.d.ts +15 -15
- package/debugger/webinspector-dom.js +1 -1
- package/debugger/webinspector-dom.js.map +1 -1
- package/debugger/webinspector-network.android.d.ts +9 -9
- package/debugger/webinspector-network.android.js +3 -3
- package/debugger/webinspector-network.android.js.map +1 -1
- package/debugger/webinspector-network.ios.d.ts +9 -9
- package/debugger/webinspector-network.ios.js +1 -1
- package/debugger/webinspector-network.ios.js.map +1 -1
- package/fetch/index.d.ts +72 -0
- package/fetch/index.js +448 -458
- package/fetch/index.js.map +1 -0
- package/file-system/file-system-access.android.js +32 -39
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.ios.js +2 -15
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.d.ts +2 -2
- package/file-system/index.js +4 -11
- package/file-system/index.js.map +1 -1
- package/fps-meter/fps-native.android.d.ts +1 -2
- package/fps-meter/fps-native.android.js.map +1 -1
- package/fps-meter/fps-native.ios.d.ts +1 -2
- package/fps-meter/fps-native.ios.js.map +1 -1
- package/global-types.d.ts +7 -8
- package/globals/global-utils.d.ts +27 -0
- package/globals/global-utils.js +67 -0
- package/globals/global-utils.js.map +1 -0
- package/globals/index.d.ts +3 -7
- package/globals/index.js +276 -281
- package/globals/index.js.map +1 -1
- package/http/http-interfaces.d.ts +84 -0
- package/http/http-interfaces.js +6 -0
- package/http/http-interfaces.js.map +1 -0
- package/http/http-request/http-request-common.js +2 -2
- package/http/http-request/http-request-common.js.map +1 -1
- package/http/http-request/index.android.d.ts +3 -7
- package/http/http-request/index.android.js +6 -22
- package/http/http-request/index.android.js.map +1 -1
- package/http/http-request/index.d.ts +5 -1
- package/http/http-request/index.ios.d.ts +3 -7
- package/http/http-request/index.ios.js +6 -22
- package/http/http-request/index.ios.js.map +1 -1
- package/http/http-shared.d.ts +5 -0
- package/http/http-shared.js +14 -0
- package/http/http-shared.js.map +1 -0
- package/http/index.d.ts +6 -105
- package/http/index.js +10 -12
- package/http/index.js.map +1 -1
- package/image-asset/index.android.js +3 -3
- package/image-asset/index.android.js.map +1 -1
- package/image-source/index.android.d.ts +1 -1
- package/image-source/index.android.js +5 -23
- package/image-source/index.android.js.map +1 -1
- package/image-source/index.ios.js +2 -9
- package/image-source/index.ios.js.map +1 -1
- package/index.d.ts +12 -8
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/inspector_modules.d.ts +11 -0
- package/inspector_modules.js +111 -3
- package/inspector_modules.js.map +1 -1
- package/js-libs/easysax/easysax.js +5 -3
- package/media-query-list/index.js +7 -17
- package/media-query-list/index.js.map +1 -1
- package/module-name-resolver/helpers.d.ts +14 -0
- package/module-name-resolver/helpers.js +27 -0
- package/module-name-resolver/helpers.js.map +1 -0
- package/module-name-resolver/index.d.ts +12 -22
- package/module-name-resolver/index.js +6 -18
- package/module-name-resolver/index.js.map +1 -1
- package/module-name-resolver/non-bundle-workflow-compat.js +32 -23
- package/module-name-resolver/non-bundle-workflow-compat.js.map +1 -1
- package/module-name-resolver/qualifier-matcher/index.d.ts +6 -12
- package/module-name-resolver/qualifier-matcher/index.js +5 -5
- package/module-name-resolver/qualifier-matcher/index.js.map +1 -1
- package/package.json +5 -2
- package/platform/device/index.android.js +2 -2
- package/platform/device/index.android.js.map +1 -1
- package/platform/screen/index.android.js +2 -2
- package/platform/screen/index.android.js.map +1 -1
- package/platform/screen/index.ios.js +2 -2
- package/platform/screen/index.ios.js.map +1 -1
- package/profiling/index.js +2 -1
- package/profiling/index.js.map +1 -1
- package/ui/action-bar/action-bar-common.js +4 -2
- package/ui/action-bar/action-bar-common.js.map +1 -1
- package/ui/action-bar/index.android.js +7 -6
- package/ui/action-bar/index.android.js.map +1 -1
- package/ui/action-bar/index.ios.js +10 -11
- package/ui/action-bar/index.ios.js.map +1 -1
- package/ui/activity-indicator/index.ios.js +3 -4
- package/ui/activity-indicator/index.ios.js.map +1 -1
- package/ui/animation/animation-common.d.ts +4 -4
- package/ui/animation/animation-common.js +2 -3
- package/ui/animation/animation-common.js.map +1 -1
- package/ui/animation/{animation-interfaces.d.ts → animation-shared.d.ts} +39 -31
- package/ui/animation/animation-shared.js +4 -0
- package/ui/animation/animation-shared.js.map +1 -0
- package/ui/animation/animation-types.d.ts +1 -0
- package/ui/animation/animation-types.js +3 -0
- package/ui/animation/animation-types.js.map +1 -0
- package/ui/animation/index.android.d.ts +1 -2
- package/ui/animation/index.android.js +5 -5
- package/ui/animation/index.android.js.map +1 -1
- package/ui/animation/index.d.ts +2 -138
- package/ui/animation/index.ios.d.ts +1 -2
- package/ui/animation/index.ios.js +3 -3
- package/ui/animation/index.ios.js.map +1 -1
- package/ui/animation/keyframe-animation.d.ts +67 -118
- package/ui/animation/keyframe-animation.js +2 -2
- package/ui/animation/keyframe-animation.js.map +1 -1
- package/ui/builder/binding-builder.d.ts +12 -15
- package/ui/builder/component-builder/index.js +5 -5
- package/ui/builder/component-builder/index.js.map +1 -1
- package/ui/builder/index.d.ts +179 -59
- package/ui/builder/index.js +450 -10
- package/ui/builder/index.js.map +1 -1
- package/ui/button/index.android.js +2 -1
- package/ui/button/index.android.js.map +1 -1
- package/ui/core/bindable/bindable-types.d.ts +37 -0
- package/ui/core/bindable/bindable-types.js +3 -0
- package/ui/core/bindable/bindable-types.js.map +1 -0
- package/ui/core/bindable/index.d.ts +2 -38
- package/ui/core/bindable/index.js +1 -2
- package/ui/core/bindable/index.js.map +1 -1
- package/ui/core/properties/index.d.ts +4 -37
- package/ui/core/properties/index.js +6 -35
- package/ui/core/properties/index.js.map +1 -1
- package/ui/core/properties/property-shared.d.ts +35 -0
- package/ui/core/properties/property-shared.js +16 -0
- package/ui/core/properties/property-shared.js.map +1 -0
- package/ui/core/view/index.android.d.ts +2 -2
- package/ui/core/view/index.android.js +13 -10
- package/ui/core/view/index.android.js.map +1 -1
- package/ui/core/view/index.d.ts +1 -61
- package/ui/core/view/index.ios.d.ts +3 -3
- package/ui/core/view/index.ios.js +11 -11
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/core/view/view-common.d.ts +19 -16
- package/ui/core/view/view-common.js +12 -14
- package/ui/core/view/view-common.js.map +1 -1
- package/ui/core/view/view-helper/index.ios.d.ts +2 -1
- package/ui/core/view/view-helper/index.ios.js +3 -4
- package/ui/core/view/view-helper/index.ios.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-common.js +1 -3
- package/ui/core/view/view-helper/view-helper-common.js.map +1 -1
- package/ui/core/view/view-helper/view-helper-shared.d.ts +5 -0
- package/ui/core/view/view-helper/view-helper-shared.js +6 -0
- package/ui/core/view/view-helper/view-helper-shared.js.map +1 -0
- package/ui/core/view/view-interfaces.d.ts +54 -0
- package/ui/core/view/view-interfaces.js +2 -0
- package/ui/core/view/view-interfaces.js.map +1 -0
- package/ui/core/view-base/index.d.ts +22 -24
- package/ui/core/view-base/index.js +9 -30
- package/ui/core/view-base/index.js.map +1 -1
- package/ui/core/view-base/utils.d.ts +1 -0
- package/ui/core/view-base/utils.js +9 -0
- package/ui/core/view-base/utils.js.map +1 -0
- package/ui/dialogs/dialogs-common.js +3 -3
- package/ui/dialogs/dialogs-common.js.map +1 -1
- package/ui/dialogs/index.android.js +8 -7
- package/ui/dialogs/index.android.js.map +1 -1
- package/ui/dialogs/index.ios.js +2 -2
- package/ui/dialogs/index.ios.js.map +1 -1
- package/ui/embedding/index.android.d.ts +1 -1
- package/ui/embedding/index.d.ts +1 -1
- package/ui/frame/fragment.android.js +3 -2
- 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 +3 -3
- package/ui/frame/frame-common.js.map +1 -1
- package/ui/frame/{callbacks/fragment-callbacks.d.ts → frame-helper-for-android.d.ts} +20 -1
- package/ui/frame/{callbacks/fragment-callbacks.js → frame-helper-for-android.js} +52 -38
- package/ui/frame/frame-helper-for-android.js.map +1 -0
- package/ui/frame/frame-interfaces.d.ts +30 -4
- package/ui/frame/frame-interfaces.js.map +1 -1
- package/ui/frame/frame-stack.js.map +1 -1
- package/ui/frame/index.android.d.ts +21 -5
- package/ui/frame/index.android.js +296 -19
- package/ui/frame/index.android.js.map +1 -1
- package/ui/frame/index.d.ts +19 -60
- package/ui/frame/index.ios.d.ts +3 -2
- package/ui/frame/index.ios.js +5 -4
- package/ui/frame/index.ios.js.map +1 -1
- package/ui/gestures/gestures-common.d.ts +4 -273
- package/ui/gestures/gestures-common.js +3 -146
- package/ui/gestures/gestures-common.js.map +1 -1
- package/ui/gestures/gestures-types.d.ts +108 -0
- package/ui/gestures/gestures-types.js +40 -0
- package/ui/gestures/gestures-types.js.map +1 -0
- package/ui/gestures/index.android.d.ts +29 -1
- package/ui/gestures/index.android.js +4 -2
- package/ui/gestures/index.android.js.map +1 -1
- package/ui/gestures/index.d.ts +35 -0
- package/ui/gestures/index.ios.d.ts +35 -1
- package/ui/gestures/index.ios.js +3 -3
- package/ui/gestures/index.ios.js.map +1 -1
- package/ui/gestures/touch-manager.d.ts +1 -1
- package/ui/html-view/index.ios.js +3 -3
- 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.js +1 -1
- package/ui/image/index.android.js.map +1 -1
- package/ui/image-cache/index.ios.js +5 -11
- package/ui/image-cache/index.ios.js.map +1 -1
- package/ui/index.d.ts +10 -5
- package/ui/index.js +18 -3
- package/ui/index.js.map +1 -1
- package/ui/label/index.ios.js.map +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js +1 -1
- package/ui/layouts/absolute-layout/absolute-layout-common.js.map +1 -1
- package/ui/layouts/absolute-layout/index.android.js +1 -1
- package/ui/layouts/absolute-layout/index.android.js.map +1 -1
- package/ui/layouts/absolute-layout/index.d.ts +1 -1
- package/ui/layouts/absolute-layout/index.ios.js.map +1 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js +2 -1
- package/ui/layouts/flexbox-layout/flexbox-layout-common.js.map +1 -1
- package/ui/layouts/flexbox-layout/index.android.js +1 -1
- 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/layout-base.android.js +2 -1
- package/ui/layouts/layout-base.android.js.map +1 -1
- package/ui/layouts/stack-layout/index.ios.js.map +1 -1
- package/ui/layouts/wrap-layout/index.android.js +1 -1
- package/ui/layouts/wrap-layout/index.android.js.map +1 -1
- package/ui/layouts/wrap-layout/index.d.ts +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js +1 -1
- package/ui/layouts/wrap-layout/wrap-layout-common.js.map +1 -1
- package/ui/list-view/index.android.d.ts +17 -1
- package/ui/list-view/index.android.js +402 -32
- package/ui/list-view/index.android.js.map +1 -1
- package/ui/list-view/index.d.ts +66 -1
- package/ui/list-view/index.ios.d.ts +24 -2
- package/ui/list-view/index.ios.js +385 -10
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/list-view/list-view-common.d.ts +15 -0
- package/ui/list-view/list-view-common.js +73 -1
- package/ui/list-view/list-view-common.js.map +1 -1
- package/ui/page/events.d.ts +6 -0
- package/ui/page/events.js +7 -0
- package/ui/page/events.js.map +1 -0
- package/ui/page/index.android.js +2 -1
- package/ui/page/index.android.js.map +1 -1
- package/ui/page/index.d.ts +1 -1
- package/ui/page/index.ios.js +4 -5
- package/ui/page/index.ios.js.map +1 -1
- package/ui/page/page-common.d.ts +3 -2
- package/ui/page/page-common.js +5 -4
- package/ui/page/page-common.js.map +1 -1
- package/ui/scroll-view/index.ios.js +3 -3
- package/ui/scroll-view/index.ios.js.map +1 -1
- package/ui/styling/background-common.js +0 -1
- package/ui/styling/background-common.js.map +1 -1
- package/ui/styling/background.android.d.ts +0 -6
- package/ui/styling/background.android.js +1 -53
- package/ui/styling/background.android.js.map +1 -1
- package/ui/styling/background.ios.js +2 -1
- package/ui/styling/background.ios.js.map +1 -1
- package/ui/styling/converters.d.ts +2 -2
- package/ui/styling/css-shadow.js.map +1 -1
- package/ui/styling/css-stroke.js.map +1 -1
- package/ui/styling/css-transform.d.ts +1 -1
- package/ui/styling/css-utils.js +1 -1
- package/ui/styling/css-utils.js.map +1 -1
- package/ui/styling/font.android.js +2 -2
- package/ui/styling/font.android.js.map +1 -1
- package/ui/styling/font.ios.js +10 -10
- package/ui/styling/font.ios.js.map +1 -1
- package/ui/styling/length-shared.d.ts +52 -0
- package/ui/styling/length-shared.js +173 -0
- package/ui/styling/length-shared.js.map +1 -0
- package/ui/styling/style/index.d.ts +1 -1
- package/ui/styling/style-properties.d.ts +58 -112
- package/ui/styling/style-properties.js +7 -93
- package/ui/styling/style-properties.js.map +1 -1
- package/ui/styling/style-scope.d.ts +85 -48
- package/ui/styling/style-scope.js +30 -36
- package/ui/styling/style-scope.js.map +1 -1
- package/ui/styling/styling-profile.d.ts +1 -0
- package/ui/styling/styling-profile.js +4 -0
- package/ui/styling/styling-profile.js.map +1 -0
- package/ui/styling/styling-shared.d.ts +3 -0
- package/ui/styling/styling-shared.js +6 -0
- package/ui/styling/styling-shared.js.map +1 -0
- package/ui/switch/index.ios.js +5 -5
- package/ui/switch/index.ios.js.map +1 -1
- package/ui/tab-view/index.android.js +6 -6
- package/ui/tab-view/index.android.js.map +1 -1
- package/ui/text-base/index.android.d.ts +1 -1
- package/ui/text-base/index.android.js +4 -4
- package/ui/text-base/index.android.js.map +1 -1
- package/ui/text-base/index.d.ts +1 -1
- package/ui/text-base/index.ios.js +5 -4
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-view/index.ios.js.map +1 -1
- package/ui/transition/fade-transition.ios.js +1 -1
- package/ui/transition/fade-transition.ios.js.map +1 -1
- package/ui/transition/index.ios.js +1 -1
- package/ui/transition/index.ios.js.map +1 -1
- package/ui/transition/modal-transition.ios.js +1 -1
- package/ui/transition/modal-transition.ios.js.map +1 -1
- package/ui/transition/page-transition.android.d.ts +1 -1
- package/ui/transition/page-transition.android.js +4 -4
- package/ui/transition/page-transition.android.js.map +1 -1
- package/ui/transition/page-transition.ios.js +1 -1
- package/ui/transition/page-transition.ios.js.map +1 -1
- package/ui/transition/shared-transition-helper.ios.js +1 -1
- package/ui/transition/shared-transition-helper.ios.js.map +1 -1
- package/ui/transition/shared-transition.js +2 -1
- package/ui/transition/shared-transition.js.map +1 -1
- package/ui/transition/slide-transition.ios.js +2 -2
- package/ui/transition/slide-transition.ios.js.map +1 -1
- package/utils/animation-helpers.d.ts +27 -0
- package/utils/animation-helpers.js +48 -0
- package/utils/animation-helpers.js.map +1 -0
- package/utils/common.d.ts +1 -38
- package/utils/common.js +2 -112
- package/utils/common.js.map +1 -1
- package/utils/debug-source.d.ts +19 -0
- package/utils/debug-source.js +78 -0
- package/utils/debug-source.js.map +1 -0
- package/utils/debug.js +1 -59
- package/utils/debug.js.map +1 -1
- package/utils/index.android.d.ts +3 -1
- package/utils/index.android.js +37 -11
- package/utils/index.android.js.map +1 -1
- package/utils/index.d.ts +2 -14
- package/utils/index.ios.d.ts +4 -1
- package/utils/index.ios.js +32 -5
- package/utils/index.ios.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.d.ts +6 -4
- package/utils/layout-helper/index.ios.js +5 -5
- package/utils/layout-helper/index.ios.js.map +1 -1
- package/utils/layout-helper/layout-helper-common.d.ts +0 -9
- package/utils/layout-helper/layout-helper-common.js +1 -9
- package/utils/layout-helper/layout-helper-common.js.map +1 -1
- package/utils/layout-helper/layout-helper-shared.d.ts +9 -0
- package/utils/layout-helper/layout-helper-shared.js +13 -0
- package/utils/layout-helper/layout-helper-shared.js.map +1 -0
- package/utils/{android/index.d.ts → native-helper-for-android.d.ts} +4 -2
- package/utils/native-helper-for-android.js +273 -0
- package/utils/native-helper-for-android.js.map +1 -0
- package/utils/native-helper.android.d.ts +29 -5
- package/utils/native-helper.android.js +18 -131
- package/utils/native-helper.android.js.map +1 -1
- package/utils/native-helper.d.ts +206 -258
- package/utils/native-helper.ios.d.ts +72 -3
- package/utils/native-helper.ios.js +250 -3
- package/utils/native-helper.ios.js.map +1 -1
- package/utils/shared.d.ts +17 -0
- package/utils/shared.js +40 -0
- package/utils/shared.js.map +1 -0
- package/utils/utils-shared.d.ts +1 -0
- package/utils/utils-shared.js +8 -0
- package/utils/utils-shared.js.map +1 -0
- package/xhr/index.js +12 -13
- package/xhr/index.js.map +1 -1
- package/xml/index.d.ts +94 -98
- package/xml/index.js +58 -2
- package/xml/index.js.map +1 -1
- package/accessibility/accessibility-css-helper.d.ts +0 -1
- package/accessibility/accessibility-css-helper.js +0 -101
- package/accessibility/accessibility-css-helper.js.map +0 -1
- package/accessibility/accessibility-service-common.d.ts +0 -8
- package/accessibility/accessibility-service-common.js +0 -26
- package/accessibility/accessibility-service-common.js.map +0 -1
- package/accessibility/accessibility-service.android.d.ts +0 -6
- package/accessibility/accessibility-service.android.js +0 -103
- package/accessibility/accessibility-service.android.js.map +0 -1
- package/accessibility/accessibility-service.d.ts +0 -10
- package/accessibility/accessibility-service.ios.d.ts +0 -6
- package/accessibility/accessibility-service.ios.js +0 -61
- package/accessibility/accessibility-service.ios.js.map +0 -1
- package/accessibility/accessibility-types.d.ts +0 -224
- package/accessibility/accessibility-types.js +0 -222
- package/accessibility/accessibility-types.js.map +0 -1
- package/accessibility/font-scale-common.d.ts +0 -7
- package/accessibility/font-scale-common.js +0 -14
- package/accessibility/font-scale-common.js.map +0 -1
- package/accessibility/font-scale.android.d.ts +0 -5
- package/accessibility/font-scale.android.js +0 -55
- package/accessibility/font-scale.android.js.map +0 -1
- package/accessibility/font-scale.d.ts +0 -9
- package/accessibility/font-scale.ios.d.ts +0 -5
- package/accessibility/font-scale.ios.js +0 -89
- package/accessibility/font-scale.ios.js.map +0 -1
- package/accessibility/index.android.d.ts +0 -10
- package/accessibility/index.android.js +0 -577
- package/accessibility/index.android.js.map +0 -1
- package/accessibility/index.ios.d.ts +0 -9
- package/accessibility/index.ios.js +0 -229
- package/accessibility/index.ios.js.map +0 -1
- package/css/package.json +0 -36
- package/css-value/package.json +0 -23
- package/debugger/dom-node.d.ts +0 -27
- package/debugger/dom-node.js.map +0 -1
- package/ui/animation/animation-interfaces.js.map +0 -1
- package/ui/builder/xml2ui.d.ts +0 -134
- package/ui/builder/xml2ui.js +0 -397
- package/ui/builder/xml2ui.js.map +0 -1
- package/ui/frame/callbacks/activity-callbacks.d.ts +0 -19
- package/ui/frame/callbacks/activity-callbacks.js +0 -301
- package/ui/frame/callbacks/activity-callbacks.js.map +0 -1
- package/ui/frame/callbacks/fragment-callbacks.js.map +0 -1
- package/utils/android/index.js +0 -160
- package/utils/android/index.js.map +0 -1
- package/utils/ios/index.d.ts +0 -39
- package/utils/ios/index.js +0 -229
- package/utils/ios/index.js.map +0 -1
package/fetch/index.js
CHANGED
|
@@ -1,335 +1,301 @@
|
|
|
1
|
-
(
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"[object Uint32Array]",
|
|
35
|
-
"[object Float32Array]",
|
|
36
|
-
"[object Float64Array]"
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
var isArrayBufferView =
|
|
40
|
-
ArrayBuffer.isView ||
|
|
41
|
-
function (obj) {
|
|
42
|
-
return (
|
|
43
|
-
obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
|
|
44
|
-
);
|
|
45
|
-
};
|
|
1
|
+
const g = (typeof globalThis !== 'undefined' && globalThis) || (typeof self !== 'undefined' && self) || (typeof global !== 'undefined' && global) || {};
|
|
2
|
+
const support = {
|
|
3
|
+
searchParams: 'URLSearchParams' in g,
|
|
4
|
+
iterable: 'Symbol' in g && 'iterator' in Symbol,
|
|
5
|
+
blob: 'FileReader' in g &&
|
|
6
|
+
'Blob' in g &&
|
|
7
|
+
(() => {
|
|
8
|
+
try {
|
|
9
|
+
new Blob();
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
catch (e) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
})(),
|
|
16
|
+
formData: 'FormData' in g,
|
|
17
|
+
arrayBuffer: 'ArrayBuffer' in g,
|
|
18
|
+
};
|
|
19
|
+
function isDataView(obj) {
|
|
20
|
+
return obj && DataView.prototype.isPrototypeOf(obj);
|
|
21
|
+
}
|
|
22
|
+
let isArrayBufferView;
|
|
23
|
+
if (support.arrayBuffer) {
|
|
24
|
+
const viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]'];
|
|
25
|
+
isArrayBufferView =
|
|
26
|
+
ArrayBuffer.isView ||
|
|
27
|
+
((obj) => {
|
|
28
|
+
return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function normalizeName(name) {
|
|
32
|
+
if (typeof name !== 'string') {
|
|
33
|
+
name = String(name);
|
|
46
34
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (typeof name !== "string") {
|
|
50
|
-
name = String(name);
|
|
51
|
-
}
|
|
52
|
-
if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
|
|
53
|
-
throw new TypeError("Invalid character in header field name");
|
|
54
|
-
}
|
|
55
|
-
return name.toLowerCase();
|
|
35
|
+
if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {
|
|
36
|
+
throw new TypeError('Invalid character in header field name: "' + name + '"');
|
|
56
37
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return value;
|
|
38
|
+
return name.toLowerCase();
|
|
39
|
+
}
|
|
40
|
+
function normalizeValue(value) {
|
|
41
|
+
if (typeof value !== 'string') {
|
|
42
|
+
value = String(value);
|
|
63
43
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return iterator;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return iterator;
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
// Build a destructive iterator for the value list
|
|
47
|
+
function iteratorFor(items) {
|
|
48
|
+
const iterator = {
|
|
49
|
+
next: () => {
|
|
50
|
+
const value = items.shift();
|
|
51
|
+
return { done: value === undefined, value };
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
if (support.iterable) {
|
|
55
|
+
iterator[Symbol.iterator] = () => iterator;
|
|
81
56
|
}
|
|
82
|
-
|
|
83
|
-
|
|
57
|
+
return iterator;
|
|
58
|
+
}
|
|
59
|
+
export class Headers {
|
|
60
|
+
constructor(headers) {
|
|
84
61
|
this.map = {};
|
|
85
|
-
|
|
86
62
|
if (headers instanceof Headers) {
|
|
87
|
-
headers.forEach(
|
|
63
|
+
headers.forEach((value, name) => {
|
|
88
64
|
this.append(name, value);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else if (Array.isArray(headers)) {
|
|
68
|
+
headers.forEach((header) => {
|
|
69
|
+
if (header.length !== 2) {
|
|
70
|
+
throw new TypeError('Headers constructor: expected name/value pair to be length 2, found ' + header.length);
|
|
71
|
+
}
|
|
92
72
|
this.append(header[0], header[1]);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
else if (headers) {
|
|
76
|
+
Object.getOwnPropertyNames(headers).forEach((name) => {
|
|
96
77
|
this.append(name, headers[name]);
|
|
97
|
-
}
|
|
78
|
+
});
|
|
98
79
|
}
|
|
99
80
|
}
|
|
100
|
-
|
|
101
|
-
Headers.prototype.append = function (name, value) {
|
|
81
|
+
append(name, value) {
|
|
102
82
|
name = normalizeName(name);
|
|
103
83
|
value = normalizeValue(value);
|
|
104
|
-
|
|
105
|
-
this.map[name] = oldValue ? oldValue +
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
Headers.prototype["delete"] = function (name) {
|
|
84
|
+
const oldValue = this.map[name];
|
|
85
|
+
this.map[name] = oldValue ? oldValue + ', ' + value : value;
|
|
86
|
+
}
|
|
87
|
+
delete(name) {
|
|
109
88
|
delete this.map[normalizeName(name)];
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
Headers.prototype.get = function (name) {
|
|
89
|
+
}
|
|
90
|
+
get(name) {
|
|
113
91
|
name = normalizeName(name);
|
|
114
92
|
return this.has(name) ? this.map[name] : null;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Headers.prototype.set = function (name, value) {
|
|
93
|
+
}
|
|
94
|
+
has(name) {
|
|
95
|
+
return Object.prototype.hasOwnProperty.call(this.map, normalizeName(name));
|
|
96
|
+
}
|
|
97
|
+
set(name, value) {
|
|
122
98
|
this.map[normalizeName(name)] = normalizeValue(value);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if (this.map.hasOwnProperty(name)) {
|
|
99
|
+
}
|
|
100
|
+
forEach(callback, thisArg) {
|
|
101
|
+
for (const name in this.map) {
|
|
102
|
+
if (Object.prototype.hasOwnProperty.call(this.map, name)) {
|
|
128
103
|
callback.call(thisArg, this.map[name], name, this);
|
|
129
104
|
}
|
|
130
105
|
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
this.forEach(function (value, name) {
|
|
136
|
-
items.push(name);
|
|
137
|
-
});
|
|
138
|
-
return iteratorFor(items);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
Headers.prototype.values = function () {
|
|
142
|
-
var items = [];
|
|
143
|
-
this.forEach(function (value) {
|
|
144
|
-
items.push(value);
|
|
145
|
-
});
|
|
106
|
+
}
|
|
107
|
+
keys() {
|
|
108
|
+
const items = [];
|
|
109
|
+
this.forEach((_, name) => items.push(name));
|
|
146
110
|
return iteratorFor(items);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
this.forEach(function (value, name) {
|
|
152
|
-
items.push([name, value]);
|
|
153
|
-
});
|
|
111
|
+
}
|
|
112
|
+
values() {
|
|
113
|
+
const items = [];
|
|
114
|
+
this.forEach((value) => items.push(value));
|
|
154
115
|
return iteratorFor(items);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
if (support.iterable) {
|
|
158
|
-
Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
|
|
159
116
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
body.bodyUsed = true;
|
|
117
|
+
entries() {
|
|
118
|
+
const items = [];
|
|
119
|
+
this.forEach((value, name) => items.push([name, value]));
|
|
120
|
+
return iteratorFor(items);
|
|
166
121
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
return new Promise(function (resolve, reject) {
|
|
170
|
-
reader.onload = function () {
|
|
171
|
-
resolve(reader.result);
|
|
172
|
-
};
|
|
173
|
-
reader.onerror = function () {
|
|
174
|
-
reject(reader.error);
|
|
175
|
-
};
|
|
176
|
-
});
|
|
122
|
+
[Symbol.iterator]() {
|
|
123
|
+
return this.entries();
|
|
177
124
|
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
reader.readAsArrayBuffer(blob);
|
|
183
|
-
return promise;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
function readBlobAsText(blob) {
|
|
187
|
-
var reader = new FileReader();
|
|
188
|
-
var promise = fileReaderReady(reader);
|
|
189
|
-
reader.readAsText(blob);
|
|
190
|
-
return promise;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
function readArrayBufferAsText(buf) {
|
|
194
|
-
var view = new Uint8Array(buf);
|
|
195
|
-
var chars = new Array(view.length);
|
|
196
|
-
|
|
197
|
-
for (var i = 0; i < view.length; i++) {
|
|
198
|
-
chars[i] = String.fromCharCode(view[i]);
|
|
199
|
-
}
|
|
200
|
-
return chars.join("");
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
function bufferClone(buf) {
|
|
204
|
-
if (buf.slice) {
|
|
205
|
-
return buf.slice(0);
|
|
206
|
-
} else {
|
|
207
|
-
var view = new Uint8Array(buf.byteLength);
|
|
208
|
-
view.set(new Uint8Array(buf));
|
|
209
|
-
return view.buffer;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
function Body() {
|
|
125
|
+
}
|
|
126
|
+
// Body mixin
|
|
127
|
+
export class Body {
|
|
128
|
+
constructor() {
|
|
214
129
|
this.bodyUsed = false;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
)
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
130
|
+
}
|
|
131
|
+
_initBody(body) {
|
|
132
|
+
// Ensure bodyUsed property exists
|
|
133
|
+
this.bodyUsed = this.bodyUsed;
|
|
134
|
+
this._bodyInit = body;
|
|
135
|
+
if (!body) {
|
|
136
|
+
this._noBody = true;
|
|
137
|
+
this._bodyText = '';
|
|
138
|
+
}
|
|
139
|
+
else if (typeof body === 'string') {
|
|
140
|
+
this._bodyText = body;
|
|
141
|
+
}
|
|
142
|
+
else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
|
|
143
|
+
this._bodyBlob = body;
|
|
144
|
+
}
|
|
145
|
+
else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
|
|
146
|
+
this._bodyFormData = body;
|
|
147
|
+
}
|
|
148
|
+
else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
|
149
|
+
this._bodyText = body.toString();
|
|
150
|
+
}
|
|
151
|
+
else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
|
152
|
+
// @ts-ignore
|
|
153
|
+
this._bodyArrayBuffer = bufferClone(body.buffer);
|
|
154
|
+
this._bodyInit = new Blob([this._bodyArrayBuffer]);
|
|
155
|
+
}
|
|
156
|
+
else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
|
|
157
|
+
this._bodyArrayBuffer = bufferClone(body);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
this._bodyText = body = Object.prototype.toString.call(body);
|
|
161
|
+
}
|
|
162
|
+
// Set Content-Type header if not set
|
|
163
|
+
if (!this.headers.get('content-type')) {
|
|
164
|
+
if (typeof body === 'string') {
|
|
165
|
+
this.headers.set('content-type', 'text/plain;charset=UTF-8');
|
|
242
166
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
if (typeof body === "string") {
|
|
246
|
-
this.headers.set("content-type", "text/plain;charset=UTF-8");
|
|
247
|
-
} else if (this._bodyBlob && this._bodyBlob.type) {
|
|
248
|
-
this.headers.set("content-type", this._bodyBlob.type);
|
|
249
|
-
} else if (
|
|
250
|
-
support.searchParams &&
|
|
251
|
-
URLSearchParams.prototype.isPrototypeOf(body)
|
|
252
|
-
) {
|
|
253
|
-
this.headers.set(
|
|
254
|
-
"content-type",
|
|
255
|
-
"application/x-www-form-urlencoded;charset=UTF-8"
|
|
256
|
-
);
|
|
257
|
-
}
|
|
167
|
+
else if (this._bodyBlob && this._bodyBlob.type) {
|
|
168
|
+
this.headers.set('content-type', this._bodyBlob.type);
|
|
258
169
|
}
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
if (this._bodyArrayBuffer) {
|
|
281
|
-
return consumed(this) || Promise.resolve(this._bodyArrayBuffer);
|
|
282
|
-
} else {
|
|
283
|
-
return this.blob().then(readBlobAsArrayBuffer);
|
|
284
|
-
}
|
|
285
|
-
};
|
|
170
|
+
else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
|
171
|
+
this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
blob() {
|
|
176
|
+
const rejected = consumed(this);
|
|
177
|
+
if (rejected) {
|
|
178
|
+
return rejected;
|
|
179
|
+
}
|
|
180
|
+
if (this._bodyBlob) {
|
|
181
|
+
return Promise.resolve(this._bodyBlob);
|
|
182
|
+
}
|
|
183
|
+
else if (this._bodyArrayBuffer) {
|
|
184
|
+
return Promise.resolve(new Blob([this._bodyArrayBuffer]));
|
|
185
|
+
}
|
|
186
|
+
else if (this._bodyFormData) {
|
|
187
|
+
throw new Error('could not read FormData body as blob');
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
return Promise.resolve(new Blob([this._bodyText]));
|
|
286
191
|
}
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
192
|
+
}
|
|
193
|
+
arrayBuffer() {
|
|
194
|
+
if (this._bodyArrayBuffer) {
|
|
195
|
+
const consumedResult = consumed(this);
|
|
196
|
+
if (consumedResult) {
|
|
197
|
+
return consumedResult;
|
|
292
198
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
return Promise.resolve(
|
|
298
|
-
} else if (this._bodyFormData) {
|
|
299
|
-
throw new Error("could not read FormData body as text");
|
|
300
|
-
} else {
|
|
301
|
-
return Promise.resolve(this._bodyText);
|
|
199
|
+
else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {
|
|
200
|
+
return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength));
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
return Promise.resolve(this._bodyArrayBuffer);
|
|
302
204
|
}
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
if (support.formData) {
|
|
306
|
-
this.formData = function () {
|
|
307
|
-
return this.text().then(decode);
|
|
308
|
-
};
|
|
309
205
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
return this.
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
206
|
+
else if (support.blob) {
|
|
207
|
+
// @ts-ignore
|
|
208
|
+
return this.blob().then(readBlobAsArrayBuffer);
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
throw new Error('could not read as ArrayBuffer');
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
text() {
|
|
215
|
+
const rejected = consumed(this);
|
|
216
|
+
if (rejected) {
|
|
217
|
+
return rejected;
|
|
218
|
+
}
|
|
219
|
+
if (this._bodyBlob) {
|
|
220
|
+
return readBlobAsText(this._bodyBlob);
|
|
221
|
+
}
|
|
222
|
+
else if (this._bodyArrayBuffer) {
|
|
223
|
+
return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer));
|
|
224
|
+
}
|
|
225
|
+
else if (this._bodyFormData) {
|
|
226
|
+
throw new Error('could not read FormData body as text');
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
return Promise.resolve(this._bodyText);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
formData() {
|
|
233
|
+
return this.text().then(decode);
|
|
234
|
+
}
|
|
235
|
+
json() {
|
|
236
|
+
return this.text().then(JSON.parse);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// Helper functions for Body
|
|
240
|
+
function consumed(body) {
|
|
241
|
+
if (body._noBody)
|
|
242
|
+
return;
|
|
243
|
+
if (body.bodyUsed) {
|
|
244
|
+
return Promise.reject(new TypeError('Already read'));
|
|
245
|
+
}
|
|
246
|
+
body.bodyUsed = true;
|
|
247
|
+
}
|
|
248
|
+
function fileReaderReady(reader) {
|
|
249
|
+
return new Promise((resolve, reject) => {
|
|
250
|
+
reader.onload = () => resolve(reader.result);
|
|
251
|
+
reader.onerror = () => reject(reader.error);
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
function readBlobAsArrayBuffer(blob) {
|
|
255
|
+
const reader = new FileReader();
|
|
256
|
+
const promise = fileReaderReady(reader);
|
|
257
|
+
reader.readAsArrayBuffer(blob);
|
|
258
|
+
return promise;
|
|
259
|
+
}
|
|
260
|
+
function readBlobAsText(blob) {
|
|
261
|
+
const reader = new FileReader();
|
|
262
|
+
const promise = fileReaderReady(reader);
|
|
263
|
+
const match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);
|
|
264
|
+
const encoding = match ? match[1] : 'utf-8';
|
|
265
|
+
reader.readAsText(blob, encoding);
|
|
266
|
+
return promise;
|
|
267
|
+
}
|
|
268
|
+
function readArrayBufferAsText(buf) {
|
|
269
|
+
const view = new Uint8Array(buf);
|
|
270
|
+
const chars = new Array(view.length);
|
|
271
|
+
for (let i = 0; i < view.length; i++) {
|
|
272
|
+
chars[i] = String.fromCharCode(view[i]);
|
|
273
|
+
}
|
|
274
|
+
return chars.join('');
|
|
275
|
+
}
|
|
276
|
+
function bufferClone(buf) {
|
|
277
|
+
if (buf.slice) {
|
|
278
|
+
return buf.slice(0);
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
const view = new Uint8Array(buf.byteLength);
|
|
282
|
+
view.set(new Uint8Array(buf));
|
|
283
|
+
return view.buffer;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
// HTTP methods whose capitalization should be normalized
|
|
287
|
+
const methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];
|
|
288
|
+
function normalizeMethod(method) {
|
|
289
|
+
const upcased = method.toUpperCase();
|
|
290
|
+
return methods.indexOf(upcased) > -1 ? upcased : method;
|
|
291
|
+
}
|
|
292
|
+
export class Request extends Body {
|
|
293
|
+
constructor(input, options = {}) {
|
|
294
|
+
super();
|
|
295
|
+
let body = options.body;
|
|
330
296
|
if (input instanceof Request) {
|
|
331
297
|
if (input.bodyUsed) {
|
|
332
|
-
throw new TypeError(
|
|
298
|
+
throw new TypeError('Already read');
|
|
333
299
|
}
|
|
334
300
|
this.url = input.url;
|
|
335
301
|
this.credentials = input.credentials;
|
|
@@ -343,197 +309,221 @@
|
|
|
343
309
|
body = input._bodyInit;
|
|
344
310
|
input.bodyUsed = true;
|
|
345
311
|
}
|
|
346
|
-
}
|
|
312
|
+
}
|
|
313
|
+
else {
|
|
347
314
|
this.url = String(input);
|
|
348
315
|
}
|
|
349
|
-
|
|
350
|
-
this.credentials = options.credentials || this.credentials || "same-origin";
|
|
316
|
+
this.credentials = options.credentials || this.credentials || 'same-origin';
|
|
351
317
|
if (options.headers || !this.headers) {
|
|
352
318
|
this.headers = new Headers(options.headers);
|
|
353
319
|
}
|
|
354
|
-
this.method = normalizeMethod(options.method || this.method ||
|
|
320
|
+
this.method = normalizeMethod(options.method || this.method || 'GET');
|
|
355
321
|
this.mode = options.mode || this.mode || null;
|
|
356
|
-
this.signal = options.signal || this.signal;
|
|
322
|
+
this.signal = options.signal || this.signal || ('AbortController' in g ? new AbortController().signal : undefined);
|
|
357
323
|
this.referrer = null;
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
324
|
+
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
|
325
|
+
throw new TypeError('Body not allowed for GET or HEAD requests');
|
|
361
326
|
}
|
|
362
327
|
this._initBody(body);
|
|
328
|
+
if (this.method === 'GET' || this.method === 'HEAD') {
|
|
329
|
+
if (options.cache === 'no-store' || options.cache === 'no-cache') {
|
|
330
|
+
const reParamSearch = /([?&])_=[^&]*/;
|
|
331
|
+
if (reParamSearch.test(this.url)) {
|
|
332
|
+
this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());
|
|
333
|
+
}
|
|
334
|
+
else {
|
|
335
|
+
const reQueryString = /\?/;
|
|
336
|
+
this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
363
340
|
}
|
|
364
|
-
|
|
365
|
-
Request.prototype.clone = function () {
|
|
341
|
+
clone() {
|
|
366
342
|
return new Request(this, { body: this._bodyInit });
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
// Decode URL-encoded form data
|
|
346
|
+
function decode(body) {
|
|
347
|
+
const form = new FormData();
|
|
348
|
+
body
|
|
349
|
+
.trim()
|
|
350
|
+
.split('&')
|
|
351
|
+
.forEach((bytes) => {
|
|
352
|
+
if (bytes) {
|
|
353
|
+
const split = bytes.split('=');
|
|
354
|
+
const name = split.shift().replace(/\+/g, ' ');
|
|
355
|
+
const value = split.join('=').replace(/\+/g, ' ');
|
|
356
|
+
form.append(decodeURIComponent(name), decodeURIComponent(value));
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
return form;
|
|
360
|
+
}
|
|
361
|
+
// Parse raw headers string into Headers
|
|
362
|
+
function parseHeaders(rawHeaders) {
|
|
363
|
+
const headers = new Headers();
|
|
364
|
+
const preProcessed = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
|
|
365
|
+
preProcessed
|
|
366
|
+
.split('\r')
|
|
367
|
+
.map((header) => (header.indexOf('\n') === 0 ? header.substr(1) : header))
|
|
368
|
+
.forEach((line) => {
|
|
369
|
+
const parts = line.split(':');
|
|
370
|
+
const key = parts.shift().trim();
|
|
371
|
+
if (key) {
|
|
372
|
+
const value = parts.join(':').trim();
|
|
373
|
+
try {
|
|
395
374
|
headers.append(key, value);
|
|
396
375
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
Body.call(Request.prototype);
|
|
402
|
-
|
|
403
|
-
function Response(bodyInit, options) {
|
|
404
|
-
if (!options) {
|
|
405
|
-
options = {};
|
|
376
|
+
catch (err) {
|
|
377
|
+
console.warn('Response ' + err.message);
|
|
378
|
+
}
|
|
406
379
|
}
|
|
407
|
-
|
|
408
|
-
|
|
380
|
+
});
|
|
381
|
+
return headers;
|
|
382
|
+
}
|
|
383
|
+
const redirectStatuses = [301, 302, 303, 307, 308];
|
|
384
|
+
export class Response extends Body {
|
|
385
|
+
constructor(bodyInit, options = {}) {
|
|
386
|
+
super();
|
|
387
|
+
this.type = 'default';
|
|
409
388
|
this.status = options.status === undefined ? 200 : options.status;
|
|
389
|
+
if (this.status < 200 || this.status > 599) {
|
|
390
|
+
throw new RangeError(`Failed to construct 'Response': The status provided (${this.status}) is outside the range [200, 599].`);
|
|
391
|
+
}
|
|
410
392
|
this.ok = this.status >= 200 && this.status < 300;
|
|
411
|
-
this.statusText =
|
|
393
|
+
this.statusText = options.statusText === undefined ? '' : String(options.statusText);
|
|
412
394
|
this.headers = new Headers(options.headers);
|
|
413
|
-
this.url = options.url ||
|
|
395
|
+
this.url = options.url || '';
|
|
414
396
|
this._initBody(bodyInit);
|
|
415
397
|
}
|
|
416
|
-
|
|
417
|
-
Body.call(Response.prototype);
|
|
418
|
-
|
|
419
|
-
Response.prototype.clone = function () {
|
|
398
|
+
clone() {
|
|
420
399
|
return new Response(this._bodyInit, {
|
|
421
400
|
status: this.status,
|
|
422
401
|
statusText: this.statusText,
|
|
423
402
|
headers: new Headers(this.headers),
|
|
424
|
-
url: this.url
|
|
403
|
+
url: this.url,
|
|
425
404
|
});
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
response.
|
|
405
|
+
}
|
|
406
|
+
static error() {
|
|
407
|
+
const response = new Response(null, { status: 200, statusText: '' });
|
|
408
|
+
response.ok = false;
|
|
409
|
+
response.status = 0;
|
|
410
|
+
response.type = 'error';
|
|
431
411
|
return response;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
exports.DOMException = function (message, name) {
|
|
412
|
+
}
|
|
413
|
+
static redirect(url, status) {
|
|
414
|
+
if (!redirectStatuses.includes(status)) {
|
|
415
|
+
throw new RangeError('Invalid status code');
|
|
416
|
+
}
|
|
417
|
+
return new Response(null, { status, headers: { location: url } });
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
// DOMException polyfill
|
|
421
|
+
export let DOMException = g.DOMException;
|
|
422
|
+
try {
|
|
423
|
+
new g.DOMException();
|
|
424
|
+
}
|
|
425
|
+
catch (err) {
|
|
426
|
+
DOMException = class {
|
|
427
|
+
constructor(message, name) {
|
|
449
428
|
this.message = message;
|
|
450
429
|
this.name = name;
|
|
451
|
-
|
|
430
|
+
const error = new Error(message);
|
|
452
431
|
this.stack = error.stack;
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
// fetch function
|
|
436
|
+
export function fetch(input, init) {
|
|
437
|
+
return new Promise((resolve, reject) => {
|
|
438
|
+
const request = new Request(input, init);
|
|
439
|
+
if (request.signal && request.signal.aborted) {
|
|
440
|
+
return reject(new DOMException('Aborted', 'AbortError'));
|
|
441
|
+
}
|
|
442
|
+
const xhr = new XMLHttpRequest();
|
|
443
|
+
function abortXhr() {
|
|
444
|
+
xhr.abort();
|
|
445
|
+
}
|
|
446
|
+
xhr.onload = function () {
|
|
447
|
+
const options = {
|
|
448
|
+
statusText: xhr.statusText,
|
|
449
|
+
headers: parseHeaders(xhr.getAllResponseHeaders() || ''),
|
|
450
|
+
};
|
|
451
|
+
// Local file handling
|
|
452
|
+
if (request.url.startsWith('file://') && (xhr.status < 200 || xhr.status > 599)) {
|
|
453
|
+
options.status = 200;
|
|
454
|
+
}
|
|
455
|
+
else {
|
|
456
|
+
options.status = xhr.status;
|
|
457
|
+
}
|
|
458
|
+
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
|
459
|
+
// @ts-ignore
|
|
460
|
+
const body = 'response' in xhr ? xhr.response : xhr.responseText;
|
|
461
|
+
setTimeout(() => resolve(new Response(body, options)), 0);
|
|
453
462
|
};
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
463
|
+
xhr.onerror = function () {
|
|
464
|
+
setTimeout(() => reject(new TypeError('Network request failed')), 0);
|
|
465
|
+
};
|
|
466
|
+
xhr.ontimeout = function () {
|
|
467
|
+
setTimeout(() => reject(new TypeError('Network request timed out')), 0);
|
|
468
|
+
};
|
|
469
|
+
xhr.onabort = function () {
|
|
470
|
+
setTimeout(() => reject(new DOMException('Aborted', 'AbortError')), 0);
|
|
471
|
+
};
|
|
472
|
+
function fixUrl(url) {
|
|
473
|
+
try {
|
|
474
|
+
return url === '' && g.location.href ? g.location.href : url;
|
|
464
475
|
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
function abortXhr() {
|
|
469
|
-
xhr.abort();
|
|
476
|
+
catch (e) {
|
|
477
|
+
return url;
|
|
470
478
|
}
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
var body = "response" in xhr ? xhr.response : xhr.responseText;
|
|
483
|
-
resolve(new Response(body, options));
|
|
484
|
-
};
|
|
485
|
-
|
|
486
|
-
xhr.onerror = function () {
|
|
487
|
-
reject(new TypeError("Network request failed"));
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
xhr.ontimeout = function () {
|
|
491
|
-
reject(new TypeError("Network request failed"));
|
|
492
|
-
};
|
|
493
|
-
|
|
494
|
-
xhr.onabort = function () {
|
|
495
|
-
reject(new exports.DOMException("Aborted", "AbortError"));
|
|
496
|
-
};
|
|
497
|
-
|
|
498
|
-
xhr.open(request.method, request.url, true);
|
|
499
|
-
|
|
500
|
-
if (request.credentials === "include") {
|
|
501
|
-
xhr.withCredentials = true;
|
|
502
|
-
} else if (request.credentials === "omit") {
|
|
503
|
-
xhr.withCredentials = false;
|
|
479
|
+
}
|
|
480
|
+
xhr.open(request.method, fixUrl(request.url), true);
|
|
481
|
+
if (request.credentials === 'include') {
|
|
482
|
+
xhr.withCredentials = true;
|
|
483
|
+
}
|
|
484
|
+
else if (request.credentials === 'omit') {
|
|
485
|
+
xhr.withCredentials = false;
|
|
486
|
+
}
|
|
487
|
+
if ('responseType' in xhr) {
|
|
488
|
+
if (support.blob) {
|
|
489
|
+
xhr.responseType = 'blob';
|
|
504
490
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
xhr.responseType = "blob";
|
|
491
|
+
else if (support.arrayBuffer) {
|
|
492
|
+
xhr.responseType = 'arraybuffer';
|
|
508
493
|
}
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
494
|
+
}
|
|
495
|
+
if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers) && !(g.Headers && init.headers instanceof g.Headers)) {
|
|
496
|
+
const names = [];
|
|
497
|
+
Object.getOwnPropertyNames(init.headers).forEach((name) => {
|
|
498
|
+
names.push(normalizeName(name));
|
|
499
|
+
xhr.setRequestHeader(name, normalizeValue(init.headers[name]));
|
|
512
500
|
});
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
501
|
+
request.headers.forEach((value, name) => {
|
|
502
|
+
if (!names.includes(name)) {
|
|
503
|
+
xhr.setRequestHeader(name, value);
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
request.headers.forEach((value, name) => xhr.setRequestHeader(name, value));
|
|
509
|
+
}
|
|
510
|
+
if (request.signal) {
|
|
511
|
+
request.signal.addEventListener('abort', abortXhr);
|
|
512
|
+
xhr.onreadystatechange = function () {
|
|
513
|
+
if (xhr.readyState === 4) {
|
|
514
|
+
request.signal.removeEventListener('abort', abortXhr);
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
// Attach polyfill to globals
|
|
522
|
+
fetch.polyfill = true;
|
|
523
|
+
if (!g.fetch) {
|
|
524
|
+
g.fetch = fetch;
|
|
525
|
+
g.Headers = Headers;
|
|
526
|
+
g.Request = Request;
|
|
527
|
+
g.Response = Response;
|
|
528
|
+
}
|
|
529
|
+
//# sourceMappingURL=index.js.map
|