add hw2
This commit is contained in:
6
node_modules/jotai/ts3.8/react/utils/useAtomCallback.d.ts
generated
vendored
Normal file
6
node_modules/jotai/ts3.8/react/utils/useAtomCallback.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
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 {};
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
27
node_modules/jotai/ts3.8/react/utils/useHydrateAtoms.d.ts
generated
vendored
Normal file
27
node_modules/jotai/ts3.8/react/utils/useHydrateAtoms.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
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 {};
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
21
node_modules/jotai/ts3.8/react/utils/useReducerAtom.d.ts
generated
vendored
Normal file
21
node_modules/jotai/ts3.8/react/utils/useReducerAtom.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
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 {};
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
9
node_modules/jotai/ts3.8/react/utils/useResetAtom.d.ts
generated
vendored
Normal file
9
node_modules/jotai/ts3.8/react/utils/useResetAtom.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
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 {};
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
Reference in New Issue
Block a user