Check out example codes for "ts enum". It will help you in understanding the concepts better.

Code Example 1

enum Response {
    No = 0,
    Yes = 1,
}

function respond(recipient: string, message: Response): void {
    // ...
}

respond("Princess Caroline", Response.Yes)

Learn ReactJs, React Native from akashmittal.com