Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address XS code hygiene tasks #4981

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ overrides:

no-empty-function: off
'@typescript-eslint/no-empty-function': error

'@typescript-eslint/consistent-type-imports':
- error
- fixStyle: inline-type-imports

# TODO #4003: We will rework on these rules
'@typescript-eslint/ban-ts-comment': off
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/StyleOptions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

type StyleOptions = {
/**
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/defaultStyleOptions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint no-magic-numbers: "off" */
import StyleOptions from './StyleOptions';
import type StyleOptions from './StyleOptions';

function fontFamily(fonts) {
return fonts.map(font => `'${font}'`).join(', ');
Expand Down
28 changes: 15 additions & 13 deletions packages/api/src/hooks/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState, type ReactNod
import { Provider } from 'react-redux';
import updateIn from 'simple-update-in';

import StyleOptions from '../StyleOptions';
import type StyleOptions from '../StyleOptions';
import usePonyfill from '../hooks/usePonyfill';
import getAllLocalizedStrings from '../localization/getAllLocalizedStrings';
import normalizeStyleOptions from '../normalizeStyleOptions';
Expand All @@ -46,19 +46,21 @@ import ActivityKeyerComposer from '../providers/ActivityKeyer/ActivityKeyerCompo
import ActivitySendStatusComposer from '../providers/ActivitySendStatus/ActivitySendStatusComposer';
import ActivitySendStatusTelemetryComposer from '../providers/ActivitySendStatusTelemetry/ActivitySendStatusTelemetryComposer';
import PonyfillComposer from '../providers/Ponyfill/PonyfillComposer';
import ActivityMiddleware from '../types/ActivityMiddleware';
import type ActivityMiddleware from '../types/ActivityMiddleware';
import { type ActivityStatusMiddleware, type RenderActivityStatus } from '../types/ActivityStatusMiddleware';
import AttachmentForScreenReaderMiddleware from '../types/AttachmentForScreenReaderMiddleware';
import AttachmentMiddleware from '../types/AttachmentMiddleware';
import AvatarMiddleware from '../types/AvatarMiddleware';
import CardActionMiddleware from '../types/CardActionMiddleware';
import GroupActivitiesMiddleware from '../types/GroupActivitiesMiddleware';
import LocalizedStrings from '../types/LocalizedStrings';
import PrecompiledGlobalizeType from '../types/PrecompiledGlobalize';
import ScrollToEndButtonMiddleware, { ScrollToEndButtonComponentFactory } from '../types/ScrollToEndButtonMiddleware';
import TelemetryMeasurementEvent, { TelemetryExceptionMeasurementEvent } from '../types/TelemetryMeasurementEvent';
import ToastMiddleware from '../types/ToastMiddleware';
import TypingIndicatorMiddleware from '../types/TypingIndicatorMiddleware';
import type AttachmentForScreenReaderMiddleware from '../types/AttachmentForScreenReaderMiddleware';
import type AttachmentMiddleware from '../types/AttachmentMiddleware';
import type AvatarMiddleware from '../types/AvatarMiddleware';
import type CardActionMiddleware from '../types/CardActionMiddleware';
import type GroupActivitiesMiddleware from '../types/GroupActivitiesMiddleware';
import type LocalizedStrings from '../types/LocalizedStrings';
import type PrecompiledGlobalizeType from '../types/PrecompiledGlobalize';
import { type ScrollToEndButtonComponentFactory } from '../types/ScrollToEndButtonMiddleware';
import type ScrollToEndButtonMiddleware from '../types/ScrollToEndButtonMiddleware';
import { type TelemetryExceptionMeasurementEvent } from '../types/TelemetryMeasurementEvent';
import type TelemetryMeasurementEvent from '../types/TelemetryMeasurementEvent';
import type ToastMiddleware from '../types/ToastMiddleware';
import type TypingIndicatorMiddleware from '../types/TypingIndicatorMiddleware';
import { type ContextOf } from '../types/ContextOf';
import createCustomEvent from '../utils/createCustomEvent';
import isObject from '../utils/isObject';
Expand Down
26 changes: 13 additions & 13 deletions packages/api/src/hooks/internal/WebChatAPIContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ import {
} from 'botframework-webchat-core';
import { createContext } from 'react';

import { StrictStyleOptions } from '../../StyleOptions';
import { LegacyActivityRenderer } from '../../types/ActivityMiddleware';
import { RenderActivityStatus } from '../../types/ActivityStatusMiddleware';
import { AttachmentForScreenReaderComponentFactory } from '../../types/AttachmentForScreenReaderMiddleware';
import { RenderAttachment } from '../../types/AttachmentMiddleware';
import { AvatarComponentFactory } from '../../types/AvatarMiddleware';
import { PerformCardAction } from '../../types/CardActionMiddleware';
import { GroupActivities } from '../../types/GroupActivitiesMiddleware';
import LocalizedStrings from '../../types/LocalizedStrings';
import { type StrictStyleOptions } from '../../StyleOptions';
import { type LegacyActivityRenderer } from '../../types/ActivityMiddleware';
import { type RenderActivityStatus } from '../../types/ActivityStatusMiddleware';
import { type AttachmentForScreenReaderComponentFactory } from '../../types/AttachmentForScreenReaderMiddleware';
import { type RenderAttachment } from '../../types/AttachmentMiddleware';
import { type AvatarComponentFactory } from '../../types/AvatarMiddleware';
import { type PerformCardAction } from '../../types/CardActionMiddleware';
import { type GroupActivities } from '../../types/GroupActivitiesMiddleware';
import type LocalizedStrings from '../../types/LocalizedStrings';
import { type Notification } from '../../types/Notification';
import PrecompiledGlobalize from '../../types/PrecompiledGlobalize';
import { ScrollToEndButtonComponentFactory } from '../../types/ScrollToEndButtonMiddleware';
import TelemetryMeasurementEvent from '../../types/TelemetryMeasurementEvent';
import { RenderToast } from '../../types/ToastMiddleware';
import type PrecompiledGlobalize from '../../types/PrecompiledGlobalize';
import { type ScrollToEndButtonComponentFactory } from '../../types/ScrollToEndButtonMiddleware';
import type TelemetryMeasurementEvent from '../../types/TelemetryMeasurementEvent';
import { type RenderToast } from '../../types/ToastMiddleware';

type WebChatAPIContext = {
activityRenderer?: LegacyActivityRenderer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isValidElement, useMemo } from 'react';

import { ActivityComponentFactory } from '../../types/ActivityMiddleware';
import { RenderAttachment } from '../../types/AttachmentMiddleware';
import { type ActivityComponentFactory } from '../../types/ActivityMiddleware';
import { type RenderAttachment } from '../../types/AttachmentMiddleware';
import useRenderAttachment from '../useRenderAttachment';
import useWebChatAPIContext from './useWebChatAPIContext';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/hooks/internal/useValueRef.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RefObject, useMemo, useRef } from 'react';
import { type RefObject, useMemo, useRef } from 'react';

export default function useValueRef<T>(value: T): RefObject<T> {
const ref = useRef<T>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { sendMessage, sendMessageBack, sendPostBack } from 'botframework-webchat-core';

import CardActionMiddleware from '../../types/CardActionMiddleware';
import type CardActionMiddleware from '../../types/CardActionMiddleware';

export default function createDefaultCardActionMiddleware(): CardActionMiddleware {
return ({ dispatch }) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import GroupActivitiesMiddleware from '../../types/GroupActivitiesMiddleware';
import type GroupActivitiesMiddleware from '../../types/GroupActivitiesMiddleware';

import type { GlobalScopePonyfill, WebChatActivity } from 'botframework-webchat-core';
import type { SendStatus } from '../../types/SendStatus';
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/hooks/useActivities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

import { useSelector } from './internal/WebChatReduxContext';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/hooks/useCreateActivityRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ActivityComponentFactory } from '../types/ActivityMiddleware';
import { type ActivityComponentFactory } from '../types/ActivityMiddleware';
import useCreateActivityRendererInternal from './internal/useCreateActivityRendererInternal';

// The newer useCreateActivityRenderer() hook does not support override renderAttachment().
Expand Down
7 changes: 3 additions & 4 deletions packages/api/src/hooks/useCreateAvatarRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useMemo } from 'react';
import { type ReactNode, useMemo } from 'react';
import useStyleOptions from './useStyleOptions';
import useWebChatAPIContext from './internal/useWebChatAPIContext';

import type { AvatarComponentFactory } from '../types/AvatarMiddleware';
import type { ReactNode } from 'react';
import type { WebChatActivity } from 'botframework-webchat-core';
import { type AvatarComponentFactory } from '../types/AvatarMiddleware';
import { type WebChatActivity } from 'botframework-webchat-core';

export default function useCreateAvatarRenderer(): ({
activity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ScrollToEndButtonComponentFactory } from '../types/ScrollToEndButtonMiddleware';
import { type ScrollToEndButtonComponentFactory } from '../types/ScrollToEndButtonMiddleware';
import useWebChatAPIContext from './internal/useWebChatAPIContext';

export default function useCreateScrollToEndButtonRenderer(): ScrollToEndButtonComponentFactory {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/hooks/useGetSendTimeoutForActivity.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

import useStyleOptions from './useStyleOptions';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/hooks/useGroupActivities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

import useWebChatAPIContext from './internal/useWebChatAPIContext';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/hooks/useMarkActivityAsSpoken.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback } from 'react';
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

import useMarkActivity from './internal/useMarkActivity';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/hooks/usePerformCardAction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PerformCardAction } from '../types/CardActionMiddleware';
import { type PerformCardAction } from '../types/CardActionMiddleware';
import useWebChatAPIContext from './internal/useWebChatAPIContext';

export default function usePerformCardAction(): PerformCardAction {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/hooks/useRenderToast.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RenderToast } from '../types/ToastMiddleware';
import { type RenderToast } from '../types/ToastMiddleware';
import useWebChatAPIContext from './internal/useWebChatAPIContext';

export default function useRenderToast(): RenderToast {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/hooks/useRenderTypingIndicator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RenderTypingIndicator } from '../types/TypingIndicatorMiddleware';
import { type RenderTypingIndicator } from '../types/TypingIndicatorMiddleware';
import useWebChatAPIContext from './internal/useWebChatAPIContext';

export default function useRenderTypingIndicator(): RenderTypingIndicator {
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/hooks/useSendTimeoutForActivity.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

import useGetSendTimeoutForActivity from './useGetSendTimeoutForActivity';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/hooks/useTimeoutForSend.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

import useStyleOptions from './useStyleOptions';

Expand Down
36 changes: 21 additions & 15 deletions packages/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import StyleOptions, { StrictStyleOptions } from './StyleOptions';
import { type StrictStyleOptions } from './StyleOptions';
import type StyleOptions from './StyleOptions';
import defaultStyleOptions from './defaultStyleOptions';
import Composer, { ComposerProps } from './hooks/Composer';
import Composer, { type ComposerProps } from './hooks/Composer';
import * as hooks from './hooks/index';
import {
SendBoxMiddlewareProxy,
Expand All @@ -22,24 +23,29 @@ import { type DebouncedNotification, type DebouncedNotifications } from './hooks
import { type PostActivityFile } from './hooks/useSendFiles';
import { localize } from './localization/Localize';
import normalizeStyleOptions from './normalizeStyleOptions';
import ActivityMiddleware, { type ActivityComponentFactory } from './types/ActivityMiddleware';
import type ActivityMiddleware from './types/ActivityMiddleware';
import { type ActivityComponentFactory } from './types/ActivityMiddleware';
import { type ActivityStatusMiddleware, type RenderActivityStatus } from './types/ActivityStatusMiddleware';
import AttachmentForScreenReaderMiddleware, {
AttachmentForScreenReaderComponentFactory
} from './types/AttachmentForScreenReaderMiddleware';
import AttachmentMiddleware, { type RenderAttachment } from './types/AttachmentMiddleware';
import AvatarMiddleware, { type AvatarComponentFactory } from './types/AvatarMiddleware';
import CardActionMiddleware, { type PerformCardAction } from './types/CardActionMiddleware';
import { type AttachmentForScreenReaderComponentFactory } from './types/AttachmentForScreenReaderMiddleware';
import type AttachmentForScreenReaderMiddleware from './types/AttachmentForScreenReaderMiddleware';
import type AttachmentMiddleware from './types/AttachmentMiddleware';
import { type RenderAttachment } from './types/AttachmentMiddleware';
import type AvatarMiddleware from './types/AvatarMiddleware';
import { type AvatarComponentFactory } from './types/AvatarMiddleware';
import type CardActionMiddleware from './types/CardActionMiddleware';
import { type PerformCardAction } from './types/CardActionMiddleware';
import { type ContextOf } from './types/ContextOf';
import GroupActivitiesMiddleware, { type GroupActivities } from './types/GroupActivitiesMiddleware';
import type GroupActivitiesMiddleware from './types/GroupActivitiesMiddleware';
import { type GroupActivities } from './types/GroupActivitiesMiddleware';
import { type Notification } from './types/Notification';
import ScrollToEndButtonMiddleware, {
type ScrollToEndButtonComponentFactory
} from './types/ScrollToEndButtonMiddleware';
import type ScrollToEndButtonMiddleware from './types/ScrollToEndButtonMiddleware';
import { type ScrollToEndButtonComponentFactory } from './types/ScrollToEndButtonMiddleware';
import { type SendStatus } from './types/SendStatus';
import ToastMiddleware, { type RenderToast } from './types/ToastMiddleware';
import type ToastMiddleware from './types/ToastMiddleware';
import { type RenderToast } from './types/ToastMiddleware';
import { type Typing } from './types/Typing';
import TypingIndicatorMiddleware, { type RenderTypingIndicator } from './types/TypingIndicatorMiddleware';
import type TypingIndicatorMiddleware from './types/TypingIndicatorMiddleware';
import { type RenderTypingIndicator } from './types/TypingIndicatorMiddleware';
import { type WebSpeechPonyfill } from './types/WebSpeechPonyfill';
import { type WebSpeechPonyfillFactory } from './types/WebSpeechPonyfillFactory';

Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/localization/getAllLocalizedStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ import zhHK from './zh-HK.json';
import zhTW from './zh-TW.json';

import bundledOverrides from './overrides.json';
import LocalizedStrings from '../types/LocalizedStrings';
import type LocalizedStrings from '../types/LocalizedStrings';
import mergeLocalizedStrings from './mergeLocalizedStrings';

let localizedStrings;
Expand Down
2 changes: 1 addition & 1 deletion packages/api/src/localization/mergeLocalizedStrings.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isForbiddenPropertyName } from 'botframework-webchat-core';

import LocalizedStrings from '../types/LocalizedStrings';
import type LocalizedStrings from '../types/LocalizedStrings';

type LocalizedStringsMap = { [language: string]: LocalizedStrings };

Expand Down
3 changes: 2 additions & 1 deletion packages/api/src/normalizeStyleOptions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { warnOnce } from 'botframework-webchat-core';

import defaultStyleOptions from './defaultStyleOptions';
import StyleOptions, { StrictStyleOptions } from './StyleOptions';
import { type StrictStyleOptions } from './StyleOptions';
import type StyleOptions from './StyleOptions';

const hideScrollToEndButtonDeprecation = warnOnce(
'"styleOptions.hideScrollToEndButton" has been deprecated. To hide scroll to end button, set "scrollToEndBehavior" to false. This deprecation migration will be removed on or after 2023-06-02.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useValueRef from '../../hooks/internal/useValueRef';
import useActivities from '../../hooks/useActivities';
import findLastIndex from '../../utils/findLastIndex';
import useActivityKeys from '../ActivityKeyer/useActivityKeys';
import ActivityAcknowledgementContext, { ActivityAcknowledgementContextType } from './private/Context';
import ActivityAcknowledgementContext, { type ActivityAcknowledgementContextType } from './private/Context';

type ActivityAcknowledgement = {
get acknowledged(): boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useContext } from 'react';

import ActivityAcknowledgementContext from './Context';

import type { ActivityAcknowledgementContextType } from './Context';
import { type ActivityAcknowledgementContextType } from './Context';

export default function useActivityAcknowledgementContext(
thrownOnUndefined = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createContext } from 'react';
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

type ActivityKeyerContextType = {
activityKeysState: readonly [readonly string[]];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

export default function getActivityId(activity: WebChatActivity): string {
return activity.id;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

export default function getClientActivityId(activity: WebChatActivity): string {
return activity.channelData?.clientActivityID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useContext } from 'react';

import ActivityKeyerContext from './Context';

import type { ActivityKeyerContextType } from './Context';
import { type ActivityKeyerContextType } from './Context';

export default function useActivityKeyerContext(thrownOnUndefined = true): ActivityKeyerContextType {
const contextValue = useContext(ActivityKeyerContext);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

import useActivityKeyerContext from './private/useContext';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { WebChatActivity } from 'botframework-webchat-core';
import { type WebChatActivity } from 'botframework-webchat-core';

import useActivityKeyerContext from './private/useContext';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useMemo, useRef, type FC, type PropsWithChildren } from 'react';
import React, { type ReactNode, useEffect, useMemo, useRef } from 'react';

import { useActivities, usePonyfill } from '../../hooks/index';
import useForceRender from '../../hooks/internal/useForceRender';
Expand All @@ -14,7 +14,11 @@ import isMapEqual from './private/isMapEqual';
const EXPIRY_SEND_FAILED = -Infinity;
const EXPIRY_SENT = Infinity;

const ActivitySendStatusComposer: FC<PropsWithChildren<{}>> = ({ children }) => {
type ActivitySendStatusComposerProps = Readonly<{
children?: ReactNode | undefined;
}>;

const ActivitySendStatusComposer = ({ children }: ActivitySendStatusComposerProps) => {
const [activities] = useActivities();
const [{ clearTimeout, Date, setTimeout }] = usePonyfill();
const forceRender = useForceRender();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useContext } from 'react';

import ActivitySendStatusContext from './Context';

import type { ActivitySendStatusContextType } from './Context';
import { type ActivitySendStatusContextType } from './Context';

export default function useActivitySendStatusContext(thrownOnUndefined = true): ActivitySendStatusContextType {
const contextValue = useContext(ActivitySendStatusContext);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createContext } from 'react';

import type { GlobalScopePonyfill } from 'botframework-webchat-core';
import { type GlobalScopePonyfill } from 'botframework-webchat-core';

type PonyfillContextType = {
ponyfillState: readonly [GlobalScopePonyfill];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useContext } from 'react';

import PonyfillContext from './PonyfillContext';

import type { Context } from 'react';
import { type Context } from 'react';

type ContextOf<T> = T extends Context<infer C> ? C : never;

Expand Down
Loading
Loading