next-box 2.1.97 → 2.1.99
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/README.md +10 -4
- package/app/types/state.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
Библиотека для разработки расширений, компонентов и работы с данными на платформе [NextBox](https://next-box.ru/).
|
|
2
2
|
|
|
3
|
-
####
|
|
3
|
+
#### NPM Установка
|
|
4
4
|
|
|
5
5
|
```
|
|
6
6
|
npm install next-box
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
####
|
|
9
|
+
#### CDN Установка
|
|
10
10
|
|
|
11
11
|
```html
|
|
12
12
|
<script src="
|
|
@@ -14,6 +14,8 @@ https://cdn.jsdelivr.net/npm/next-box@latest/index.min.js
|
|
|
14
14
|
"></script>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
#### Простой пример использования
|
|
18
|
+
|
|
17
19
|
```javascript
|
|
18
20
|
import { NextBox, StorageApi, Transport } from 'next-box';
|
|
19
21
|
|
|
@@ -23,7 +25,11 @@ nb.init((state) => {
|
|
|
23
25
|
const api = new StorageApi(state);
|
|
24
26
|
...
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
api.download()
|
|
29
|
+
.then((response) => response.json())
|
|
30
|
+
.then((result) => {
|
|
31
|
+
...
|
|
32
|
+
})
|
|
27
33
|
});
|
|
28
34
|
```
|
|
29
35
|
|
package/app/types/state.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExtensionType, FileInfo, Lang } from './base';
|
|
2
2
|
import { SettingValue } from './setting';
|
|
3
3
|
import { StorageRoot } from './storage-element';
|
|
4
|
+
import { User } from './user';
|
|
4
5
|
export declare enum ViewState {
|
|
5
6
|
view = "view",
|
|
6
7
|
edit = "edit"
|
|
@@ -21,6 +22,7 @@ export interface AppState {
|
|
|
21
22
|
[key: string]: any;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
25
|
+
user?: User;
|
|
24
26
|
debug: boolean;
|
|
25
27
|
view: ViewState;
|
|
26
28
|
brouserURL: string;
|