what-framework 0.6.1 → 0.6.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/compiler.d.ts +1 -0
- package/dist/compiler.js +3 -0
- package/dist/compiler.js.map +7 -0
- package/dist/compiler.min.js +2 -0
- package/dist/compiler.min.js.map +7 -0
- package/hooks.d.ts +25 -0
- package/jsx-runtime.d.ts +2 -0
- package/package.json +26 -7
- package/react-compat.d.ts +54 -0
- package/src/compiler.js +4 -0
- package/src/hooks.js +1 -0
- package/src/react-compat.js +1 -0
package/compiler.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'what-core/compiler';
|
package/dist/compiler.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/compiler.js"],
|
|
4
|
+
"sourcesContent": ["// What Framework - Compiler Runtime Internals\n// Re-exports from what-core/compiler for generated code.\n\nexport * from 'what-core/compiler';\n"],
|
|
5
|
+
"mappings": ";AAGA,cAAc;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/compiler.js"],
|
|
4
|
+
"sourcesContent": ["// What Framework - Compiler Runtime Internals\n// Re-exports from what-core/compiler for generated code.\n\nexport * from 'what-core/compiler';\n"],
|
|
5
|
+
"mappings": "AAGA,WAAc",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/hooks.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// What Framework - Hooks Type Definitions
|
|
2
|
+
|
|
3
|
+
import { Signal } from './index';
|
|
4
|
+
|
|
5
|
+
export function useState<T>(initial: T | (() => T)): [Signal<T>, (value: T | ((prev: T) => T)) => void];
|
|
6
|
+
export function useSignal<T>(initial: T): Signal<T>;
|
|
7
|
+
export function useComputed<T>(fn: () => T): Signal<T>;
|
|
8
|
+
export function useEffect(fn: () => void | (() => void), deps?: any[]): void;
|
|
9
|
+
export function useMemo<T>(fn: () => T, deps?: any[]): T;
|
|
10
|
+
export function useCallback<T extends (...args: any[]) => any>(fn: T, deps?: any[]): T;
|
|
11
|
+
export function useRef<T>(initial?: T): { current: T };
|
|
12
|
+
export function useContext<T>(context: { _defaultValue: T }): T;
|
|
13
|
+
export function createContext<T>(defaultValue?: T): { _defaultValue: T; Provider: (props: { value: T; children: any }) => any };
|
|
14
|
+
export function useReducer<S, A>(reducer: (state: S, action: A) => S, initialState: S, init?: (s: S) => S): [Signal<S>, (action: A) => void];
|
|
15
|
+
export function onMount(fn: () => void | (() => void)): void;
|
|
16
|
+
export function onCleanup(fn: () => void): void;
|
|
17
|
+
|
|
18
|
+
export interface Resource<T> {
|
|
19
|
+
(): T | undefined;
|
|
20
|
+
loading: Signal<boolean>;
|
|
21
|
+
error: Signal<Error | null>;
|
|
22
|
+
refetch: () => void;
|
|
23
|
+
mutate: (value: T) => void;
|
|
24
|
+
}
|
|
25
|
+
export function createResource<T>(fetcher: () => Promise<T>, options?: { initialValue?: T }): Resource<T>;
|
package/jsx-runtime.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "what-framework",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "The closest framework to vanilla JS
|
|
3
|
+
"version": "0.6.3",
|
|
4
|
+
"description": "The closest framework to vanilla JS \u2014 signals, components, islands, SSR",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -13,10 +13,12 @@
|
|
|
13
13
|
"import": "./src/index.js"
|
|
14
14
|
},
|
|
15
15
|
"./jsx-runtime": {
|
|
16
|
+
"types": "./jsx-runtime.d.ts",
|
|
16
17
|
"production": "./dist/jsx-runtime.min.js",
|
|
17
18
|
"import": "./src/jsx-runtime.js"
|
|
18
19
|
},
|
|
19
20
|
"./jsx-dev-runtime": {
|
|
21
|
+
"types": "./jsx-runtime.d.ts",
|
|
20
22
|
"production": "./dist/jsx-dev-runtime.min.js",
|
|
21
23
|
"import": "./src/jsx-dev-runtime.js"
|
|
22
24
|
},
|
|
@@ -39,16 +41,33 @@
|
|
|
39
41
|
"types": "./testing.d.ts",
|
|
40
42
|
"production": "./dist/testing.min.js",
|
|
41
43
|
"import": "./src/testing.js"
|
|
44
|
+
},
|
|
45
|
+
"./hooks": {
|
|
46
|
+
"types": "./hooks.d.ts",
|
|
47
|
+
"import": "./src/hooks.js"
|
|
48
|
+
},
|
|
49
|
+
"./react-compat": {
|
|
50
|
+
"types": "./react-compat.d.ts",
|
|
51
|
+
"import": "./src/react-compat.js"
|
|
52
|
+
},
|
|
53
|
+
"./compiler": {
|
|
54
|
+
"types": "./compiler.d.ts",
|
|
55
|
+
"production": "./dist/compiler.min.js",
|
|
56
|
+
"import": "./src/compiler.js"
|
|
42
57
|
}
|
|
43
58
|
},
|
|
44
59
|
"files": [
|
|
45
60
|
"src",
|
|
46
61
|
"dist",
|
|
47
62
|
"index.d.ts",
|
|
63
|
+
"jsx-runtime.d.ts",
|
|
48
64
|
"render.d.ts",
|
|
49
65
|
"router.d.ts",
|
|
50
66
|
"server.d.ts",
|
|
51
|
-
"testing.d.ts"
|
|
67
|
+
"testing.d.ts",
|
|
68
|
+
"hooks.d.ts",
|
|
69
|
+
"react-compat.d.ts",
|
|
70
|
+
"compiler.d.ts"
|
|
52
71
|
],
|
|
53
72
|
"sideEffects": false,
|
|
54
73
|
"keywords": [
|
|
@@ -73,9 +92,9 @@
|
|
|
73
92
|
},
|
|
74
93
|
"homepage": "https://whatfw.com",
|
|
75
94
|
"dependencies": {
|
|
76
|
-
"what-core": "^0.6.
|
|
77
|
-
"what-router": "^0.6.
|
|
78
|
-
"what-server": "^0.6.
|
|
79
|
-
"what-compiler": "^0.6.
|
|
95
|
+
"what-core": "^0.6.3",
|
|
96
|
+
"what-router": "^0.6.3",
|
|
97
|
+
"what-server": "^0.6.3",
|
|
98
|
+
"what-compiler": "^0.6.3"
|
|
80
99
|
}
|
|
81
100
|
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// What Framework - React Compatibility Layer Type Definitions
|
|
2
|
+
|
|
3
|
+
import { Signal, VNode } from './index';
|
|
4
|
+
|
|
5
|
+
export const useState: <T>(initial: T | (() => T)) => [Signal<T>, (value: T | ((prev: T) => T)) => void];
|
|
6
|
+
export const useEffect: (fn: () => void | (() => void), deps?: any[]) => void;
|
|
7
|
+
export const useMemo: <T>(fn: () => T, deps?: any[]) => T;
|
|
8
|
+
export const useCallback: <T extends (...args: any[]) => any>(fn: T, deps?: any[]) => T;
|
|
9
|
+
export const useRef: <T>(initial?: T) => { current: T };
|
|
10
|
+
export const useContext: <T>(context: { _defaultValue: T }) => T;
|
|
11
|
+
export const useReducer: <S, A>(reducer: (state: S, action: A) => S, initialState: S, init?: (s: S) => S) => [Signal<S>, (action: A) => void];
|
|
12
|
+
export const createContext: <T>(defaultValue?: T) => { _defaultValue: T; Provider: (props: { value: T; children: any }) => any };
|
|
13
|
+
export const Fragment: (props: { children?: any }) => any;
|
|
14
|
+
export const Suspense: (props: { fallback?: any; children?: any }) => any;
|
|
15
|
+
export const memo: <T extends (...args: any[]) => any>(component: T) => T;
|
|
16
|
+
export const lazy: <T>(loader: () => Promise<{ default: T }>) => T;
|
|
17
|
+
|
|
18
|
+
export function createElement(type: any, props?: any, ...children: any[]): VNode;
|
|
19
|
+
export function forwardRef<T>(render: (props: any, ref: { current: T }) => any): (props: any) => any;
|
|
20
|
+
export function createRef<T>(): { current: T | null };
|
|
21
|
+
export function cloneElement(element: VNode, props?: any, ...children: any[]): VNode;
|
|
22
|
+
export function isValidElement(object: any): boolean;
|
|
23
|
+
|
|
24
|
+
export function useLayoutEffect(fn: () => void | (() => void), deps?: any[]): void;
|
|
25
|
+
export function useImperativeHandle<T>(ref: { current: T }, createHandle: () => T, deps?: any[]): void;
|
|
26
|
+
export function useId(): string;
|
|
27
|
+
export function useDebugValue(...args: any[]): void;
|
|
28
|
+
export function useSyncExternalStore<T>(subscribe: (cb: () => void) => () => void, getSnapshot: () => T, getServerSnapshot?: () => T): T;
|
|
29
|
+
export function useTransition(): [boolean, (fn: () => void) => void];
|
|
30
|
+
export function useDeferredValue<T>(value: T): T;
|
|
31
|
+
export function startTransition(fn: () => void): void;
|
|
32
|
+
export function StrictMode(props: { children?: any }): any;
|
|
33
|
+
|
|
34
|
+
export const version: string;
|
|
35
|
+
|
|
36
|
+
declare const React: {
|
|
37
|
+
useState: typeof useState;
|
|
38
|
+
useEffect: typeof useEffect;
|
|
39
|
+
useMemo: typeof useMemo;
|
|
40
|
+
useCallback: typeof useCallback;
|
|
41
|
+
useRef: typeof useRef;
|
|
42
|
+
useContext: typeof useContext;
|
|
43
|
+
useReducer: typeof useReducer;
|
|
44
|
+
createContext: typeof createContext;
|
|
45
|
+
createElement: typeof createElement;
|
|
46
|
+
Fragment: typeof Fragment;
|
|
47
|
+
memo: typeof memo;
|
|
48
|
+
lazy: typeof lazy;
|
|
49
|
+
forwardRef: typeof forwardRef;
|
|
50
|
+
createRef: typeof createRef;
|
|
51
|
+
isValidElement: typeof isValidElement;
|
|
52
|
+
version: typeof version;
|
|
53
|
+
};
|
|
54
|
+
export default React;
|
package/src/compiler.js
ADDED
package/src/hooks.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'what-core/hooks';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from 'what-react-compat';
|