-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor to use module augmentation instead of
@ts-expect-error
Closes GH-5. Reviewed-by: Titus Wormer <tituswormer@gmail.com>
- Loading branch information
1 parent
ebf8926
commit 5ae98d2
Showing
4 changed files
with
43 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// To do: remove when landed in DT | ||
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/68600 | ||
declare module 'react/jsx-runtime' { | ||
import {ElementType, Fragment, Key, ReactElement} from 'react' | ||
|
||
function jsx(type: ElementType, props: unknown, key?: Key): ReactElement | ||
|
||
export {Fragment, jsx, jsx as jsxs} | ||
} | ||
|
||
// To do: remove when landed in DT | ||
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/68600 | ||
declare module 'react/jsx-dev-runtime' { | ||
import {ElementType, Fragment, Key, ReactElement} from 'react' | ||
import {Source} from 'hast-util-to-jsx-runtime' | ||
|
||
function jsxDEV( | ||
type: ElementType, | ||
props: unknown, | ||
key: Key | undefined, | ||
isStatic: boolean, | ||
source?: Source, | ||
self?: unknown | ||
): ReactElement | ||
|
||
export {Fragment, jsxDEV} | ||
} | ||
|
||
// Support loading hastscript from https://esm.sh | ||
declare module 'https://esm.sh/hastscript@8?dev' { | ||
export * from 'hastscript' | ||
} |