Clean up types of numbers in the position interface

Open Beginner friendly
#215 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Quiet
Tech stack
typescript
Domain
frontend

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.

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
Dominant language
TypeScript
Stars
5
Forks
4
Avg merge
3d 59m
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from DiamondLightSource/cs-web-lib

All issues in DiamondLightSource/cs-web-lib

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.