Comments (1)
As per preactjs/preact#1180 (comment), changing the preact.d.ts
that Calcite generates like so appears to work both with the legacy and the new moduleResolution strategy:
- import { JSXInternal } from "preact/src/jsx";
- import { JSX } from "./components";
+ import { JSX as JSXInternal } from "preact";
+ import { JSX as CalciteJsx } from "./components";
- declare module "preact/src/jsx" {
- namespace JSXInternal {
+ declare module 'preact' {
+ namespace createElement.JSX extends JSXInternal.IntrinsicElements {
This seems to work because new versions of TypeScript look at the jsx factory function to resolve the JSX namespace
In addition:
- Rename usages of
JSX.Calcite*
in the file withCalciteJsx.Calcite*
) - Duplicate the contents of
namespace createElement.JSX extends JSXInternal.IntrinsicElements { ... }
and call itnamespace h.JSX extends JSXInternal.IntrinsicElements { ... }
so that typing works both for people using"jsxFactory": "h"
and "jsxFactory": "createElement"`
@paulcpederson Since you worked on the original Calcite types for Preact, could you please verify if the above fix looks good and if so if it can be integrated into the preact.d.ts that Calcite ships?
from calcite-design-system.
Related Issues (20)
- [New component] Input search HOT 1
- Filter: Deprecate component
- Sass compiler does not throw an error when expected HOT 1
- [Action] Support "no text" display - make `label` required, make `text` optional HOT 2
- list: filter change wrongly calls calciteListChange HOT 2
- [Carousel] Add support for preventing infinite navigation
- Slots Missing from Calcite Modal HOT 6
- [List] - renamed list items are still present in filtered lists HOT 4
- Calcite block section should enable swapping the position of the caret
- Investigate using the dialog element and popover attribute
- Shell content - slotted popover's z-index is set to `1`.
- calcite-shell-panel: Allow chevron to represent button action rather than current state
- [Shell] When `panel-top` / `panel-bottom` slots are populated with 2 + elements - display is incorrect
- [Tooling] Add browsers supported for each release
- Panel `calcitePanelClose` event emitted despite `beforeClose` failing
- shell-panel: z-index changed HOT 3
- Flow should stop propagation of calciteFlowItemBack event HOT 1
- InputTimePicker/InputTimeZone unstable test HOT 2
- [Dialog] Improve assistive technology (AT) experience for `dragEnabled` and `resizable` HOT 2
- List - dynamically changing list-items within a list causes existing filter and new list-items to be out of sync
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from calcite-design-system.