-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
44 lines (38 loc) · 1.07 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import * as rollup from 'rollup'
type Falsy = false | 0 | '' | null | undefined
type Stringifiable = { toString: () => string }
/**
* The `resolveBanner` function returns a banner as
* - `string`
* - stringifiable object, i.e. having `toString` method, such as `Buffer`
* - any falsy value for an empty banner
* - a `Promise` resolving any of the values mentioned above
*/
type ResolveBanner = (
chunk: rollup.RenderedChunk,
options: rollup.OutputOptions,
) => string | Falsy | Stringifiable | Promise<string | Falsy | Stringifiable>
type FormatterOption = 'docBlock' | 'docBlockAndGap'
type Options = {
/**
* Set `false` to explicitly disable sourcemaps.
* `true` by default
*/
sourcemap?: boolean
/**
* Transform the resolved banner string
*
* @example
* banner2(() => 'banner', { formatter: 'docBlock' })
* // outputs multiline comment similar to:
* /**
* * banner
* * /
*/
formatter?: FormatterOption
}
declare function banner2(
resolveBanner: ResolveBanner,
options?: Options,
): rollup.Plugin
export default banner2