Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Avoid inexact object types #82

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-strict-dom/src/dom/modules/ThemeContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import * as React from 'react';

type ProviderValue = {
customProperties: { ... }
customProperties: { +[string]: ?string | number }
};

type ProviderProps = {
Expand Down
6 changes: 3 additions & 3 deletions packages/react-strict-dom/src/native/stylex/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,10 @@ function resolveStyle<S: { +[string]: mixed }>(
* which can be done at initialization-time (could potentially be done at
* compile-time in the future).
*/
function _create<S: { [string]: { ... } }>(styles: S): {
[string]: { ... }
function _create<S: { +[string]: { +[string]: mixed } }>(styles: S): {
[string]: mixed
} {
const result: { [string]: { ... } } = {};
const result: { [string]: mixed } = {};
for (const styleName in styles) {
const val = styles[styleName];
if (typeof val === 'function') {
Expand Down
4 changes: 3 additions & 1 deletion packages/react-strict-dom/src/types/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import typeof TStyleX from '@stylexjs/stylex';

export type Style = InlineStyles;

export type Styles = StyleXArray<StyleXStyles<> | Theme<VarGroup<{ ... }>>>;
export type Styles = StyleXArray<
StyleXStyles<> | Theme<VarGroup<{ +[string]: mixed }>>
>;

export type IStyleX = $ReadOnly<{
create: TStyleX['create'],
Expand Down
Loading