From 0ccb9b23867a5e91f05ee42585b1b8335a74f8de Mon Sep 17 00:00:00 2001 From: Cole Lawrence Date: Wed, 20 Apr 2022 11:21:27 -0400 Subject: [PATCH] doc: Internals IShorthandProp --- theatre/core/src/propTypes/internals.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/theatre/core/src/propTypes/internals.ts b/theatre/core/src/propTypes/internals.ts index 61f062f..1c5c674 100644 --- a/theatre/core/src/propTypes/internals.ts +++ b/theatre/core/src/propTypes/internals.ts @@ -17,8 +17,16 @@ export type IValidCompoundProps = { [K in string]: PropTypeConfig } -// Question: Why doesn't this include Rgba? Should it include Marker? -// - Is this just for compound props? +/** + * + * This does not include Rgba since Rgba does not have a predictable + * object shape. We prefer to infer that compound props are described as + * `Record` for now. + * + * In the future, it might be reasonable to wrap these types up into something + * which would allow us to differentiate between values at runtime + * (e.g. `val.type = "Rgba"` vs `val.type = "Compound"` etc) + */ type IShorthandProp = | string | number