add all frontend files

This commit is contained in:
2026-01-17 15:16:36 -05:00
parent ff16ae7858
commit e40287e4aa
25704 changed files with 1935289 additions and 0 deletions

26
node_modules/@rc-component/context/lib/context.d.ts generated vendored Normal file
View File

@@ -0,0 +1,26 @@
import * as React from 'react';
export type Selector<ContextProps, SelectorValue = ContextProps> = (value: ContextProps) => SelectorValue;
export type Trigger<ContextProps> = (value: ContextProps) => void;
export type Listeners<ContextProps> = Set<Trigger<ContextProps>>;
export interface Context<ContextProps> {
getValue: () => ContextProps;
listeners: Listeners<ContextProps>;
}
export interface ContextSelectorProviderProps<T> {
value: T;
children?: React.ReactNode;
}
export interface SelectorContext<ContextProps> {
Context: React.Context<Context<ContextProps>>;
Provider: React.ComponentType<ContextSelectorProviderProps<ContextProps>>;
defaultValue?: ContextProps;
}
export declare function createContext<ContextProps>(defaultValue?: ContextProps): SelectorContext<ContextProps>;
/** e.g. useSelect(userContext) => user */
export declare function useContext<ContextProps>(holder: SelectorContext<ContextProps>): ContextProps;
/** e.g. useSelect(userContext, user => user.name) => user.name */
export declare function useContext<ContextProps, SelectorValue>(holder: SelectorContext<ContextProps>, selector: Selector<ContextProps, SelectorValue>): SelectorValue;
/** e.g. useSelect(userContext, ['name', 'age']) => user { name, age } */
export declare function useContext<ContextProps, SelectorValue extends Partial<ContextProps>>(holder: SelectorContext<ContextProps>, selector: (keyof ContextProps)[]): SelectorValue;
/** e.g. useSelect(userContext, 'name') => user.name */
export declare function useContext<ContextProps, PropName extends keyof ContextProps>(holder: SelectorContext<ContextProps>, selector: PropName): ContextProps[PropName];