This commit is contained in:
Martino Ferrari
2026-04-25 22:56:09 +02:00
parent 8b548ba1c2
commit 986f6cd6d8
85 changed files with 11479 additions and 5050 deletions
+13
View File
@@ -0,0 +1,13 @@
import type { Ref, Context, ComponentChild } from './preact';
export type StateUpdater<S> = S | ((prevState: S) => S);
export function useState<S>(initialState: S | (() => S)): [S, (update: StateUpdater<S>) => void];
export function useReducer<S, A>(reducer: (state: S, action: A) => S, initialState: S): [S, (action: A) => void];
export function useEffect(effect: () => void | (() => void), inputs?: readonly unknown[]): void;
export function useLayoutEffect(effect: () => void | (() => void), inputs?: readonly unknown[]): void;
export function useRef<T>(initialValue: T): { current: T };
export function useRef<T>(initialValue: T | null): Ref<T>;
export function useRef<T = undefined>(): Ref<T | undefined>;
export function useMemo<T>(factory: () => T, inputs: readonly unknown[]): T;
export function useCallback<T extends (...args: any[]) => any>(callback: T, inputs: readonly unknown[]): T;
export function useContext<T>(context: Context<T>): T;