Download node_modules/@radix-ui/react-context/dist/index.d.ts from metarm/QMetaRam: direct link, hf CLI and curl.
- Browser
- Download file 2.37 kB
-
https://huggingface.co/metarm/QMetaRam/resolve/main/node_modules/%40radix-ui/react-context/dist/index.d.ts
- Command line
-
hf download hf://metarm/QMetaRam/node_modules/@radix-ui/react-context/dist/index.d.ts
-
curl -L -o index.d.ts https://huggingface.co/metarm/QMetaRam/resolve/main/node_modules/%40radix-ui/react-context/dist/index.d.ts
2.37 kB
| import * as React from 'react'; | |
| type ContextProvider<ContextValueType extends object | null> = React.FC<ContextValueType & { | |
| children: React.ReactNode; | |
| }>; | |
| interface UseAssertedContext<ContextValueType extends object | null> { | |
| (consumerName: string): ContextValueType; | |
| } | |
| interface UseContext<ContextValueType extends object | null> { | |
| (consumerName: string): ContextValueType; | |
| (consumerName: string, options: { | |
| optional: true; | |
| }): ContextValueType | undefined; | |
| } | |
| declare function createContext<ContextValueType extends object | null>(rootComponentName: string): readonly [ContextProvider<ContextValueType>, UseContext<ContextValueType>]; | |
| declare function createContext<ContextValueType extends object | null>(rootComponentName: string, defaultContext: ContextValueType): readonly [ContextProvider<ContextValueType>, UseAssertedContext<ContextValueType>]; | |
| type Scope<C = any> = { | |
| [scopeName: string]: React.Context<C>[]; | |
| } | undefined; | |
| type ScopeHook = (scope: Scope) => { | |
| [__scopeProp: string]: Scope; | |
| }; | |
| interface CreateScope { | |
| scopeName: string; | |
| (): ScopeHook; | |
| } | |
| type ScopedContextProvider<ContextValueType extends object | null> = React.FC<ContextValueType & { | |
| scope: Scope<ContextValueType>; | |
| children: React.ReactNode; | |
| }>; | |
| interface UseScopedContext<ContextValueType extends object | null> { | |
| (consumerName: string, scope: Scope<ContextValueType | undefined>): ContextValueType; | |
| (consumerName: string, scope: Scope<ContextValueType | undefined>, options: { | |
| optional?: true; | |
| }): ContextValueType | undefined; | |
| } | |
| interface UseAssertedScopedContext<ContextValueType extends object | null> { | |
| (consumerName: string, scope: Scope<ContextValueType | undefined>): ContextValueType; | |
| } | |
| interface CreateScopedContext { | |
| <ContextValueType extends object | null>(rootComponentName: string): readonly [ScopedContextProvider<ContextValueType>, UseScopedContext<ContextValueType>]; | |
| <ContextValueType extends object | null>(rootComponentName: string, defaultContext: ContextValueType): readonly [ScopedContextProvider<ContextValueType>, UseAssertedScopedContext<ContextValueType>]; | |
| } | |
| declare function createContextScope(scopeName: string, createContextScopeDeps?: CreateScope[]): readonly [CreateScopedContext, CreateScope]; | |
| export { type CreateScope, type Scope, createContext, createContextScope }; | |