@variousjs/various 5.1.1 → 5.1.3

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/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@variousjs/various",
3
- "version": "5.1.1",
3
+ "version": "5.1.3",
4
4
  "description": "RequireJS(AMD) + React",
5
5
  "files": [
6
6
  "dist",
7
- "index.d.ts"
7
+ "index.d.ts",
8
+ "standalone.d.ts"
8
9
  ],
9
10
  "exports": {
10
11
  ".": {
@@ -0,0 +1,43 @@
1
+ declare module '@variousjs/various/standalone' {
2
+ import { ComponentType, RefObject } from 'react'
3
+ import {
4
+ VariousComponentType,
5
+ ObjectRecord,
6
+ ModuleDefined,
7
+ FallbackNode,
8
+ ErrorFallbackNode,
9
+ } from '@variousjs/various'
10
+
11
+ export type DependencyType = string | object | Function
12
+
13
+ export function createComponent<P extends object = ObjectRecord>(
14
+ config: ModuleDefined & {
15
+ url: string,
16
+ type?: VariousComponentType,
17
+ dependencies?: Partial<Record<
18
+ string,
19
+ DependencyType
20
+ >>,
21
+ storeKeys?: string[],
22
+ },
23
+ ): ComponentType<P & {
24
+ /**
25
+ * for React Component only
26
+ */
27
+ $ref?: RefObject<unknown>,
28
+ }> & {
29
+ dispatch: (next: Record<string, any>) => void,
30
+ }
31
+
32
+ export function createConfig(
33
+ config: {
34
+ baseDependencies: Partial<Record<
35
+ string,
36
+ DependencyType
37
+ >>,
38
+ store?: Record<string, any>,
39
+ fallback?: FallbackNode<any>,
40
+ errorFallback?: ErrorFallbackNode<any>,
41
+ },
42
+ ): void
43
+ }