@variousjs/various 0.6.1 → 1.1.0
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/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/{types/index.d.ts → index.d.ts} +22 -17
- package/package.json +7 -7
- package/dist/core.js.LICENSE.txt +0 -8
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
declare module '@variousjs/various' {
|
|
2
2
|
import { ComponentType } from 'react'
|
|
3
3
|
|
|
4
|
-
type $dispatch = (type: string, method: string, value?: any) =>
|
|
4
|
+
type $dispatch = (type: string, method: string, value?: any) => Promise<any>
|
|
5
5
|
type $render = (params: {
|
|
6
6
|
name: string,
|
|
7
7
|
url?: string,
|
|
8
8
|
module?: string,
|
|
9
|
-
props?:
|
|
9
|
+
props?: Record<string, any>,
|
|
10
10
|
target: Element | null,
|
|
11
11
|
onMounted?: () => void,
|
|
12
12
|
}) => () => void
|
|
13
13
|
type $preload = (names: string[]) => Promise<void>
|
|
14
14
|
type $postMessage = (name: string, value?: any) => void
|
|
15
15
|
type $getMountedComponents = () => string[]
|
|
16
|
+
type $t = (key: string, defaultText?: string) => string | undefined
|
|
16
17
|
|
|
17
18
|
export { default as Store, Connect, Dispatch } from 'nycticorax'
|
|
18
19
|
|
|
@@ -24,12 +25,13 @@ declare module '@variousjs/various' {
|
|
|
24
25
|
$preload: $preload,
|
|
25
26
|
$postMessage: $postMessage,
|
|
26
27
|
$getMountedComponents: $getMountedComponents,
|
|
28
|
+
$t: $t,
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export interface ErrorProps {
|
|
30
|
-
reload?: () => void,
|
|
31
|
-
type: 'LOADING_ERROR' | 'DEPENDENCIES_LOADING_ERROR' | 'NOT_DEFINED' | 'INVALID_COMPONENT' | 'SCRIPT_ERROR' | 'CONTAINER_ERROR',
|
|
32
|
-
message?: string,
|
|
32
|
+
$reload?: () => void,
|
|
33
|
+
$type: 'LOADING_ERROR' | 'DEPENDENCIES_LOADING_ERROR' | 'NOT_DEFINED' | 'INVALID_COMPONENT' | 'SCRIPT_ERROR' | 'CONTAINER_ERROR',
|
|
34
|
+
$message?: string,
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
export interface ContainerProps<C = {}> {
|
|
@@ -40,18 +42,21 @@ declare module '@variousjs/various' {
|
|
|
40
42
|
}>,
|
|
41
43
|
}
|
|
42
44
|
|
|
43
|
-
type
|
|
44
|
-
getStore: () =>
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
type Dispatch<T> = (
|
|
46
|
+
nycticorax: { getStore: () => T, emit: (next: Partial<T>) => void },
|
|
47
|
+
params: { value?: any, trigger: string },
|
|
48
|
+
) => Promise<any>
|
|
47
49
|
|
|
48
|
-
export type Actions<S = {}> =
|
|
49
|
-
[name: string]: (store: Store<S>, ...args: any[]) => unknown,
|
|
50
|
-
}
|
|
50
|
+
export type Actions<S = {}> = Record<string, Dispatch<S>>
|
|
51
51
|
|
|
52
|
-
export type
|
|
53
|
-
type: string,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}) =>
|
|
52
|
+
export type MessageInvoker = (
|
|
53
|
+
message: { type: string, name: string, value?: any },
|
|
54
|
+
) => any
|
|
55
|
+
|
|
56
|
+
export type Invoker = (params: { trigger: string, value?: any }) => any
|
|
57
|
+
|
|
58
|
+
export type Ii8n = () => {
|
|
59
|
+
localeKey: string,
|
|
60
|
+
resources: Record<string, Record<string, string>>,
|
|
61
|
+
}
|
|
57
62
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@variousjs/various",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "RequireJS(AMD) + React",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
|
-
"
|
|
7
|
+
"index.d.ts"
|
|
8
8
|
],
|
|
9
9
|
"unpkg": "dist/index.js",
|
|
10
10
|
"publishConfig": {
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
},
|
|
13
13
|
"nyc": {
|
|
14
14
|
"exclude": [
|
|
15
|
-
"
|
|
15
|
+
"examples/*"
|
|
16
16
|
],
|
|
17
17
|
"excludeAfterRemap": true
|
|
18
18
|
},
|
|
19
|
-
"types": "
|
|
19
|
+
"types": "index.d.ts",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"lint": "tsc --noemit && eslint . --ext .ts,.tsx,.js",
|
|
22
|
+
"prestart": "mkdir -p demo/dist && cp demo/empty.js demo/dist/empty.js",
|
|
22
23
|
"start": "webpack --config webpack/components.js --progress & webpack serve --config webpack/index.js --progress",
|
|
23
24
|
"prebuild": "npm run lint",
|
|
24
|
-
"build": "NODE_ENV=production webpack --
|
|
25
|
-
"postbuild": "cp -R dist/ docs/dist/",
|
|
25
|
+
"build": "NODE_ENV=production webpack --config webpack/index.js --progress",
|
|
26
26
|
"cy:run": "cypress run",
|
|
27
27
|
"ci": "start-server-and-test start http://127.0.0.1:2333 cy:run",
|
|
28
28
|
"cypress": "cypress open"
|
|
@@ -73,6 +73,6 @@
|
|
|
73
73
|
"webpack-dev-server": "^4.7.3"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"nycticorax": "^
|
|
76
|
+
"nycticorax": "^3.0.3"
|
|
77
77
|
}
|
|
78
78
|
}
|
package/dist/core.js.LICENSE.txt
DELETED