1
- // Type declarations for CSS modules and side-effect imports
1
+ // Global type declarations for better TypeScript compatibility
2
+
3
+ // CSS modules and side-effect imports
2
4
declare module "*.css" {
3
5
const content : any ;
4
6
export default content ;
@@ -9,22 +11,38 @@ declare module "*.module.css" {
9
11
export default classes ;
10
12
}
11
13
12
- // Allow importing CSS files as side effects
13
- declare module "*.css " {
14
- const content : any ;
15
- export = content ;
14
+ // JSON modules
15
+ declare module "*.json " {
16
+ const value : any ;
17
+ export default value ;
16
18
}
17
19
18
- // Docusaurus module declarations
20
+ // JSX namespace declaration
21
+ declare namespace JSX {
22
+ interface Element extends React . ReactElement < any , any > { }
23
+ interface IntrinsicElements {
24
+ [ elemName : string ] : any ;
25
+ }
26
+ }
27
+
28
+ // Docusaurus theme-common module
19
29
declare module "@docusaurus/theme-common" {
20
30
export function useColorMode ( ) : {
21
31
colorMode : "light" | "dark" ;
22
32
setColorMode : ( mode : "light" | "dark" ) => void ;
23
33
} ;
24
- // Add other exports as needed
25
- export * from "@docusaurus/theme-common/lib/utils/useColorMode" ;
34
+
35
+ export function useThemeConfig ( ) : any ;
36
+ export function usePluralForm ( ) : any ;
37
+ export function isMultiColumnFooterLinks ( ) : any ;
38
+ export const ThemeClassNames : any ;
39
+ export const ErrorCauseBoundary : any ;
40
+
41
+ // Export all other members as any
42
+ export const [ key : string ] : any ;
26
43
}
27
44
45
+ // Other Docusaurus modules
28
46
declare module "@docusaurus/useDocusaurusContext" {
29
47
export default function useDocusaurusContext ( ) : {
30
48
siteConfig : {
@@ -46,6 +64,14 @@ declare module "@theme/Layout" {
46
64
export default Layout ;
47
65
}
48
66
67
+ declare module "@theme/Footer" {
68
+ export interface Props {
69
+ [ key : string ] : any ;
70
+ }
71
+ const Footer : React . FC < Props > ;
72
+ export default Footer ;
73
+ }
74
+
49
75
declare module "@docusaurus/Head" {
50
76
import { ReactNode } from "react" ;
51
77
interface HeadProps {
@@ -56,14 +82,66 @@ declare module "@docusaurus/Head" {
56
82
export default Head ;
57
83
}
58
84
59
- // JSON module declarations
60
- declare module "*.json" {
61
- const value : any ;
62
- export default value ;
85
+ // Site-specific modules - using wildcard pattern for flexibility
86
+ declare module "@site/src/lib/statsProvider" {
87
+ export function useCommunityStatsContext ( ) : any ;
88
+ export const CommunityStatsProvider : any ;
89
+ export const [ key : string ] : any ;
90
+ }
91
+
92
+ declare module "@site/src/lib/utils" {
93
+ export function cn ( ...args : any [ ] ) : string ;
94
+ export const [ key : string ] : any ;
95
+ }
96
+
97
+ declare module "@site/src/utils/jsUtils" {
98
+ export function sortBy ( array : any [ ] , key : string ) : any [ ] ;
99
+ export const [ key : string ] : any ;
100
+ }
101
+
102
+ declare module "@site/src/services/github" {
103
+ export const githubService : any ;
104
+ export interface GitHubDiscussion {
105
+ [ key : string ] : any ;
106
+ }
107
+ export const [ key : string ] : any ;
108
+ }
109
+
110
+ declare module "@site/src/components/ui/button" {
111
+ export const Button : any ;
112
+ export const [ key : string ] : any ;
113
+ }
114
+
115
+ declare module "@site/src/database/sponsors" {
116
+ export interface Sponsor {
117
+ [ key : string ] : any ;
118
+ }
119
+ export const [ key : string ] : any ;
120
+ }
121
+
122
+ declare module "@site/src/data/users" {
123
+ export interface Tag {
124
+ [ key : string ] : any ;
125
+ }
126
+ export interface TagList {
127
+ [ key : string ] : any ;
128
+ }
129
+ export interface Tags {
130
+ [ key : string ] : any ;
131
+ }
132
+ export interface TagType {
133
+ [ key : string ] : any ;
134
+ }
135
+ export interface User {
136
+ [ key : string ] : any ;
137
+ }
138
+ export const sortedUsers : any ;
139
+ export const [ key : string ] : any ;
63
140
}
64
141
65
- // Allow any for missing modules
142
+ // Catch-all for any missing modules
66
143
declare module "*" {
67
144
const content : any ;
68
145
export default content ;
146
+ export const [ key : string ] : any ;
69
147
}
0 commit comments