Blame view

天文台pc/tianwentai-ui/node_modules/@radix-ui/react-context/dist/index.d.ts 1 KB
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  import * as React from 'react';
  
  declare function createContext<ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType): readonly [React.FC<ContextValueType & {
      children: React.ReactNode;
  }>, (consumerName: string) => ContextValueType];
  type Scope<C = any> = {
      [scopeName: string]: React.Context<C>[];
  } | undefined;
  type ScopeHook = (scope: Scope) => {
      [__scopeProp: string]: Scope;
  };
  interface CreateScope {
      scopeName: string;
      (): ScopeHook;
  }
  declare function createContextScope(scopeName: string, createContextScopeDeps?: CreateScope[]): readonly [<ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType | undefined) => readonly [React.FC<ContextValueType & {
      scope: Scope<ContextValueType>;
      children: React.ReactNode;
  }>, (consumerName: string, scope: Scope<ContextValueType | undefined>) => ContextValueType], CreateScope];
  
  export { type CreateScope, type Scope, createContext, createContextScope };