DiamondLightSource / DiamondLightSource/cs-web-lib
Clean up types of numbers in the position interface
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 4
- Avg merge
- 3d 59m
- Merged PRs (30d)
- 3
Description
As someone using `cs-web-lib` in my app it's confusing that parameters that I would naturally expect to be numbers are expected to be passed in as strings e.g. many of the items in https://github.com/DiamondLightSource/cs-web-lib/blob/b307d188133c1df647f08c2401d9edca487ecf69/src/types/position.ts#L8. See initial confusion at https://github.com/DiamondLightSource/atlas/pull/84#discussion_r3473737603.
## Acceptance Criteria
* We can pass these values in as numbers
* If we must keep backwards compatibility we still allow strings but ideally I feel like they should be typed as just numbers
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/types/position.ts at the linked definitions, then inspect the related discussion in atlas pull request 84 and usages of the position interface. Update the types so numeric values can be passed as numbers, retaining string compatibility only if required; done means the acceptance criteria are met without breaking existing callers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 75/100