@rollup/browser 4.9.2 → 4.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,5 @@
1
+ import type { Program } from 'estree';
2
+
1
3
  export const VERSION: string;
2
4
 
3
5
  // utils
@@ -98,13 +100,13 @@ interface ModuleOptions {
98
100
  }
99
101
 
100
102
  export interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
101
- ast?: AstNode;
103
+ ast?: ProgramNode;
102
104
  code: string;
103
105
  map?: SourceMapInput;
104
106
  }
105
107
 
106
108
  export interface TransformModuleJSON {
107
- ast?: AstNode;
109
+ ast?: ProgramNode;
108
110
  code: string;
109
111
  // note if plugins use new this.cache to opt-out auto transform cache
110
112
  customTransformCache: boolean;
@@ -115,7 +117,7 @@ export interface TransformModuleJSON {
115
117
  }
116
118
 
117
119
  export interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
118
- ast: AstNode;
120
+ ast: ProgramNode;
119
121
  dependencies: string[];
120
122
  id: string;
121
123
  resolvedIds: ResolvedIdMap;
@@ -171,7 +173,7 @@ export type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk;
171
173
  export type EmitFile = (emittedFile: EmittedFile) => string;
172
174
 
173
175
  interface ModuleInfo extends ModuleOptions {
174
- ast: AstNode | null;
176
+ ast: ProgramNode | null;
175
177
  code: string | null;
176
178
  dynamicImporters: readonly string[];
177
179
  dynamicallyImportedIdResolutions: readonly ResolvedId[];
@@ -204,7 +206,7 @@ type LoggingFunctionWithPosition = (
204
206
  export type ParseAst = (
205
207
  input: string,
206
208
  options?: { allowReturnOutsideFunction?: boolean }
207
- ) => AstNode;
209
+ ) => ProgramNode;
208
210
 
209
211
  // declare AbortSignal here for environments without DOM lib or @types/node
210
212
  declare global {
@@ -214,7 +216,7 @@ declare global {
214
216
  export type ParseAstAsync = (
215
217
  input: string,
216
218
  options?: { allowReturnOutsideFunction?: boolean; signal?: AbortSignal }
217
- ) => Promise<AstNode>;
219
+ ) => Promise<ProgramNode>;
218
220
 
219
221
  export interface PluginContext extends MinimalPluginContext {
220
222
  addWatchFile: (id: string) => void;
@@ -280,7 +282,7 @@ export type ResolveIdHook = (
280
282
  export type ShouldTransformCachedModuleHook = (
281
283
  this: PluginContext,
282
284
  options: {
283
- ast: AstNode;
285
+ ast: ProgramNode;
284
286
  code: string;
285
287
  id: string;
286
288
  meta: CustomPluginOptions;
@@ -977,6 +979,8 @@ interface AstNode {
977
979
  type: string;
978
980
  }
979
981
 
982
+ type ProgramNode = Program & AstNode;
983
+
980
984
  export function defineConfig(options: RollupOptions): RollupOptions;
981
985
  export function defineConfig(options: RollupOptions[]): RollupOptions[];
982
986
  export function defineConfig(optionsFunction: RollupOptionsFunction): RollupOptionsFunction;