From dbce06759a19c455b4b654651cb48c59af2891ee Mon Sep 17 00:00:00 2001 From: mg901 Date: Thu, 7 Feb 2019 19:28:16 +0300 Subject: [PATCH] feat: add import BpProps --- src/index.js | 12 +++++++----- src/models.js | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index 1217ccd0..6d327894 100644 --- a/src/index.js +++ b/src/index.js @@ -2,9 +2,11 @@ import { calcMinWidthInPx, calcMaxWidthInPx } from './calculators'; import { withMinMedia, withMaxMedia, withMinAndMaxMedia } from './HOFs'; -import type { Props } from './models'; +import type { BpProps } from './models'; -type Up = (string) => (Props) => string; +export type { BpProps } from './models'; + +type Up = (string) => (BpProps) => string; export const up: Up = (breakName) => ({ theme }) => withMinMedia( calcMinWidthInPx( @@ -14,7 +16,7 @@ export const up: Up = (breakName) => ({ theme }) => ), ); -type Down = (string) => (Props) => string; +type Down = (string) => (BpProps) => string; export const down: Down = (breakName) => ({ theme }) => withMaxMedia( calcMaxWidthInPx( @@ -24,7 +26,7 @@ export const down: Down = (breakName) => ({ theme }) => ), ); -type Between = (string, string) => (Props) => string; +type Between = (string, string) => (BpProps) => string; export const between: Between = (minBreak, maxBreak) => ({ theme }) => withMinAndMaxMedia( calcMinWidthInPx( @@ -39,7 +41,7 @@ export const between: Between = (minBreak, maxBreak) => ({ theme }) => ), ); -type Only = (string) => (Props) => string; +type Only = (string) => (BpProps) => string; export const only: Only = (breakName) => ({ theme }) => withMinAndMaxMedia( calcMinWidthInPx( diff --git a/src/models.js b/src/models.js index e9b61f13..751183ff 100644 --- a/src/models.js +++ b/src/models.js @@ -11,6 +11,6 @@ export type CustomBreakpoints = { breakpoints?: BreakpointsMap, }; -export type Props = { +export type BpProps = { theme: CustomBreakpoints, };