Skip to content

Commit 610fdd3

Browse files
justin808claude
andcommitted
RBS: Narrow type signatures for props parameters
Improve type precision for props parameters in RBS signatures by changing from `untyped` to `Hash[Symbol, untyped] | String`. This change: - Provides better type checking for props parameters - Accepts both common formats (Hash or JSON string) - Improves IDE support and autocomplete - Helps catch type errors earlier Updated signatures: - helper.rbs: sanitized_props_string props parameter - controller.rbs: redux_store props parameter Fixes #1951 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 0364781 commit 610fdd3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sig/react_on_rails/controller.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module ReactOnRails
55

66
def redux_store: (
77
String store_name,
8-
?props: untyped,
8+
?props: Hash[Symbol, untyped] | String,
99
?immediate_hydration: bool
1010
) -> void
1111

sig/react_on_rails/helper.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module ReactOnRails
2121
# Returns html_safe string (ActiveSupport::SafeBuffer)
2222
def redux_store: (
2323
String store_name,
24-
?Hash[Symbol, untyped] props
24+
?Hash[Symbol, untyped] | String props
2525
) -> safe_buffer
2626

2727
# Returns html_safe string (ActiveSupport::SafeBuffer)
@@ -33,7 +33,7 @@ module ReactOnRails
3333
?Hash[Symbol, untyped] options
3434
) -> safe_buffer
3535

36-
def sanitized_props_string: (untyped props) -> String
36+
def sanitized_props_string: (Hash[Symbol, untyped] | String props) -> String
3737

3838
def rails_context: (
3939
?server_side: bool

0 commit comments

Comments
 (0)