Files
yoga/javascript/src_js
Bela Bohlender c09405d58c Typescript: improve enum types and setMargin type (#1233)
Summary:
Currently, it is impossible to write `node.setPositionType(2)` instead of `node.setPositionType(POSITION_TYPE_ABSOLUTE)`. I understand that the idea is to force explicit usage of the enums. However, declaring `type POSITION_TYPE_ABSOLUTE = 2 & ['POSITION_TYPE']` artificially limits use cases, where, for example, the state should be serialized typesafe.

Additionally, this PR fixes the incorrect typing of `setMargin(edge: Edge, margin: number)` by extending the type to `margin: number | string`

Pull Request resolved: https://github.com/facebook/yoga/pull/1233

Reviewed By: javache

Differential Revision: D43695520

Pulled By: NickGerleman

fbshipit-source-id: aac5f1de71817cc268fb003454ba29d31be10e0b
2023-03-01 07:40:03 -08:00
..
2023-02-20 19:54:03 -08:00
2022-12-28 01:27:12 -08:00
2022-12-28 01:27:12 -08:00
2022-12-28 01:27:12 -08:00
2022-12-28 01:27:12 -08:00