From e4ecb6692257a34442feddbfb84e4e4ed8a9eb50 Mon Sep 17 00:00:00 2001 From: Daven Quinn Date: Thu, 30 May 2024 00:39:42 -0500 Subject: [PATCH] Add types for new styling module --- src/declaration.d.ts | 7 ++++++- src/pages/map/map-interface/map-page/index.ts | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/declaration.d.ts b/src/declaration.d.ts index 24e251da..1fdeea07 100644 --- a/src/declaration.d.ts +++ b/src/declaration.d.ts @@ -1,5 +1,10 @@ // declaration.d.ts +import type { Hyper } from "@macrostrat/hyper"; + +// Union of hyper and record +type StyledHyper = Hyper & Record; + // Style modules declare module "*.module.styl" { const classes: { [key: string]: string }; @@ -11,7 +16,7 @@ declare module "*.styl" { export default content; } -// Style modules +// Override declarations for sass module declare module "*.module.sass" { const classes: { [key: string]: string }; export default classes; diff --git a/src/pages/map/map-interface/map-page/index.ts b/src/pages/map/map-interface/map-page/index.ts index 9c9e8bd0..3f31cab6 100644 --- a/src/pages/map/map-interface/map-page/index.ts +++ b/src/pages/map/map-interface/map-page/index.ts @@ -16,7 +16,6 @@ import { useContextPanelOpen, } from "../app-state"; import Searchbar from "../components/navbar"; -import styles from "./main.module.styl"; import MapContainer from "./map-view"; import { MenuPage } from "./menu"; import { info } from "console"; @@ -25,7 +24,7 @@ const ElevationChart = loadable(() => import("../components/elevation-chart")); const InfoDrawer = loadable(() => import("../components/info-drawer")); const Menu = loadable(() => import("./menu")); -const h = hyper.styled(styles); +import h from "./main.module.styl"; function MapView(props) { return h(