From ee0a5c75c6447092c6cd7cea0fe428d6f6a79192 Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Sun, 7 Jul 2024 04:20:33 -0700 Subject: [PATCH] feat: Add TypeScript types for , , , (#3100) * feat: add typings for and * feat: add typings for * feat: add typings for * chore: typing cleanups for code * feat: slightly more detailed types for - per review --- src/setupTest.ts | 4 ---- www/src/components/css-utilities-table/index.tsx | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/setupTest.ts b/src/setupTest.ts index 2a528b828c..d7e0b36a58 100644 --- a/src/setupTest.ts +++ b/src/setupTest.ts @@ -20,7 +20,3 @@ class ResizeObserver { } window.ResizeObserver = ResizeObserver; - -(window as any).crypto = { - getRandomValues: (arr: any) => crypto.randomBytes(arr.length), -}; diff --git a/www/src/components/css-utilities-table/index.tsx b/www/src/components/css-utilities-table/index.tsx index 4d16d9b490..221ecf93a9 100644 --- a/www/src/components/css-utilities-table/index.tsx +++ b/www/src/components/css-utilities-table/index.tsx @@ -7,7 +7,7 @@ import { colorCSSDeclaration } from './utils'; function CSSUtilitiesTable({ selectors }: CSSUtilities) { const [showPopover, setShowPopover] = useState(false); - const [popoverTarget, setPopoverTarget] = useState(undefined); + const [popoverTarget, setPopoverTarget] = useState(undefined); const [computedStyle, setComputedStyle] = useState(''); useEffect(() => { @@ -21,7 +21,7 @@ function CSSUtilitiesTable({ selectors }: CSSUtilities) { }, []); const handleCSSVariableMouseEnter = (e: React.MouseEvent, declaration: string) => { - setPopoverTarget(e.target); + setPopoverTarget(e.target as HTMLElement); setShowPopover(true); const propertyName = declaration.split(':')[0];