add hw2
This commit is contained in:
5
node_modules/jotai/react/utils/useAtomCallback.d.ts
generated
vendored
Normal file
5
node_modules/jotai/react/utils/useAtomCallback.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import { useSetAtom } from 'jotai/react';
|
||||
import type { Getter, Setter } from 'jotai/vanilla';
|
||||
type Options = Parameters<typeof useSetAtom>[1];
|
||||
export declare function useAtomCallback<Result, Args extends unknown[]>(callback: (get: Getter, set: Setter, ...arg: Args) => Result, options?: Options): (...args: Args) => Result;
|
||||
export {};
|
||||
14
node_modules/jotai/react/utils/useHydrateAtoms.d.ts
generated
vendored
Normal file
14
node_modules/jotai/react/utils/useHydrateAtoms.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { useStore } from 'jotai/react';
|
||||
import { type WritableAtom } from 'jotai/vanilla';
|
||||
type Options = Parameters<typeof useStore>[0] & {
|
||||
dangerouslyForceHydrate?: boolean;
|
||||
};
|
||||
type AnyWritableAtom = WritableAtom<any, any[], any>;
|
||||
type InferAtomTuples<T> = {
|
||||
[K in keyof T]: T[K] extends readonly [infer A, ...infer Rest] ? A extends WritableAtom<unknown, infer Args, unknown> ? Rest extends Args ? readonly [A, ...Rest] : never : T[K] : never;
|
||||
};
|
||||
export type INTERNAL_InferAtomTuples<T> = InferAtomTuples<T>;
|
||||
export declare function useHydrateAtoms<T extends (readonly [AnyWritableAtom, ...unknown[]])[]>(values: InferAtomTuples<T>, options?: Options): void;
|
||||
export declare function useHydrateAtoms<T extends Map<AnyWritableAtom, unknown>>(values: T, options?: Options): void;
|
||||
export declare function useHydrateAtoms<T extends Iterable<readonly [AnyWritableAtom, ...unknown[]]>>(values: InferAtomTuples<T>, options?: Options): void;
|
||||
export {};
|
||||
14
node_modules/jotai/react/utils/useReducerAtom.d.ts
generated
vendored
Normal file
14
node_modules/jotai/react/utils/useReducerAtom.d.ts
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { useAtom } from 'jotai/react';
|
||||
import type { PrimitiveAtom } from 'jotai/vanilla';
|
||||
type Options = Parameters<typeof useAtom>[1];
|
||||
/**
|
||||
* @deprecated please use a recipe instead
|
||||
* https://github.com/pmndrs/jotai/pull/2467
|
||||
*/
|
||||
export declare function useReducerAtom<Value, Action>(anAtom: PrimitiveAtom<Value>, reducer: (v: Value, a?: Action) => Value, options?: Options): [Value, (action?: Action) => void];
|
||||
/**
|
||||
* @deprecated please use a recipe instead
|
||||
* https://github.com/pmndrs/jotai/pull/2467
|
||||
*/
|
||||
export declare function useReducerAtom<Value, Action>(anAtom: PrimitiveAtom<Value>, reducer: (v: Value, a: Action) => Value, options?: Options): [Value, (action: Action) => void];
|
||||
export {};
|
||||
6
node_modules/jotai/react/utils/useResetAtom.d.ts
generated
vendored
Normal file
6
node_modules/jotai/react/utils/useResetAtom.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { useSetAtom } from 'jotai/react';
|
||||
import { RESET } from 'jotai/vanilla/utils';
|
||||
import type { WritableAtom } from 'jotai/vanilla';
|
||||
type Options = Parameters<typeof useSetAtom>[1];
|
||||
export declare function useResetAtom<T>(anAtom: WritableAtom<unknown, [typeof RESET], T>, options?: Options): () => T;
|
||||
export {};
|
||||
Reference in New Issue
Block a user