Skip to content

Commit

Permalink
chore(ts): fix banner options typings
Browse files Browse the repository at this point in the history
  • Loading branch information
mjeanroy committed May 30, 2021
1 parent 19089d1 commit 9a03220
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,31 @@ export interface Person {

export type CommentStyle = 'regular' | 'ignored' | 'slash';

export type Banner = string | {
interface BannerContentOptions {
/**
* File to get banner content from.
*/
file: string,

/**
* File encoding.
* @default utf-8
*/
encoding?: string,
}

type BannerContent = string | BannerContentOptions;

interface BannerOptions {
/**
* @see {@link https://github.com/mjeanroy/rollup-plugin-license#comment-style}
*/
commentStyle?: CommentStyle,
content: string | (() => string) | {
/**
* File to get banner content from
*/
file: string,

/**
* @default utf-8
*/
encoding?: string,
},
content: BannerContent | (() => BannerContent),
data?: { [key: string]: string } | (() => { [key: string]: string }),
};
}

export type Banner = string | BannerOptions;

/**
* Dependency information is derived from the package.json file
Expand Down

0 comments on commit 9a03220

Please sign in to comment.