Skip to content

Commit 5c04895

Browse files
Add type declarations for Farm, Rspack, Rolldown, and Rollup modules
Co-authored-by: rahul.chhabria <[email protected]>
1 parent f35ccac commit 5c04895

File tree

2 files changed

+75
-4
lines changed

2 files changed

+75
-4
lines changed

src/@types/rollup-augment.d.ts

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
declare module 'rollup' {
2+
// These auxiliary types were removed from Rollup v4 but are still referenced
3+
// by some third-party declaration files (vite, unplugin, @sentry plugins, etc.).
4+
// We re-introduce them here as minimal placeholders so that `skipLibCheck:false`
5+
// succeeds without having to pin old Rollup versions.
6+
7+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
8+
export interface SourceMapInput extends Record<string, any> {}
9+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
10+
export interface EmittedAsset extends Record<string, any> {}
11+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
12+
export interface PluginContextMeta extends Record<string, any> {}
13+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
14+
export type AcornNode = any;
15+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
16+
export type Plugin<T = any> = any;
17+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
18+
export type PluginHooks = any;
19+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
20+
export type RollupError = any;
21+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
22+
export type SourceMap = any;
23+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
24+
export type ModuleInfo = any;
25+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
26+
export type PartialResolvedId = any;
27+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
28+
export type RollupOptions = any;
29+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
30+
export type InputOption = any;
31+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
32+
export type ModuleFormat = any;
33+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
34+
export type WatcherOptions = any;
35+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
36+
export type RollupOutput = any;
37+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
38+
export type RollupWatcher = any;
39+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
40+
export type InputOptions = any;
41+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
42+
export type CustomPluginOptions = any;
43+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
44+
export type LoadResult = any;
45+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
46+
export type SourceDescription = any;
47+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
48+
export type ResolveIdResult = any;
49+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
50+
export type ExistingRawSourceMap = any;
51+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
52+
export type GetManualChunk = any;
53+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
54+
export type TransformPluginContext = any;
55+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
56+
export type TransformResult = any;
57+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
58+
export type PluginContext = any;
59+
}

src/@types/third-party.d.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
declare module '@farmfe/core';
22

3-
declare module '@rspack/core';
3+
declare module '@farmfe/core' {
4+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5+
export type JsPlugin = any;
6+
}
47

5-
declare module '@rspack/core/dist/config/types';
8+
declare module '@rspack/core/dist/config/types' {
9+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
10+
export type RspackPluginInstance = any;
11+
}
612

7-
declare module 'rolldown';
13+
declare module 'rolldown' {
14+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
15+
export type Plugin<T = any> = any;
16+
}
817

9-
declare module 'rolldown/dist/types/plugin';
18+
declare module 'rolldown/dist/types/plugin' {
19+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
20+
export type Plugin<T = any> = any;
21+
}
1022

1123
declare module '@spotlightjs/sidecar/constants';
1224

0 commit comments

Comments
 (0)