| 1 |
/* eslint-disable import/no-extraneous-dependencies */ |
| 2 |
import type { RollupBuild, OutputOptions, OutputChunk, OutputAsset } from 'rollup'; |
| 3 |
import type { Assertions } from 'ava'; |
| 4 |
|
| 5 |
interface GetCode { |
| 6 |
(bundle: RollupBuild, outputOptions?: OutputOptions | null, allFiles?: false): Promise<string>; |
| 7 |
(bundle: RollupBuild, outputOptions: OutputOptions | null | undefined, allFiles: true): Promise< |
| 8 |
Array<{ |
| 9 |
code: OutputChunk['code'] | undefined; |
| 10 |
fileName: OutputChunk['fileName'] | OutputAsset['fileName']; |
| 11 |
source: OutputAsset['source'] | undefined; |
| 12 |
}> |
| 13 |
>; |
| 14 |
} |
| 15 |
|
| 16 |
export const getCode: GetCode; |
| 17 |
|
| 18 |
export function getFiles( |
| 19 |
bundle: RollupBuild, |
| 20 |
outputOptions?: OutputOptions |
| 21 |
): Promise< |
| 22 |
{ |
| 23 |
fileName: string; |
| 24 |
content: any; |
| 25 |
}[] |
| 26 |
>; |
| 27 |
|
| 28 |
export function evaluateBundle(bundle: RollupBuild): Promise<Pick<NodeModule, 'exports'>>; |
| 29 |
|
| 30 |
export function getImports(bundle: RollupBuild): Promise<string[]>; |
| 31 |
|
| 32 |
export function getResolvedModules(bundle: RollupBuild): Promise<Record<string, string>>; |
| 33 |
|
| 34 |
export function onwarn(warning: string | any): void; |
| 35 |
|
| 36 |
export function testBundle( |
| 37 |
t: Assertions, |
| 38 |
bundle: RollupBuild, |
| 39 |
options: { inject: Record<string, any>; options: Record<string, any> } |
| 40 |
): Promise<{ |
| 41 |
code: string; |
| 42 |
error?: any; |
| 43 |
result?: any; |
| 44 |
module: Pick<NodeModule, 'exports'>; |
| 45 |
}>; |