Extras for Typescript: Revision history

Jump to navigation Jump to search

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

6 November 2024

  • curprev 23:0023:00, 6 November 2024 Iwiseman talk contribs 6,984 bytes +642 Material UI
  • curprev 22:4522:45, 6 November 2024 Iwiseman talk contribs 6,342 bytes +6,342 Created page with "=Option Fields for Types= This was a humorous approach to this where the type was <syntaxhighlight lang="ts"> type Props { name: string gender: "male | female" salary?: number weight?: number } </syntaxhighlight> You only want weight for male and salary for female so we can use intersections <syntaxhighlight lang="ts"> type Props { name: string } & (MaleProps | FemaleProps) type MaleProps { gender: "male" weight: number } type FemaleProps { gen..."