(
type_name: str,
component_name: str,
prop_name: str,
type_info,
custom_props=None,
custom_ignore=None,
)
| 150 | |
| 151 | |
| 152 | def get_prop_typing( |
| 153 | type_name: str, |
| 154 | component_name: str, |
| 155 | prop_name: str, |
| 156 | type_info, |
| 157 | custom_props=None, |
| 158 | custom_ignore=None, |
| 159 | ): |
| 160 | if prop_name == "id": |
| 161 | # Id is always the same either a string or a dict for pattern matching. |
| 162 | return "typing.Union[str, dict]" |
| 163 | |
| 164 | if custom_props: |
| 165 | special = _get_custom_prop(custom_props, component_name, prop_name) |
| 166 | if special: |
| 167 | return special(type_info, component_name, prop_name) |
| 168 | |
| 169 | if custom_ignore and prop_name in custom_ignore: |
| 170 | return "typing.Any" |
| 171 | |
| 172 | prop_type = PROP_TYPING.get(type_name, generate_any)( |
| 173 | type_info, component_name, prop_name |
| 174 | ) |
| 175 | return prop_type |
| 176 | |
| 177 | |
| 178 | PROP_TYPING = { |
no test coverage detected
searching dependent graphs…