{
  "version": 1,
  "width": 720,
  "height": 400,
  "title": "Annotated code",
  "description": "Explain one function and highlight its important return value. All values are illustrative example data.",
  "elements": [
    {
      "type": "text",
      "x": 36,
      "y": 39,
      "text": "A typed response",
      "size": 17,
      "fill": "ink",
      "align": "start",
      "mono": false
    },
    {
      "type": "text",
      "x": 36,
      "y": 62,
      "text": "TypeScript · example source",
      "size": 11,
      "fill": "muted",
      "align": "start",
      "mono": true
    },
    {
      "type": "box",
      "x": 31,
      "y": 180,
      "w": 658,
      "h": 29,
      "fill": "soft",
      "stroke": "none",
      "dashed": false
    },
    {
      "type": "text",
      "x": 44,
      "y": 112,
      "text": "1",
      "size": 11,
      "fill": "muted",
      "align": "end",
      "mono": true
    },
    {
      "type": "text",
      "x": 64,
      "y": 112,
      "text": "type Result = { id: string };",
      "size": 14,
      "fill": "accent",
      "align": "start",
      "mono": true
    },
    {
      "type": "text",
      "x": 44,
      "y": 141,
      "text": "2",
      "size": 11,
      "fill": "muted",
      "align": "end",
      "mono": true
    },
    {
      "type": "text",
      "x": 64,
      "y": 141,
      "text": "",
      "size": 14,
      "fill": "ink",
      "align": "start",
      "mono": true
    },
    {
      "type": "text",
      "x": 44,
      "y": 170,
      "text": "3",
      "size": 11,
      "fill": "muted",
      "align": "end",
      "mono": true
    },
    {
      "type": "text",
      "x": 64,
      "y": 170,
      "text": "async function read(id: string) {",
      "size": 14,
      "fill": "ink",
      "align": "start",
      "mono": true
    },
    {
      "type": "text",
      "x": 44,
      "y": 199,
      "text": "4",
      "size": 11,
      "fill": "muted",
      "align": "end",
      "mono": true
    },
    {
      "type": "text",
      "x": 64,
      "y": 199,
      "text": "  const response = await fetch(`/api/${id}`);",
      "size": 14,
      "fill": "accent",
      "align": "start",
      "mono": true
    },
    {
      "type": "text",
      "x": 44,
      "y": 228,
      "text": "5",
      "size": 11,
      "fill": "muted",
      "align": "end",
      "mono": true
    },
    {
      "type": "text",
      "x": 64,
      "y": 228,
      "text": "  return response.json() as Promise<Result>;",
      "size": 14,
      "fill": "ink",
      "align": "start",
      "mono": true
    },
    {
      "type": "text",
      "x": 44,
      "y": 257,
      "text": "6",
      "size": 11,
      "fill": "muted",
      "align": "end",
      "mono": true
    },
    {
      "type": "text",
      "x": 64,
      "y": 257,
      "text": "}",
      "size": 14,
      "fill": "ink",
      "align": "start",
      "mono": true
    },
    {
      "type": "text",
      "x": 64,
      "y": 339,
      "text": "Return the parsed JSON with a declared result type.",
      "size": 12,
      "fill": "muted",
      "align": "start",
      "mono": false
    }
  ]
}