Skip to content

Commit d93156f

Browse files
committedJan 31, 2019
fix: types
1 parent 84dfd4d commit d93156f

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed
 

‎src/types.ts

+13-6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { ModuleFormat as RollupFormat } from 'rollup'
22

33
import { Banner } from './utils/get-banner'
44

5+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
6+
type Diff<T extends keyof any, U extends keyof any> = ({ [P in T]: P } &
7+
{ [P in U]: never } & { [x: string]: never })[T]
8+
type Overwrite<T, U> = Pick<T, Diff<keyof T, keyof U>> & U
9+
510
export type Format =
611
| RollupFormat
712
| 'cjs-min'
@@ -209,14 +214,16 @@ export interface Config {
209214
extendConfig?: ExtendConfig
210215
}
211216

217+
interface ConfigOutputOverwrite {
218+
/**
219+
* Output directory, always a string
220+
*/
221+
dir: string
222+
}
223+
212224
export interface NormalizedConfig {
213225
input?: string | ConfigEntryObject | Array<ConfigEntryObject | string>
214-
output: Overwrite<
215-
ConfigOutput,
216-
{
217-
dir: string
218-
}
219-
>
226+
output: Overwrite<ConfigOutput, ConfigOutputOverwrite>
220227
env?: Env
221228
bundleNodeModules?: boolean | string[]
222229
plugins: {

‎types.d.ts

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
declare module '*.json'
22

3-
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
4-
type Diff<T extends keyof any, U extends keyof any> = ({ [P in T]: P } &
5-
{ [P in U]: never } & { [x: string]: never })[T]
6-
type Overwrite<T, U> = Pick<T, Diff<keyof T, keyof U>> & U
7-
83
declare module 'tinydate' {
94
type Tinydate = (template: string) => (date?: Date) => string
105
const tinydate: Tinydate

0 commit comments

Comments
 (0)
Please sign in to comment.