Skip to content

Commit

Permalink
Add Flow libdefs for global
Browse files Browse the repository at this point in the history
Summary:
Changelog: [Internal]

Currently, `global` is typed as `any` and any `global` properties
accesses are untyped. This diff add a flow libdefs for the `global`
object as a start point.

Reviewed By: yungsters

Differential Revision: D30000895

fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d
  • Loading branch information
Huxpro authored and facebook-github-bot committed Aug 9, 2021
1 parent f3374d0 commit b931aa7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions flow/global.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* 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.
*
* @flow strict
* @format
*/

/**
* `global` is a object containing all the global variables for React Native.
*
* NOTE: Consider cross-platform as well as JS environments compatibility
* when defining the types here. Consider both presence (`?`) as well as
* writeability (`+`) when defining types.
*/
declare var global: {
// Undeclared properties are implicitly `any`.
[string | symbol]: any,

This comment has been minimized.

Copy link
@cavaalex

cavaalex Jan 31, 2022

Apparently this is a breaking change for apps running older flow-bin without symbol.

};

0 comments on commit b931aa7

Please sign in to comment.