From 2d4bedba0f6a8f2cfe597a1044822eb635d5e243 Mon Sep 17 00:00:00 2001 From: Spencer Ahrens Date: Wed, 13 Dec 2017 11:45:13 -0800 Subject: [PATCH] add CoreEventTypes with LayoutEvent Reviewed By: mhollweck Differential Revision: D6554426 fbshipit-source-id: 856fcb8017682bc203fd69f5f4c93704816046ac --- IntegrationTests/LayoutEventsTest.js | 12 +----------- Libraries/Types/CoreEventTypes.js | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 Libraries/Types/CoreEventTypes.js diff --git a/IntegrationTests/LayoutEventsTest.js b/IntegrationTests/LayoutEventsTest.js index 220701c4e..ab7bc6040 100644 --- a/IntegrationTests/LayoutEventsTest.js +++ b/IntegrationTests/LayoutEventsTest.js @@ -29,17 +29,7 @@ function debug(...args) { // console.log.apply(null, arguments); } -type Layout = { - x: number; - y: number; - width: number; - height: number; -}; -type LayoutEvent = { - nativeEvent: { - layout: Layout; - }; -}; +import type {Layout, LayoutEvent} from 'CoreEventTypes'; type Style = { margin?: number, padding?: number, diff --git a/Libraries/Types/CoreEventTypes.js b/Libraries/Types/CoreEventTypes.js new file mode 100644 index 000000000..6f236371f --- /dev/null +++ b/Libraries/Types/CoreEventTypes.js @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + * @providesModule CoreEventTypes + * @flow + * @format + */ + +'use strict'; + +export type Layout = { + x: number, + y: number, + width: number, + height: number, +}; +export type LayoutEvent = { + nativeEvent: { + layout: Layout, + }, +};