Skip to content

Commit 2e8f733

Browse files
✨ Add global types
1 parent 67e772d commit 2e8f733

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

types/global.d.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import 'react';
2+
3+
declare global {
4+
// A type for the properties of a function component
5+
namespace React {
6+
interface CodeBlockHTMLAttributes<T> extends HTMLAttributes<T> {
7+
/** The accessible name of code block */
8+
label?: string | undefined;
9+
/** The Language name */
10+
language?: string | undefined;
11+
/** The flag to display the UI */
12+
controls?: boolean;
13+
}
14+
}
15+
16+
// A type for JSX markup
17+
namespace JSX {
18+
interface IntrinsicElements {
19+
'code-block': React.DetailedHTMLProps<React.HTMLAttributes<HTMLPreElement>, HTMLPreElement> & {
20+
/** The accessible name of code block */
21+
label?: string | undefined;
22+
/** The Language name */
23+
language?: string | undefined;
24+
/** The flag to display the UI */
25+
controls?: boolean;
26+
}
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)