🔧 npm update
This commit is contained in:
192
node_modules/rollup/dist/rollup.d.ts
generated
vendored
192
node_modules/rollup/dist/rollup.d.ts
generated
vendored
@@ -1,4 +1,20 @@
|
||||
import type { Program } from 'estree';
|
||||
import type * as estree from 'estree';
|
||||
|
||||
declare module 'estree' {
|
||||
export interface Decorator extends estree.BaseNode {
|
||||
type: 'Decorator';
|
||||
expression: estree.Expression;
|
||||
}
|
||||
interface PropertyDefinition {
|
||||
decorators: estree.Decorator[];
|
||||
}
|
||||
interface MethodDefinition {
|
||||
decorators: estree.Decorator[];
|
||||
}
|
||||
interface BaseClass {
|
||||
decorators: estree.Decorator[];
|
||||
}
|
||||
}
|
||||
|
||||
export const VERSION: string;
|
||||
|
||||
@@ -86,6 +102,7 @@ export interface SourceMap {
|
||||
sources: string[];
|
||||
sourcesContent?: string[];
|
||||
version: number;
|
||||
debugId?: string;
|
||||
toString(): string;
|
||||
toUrl(): string;
|
||||
}
|
||||
@@ -145,6 +162,7 @@ export interface EmittedAsset {
|
||||
fileName?: string;
|
||||
name?: string;
|
||||
needsCodeReference?: boolean;
|
||||
originalFileName?: string | null;
|
||||
source?: string | Uint8Array;
|
||||
type: 'asset';
|
||||
}
|
||||
@@ -172,7 +190,7 @@ export type EmittedFile = EmittedAsset | EmittedChunk | EmittedPrebuiltChunk;
|
||||
|
||||
export type EmitFile = (emittedFile: EmittedFile) => string;
|
||||
|
||||
interface ModuleInfo extends ModuleOptions {
|
||||
export interface ModuleInfo extends ModuleOptions {
|
||||
ast: ProgramNode | null;
|
||||
code: string | null;
|
||||
dynamicImporters: readonly string[];
|
||||
@@ -194,6 +212,7 @@ interface ModuleInfo extends ModuleOptions {
|
||||
|
||||
export type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-indexed-object-style -- this is an interface so that it can be extended by plugins
|
||||
export interface CustomPluginOptions {
|
||||
[plugin: string]: any;
|
||||
}
|
||||
@@ -205,17 +224,18 @@ type LoggingFunctionWithPosition = (
|
||||
|
||||
export type ParseAst = (
|
||||
input: string,
|
||||
options?: { allowReturnOutsideFunction?: boolean }
|
||||
options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean }
|
||||
) => ProgramNode;
|
||||
|
||||
// declare AbortSignal here for environments without DOM lib or @types/node
|
||||
declare global {
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
interface AbortSignal {}
|
||||
}
|
||||
|
||||
export type ParseAstAsync = (
|
||||
input: string,
|
||||
options?: { allowReturnOutsideFunction?: boolean; signal?: AbortSignal }
|
||||
options?: { allowReturnOutsideFunction?: boolean; jsx?: boolean; signal?: AbortSignal }
|
||||
) => Promise<ProgramNode>;
|
||||
|
||||
export interface PluginContext extends MinimalPluginContext {
|
||||
@@ -252,17 +272,29 @@ export interface PluginContextMeta {
|
||||
watchMode: boolean;
|
||||
}
|
||||
|
||||
export type StringOrRegExp = string | RegExp;
|
||||
|
||||
export type StringFilter<Value = StringOrRegExp> =
|
||||
| MaybeArray<Value>
|
||||
| {
|
||||
include?: MaybeArray<Value>;
|
||||
exclude?: MaybeArray<Value>;
|
||||
};
|
||||
|
||||
export interface HookFilter {
|
||||
id?: StringFilter;
|
||||
code?: StringFilter;
|
||||
}
|
||||
|
||||
export interface ResolvedId extends ModuleOptions {
|
||||
external: boolean | 'absolute';
|
||||
id: string;
|
||||
resolvedBy: string;
|
||||
}
|
||||
|
||||
export interface ResolvedIdMap {
|
||||
[key: string]: ResolvedId;
|
||||
}
|
||||
export type ResolvedIdMap = Record<string, ResolvedId>;
|
||||
|
||||
interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
|
||||
export interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
|
||||
external?: boolean | 'absolute' | 'relative';
|
||||
id: string;
|
||||
resolvedBy?: string;
|
||||
@@ -378,18 +410,32 @@ export type WatchChangeHook = (
|
||||
* const myPlugin: PluginImpl<Options> = (options = {}) => { ... }
|
||||
* ```
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
export type PluginImpl<O extends object = object, A = any> = (options?: O) => Plugin<A>;
|
||||
|
||||
export interface OutputBundle {
|
||||
[fileName: string]: OutputAsset | OutputChunk;
|
||||
export type OutputBundle = Record<string, OutputAsset | OutputChunk>;
|
||||
|
||||
export type PreRenderedChunkWithFileName = PreRenderedChunk & { fileName: string };
|
||||
|
||||
export interface ImportedInternalChunk {
|
||||
type: 'internal';
|
||||
fileName: string;
|
||||
resolvedImportPath: string;
|
||||
chunk: PreRenderedChunk;
|
||||
}
|
||||
|
||||
export interface ImportedExternalChunk {
|
||||
type: 'external';
|
||||
fileName: string;
|
||||
resolvedImportPath: string;
|
||||
}
|
||||
|
||||
export type DynamicImportTargetChunk = ImportedInternalChunk | ImportedExternalChunk;
|
||||
|
||||
export interface FunctionPluginHooks {
|
||||
augmentChunkHash: (this: PluginContext, chunk: RenderedChunk) => string | void;
|
||||
buildEnd: (this: PluginContext, error?: Error) => void;
|
||||
buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
|
||||
closeBundle: (this: PluginContext) => void;
|
||||
closeBundle: (this: PluginContext, error?: Error) => void;
|
||||
closeWatcher: (this: PluginContext) => void;
|
||||
generateBundle: (
|
||||
this: PluginContext,
|
||||
@@ -410,6 +456,9 @@ export interface FunctionPluginHooks {
|
||||
format: InternalModuleFormat;
|
||||
moduleId: string;
|
||||
targetModuleId: string | null;
|
||||
chunk: PreRenderedChunkWithFileName;
|
||||
targetChunk: PreRenderedChunkWithFileName | null;
|
||||
getTargetChunkImports: () => DynamicImportTargetChunk[] | null;
|
||||
}
|
||||
) => { left: string; right: string } | NullValue;
|
||||
renderError: (this: PluginContext, error?: Error) => void;
|
||||
@@ -488,20 +537,29 @@ type MakeAsync<Function_> = Function_ extends (
|
||||
? (this: This, ...parameters: Arguments) => Return | Promise<Return>
|
||||
: never;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
export type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
|
||||
|
||||
export type HookFilterExtension<K extends keyof FunctionPluginHooks> = K extends 'transform'
|
||||
? { filter?: HookFilter }
|
||||
: K extends 'load'
|
||||
? { filter?: Pick<HookFilter, 'id'> }
|
||||
: K extends 'resolveId'
|
||||
? { filter?: { id?: StringFilter<RegExp> } }
|
||||
: // eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
{};
|
||||
|
||||
export type PluginHooks = {
|
||||
[K in keyof FunctionPluginHooks]: ObjectHook<
|
||||
K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K],
|
||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
||||
K extends ParallelPluginHooks ? { sequential?: boolean } : {}
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
||||
HookFilterExtension<K> & (K extends ParallelPluginHooks ? { sequential?: boolean } : {})
|
||||
>;
|
||||
};
|
||||
|
||||
export interface OutputPlugin
|
||||
extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>,
|
||||
Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
|
||||
Partial<Record<AddonHooks, ObjectHook<AddonHook>>> {
|
||||
cacheKey?: string;
|
||||
name: string;
|
||||
version?: string;
|
||||
@@ -512,6 +570,38 @@ export interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
|
||||
api?: A;
|
||||
}
|
||||
|
||||
export type JsxPreset = 'react' | 'react-jsx' | 'preserve' | 'preserve-react';
|
||||
|
||||
export type NormalizedJsxOptions =
|
||||
| NormalizedJsxPreserveOptions
|
||||
| NormalizedJsxClassicOptions
|
||||
| NormalizedJsxAutomaticOptions;
|
||||
|
||||
interface NormalizedJsxPreserveOptions {
|
||||
factory: string | null;
|
||||
fragment: string | null;
|
||||
importSource: string | null;
|
||||
mode: 'preserve';
|
||||
}
|
||||
|
||||
interface NormalizedJsxClassicOptions {
|
||||
factory: string;
|
||||
fragment: string;
|
||||
importSource: string | null;
|
||||
mode: 'classic';
|
||||
}
|
||||
|
||||
interface NormalizedJsxAutomaticOptions {
|
||||
factory: string;
|
||||
importSource: string | null;
|
||||
jsxImportSource: string;
|
||||
mode: 'automatic';
|
||||
}
|
||||
|
||||
export type JsxOptions = Partial<NormalizedJsxOptions> & {
|
||||
preset?: JsxPreset;
|
||||
};
|
||||
|
||||
export type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
|
||||
|
||||
export interface NormalizedTreeshakingOptions {
|
||||
@@ -534,6 +624,7 @@ interface ManualChunkMeta {
|
||||
getModuleIds: () => IterableIterator<string>;
|
||||
getModuleInfo: GetModuleInfo;
|
||||
}
|
||||
|
||||
export type GetManualChunk = (id: string, meta: ManualChunkMeta) => string | NullValue;
|
||||
|
||||
export type ExternalOption =
|
||||
@@ -542,11 +633,11 @@ export type ExternalOption =
|
||||
| RegExp
|
||||
| ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue);
|
||||
|
||||
export type GlobalsOption = { [name: string]: string } | ((name: string) => string);
|
||||
export type GlobalsOption = Record<string, string> | ((name: string) => string);
|
||||
|
||||
export type InputOption = string | string[] | { [entryAlias: string]: string };
|
||||
export type InputOption = string | string[] | Record<string, string>;
|
||||
|
||||
export type ManualChunksOption = { [chunkAlias: string]: string[] } | GetManualChunk;
|
||||
export type ManualChunksOption = Record<string, string[]> | GetManualChunk;
|
||||
|
||||
export type LogHandlerWithDefault = (
|
||||
level: LogLevel,
|
||||
@@ -581,10 +672,11 @@ export interface InputOptions {
|
||||
experimentalLogSideEffects?: boolean;
|
||||
external?: ExternalOption;
|
||||
input?: InputOption;
|
||||
jsx?: false | JsxPreset | JsxOptions;
|
||||
logLevel?: LogLevelOption;
|
||||
makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource';
|
||||
maxParallelFileOps?: number;
|
||||
moduleContext?: ((id: string) => string | NullValue) | { [id: string]: string };
|
||||
moduleContext?: ((id: string) => string | NullValue) | Record<string, string>;
|
||||
onLog?: LogHandlerWithDefault;
|
||||
onwarn?: WarningHandlerWithDefault;
|
||||
perf?: boolean;
|
||||
@@ -607,7 +699,8 @@ export interface NormalizedInputOptions {
|
||||
experimentalCacheExpiry: number;
|
||||
experimentalLogSideEffects: boolean;
|
||||
external: IsExternal;
|
||||
input: string[] | { [entryAlias: string]: string };
|
||||
input: string[] | Record<string, string>;
|
||||
jsx: false | NormalizedJsxOptions;
|
||||
logLevel: LogLevelOption;
|
||||
makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
|
||||
maxParallelFileOps: number;
|
||||
@@ -623,6 +716,7 @@ export interface NormalizedInputOptions {
|
||||
}
|
||||
|
||||
export type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd';
|
||||
export type ImportAttributesKey = 'with' | 'assert';
|
||||
|
||||
export type ModuleFormat = InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs';
|
||||
|
||||
@@ -683,6 +777,8 @@ type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;
|
||||
|
||||
type OutputPluginOption = MaybePromise<OutputPlugin | NullValue | false | OutputPluginOption[]>;
|
||||
|
||||
type HashCharacters = 'base64' | 'base36' | 'hex';
|
||||
|
||||
export interface OutputOptions {
|
||||
amd?: AmdOptions;
|
||||
assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
|
||||
@@ -708,7 +804,9 @@ export interface OutputOptions {
|
||||
freeze?: boolean;
|
||||
generatedCode?: GeneratedCodePreset | GeneratedCodeOptions;
|
||||
globals?: GlobalsOption;
|
||||
hashCharacters?: HashCharacters;
|
||||
hoistTransitiveImports?: boolean;
|
||||
importAttributesKey?: ImportAttributesKey;
|
||||
indent?: string | boolean;
|
||||
inlineDynamicImports?: boolean;
|
||||
interop?: InteropType | GetInterop;
|
||||
@@ -722,6 +820,7 @@ export interface OutputOptions {
|
||||
plugins?: OutputPluginOption;
|
||||
preserveModules?: boolean;
|
||||
preserveModulesRoot?: string;
|
||||
reexportProtoFromExternal?: boolean;
|
||||
sanitizeFileName?: boolean | ((fileName: string) => string);
|
||||
sourcemap?: boolean | 'inline' | 'hidden';
|
||||
sourcemapBaseUrl?: string;
|
||||
@@ -730,9 +829,11 @@ export interface OutputOptions {
|
||||
sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
|
||||
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
|
||||
sourcemapPathTransform?: SourcemapPathTransformOption;
|
||||
sourcemapDebugIds?: boolean;
|
||||
strict?: boolean;
|
||||
systemNullSetters?: boolean;
|
||||
validate?: boolean;
|
||||
virtualDirname?: string;
|
||||
}
|
||||
|
||||
export interface NormalizedOutputOptions {
|
||||
@@ -758,7 +859,9 @@ export interface NormalizedOutputOptions {
|
||||
freeze: boolean;
|
||||
generatedCode: NormalizedGeneratedCodeOptions;
|
||||
globals: GlobalsOption;
|
||||
hashCharacters: HashCharacters;
|
||||
hoistTransitiveImports: boolean;
|
||||
importAttributesKey: ImportAttributesKey;
|
||||
indent: true | string;
|
||||
inlineDynamicImports: boolean;
|
||||
interop: GetInterop;
|
||||
@@ -772,6 +875,7 @@ export interface NormalizedOutputOptions {
|
||||
plugins: OutputPlugin[];
|
||||
preserveModules: boolean;
|
||||
preserveModulesRoot: string | undefined;
|
||||
reexportProtoFromExternal: boolean;
|
||||
sanitizeFileName: (fileName: string) => string;
|
||||
sourcemap: boolean | 'inline' | 'hidden';
|
||||
sourcemapBaseUrl: string | undefined;
|
||||
@@ -780,9 +884,11 @@ export interface NormalizedOutputOptions {
|
||||
sourcemapFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
|
||||
sourcemapIgnoreList: SourcemapIgnoreListOption;
|
||||
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
||||
sourcemapDebugIds: boolean;
|
||||
strict: boolean;
|
||||
systemNullSetters: boolean;
|
||||
validate: boolean;
|
||||
virtualDirname: string;
|
||||
}
|
||||
|
||||
export type WarningHandlerWithDefault = (
|
||||
@@ -790,12 +896,15 @@ export type WarningHandlerWithDefault = (
|
||||
defaultHandler: LoggingFunction
|
||||
) => void;
|
||||
|
||||
export interface SerializedTimings {
|
||||
[label: string]: [number, number, number];
|
||||
}
|
||||
export type SerializedTimings = Record<string, [number, number, number]>;
|
||||
|
||||
export interface PreRenderedAsset {
|
||||
/** @deprecated Use "names" instead. */
|
||||
name: string | undefined;
|
||||
names: string[];
|
||||
/** @deprecated Use "originalFileNames" instead. */
|
||||
originalFileName: string | null;
|
||||
originalFileNames: string[];
|
||||
source: string | Uint8Array;
|
||||
type: 'asset';
|
||||
}
|
||||
@@ -828,13 +937,9 @@ export interface RenderedChunk extends PreRenderedChunk {
|
||||
dynamicImports: string[];
|
||||
fileName: string;
|
||||
implicitlyLoadedBefore: string[];
|
||||
importedBindings: {
|
||||
[imported: string]: string[];
|
||||
};
|
||||
importedBindings: Record<string, string[]>;
|
||||
imports: string[];
|
||||
modules: {
|
||||
[id: string]: RenderedModule;
|
||||
};
|
||||
modules: Record<string, RenderedModule>;
|
||||
referencedFiles: string[];
|
||||
}
|
||||
|
||||
@@ -845,9 +950,7 @@ export interface OutputChunk extends RenderedChunk {
|
||||
preliminaryFileName: string;
|
||||
}
|
||||
|
||||
export interface SerializablePluginCache {
|
||||
[key: string]: [number, any];
|
||||
}
|
||||
export type SerializablePluginCache = Record<string, [number, any]>;
|
||||
|
||||
export interface RollupCache {
|
||||
modules: ModuleJSON[];
|
||||
@@ -862,6 +965,7 @@ export interface RollupBuild {
|
||||
cache: RollupCache | undefined;
|
||||
close: () => Promise<void>;
|
||||
closed: boolean;
|
||||
[Symbol.asyncDispose](): Promise<void>;
|
||||
generate: (outputOptions: OutputOptions) => Promise<RollupOutput>;
|
||||
getTimings?: () => SerializedTimings;
|
||||
watchFiles: string[];
|
||||
@@ -911,6 +1015,7 @@ export interface WatcherOptions {
|
||||
exclude?: string | RegExp | (string | RegExp)[];
|
||||
include?: string | RegExp | (string | RegExp)[];
|
||||
skipWrite?: boolean;
|
||||
onInvalidate?: (id: string) => void;
|
||||
}
|
||||
|
||||
export interface RollupWatchOptions extends InputOptions {
|
||||
@@ -919,11 +1024,11 @@ export interface RollupWatchOptions extends InputOptions {
|
||||
}
|
||||
|
||||
export type AwaitedEventListener<
|
||||
T extends { [event: string]: (...parameters: any) => any },
|
||||
T extends Record<string, (...parameters: any) => any>,
|
||||
K extends keyof T
|
||||
> = (...parameters: Parameters<T[K]>) => void | Promise<void>;
|
||||
|
||||
export interface AwaitingEventEmitter<T extends { [event: string]: (...parameters: any) => any }> {
|
||||
export interface AwaitingEventEmitter<T extends Record<string, (...parameters: any) => any>> {
|
||||
close(): Promise<void>;
|
||||
emit<K extends keyof T>(event: K, ...parameters: Parameters<T[K]>): Promise<unknown>;
|
||||
/**
|
||||
@@ -973,13 +1078,22 @@ export type RollupWatcher = AwaitingEventEmitter<{
|
||||
|
||||
export function watch(config: RollupWatchOptions | RollupWatchOptions[]): RollupWatcher;
|
||||
|
||||
interface AstNode {
|
||||
interface AstNodeLocation {
|
||||
end: number;
|
||||
start: number;
|
||||
type: string;
|
||||
}
|
||||
|
||||
type ProgramNode = Program & AstNode;
|
||||
type OmittedEstreeKeys =
|
||||
| 'loc'
|
||||
| 'range'
|
||||
| 'leadingComments'
|
||||
| 'trailingComments'
|
||||
| 'innerComments'
|
||||
| 'comments';
|
||||
type RollupAstNode<T> = Omit<T, OmittedEstreeKeys> & AstNodeLocation;
|
||||
|
||||
type ProgramNode = RollupAstNode<estree.Program>;
|
||||
export type AstNode = RollupAstNode<estree.Node>;
|
||||
|
||||
export function defineConfig(options: RollupOptions): RollupOptions;
|
||||
export function defineConfig(options: RollupOptions[]): RollupOptions[];
|
||||
|
||||
Reference in New Issue
Block a user