From 382330bfaf14d70a661abe1f2b6c24c98037bf1a Mon Sep 17 00:00:00 2001 From: Michel Weststrate Date: Wed, 11 Dec 2019 03:43:31 -0800 Subject: [PATCH] Convert to TypeScript Summary: Before looking into performance bottlenecks, I thought it wise to upgrade to TypeScript as that is where all plugins are heading Reviewed By: jknoxville Differential Revision: D18829689 fbshipit-source-id: 4c515f240d742f77e89f3cbdff500c69afb3ac06 --- src/index.tsx | 1 + src/utils/jsonTypes.tsx | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/utils/jsonTypes.tsx diff --git a/src/index.tsx b/src/index.tsx index f5654591a..96582ba82 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -10,6 +10,7 @@ export {default as styled, keyframes} from 'react-emotion'; export * from './ui/index'; export {getStringFromErrorLike, textContent} from './utils/index'; +export * from './utils/jsonTypes'; export {default as GK} from './fb-stubs/GK'; export {default as createPaste} from './fb-stubs/createPaste'; export {internGraphPOSTAPIRequest, graphQLQuery} from './fb-stubs/user'; diff --git a/src/utils/jsonTypes.tsx b/src/utils/jsonTypes.tsx new file mode 100644 index 000000000..e3c383b26 --- /dev/null +++ b/src/utils/jsonTypes.tsx @@ -0,0 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +export type JSON = JSONPrimitive | JSONArray | JSONObject; + +export type JSONPrimitive = null | boolean | number | string; + +export type JSONArray = JSON[]; + +export type JSONObject = {[key: string]: JSON};