games:
  - type: speed-round
    title: "Type This!"
    rounds:
      - question: "An array of strings. What's the type?"
        options:
          - "Array<string>"
          - "string[]"
          - "string Array"
          - "[]string"
        answer: 1
        timeLimit: 12
      - question: "A function that takes a number and returns a boolean. What's the type?"
        options:
          - "function number -> boolean"
          - "(n: number) => boolean"
          - "NumberBoolean"
          - "Function<number, boolean>"
        answer: 1
        timeLimit: 16
      - question: "An object with keys that can be any string, and values that are numbers. What's the type?"
        options:
          - "object"
          - "Record<string, number>"
          - "{ [key: string]: number }"
          - "Map<string, number>"
        answer: 1
        timeLimit: 16
      - question: "A value that can be either a string or null. What's the type?"
        options:
          - "string | null"
          - "string | undefined"
          - "string?"
          - "optional string"
        answer: 0
        timeLimit: 14
      - question: "A Promise that resolves to a User object. What's the type?"
        options:
          - "Promise User"
          - "Promise<User>"
          - "async User"
          - "User | Promise"
        answer: 1
        timeLimit: 14
      - question: "A tuple with exactly [string, number] in that order. What's the type?"
        options:
          - "Array<string | number>"
          - "[string, number]"
          - "tuple string number"
          - "(string, number)"
        answer: 1
        timeLimit: 14
      - question: "A function with no parameters that returns void. What's the type?"
        options:
          - "() => void"
          - "void"
          - "function void"
          - "()void"
        answer: 0
        timeLimit: 12
      - question: "A union of string literals: 'pending' | 'success' | 'error'. What's the type?"
        options:
          - "string"
          - "'pending' | 'success' | 'error'"
          - "enum Status"
          - "Status"
        answer: 1
        timeLimit: 16
      - question: "A generic type that wraps any type T. What's the type for a box containing a number?"
        options:
          - "Box number"
          - "Box<number>"
          - "Generic<number>"
          - "T<number>"
        answer: 1
        timeLimit: 14
      - question: "A readonly array that cannot be mutated. What's the type?"
        options:
          - "array"
          - "ReadonlyArray<string>"
          - "const string[]"
          - "immutable string[]"
        answer: 1
        timeLimit: 16

  - type: classify
    title: "Type vs Interface"
    categories:
      - name: "type alias"
        color: "#58a6ff"
      - name: "interface"
        color: "#3fb950"
      - name: "either works"
        color: "#8b949e"
    items:
      - text: "A union type: string | number."
        category: "type alias"
      - text: "An object shape that will be extended by other types (extends)."
        category: "interface"
      - text: "A simple object shape with a few properties, no extension planned."
        category: "either works"
      - text: "A mapped type: { [K in keyof T]: T[K] }."
        category: "type alias"
      - text: "Declaration merging needed (e.g. augmenting a library's types)."
        category: "interface"
      - text: "A primitive alias: type ID = string."
        category: "type alias"
      - text: "An intersection type: A & B."
        category: "type alias"
      - text: "A class-implementable contract (class Foo implements Bar)."
        category: "either works"
