@nativescript/core 8.5.2 → 8.5.3-next-05-05-2023-4889747047
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/css/LICENSE +9 -0
- package/css/Readme.md +278 -0
- package/css-value/LICENSE +9 -0
- package/css-value/Readme.md +45 -0
- package/fetch/LICENSE +20 -0
- package/fetch/README.md +1 -0
- package/file-system/file-system-access.android.d.ts +18 -0
- package/file-system/file-system-access.android.js +202 -0
- package/file-system/file-system-access.android.js.map +1 -1
- package/file-system/file-system-access.d.ts +67 -0
- package/file-system/file-system-access.ios.d.ts +9 -0
- package/file-system/file-system-access.ios.js +106 -0
- package/file-system/file-system-access.ios.js.map +1 -1
- package/file-system/index.d.ts +60 -0
- package/file-system/index.js +194 -0
- package/file-system/index.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/js-libs/easysax/LICENSE +20 -0
- package/js-libs/easysax/README.md +46 -0
- package/package.json +1 -1
- package/platforms/README.md +1 -0
- package/platforms/android/widgets-release.aar +0 -0
- package/platforms/ios/TNSWidgets.xcframework/Info.plist +7 -7
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Headers/TNSWidgets.h +1 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Headers/TNSWidgets.h +1 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Resources/Info.plist +4 -4
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Headers/TNSWidgets.h +1 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/Resources/Info.plist +4 -4
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/A/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/TNSWidgets.framework/Versions/Current/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-maccatalyst/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/NSFileHandle+Async.h +22 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Headers/TNSWidgets.h +1 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/Info.plist +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/TNSWidgets +0 -0
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/TNSWidgets.framework/_CodeSignature/CodeResources +14 -3
- package/platforms/ios/TNSWidgets.xcframework/ios-arm64_x86_64-simulator/dSYMs/TNSWidgets.framework.dSYM/Contents/Resources/DWARF/TNSWidgets +0 -0
- package/ui/core/view/index.ios.js +7 -5
- package/ui/core/view/index.ios.js.map +1 -1
- package/ui/layouts/layout-base.ios.js +3 -2
- package/ui/layouts/layout-base.ios.js.map +1 -1
- package/ui/list-view/index.ios.js +15 -14
- package/ui/list-view/index.ios.js.map +1 -1
- package/ui/text-base/formatted-string.d.ts +18 -3
- package/ui/text-base/formatted-string.js +27 -0
- package/ui/text-base/formatted-string.js.map +1 -1
- package/ui/text-base/index.ios.js +27 -18
- package/ui/text-base/index.ios.js.map +1 -1
- package/ui/text-base/span.d.ts +18 -3
- package/ui/text-base/span.js +18 -0
- package/ui/text-base/span.js.map +1 -1
- package/utils/native-helper.ios.js +3 -0
- package/utils/native-helper.ios.js.map +1 -1
package/css/LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/css/Readme.md
ADDED
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
# css [](https://travis-ci.org/reworkcss/css)
|
|
2
|
+
|
|
3
|
+
CSS parser / stringifier.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
$ npm install css
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
var css = require('css');
|
|
13
|
+
var obj = css.parse('body { font-size: 12px; }', options);
|
|
14
|
+
css.stringify(obj, options);
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
### css.parse(code, [options])
|
|
20
|
+
|
|
21
|
+
Accepts a CSS string and returns an AST `object`.
|
|
22
|
+
|
|
23
|
+
`options`:
|
|
24
|
+
|
|
25
|
+
- silent: silently fail on parse errors.
|
|
26
|
+
- source: the path to the file containing `css`. Makes errors and source
|
|
27
|
+
maps more helpful, by letting them know where code comes from.
|
|
28
|
+
|
|
29
|
+
### Example
|
|
30
|
+
|
|
31
|
+
```js
|
|
32
|
+
var ast = css.parse('body { font-size: 12px; }', { source: 'source.css' });
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Errors
|
|
37
|
+
|
|
38
|
+
Errors will have `error.position`, just like [`node.position`](#position). The
|
|
39
|
+
error contains the source position in the message. To get the error message
|
|
40
|
+
without the position use `error.reason`.
|
|
41
|
+
|
|
42
|
+
If you create any errors in plugins such as in
|
|
43
|
+
[rework](https://github.com/reworkcss/rework), you __must__ set the `position`
|
|
44
|
+
as well for consistency.
|
|
45
|
+
|
|
46
|
+
## AST
|
|
47
|
+
|
|
48
|
+
### Common properties
|
|
49
|
+
|
|
50
|
+
All nodes have the following properties.
|
|
51
|
+
|
|
52
|
+
#### position
|
|
53
|
+
|
|
54
|
+
Information about the position in the source string that corresponds to
|
|
55
|
+
the node.
|
|
56
|
+
|
|
57
|
+
`Object`:
|
|
58
|
+
|
|
59
|
+
- start: `Object`:
|
|
60
|
+
- line: `Number`.
|
|
61
|
+
- column: `Number`.
|
|
62
|
+
- end: `Object`:
|
|
63
|
+
- line: `Number`.
|
|
64
|
+
- column: `Number`.
|
|
65
|
+
- source: `String` or `undefined`. The value of `options.source` if passed to
|
|
66
|
+
`css.parse`. Otherwise `undefined`.
|
|
67
|
+
- content: `String`. The full source string passed to `css.parse`.
|
|
68
|
+
|
|
69
|
+
The line and column numbers are 1-based: The first line is 1 and the first
|
|
70
|
+
column of a line is 1 (not 0).
|
|
71
|
+
|
|
72
|
+
The `position` property lets you know from which source file the node comes
|
|
73
|
+
from (if available), what that file contains, and what part of that file was
|
|
74
|
+
parsed into the node.
|
|
75
|
+
|
|
76
|
+
#### type
|
|
77
|
+
|
|
78
|
+
`String`. The possible values are the ones listed in the Types section below.
|
|
79
|
+
|
|
80
|
+
#### parent
|
|
81
|
+
|
|
82
|
+
A reference to the parent node, or `null` if the node has no parent.
|
|
83
|
+
|
|
84
|
+
### Types
|
|
85
|
+
|
|
86
|
+
The available values of `node.type` are listed below, as well as the available
|
|
87
|
+
properties of each node (other than the common properties listed above.)
|
|
88
|
+
|
|
89
|
+
#### stylesheet
|
|
90
|
+
|
|
91
|
+
The root node returned by `css.parse`.
|
|
92
|
+
|
|
93
|
+
- stylesheet: `Object`:
|
|
94
|
+
- rules: `Array` of nodes with the types `rule`, `comment` and any of the
|
|
95
|
+
at-rule types.
|
|
96
|
+
|
|
97
|
+
#### rule
|
|
98
|
+
|
|
99
|
+
- selectors: `Array` of `String`s. The list of selectors of the rule, split
|
|
100
|
+
on commas. Each selector is trimmed from whitespace and comments.
|
|
101
|
+
- declarations: `Array` of nodes with the types `declaration` and `comment`.
|
|
102
|
+
|
|
103
|
+
#### declaration
|
|
104
|
+
|
|
105
|
+
- property: `String`. The property name, trimmed from whitespace and
|
|
106
|
+
comments. May not be empty.
|
|
107
|
+
- value: `String`. The value of the property, trimmed from whitespace and
|
|
108
|
+
comments. Empty values are allowed.
|
|
109
|
+
|
|
110
|
+
#### comment
|
|
111
|
+
|
|
112
|
+
A rule-level or declaration-level comment. Comments inside selectors,
|
|
113
|
+
properties and values etc. are lost.
|
|
114
|
+
|
|
115
|
+
- comment: `String`. The part between the starting `/*` and the ending `*/`
|
|
116
|
+
of the comment, including whitespace.
|
|
117
|
+
|
|
118
|
+
#### charset
|
|
119
|
+
|
|
120
|
+
The `@charset` at-rule.
|
|
121
|
+
|
|
122
|
+
- charset: `String`. The part following `@charset `.
|
|
123
|
+
|
|
124
|
+
#### custom-media
|
|
125
|
+
|
|
126
|
+
The `@custom-media` at-rule.
|
|
127
|
+
|
|
128
|
+
- name: `String`. The `--`-prefixed name.
|
|
129
|
+
- media: `String`. The part following the name.
|
|
130
|
+
|
|
131
|
+
#### document
|
|
132
|
+
|
|
133
|
+
The `@document` at-rule.
|
|
134
|
+
|
|
135
|
+
- document: `String`. The part following `@document `.
|
|
136
|
+
- vendor: `String` or `undefined`. The vendor prefix in `@document`, or
|
|
137
|
+
`undefined` if there is none.
|
|
138
|
+
- rules: `Array` of nodes with the types `rule`, `comment` and any of the
|
|
139
|
+
at-rule types.
|
|
140
|
+
|
|
141
|
+
#### font-face
|
|
142
|
+
|
|
143
|
+
The `@font-face` at-rule.
|
|
144
|
+
|
|
145
|
+
- declarations: `Array` of nodes with the types `declaration` and `comment`.
|
|
146
|
+
|
|
147
|
+
#### host
|
|
148
|
+
|
|
149
|
+
The `@host` at-rule.
|
|
150
|
+
|
|
151
|
+
- rules: `Array` of nodes with the types `rule`, `comment` and any of the
|
|
152
|
+
at-rule types.
|
|
153
|
+
|
|
154
|
+
#### import
|
|
155
|
+
|
|
156
|
+
The `@import` at-rule.
|
|
157
|
+
|
|
158
|
+
- import: `String`. The part following `@import `.
|
|
159
|
+
|
|
160
|
+
#### keyframes
|
|
161
|
+
|
|
162
|
+
The `@keyframes` at-rule.
|
|
163
|
+
|
|
164
|
+
- name: `String`. The name of the keyframes rule.
|
|
165
|
+
- vendor: `String` or `undefined`. The vendor prefix in `@keyframes`, or
|
|
166
|
+
`undefined` if there is none.
|
|
167
|
+
- keyframes: `Array` of nodes with the types `keyframe` and `comment`.
|
|
168
|
+
|
|
169
|
+
#### keyframe
|
|
170
|
+
|
|
171
|
+
- values: `Array` of `String`s. The list of “selectors” of the keyframe rule,
|
|
172
|
+
split on commas. Each “selector” is trimmed from whitespace.
|
|
173
|
+
- declarations: `Array` of nodes with the types `declaration` and `comment`.
|
|
174
|
+
|
|
175
|
+
#### media
|
|
176
|
+
|
|
177
|
+
The `@media` at-rule.
|
|
178
|
+
|
|
179
|
+
- media: `String`. The part following `@media `.
|
|
180
|
+
- rules: `Array` of nodes with the types `rule`, `comment` and any of the
|
|
181
|
+
at-rule types.
|
|
182
|
+
|
|
183
|
+
#### namespace
|
|
184
|
+
|
|
185
|
+
The `@namespace` at-rule.
|
|
186
|
+
|
|
187
|
+
- namespace: `String`. The part following `@namespace `.
|
|
188
|
+
|
|
189
|
+
#### page
|
|
190
|
+
|
|
191
|
+
The `@page` at-rule.
|
|
192
|
+
|
|
193
|
+
- selectors: `Array` of `String`s. The list of selectors of the rule, split
|
|
194
|
+
on commas. Each selector is trimmed from whitespace and comments.
|
|
195
|
+
- declarations: `Array` of nodes with the types `declaration` and `comment`.
|
|
196
|
+
|
|
197
|
+
#### supports
|
|
198
|
+
|
|
199
|
+
The `@supports` at-rule.
|
|
200
|
+
|
|
201
|
+
- supports: `String`. The part following `@supports `.
|
|
202
|
+
- rules: `Array` of nodes with the types `rule`, `comment` and any of the
|
|
203
|
+
at-rule types.
|
|
204
|
+
|
|
205
|
+
### Example
|
|
206
|
+
|
|
207
|
+
CSS:
|
|
208
|
+
|
|
209
|
+
```css
|
|
210
|
+
body {
|
|
211
|
+
background: #eee;
|
|
212
|
+
color: #888;
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Parse tree:
|
|
217
|
+
|
|
218
|
+
```json
|
|
219
|
+
{
|
|
220
|
+
"type": "stylesheet",
|
|
221
|
+
"stylesheet": {
|
|
222
|
+
"rules": [
|
|
223
|
+
{
|
|
224
|
+
"type": "rule",
|
|
225
|
+
"selectors": [
|
|
226
|
+
"body"
|
|
227
|
+
],
|
|
228
|
+
"declarations": [
|
|
229
|
+
{
|
|
230
|
+
"type": "declaration",
|
|
231
|
+
"property": "background",
|
|
232
|
+
"value": "#eee",
|
|
233
|
+
"position": {
|
|
234
|
+
"start": {
|
|
235
|
+
"line": 2,
|
|
236
|
+
"column": 3
|
|
237
|
+
},
|
|
238
|
+
"end": {
|
|
239
|
+
"line": 2,
|
|
240
|
+
"column": 19
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"type": "declaration",
|
|
246
|
+
"property": "color",
|
|
247
|
+
"value": "#888",
|
|
248
|
+
"position": {
|
|
249
|
+
"start": {
|
|
250
|
+
"line": 3,
|
|
251
|
+
"column": 3
|
|
252
|
+
},
|
|
253
|
+
"end": {
|
|
254
|
+
"line": 3,
|
|
255
|
+
"column": 14
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
"position": {
|
|
261
|
+
"start": {
|
|
262
|
+
"line": 1,
|
|
263
|
+
"column": 1
|
|
264
|
+
},
|
|
265
|
+
"end": {
|
|
266
|
+
"line": 4,
|
|
267
|
+
"column": 2
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
]
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
## License
|
|
277
|
+
|
|
278
|
+
MIT
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2013 TJ Holowaychuk <tj@vision-media.ca>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
# css-value
|
|
3
|
+
|
|
4
|
+
WIP CSS value parser
|
|
5
|
+
|
|
6
|
+
## Example
|
|
7
|
+
|
|
8
|
+
The CSS value string "1px 0 0 5% .5px .10 1.5" yields:
|
|
9
|
+
|
|
10
|
+
```js
|
|
11
|
+
[
|
|
12
|
+
{ type: 'number', string: '1px', unit: 'px', value: 1 },
|
|
13
|
+
{ type: 'number', string: '0', unit: '', value: 0 },
|
|
14
|
+
{ type: 'number', string: '0', unit: '', value: 0 },
|
|
15
|
+
{ type: 'number', string: '5%', unit: '%', value: 5 },
|
|
16
|
+
{ type: 'number', string: '.5px', unit: 'px', value: .5 },
|
|
17
|
+
{ type: 'number', string: '.10', unit: '', value: .1 },
|
|
18
|
+
{ type: 'number', string: '1.5', unit: '', value: 1.5 }
|
|
19
|
+
]
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## License
|
|
23
|
+
|
|
24
|
+
(The MIT License)
|
|
25
|
+
|
|
26
|
+
Copyright (c) 2013 TJ Holowaychuk <tj@vision-media.ca>
|
|
27
|
+
|
|
28
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
29
|
+
a copy of this software and associated documentation files (the
|
|
30
|
+
'Software'), to deal in the Software without restriction, including
|
|
31
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
32
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
33
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
34
|
+
the following conditions:
|
|
35
|
+
|
|
36
|
+
The above copyright notice and this permission notice shall be
|
|
37
|
+
included in all copies or substantial portions of the Software.
|
|
38
|
+
|
|
39
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
40
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
41
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
42
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
43
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
44
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
45
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/fetch/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright (c) 2014-2016 GitHub, Inc.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/fetch/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Implementation of [fetch API](https://fetch.spec.whatwg.org/). Modified version of https://github.com/github/fetch.
|
|
@@ -47,6 +47,12 @@ export declare class FileSystemAccess implements IFileSystemAccess {
|
|
|
47
47
|
readAsync(path: string): Promise<number[]>;
|
|
48
48
|
readSync(path: string, onError?: (error: any) => any): any;
|
|
49
49
|
static getBuffer(buffer: ArrayBuffer | Uint8Array | Uint8ClampedArray): any;
|
|
50
|
+
appendBuffer: any;
|
|
51
|
+
appendBufferAsync(path: string, buffer: ArrayBuffer | Uint8Array | Uint8ClampedArray): Promise<void>;
|
|
52
|
+
appendBufferSync(path: string, buffer: ArrayBuffer | Uint8Array | Uint8ClampedArray, onError?: (error: any) => any): void;
|
|
53
|
+
append: any;
|
|
54
|
+
appendAsync(path: string, bytes: androidNative.Array<number>): Promise<void>;
|
|
55
|
+
appendSync(path: string, bytes: androidNative.Array<number>, onError?: (error: any) => any): void;
|
|
50
56
|
writeBuffer: any;
|
|
51
57
|
writeBufferAsync(path: string, buffer: ArrayBuffer | Uint8Array | Uint8ClampedArray): Promise<void>;
|
|
52
58
|
writeBufferSync(path: string, buffer: ArrayBuffer | Uint8Array | Uint8ClampedArray, onError?: (error: any) => any): void;
|
|
@@ -57,6 +63,9 @@ export declare class FileSystemAccess implements IFileSystemAccess {
|
|
|
57
63
|
readTextAsync(path: string, encoding?: any): Promise<string>;
|
|
58
64
|
readTextSync(path: string, onError?: (error: any) => any, encoding?: any): string;
|
|
59
65
|
private static _removeUtf8Bom;
|
|
66
|
+
appendText: any;
|
|
67
|
+
appendTextAsync(path: string, content: string, encoding?: any): Promise<void>;
|
|
68
|
+
appendTextSync(path: string, content: string, onError?: (error: any) => any, encoding?: any): void;
|
|
60
69
|
writeText: any;
|
|
61
70
|
writeTextAsync(path: string, content: string, encoding?: any): Promise<void>;
|
|
62
71
|
writeTextSync(path: string, content: string, onError?: (error: any) => any, encoding?: any): void;
|
|
@@ -107,6 +116,15 @@ export declare class FileSystemAccess29 extends FileSystemAccess {
|
|
|
107
116
|
getTempFolderPath(): string;
|
|
108
117
|
getLogicalRootPath(): string;
|
|
109
118
|
getCurrentAppPath(): string;
|
|
119
|
+
appendBuffer: any;
|
|
120
|
+
appendBufferAsync(path: string, content: any): Promise<void>;
|
|
121
|
+
appendBufferSync(path: string, content: any, onError?: (error: any) => any): void;
|
|
122
|
+
append: any;
|
|
123
|
+
appendAsync(path: string, content: any): Promise<void>;
|
|
124
|
+
appendSync(path: string, content: any, onError?: (error: any) => any): void;
|
|
125
|
+
appendText: any;
|
|
126
|
+
appendTextAsync(path: string, content: string, encoding?: any): Promise<void>;
|
|
127
|
+
appendTextSync(path: string, content: string, onError?: (error: any) => any, encoding?: any): void;
|
|
110
128
|
readText: any;
|
|
111
129
|
readTextAsync(path: string, encoding?: any): Promise<string>;
|
|
112
130
|
readTextSync(path: string, onError?: (error: any) => any, encoding?: any): string;
|
|
@@ -24,9 +24,12 @@ export class FileSystemAccess {
|
|
|
24
24
|
this.copy = this.copySync.bind(this);
|
|
25
25
|
this.readBuffer = this.readBufferSync.bind(this);
|
|
26
26
|
this.read = this.readSync.bind(this);
|
|
27
|
+
this.appendBuffer = this.appendBufferSync.bind(this);
|
|
28
|
+
this.append = this.appendSync.bind(this);
|
|
27
29
|
this.writeBuffer = this.writeBufferSync.bind(this);
|
|
28
30
|
this.write = this.writeSync.bind(this);
|
|
29
31
|
this.readText = this.readTextSync.bind(this);
|
|
32
|
+
this.appendText = this.appendTextSync.bind(this);
|
|
30
33
|
this.writeText = this.writeTextSync.bind(this);
|
|
31
34
|
}
|
|
32
35
|
getLastModified(path) {
|
|
@@ -310,6 +313,67 @@ export class FileSystemAccess {
|
|
|
310
313
|
return buffer?.buffer?.nativeObject || buffer;
|
|
311
314
|
}
|
|
312
315
|
}
|
|
316
|
+
appendBufferAsync(path, buffer) {
|
|
317
|
+
return new Promise((resolve, reject) => {
|
|
318
|
+
try {
|
|
319
|
+
org.nativescript.widgets.Async.File.appendBuffer(path, FileSystemAccess.getBuffer(buffer), new org.nativescript.widgets.Async.CompleteCallback({
|
|
320
|
+
onComplete: () => {
|
|
321
|
+
resolve();
|
|
322
|
+
},
|
|
323
|
+
onError: (err) => {
|
|
324
|
+
reject(new Error(err));
|
|
325
|
+
},
|
|
326
|
+
}), null);
|
|
327
|
+
}
|
|
328
|
+
catch (ex) {
|
|
329
|
+
reject(ex);
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
appendBufferSync(path, buffer, onError) {
|
|
334
|
+
try {
|
|
335
|
+
const javaFile = new java.io.File(path);
|
|
336
|
+
const stream = new java.io.FileOutputStream(javaFile);
|
|
337
|
+
const channel = stream.getChannel();
|
|
338
|
+
channel.write(FileSystemAccess.getBuffer(buffer));
|
|
339
|
+
stream.close();
|
|
340
|
+
}
|
|
341
|
+
catch (exception) {
|
|
342
|
+
if (onError) {
|
|
343
|
+
onError(exception);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
appendAsync(path, bytes) {
|
|
348
|
+
return new Promise((resolve, reject) => {
|
|
349
|
+
try {
|
|
350
|
+
org.nativescript.widgets.Async.File.append(path, bytes, new org.nativescript.widgets.Async.CompleteCallback({
|
|
351
|
+
onComplete: () => {
|
|
352
|
+
resolve();
|
|
353
|
+
},
|
|
354
|
+
onError: (err) => {
|
|
355
|
+
reject(new Error(err));
|
|
356
|
+
},
|
|
357
|
+
}), null);
|
|
358
|
+
}
|
|
359
|
+
catch (ex) {
|
|
360
|
+
reject(ex);
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
appendSync(path, bytes, onError) {
|
|
365
|
+
try {
|
|
366
|
+
const javaFile = new java.io.File(path);
|
|
367
|
+
const stream = new java.io.FileOutputStream(javaFile, true);
|
|
368
|
+
stream.write(bytes, 0, bytes.length);
|
|
369
|
+
stream.close();
|
|
370
|
+
}
|
|
371
|
+
catch (exception) {
|
|
372
|
+
if (onError) {
|
|
373
|
+
onError(exception);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
313
377
|
writeBufferAsync(path, buffer) {
|
|
314
378
|
return new Promise((resolve, reject) => {
|
|
315
379
|
try {
|
|
@@ -442,6 +506,45 @@ export class FileSystemAccess {
|
|
|
442
506
|
}
|
|
443
507
|
return s;
|
|
444
508
|
}
|
|
509
|
+
appendTextAsync(path, content, encoding) {
|
|
510
|
+
let actualEncoding = encoding;
|
|
511
|
+
if (!actualEncoding) {
|
|
512
|
+
actualEncoding = textModule.encoding.UTF_8;
|
|
513
|
+
}
|
|
514
|
+
return new Promise((resolve, reject) => {
|
|
515
|
+
try {
|
|
516
|
+
org.nativescript.widgets.Async.File.appendText(path, content, actualEncoding, new org.nativescript.widgets.Async.CompleteCallback({
|
|
517
|
+
onComplete: () => {
|
|
518
|
+
resolve();
|
|
519
|
+
},
|
|
520
|
+
onError: (err) => {
|
|
521
|
+
reject(new Error(err));
|
|
522
|
+
},
|
|
523
|
+
}), null);
|
|
524
|
+
}
|
|
525
|
+
catch (ex) {
|
|
526
|
+
reject(ex);
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
appendTextSync(path, content, onError, encoding) {
|
|
531
|
+
try {
|
|
532
|
+
const javaFile = new java.io.File(path);
|
|
533
|
+
const stream = new java.io.FileOutputStream(javaFile, true);
|
|
534
|
+
let actualEncoding = encoding;
|
|
535
|
+
if (!actualEncoding) {
|
|
536
|
+
actualEncoding = textModule.encoding.UTF_8;
|
|
537
|
+
}
|
|
538
|
+
const writer = new java.io.OutputStreamWriter(stream, actualEncoding);
|
|
539
|
+
writer.write(content);
|
|
540
|
+
writer.close();
|
|
541
|
+
}
|
|
542
|
+
catch (exception) {
|
|
543
|
+
if (onError) {
|
|
544
|
+
onError(exception);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
445
548
|
writeTextAsync(path, content, encoding) {
|
|
446
549
|
let actualEncoding = encoding;
|
|
447
550
|
if (!actualEncoding) {
|
|
@@ -615,6 +718,9 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
615
718
|
constructor() {
|
|
616
719
|
super(...arguments);
|
|
617
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);
|
|
618
724
|
this.readText = this.readTextSync.bind(this);
|
|
619
725
|
this.readBuffer = this.readBufferSync.bind(this);
|
|
620
726
|
this.read = this.readSync.bind(this);
|
|
@@ -753,6 +859,102 @@ export class FileSystemAccess29 extends FileSystemAccess {
|
|
|
753
859
|
getCurrentAppPath() {
|
|
754
860
|
return super.getCurrentAppPath();
|
|
755
861
|
}
|
|
862
|
+
appendBufferAsync(path, content) {
|
|
863
|
+
if (isContentUri(path)) {
|
|
864
|
+
return new Promise((resolve, reject) => {
|
|
865
|
+
getOrSetHelper(path).appendBuffer(applicationContext, FileSystemAccess.getBuffer(content), new org.nativescript.widgets.FileHelper.Callback({
|
|
866
|
+
onSuccess(result) {
|
|
867
|
+
resolve();
|
|
868
|
+
},
|
|
869
|
+
onError(error) {
|
|
870
|
+
reject(error);
|
|
871
|
+
},
|
|
872
|
+
}));
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
return super.appendAsync(path, content);
|
|
876
|
+
}
|
|
877
|
+
appendBufferSync(path, content, onError) {
|
|
878
|
+
if (isContentUri(path)) {
|
|
879
|
+
let callback = null;
|
|
880
|
+
if (typeof onError === 'function') {
|
|
881
|
+
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
882
|
+
onSuccess(result) { },
|
|
883
|
+
onError(error) {
|
|
884
|
+
onError(error);
|
|
885
|
+
},
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
getOrSetHelper(path).appendSync(applicationContext, FileSystemAccess.getBuffer(content), callback);
|
|
889
|
+
}
|
|
890
|
+
else {
|
|
891
|
+
super.appendSync(path, content, onError);
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
appendAsync(path, content) {
|
|
895
|
+
if (isContentUri(path)) {
|
|
896
|
+
return new Promise((resolve, reject) => {
|
|
897
|
+
getOrSetHelper(path).append(applicationContext, content, new org.nativescript.widgets.FileHelper.Callback({
|
|
898
|
+
onSuccess(result) {
|
|
899
|
+
resolve();
|
|
900
|
+
},
|
|
901
|
+
onError(error) {
|
|
902
|
+
reject(error);
|
|
903
|
+
},
|
|
904
|
+
}));
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
return super.appendAsync(path, content);
|
|
908
|
+
}
|
|
909
|
+
appendSync(path, content, onError) {
|
|
910
|
+
if (isContentUri(path)) {
|
|
911
|
+
let callback = null;
|
|
912
|
+
if (typeof onError === 'function') {
|
|
913
|
+
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
914
|
+
onSuccess(result) { },
|
|
915
|
+
onError(error) {
|
|
916
|
+
onError(error);
|
|
917
|
+
},
|
|
918
|
+
});
|
|
919
|
+
}
|
|
920
|
+
getOrSetHelper(path).appendSync(applicationContext, content, callback);
|
|
921
|
+
}
|
|
922
|
+
else {
|
|
923
|
+
super.appendSync(path, content, onError);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
appendTextAsync(path, content, encoding) {
|
|
927
|
+
if (isContentUri(path)) {
|
|
928
|
+
return new Promise((resolve, reject) => {
|
|
929
|
+
getOrSetHelper(path).appendText(applicationContext, content, encoding ?? null, new org.nativescript.widgets.FileHelper.Callback({
|
|
930
|
+
onSuccess(result) {
|
|
931
|
+
resolve();
|
|
932
|
+
},
|
|
933
|
+
onError(error) {
|
|
934
|
+
reject(error);
|
|
935
|
+
},
|
|
936
|
+
}));
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
return super.appendTextAsync(path, content, encoding);
|
|
940
|
+
}
|
|
941
|
+
appendTextSync(path, content, onError, encoding) {
|
|
942
|
+
if (isContentUri(path)) {
|
|
943
|
+
let callback = null;
|
|
944
|
+
if (typeof onError === 'function') {
|
|
945
|
+
callback = new org.nativescript.widgets.FileHelper.Callback({
|
|
946
|
+
onSuccess(result) { },
|
|
947
|
+
onError(error) {
|
|
948
|
+
onError(error);
|
|
949
|
+
},
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
getOrSetHelper(path).appendTextSync(applicationContext, content, encoding ?? null, callback);
|
|
953
|
+
}
|
|
954
|
+
else {
|
|
955
|
+
super.appendTextSync(path, content, onError);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
756
958
|
readTextAsync(path, encoding) {
|
|
757
959
|
if (isContentUri(path)) {
|
|
758
960
|
return new Promise((resolve, reject) => {
|