From 351d67eec82168f0967dc36c044fc05e51f27be6 Mon Sep 17 00:00:00 2001 From: Alexey Plutalov Date: Fri, 5 May 2017 16:53:14 +0300 Subject: [PATCH] Add local `css` namespace types --- src/css/add-class.js | 2 +- src/css/has-class.js | 2 +- src/css/remove-class.js | 2 +- src/css/toggle-class.js | 2 +- src/css/types.js | 3 +++ src/types.js | 2 -- 6 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 src/css/types.js diff --git a/src/css/add-class.js b/src/css/add-class.js index 506eda3..f22c78d 100644 --- a/src/css/add-class.js +++ b/src/css/add-class.js @@ -1,6 +1,6 @@ /* @flow */ -import type { CSSClass } from "../types"; +import type { CSSClass } from "./types"; import hasClass from "./has-class"; diff --git a/src/css/has-class.js b/src/css/has-class.js index 7d360c0..f75bcc3 100644 --- a/src/css/has-class.js +++ b/src/css/has-class.js @@ -1,6 +1,6 @@ /* @flow */ -import type { CSSClass } from "../types"; +import type { CSSClass } from "./types"; function hasClass(element: Element, cssClass: CSSClass): boolean { return element.classList.contains(cssClass); diff --git a/src/css/remove-class.js b/src/css/remove-class.js index 9eac781..4071eb1 100644 --- a/src/css/remove-class.js +++ b/src/css/remove-class.js @@ -1,6 +1,6 @@ /* @flow */ -import type { CSSClass } from "../types"; +import type { CSSClass } from "./types"; import hasClass from "./has-class"; diff --git a/src/css/toggle-class.js b/src/css/toggle-class.js index 13de36d..c3dc6ed 100644 --- a/src/css/toggle-class.js +++ b/src/css/toggle-class.js @@ -1,6 +1,6 @@ /* @flow */ -import type { CSSClass } from "../types"; +import type { CSSClass } from "./types"; import addClass from "./add-class"; import hasClass from "./has-class"; diff --git a/src/css/types.js b/src/css/types.js new file mode 100644 index 0000000..086b752 --- /dev/null +++ b/src/css/types.js @@ -0,0 +1,3 @@ +/* @flow */ + +export type CSSClass = string; diff --git a/src/types.js b/src/types.js index aa845b7..ee551a1 100644 --- a/src/types.js +++ b/src/types.js @@ -1,7 +1,5 @@ /* @flow */ -export type CSSClass = string; - export type Dataset = { [key: string]: string }; export type DelegatedEvent = Event & { delegateTarget: EventTarget };