Skip to content

Commit

Permalink
fix: Improve legibility, fix interpolation return type
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Mar 8, 2019
1 parent 3ed4f44 commit e941fbf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@
// Definitions by: François Best <https://github.com/franky47>
// TypeScript version: 3.1.6

import { ThemedStyledProps, FlattenInterpolation } from 'styled-components'
import {
ThemedStyledProps,
InterpolationValue,
FlattenInterpolation
} from 'styled-components'

type InterpolationFunction<Props, Theme> = (
props: ThemedStyledProps<Props, Theme>
) => InterpolationValue | FlattenInterpolation<ThemedStyledProps<Props, Theme>>

type GeneratorFunction<Props, Theme> = (
strings: TemplateStringsArray,
...interpolations: (
| ((
props: ThemedStyledProps<Props, Theme>
) => string | FlattenInterpolation<ThemedStyledProps<Props, Theme>>)
| InterpolationFunction<Props, Theme>
| FlattenInterpolation<ThemedStyledProps<Props, Theme>>)[]
) => any

Expand Down

0 comments on commit e941fbf

Please sign in to comment.