add hw2
This commit is contained in:
26
node_modules/jotai/ts3.8/esm/vanilla/utils/atomFamily.d.ts
generated
vendored
Normal file
26
node_modules/jotai/ts3.8/esm/vanilla/utils/atomFamily.d.ts
generated
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { Atom } from 'jotai/vanilla';
|
||||
/**
|
||||
* in milliseconds
|
||||
*/
|
||||
type CreatedAt = number;
|
||||
type ShouldRemove<Param> = (createdAt: CreatedAt, param: Param) => boolean;
|
||||
type Cleanup = () => void;
|
||||
type Callback<Param, AtomType> = (event: {
|
||||
type: 'CREATE' | 'REMOVE';
|
||||
param: Param;
|
||||
atom: AtomType;
|
||||
}) => void;
|
||||
export interface AtomFamily<Param, AtomType> {
|
||||
(param: Param): AtomType;
|
||||
getParams(): Iterable<Param>;
|
||||
remove(param: Param): void;
|
||||
setShouldRemove(shouldRemove: ShouldRemove<Param> | null): void;
|
||||
/**
|
||||
* fires when a atom is created or removed
|
||||
* This API is for advanced use cases, and can change without notice.
|
||||
*/
|
||||
unstable_listen(callback: Callback<Param, AtomType>): Cleanup;
|
||||
}
|
||||
export declare function atomFamily<Param, AtomType extends Atom<unknown>>(initializeAtom: (param: Param) => AtomType, areEqual?: (a: Param, b: Param) => boolean): AtomFamily<Param, AtomType>;
|
||||
export {};
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
11
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithDefault.d.ts
generated
vendored
Normal file
11
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithDefault.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { WritableAtom } from 'jotai/vanilla';
|
||||
import { RESET } from './constants';
|
||||
type Read<Value, Args extends unknown[], Result> = WritableAtom<Value, Args, Result>['read'];
|
||||
type DefaultSetStateAction<Value> = Value | typeof RESET | ((prev: Value) => Value | typeof RESET);
|
||||
export declare function atomWithDefault<Value>(getDefault: Read<Value, [
|
||||
DefaultSetStateAction<Value>
|
||||
], void>): WritableAtom<Value, [
|
||||
DefaultSetStateAction<Value>
|
||||
], void>;
|
||||
export {};
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
3
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithLazy.d.ts
generated
vendored
Normal file
3
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithLazy.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { PrimitiveAtom } from 'jotai/vanilla';
|
||||
export declare function atomWithLazy<Value>(makeInitial: () => Value): PrimitiveAtom<Value>;
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
37
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithObservable.d.ts
generated
vendored
Normal file
37
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithObservable.d.ts
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
import type { Atom, Getter, WritableAtom } from 'jotai/vanilla';
|
||||
type AnyError = unknown;
|
||||
type Subscription = {
|
||||
unsubscribe: () => void;
|
||||
};
|
||||
type Observer<T> = {
|
||||
next: (value: T) => void;
|
||||
error: (error: AnyError) => void;
|
||||
complete: () => void;
|
||||
};
|
||||
type ObservableLike<T> = {
|
||||
subscribe(observer: Observer<T>): Subscription;
|
||||
} | {
|
||||
subscribe(observer: Partial<Observer<T>>): Subscription;
|
||||
} | {
|
||||
subscribe(observer: Partial<Observer<T>>): Subscription;
|
||||
subscribe(next: (value: T) => void): Subscription;
|
||||
};
|
||||
type SubjectLike<T> = ObservableLike<T> & Observer<T>;
|
||||
type Options<Data> = {
|
||||
initialValue?: Data | (() => Data);
|
||||
unstable_timeout?: number;
|
||||
};
|
||||
type OptionsWithInitialValue<Data> = {
|
||||
initialValue: Data | (() => Data);
|
||||
unstable_timeout?: number;
|
||||
};
|
||||
export declare function atomWithObservable<Data>(getObservable: (get: Getter) => SubjectLike<Data>, options: OptionsWithInitialValue<Data>): WritableAtom<Data, [
|
||||
Data
|
||||
], void>;
|
||||
export declare function atomWithObservable<Data>(getObservable: (get: Getter) => SubjectLike<Data>, options?: Options<Data>): WritableAtom<Data | Promise<Data>, [
|
||||
Data
|
||||
], void>;
|
||||
export declare function atomWithObservable<Data>(getObservable: (get: Getter) => ObservableLike<Data>, options: OptionsWithInitialValue<Data>): Atom<Data>;
|
||||
export declare function atomWithObservable<Data>(getObservable: (get: Getter) => ObservableLike<Data>, options?: Options<Data>): Atom<Data | Promise<Data>>;
|
||||
export {};
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
8
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithReducer.d.ts
generated
vendored
Normal file
8
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithReducer.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { WritableAtom } from 'jotai/vanilla';
|
||||
export declare function atomWithReducer<Value, Action>(initialValue: Value, reducer: (value: Value, action?: Action) => Value): WritableAtom<Value, [
|
||||
Action?
|
||||
], void>;
|
||||
export declare function atomWithReducer<Value, Action>(initialValue: Value, reducer: (value: Value, action: Action) => Value): WritableAtom<Value, [
|
||||
Action
|
||||
], void>;
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
10
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithRefresh.d.ts
generated
vendored
Normal file
10
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithRefresh.d.ts
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { WritableAtom } from 'jotai/vanilla';
|
||||
type Read<Value, Args extends unknown[], Result> = WritableAtom<Value, Args, Result>['read'];
|
||||
type Write<Value, Args extends unknown[], Result> = WritableAtom<Value, Args, Result>['write'];
|
||||
export declare function atomWithRefresh<Value, Args extends unknown[], Result>(read: Read<Value, Args, Result>, write: Write<Value, Args, Result>): WritableAtom<Value, Args | [
|
||||
], Result | void>;
|
||||
export declare function atomWithRefresh<Value>(read: Read<Value, [
|
||||
], void>): WritableAtom<Value, [
|
||||
], void>;
|
||||
export {};
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
11
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithReset.d.ts
generated
vendored
Normal file
11
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithReset.d.ts
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { WritableAtom } from 'jotai/vanilla';
|
||||
import { RESET } from './constants';
|
||||
type SetStateActionWithReset<Value> = Value | typeof RESET | ((prev: Value) => Value | typeof RESET);
|
||||
type WithInitialValue<Value> = {
|
||||
init: Value;
|
||||
};
|
||||
export declare function atomWithReset<Value>(initialValue: Value): WritableAtom<Value, [
|
||||
SetStateActionWithReset<Value>
|
||||
], void> & WithInitialValue<Value>;
|
||||
export {};
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
53
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithStorage.d.ts
generated
vendored
Normal file
53
node_modules/jotai/ts3.8/esm/vanilla/utils/atomWithStorage.d.ts
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
import type { WritableAtom } from 'jotai/vanilla';
|
||||
import { RESET } from './constants';
|
||||
type Unsubscribe = () => void;
|
||||
type Subscribe<Value> = (key: string, callback: (value: Value) => void, initialValue: Value) => Unsubscribe | undefined;
|
||||
type StringSubscribe = (key: string, callback: (value: string | null) => void) => Unsubscribe | undefined;
|
||||
type SetStateActionWithReset<Value> = Value | typeof RESET | ((prev: Value) => Value | typeof RESET);
|
||||
export interface AsyncStorage<Value> {
|
||||
getItem: (key: string, initialValue: Value) => PromiseLike<Value>;
|
||||
setItem: (key: string, newValue: Value) => PromiseLike<void>;
|
||||
removeItem: (key: string) => PromiseLike<void>;
|
||||
subscribe?: Subscribe<Value>;
|
||||
}
|
||||
export interface SyncStorage<Value> {
|
||||
getItem: (key: string, initialValue: Value) => Value;
|
||||
setItem: (key: string, newValue: Value) => void;
|
||||
removeItem: (key: string) => void;
|
||||
subscribe?: Subscribe<Value>;
|
||||
}
|
||||
export interface AsyncStringStorage {
|
||||
getItem: (key: string) => PromiseLike<string | null>;
|
||||
setItem: (key: string, newValue: string) => PromiseLike<void>;
|
||||
removeItem: (key: string) => PromiseLike<void>;
|
||||
subscribe?: StringSubscribe;
|
||||
}
|
||||
export interface SyncStringStorage {
|
||||
getItem: (key: string) => string | null;
|
||||
setItem: (key: string, newValue: string) => void;
|
||||
removeItem: (key: string) => void;
|
||||
subscribe?: StringSubscribe;
|
||||
}
|
||||
export declare function withStorageValidator<Value>(validator: (value: unknown) => value is Value): {
|
||||
(storage: AsyncStorage<unknown>): AsyncStorage<Value>;
|
||||
(storage: SyncStorage<unknown>): SyncStorage<Value>;
|
||||
};
|
||||
type JsonStorageOptions = {
|
||||
reviver?: (key: string, value: unknown) => unknown;
|
||||
replacer?: (key: string, value: unknown) => unknown;
|
||||
};
|
||||
export declare function createJSONStorage<Value>(): SyncStorage<Value>;
|
||||
export declare function createJSONStorage<Value>(getStringStorage: () => AsyncStringStorage, options?: JsonStorageOptions): AsyncStorage<Value>;
|
||||
export declare function createJSONStorage<Value>(getStringStorage: () => SyncStringStorage, options?: JsonStorageOptions): SyncStorage<Value>;
|
||||
export declare function atomWithStorage<Value>(key: string, initialValue: Value, storage: AsyncStorage<Value>, options?: {
|
||||
getOnInit?: boolean;
|
||||
}): WritableAtom<Value | Promise<Value>, [
|
||||
SetStateActionWithReset<Value | Promise<Value>>
|
||||
], Promise<void>>;
|
||||
export declare function atomWithStorage<Value>(key: string, initialValue: Value, storage?: SyncStorage<Value>, options?: {
|
||||
getOnInit?: boolean;
|
||||
}): WritableAtom<Value, [
|
||||
SetStateActionWithReset<Value>
|
||||
], void>;
|
||||
export {};
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
2
node_modules/jotai/ts3.8/esm/vanilla/utils/constants.d.ts
generated
vendored
Normal file
2
node_modules/jotai/ts3.8/esm/vanilla/utils/constants.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export declare const RESET: unique symbol;
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
7
node_modules/jotai/ts3.8/esm/vanilla/utils/freezeAtom.d.ts
generated
vendored
Normal file
7
node_modules/jotai/ts3.8/esm/vanilla/utils/freezeAtom.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Atom } from 'jotai/vanilla';
|
||||
export declare function freezeAtom<AtomType extends Atom<unknown>>(anAtom: AtomType): AtomType;
|
||||
/**
|
||||
* @deprecated Define it on users end
|
||||
*/
|
||||
export declare function freezeAtomCreator<CreateAtom extends (...args: unknown[]) => Atom<unknown>>(createAtom: CreateAtom): CreateAtom;
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
12
node_modules/jotai/ts3.8/esm/vanilla/utils/loadable.d.ts
generated
vendored
Normal file
12
node_modules/jotai/ts3.8/esm/vanilla/utils/loadable.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import type { Atom } from 'jotai/vanilla';
|
||||
export type Loadable<Value> = {
|
||||
state: 'loading';
|
||||
} | {
|
||||
state: 'hasError';
|
||||
error: unknown;
|
||||
} | {
|
||||
state: 'hasData';
|
||||
data: Awaited<Value>;
|
||||
};
|
||||
export declare function loadable<Value>(anAtom: Atom<Value>): Atom<Loadable<Value>>;
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
3
node_modules/jotai/ts3.8/esm/vanilla/utils/selectAtom.d.ts
generated
vendored
Normal file
3
node_modules/jotai/ts3.8/esm/vanilla/utils/selectAtom.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { Atom } from 'jotai/vanilla';
|
||||
export declare function selectAtom<Value, Slice>(anAtom: Atom<Value>, selector: (v: Value, prevSlice?: Slice) => Slice, equalityFn?: (a: Slice, b: Slice) => boolean): Atom<Slice>;
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
21
node_modules/jotai/ts3.8/esm/vanilla/utils/splitAtom.d.ts
generated
vendored
Normal file
21
node_modules/jotai/ts3.8/esm/vanilla/utils/splitAtom.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { Atom, PrimitiveAtom, WritableAtom } from 'jotai/vanilla';
|
||||
type SplitAtomAction<Item> = {
|
||||
type: 'remove';
|
||||
atom: PrimitiveAtom<Item>;
|
||||
} | {
|
||||
type: 'insert';
|
||||
value: Item;
|
||||
before?: PrimitiveAtom<Item>;
|
||||
} | {
|
||||
type: 'move';
|
||||
atom: PrimitiveAtom<Item>;
|
||||
before?: PrimitiveAtom<Item>;
|
||||
};
|
||||
export declare function splitAtom<Item, Key>(arrAtom: WritableAtom<Item[], [
|
||||
Item[]
|
||||
], void>, keyExtractor?: (item: Item) => Key): WritableAtom<PrimitiveAtom<Item>[], [
|
||||
SplitAtomAction<Item>
|
||||
], void>;
|
||||
export declare function splitAtom<Item, Key>(arrAtom: Atom<Item[]>, keyExtractor?: (item: Item) => Key): Atom<Atom<Item>[]>;
|
||||
export {};
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
6
node_modules/jotai/ts3.8/esm/vanilla/utils/unwrap.d.ts
generated
vendored
Normal file
6
node_modules/jotai/ts3.8/esm/vanilla/utils/unwrap.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { Atom, WritableAtom } from 'jotai/vanilla';
|
||||
export declare function unwrap<Value, Args extends unknown[], Result>(anAtom: WritableAtom<Value, Args, Result>): WritableAtom<Awaited<Value> | undefined, Args, Result>;
|
||||
export declare function unwrap<Value, Args extends unknown[], Result, PendingValue>(anAtom: WritableAtom<Value, Args, Result>, fallback: (prev?: Awaited<Value>) => PendingValue): WritableAtom<Awaited<Value> | PendingValue, Args, Result>;
|
||||
export declare function unwrap<Value>(anAtom: Atom<Value>): Atom<Awaited<Value> | undefined>;
|
||||
export declare function unwrap<Value, PendingValue>(anAtom: Atom<Value>, fallback: (prev?: Awaited<Value>) => PendingValue): Atom<Awaited<Value> | PendingValue>;
|
||||
declare type Awaited<T> = T extends Promise<infer V> ? V : T;
|
||||
Reference in New Issue
Block a user