index.d.mts 1.1 KB

1234567891011121314151617181920212223242526
  1. import * as React from "react";
  2. export function createContext<ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType): readonly [{
  3. (props: ContextValueType & {
  4. children: React.ReactNode;
  5. }): JSX.Element;
  6. displayName: string;
  7. }, (consumerName: string) => ContextValueType];
  8. export type Scope<C = any> = {
  9. [scopeName: string]: React.Context<C>[];
  10. } | undefined;
  11. type ScopeHook = (scope: Scope) => {
  12. [__scopeProp: string]: Scope;
  13. };
  14. export interface CreateScope {
  15. scopeName: string;
  16. (): ScopeHook;
  17. }
  18. export function createContextScope(scopeName: string, createContextScopeDeps?: CreateScope[]): readonly [<ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType | undefined) => readonly [{
  19. (props: ContextValueType & {
  20. scope: Scope<ContextValueType>;
  21. children: React.ReactNode;
  22. }): JSX.Element;
  23. displayName: string;
  24. }, (consumerName: string, scope: Scope<ContextValueType | undefined>) => ContextValueType], CreateScope];
  25. //# sourceMappingURL=index.d.ts.map