Skip to content

Commit

Permalink
chore: improve types
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Oct 14, 2022
1 parent 65d49f1 commit 4eb3e36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/rollup/rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ async function getOutputOptionsAndPluginDriver(
};
}

async function getOutputOptions(
function getOutputOptions(
inputOptions: NormalizedInputOptions,
unsetInputOptions: ReadonlySet<string>,
rawOutputOptions: OutputOptions,
Expand Down
20 changes: 6 additions & 14 deletions src/rollup/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
export const VERSION: string;

type FalsyValue = false | null | undefined;
type MaybeArray<T> = T | T[];
type MaybePromise<T> = T | Promise<T>;

export interface RollupError extends RollupLog {
name?: string;
stack?: string;
Expand Down Expand Up @@ -495,13 +499,7 @@ export type SourcemapPathTransformOption = (
sourcemapPath: string
) => string;

export type InputPluginOption =
| Plugin
| null
| false
| undefined
| InputPluginOption[]
| Promise<Plugin | false | null | undefined | InputPluginOption[]>;
export type InputPluginOption = MaybePromise<Plugin | FalsyValue | InputPluginOption[]>;

export interface InputOptions {
acorn?: Record<string, unknown>;
Expand Down Expand Up @@ -625,13 +623,7 @@ export type NormalizedAmdOptions = (

type AddonFunction = (chunk: RenderedChunk) => string | Promise<string>;

type OutputPluginOption =
| OutputPlugin
| null
| false
| undefined
| OutputPluginOption[]
| Promise<OutputPlugin | false | null | undefined | OutputPluginOption[]>;
type OutputPluginOption = MaybePromise<OutputPlugin | FalsyValue | OutputPluginOption[]>;

export interface OutputOptions {
amd?: AmdOptions;
Expand Down

0 comments on commit 4eb3e36

Please sign in to comment.