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, + }, +};