{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://typecaast.com/schema/v1/typecaast.schema.json",
  "title": "Typecaast config",
  "type": "object",
  "properties": {
    "version": {
      "type": "number",
      "const": 1
    },
    "meta": {
      "type": "object",
      "properties": {
        "canvas": {
          "type": "object",
          "properties": {
            "width": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "height": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "width",
            "height"
          ],
          "additionalProperties": false
        },
        "fps": {
          "default": 30,
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "fit": {
          "default": "reflow",
          "type": "string",
          "enum": [
            "reflow",
            "scale",
            "fixed"
          ]
        },
        "theme": {
          "default": "auto",
          "type": "string",
          "enum": [
            "light",
            "dark",
            "auto"
          ]
        },
        "skin": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1
            },
            "options": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "required": [
            "id"
          ],
          "additionalProperties": false
        },
        "seed": {
          "default": 42,
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        "background": {
          "default": "transparent",
          "type": "string"
        },
        "assets": {
          "default": "inline",
          "type": "string",
          "enum": [
            "inline",
            "url"
          ]
        },
        "composer": {
          "default": "auto",
          "type": "string",
          "enum": [
            "auto",
            "always",
            "never"
          ]
        },
        "loop": {
          "default": false,
          "type": "boolean"
        }
      },
      "required": [
        "canvas",
        "fps",
        "fit",
        "theme",
        "skin",
        "seed",
        "background",
        "assets",
        "composer",
        "loop"
      ],
      "additionalProperties": false
    },
    "participants": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "avatar": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "isSelf": {
            "type": "boolean"
          },
          "kind": {
            "default": "person",
            "type": "string",
            "enum": [
              "person",
              "app"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "kind"
        ],
        "additionalProperties": false
      }
    },
    "pacing": {
      "default": {
        "readingWpm": 240,
        "typingCps": 14,
        "humanize": 0.15,
        "startDelayMs": 400
      },
      "type": "object",
      "properties": {
        "readingWpm": {
          "default": 240,
          "type": "number",
          "exclusiveMinimum": 0
        },
        "typingCps": {
          "default": 14,
          "type": "number",
          "exclusiveMinimum": 0
        },
        "humanize": {
          "default": 0.15,
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "startDelayMs": {
          "default": 400,
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "readingWpm",
        "typingCps",
        "humanize",
        "startDelayMs"
      ],
      "additionalProperties": false
    },
    "timeline": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "message"
              },
              "from": {
                "type": "string"
              },
              "typing": {
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "showTypingFor": {
                        "type": "number",
                        "minimum": 0
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              },
              "text": {
                "type": "string"
              },
              "images": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "src": {
                      "type": "string"
                    },
                    "alt": {
                      "type": "string"
                    },
                    "width": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "height": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "src"
                  ],
                  "additionalProperties": false
                }
              },
              "content": {
                "allOf": [
                  {
                    "$ref": "#/definitions/__schema0"
                  }
                ]
              },
              "id": {
                "type": "string"
              },
              "instant": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "from"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "reaction"
              },
              "target": {
                "type": "string"
              },
              "emoji": {
                "type": "string"
              },
              "shortcode": {
                "type": "string"
              },
              "from": {
                "type": "string"
              },
              "delay": {
                "type": "number",
                "minimum": 0
              },
              "id": {
                "type": "string"
              },
              "instant": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "emoji"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "typing"
              },
              "from": {
                "type": "string"
              },
              "showTypingFor": {
                "type": "number",
                "minimum": 0
              },
              "id": {
                "type": "string"
              },
              "instant": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "from"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "composerType"
              },
              "from": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "typingDuration": {
                "type": "number",
                "minimum": 0
              },
              "id": {
                "type": "string"
              },
              "instant": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "from",
              "text"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "send"
              },
              "from": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "instant": {
                "type": "boolean"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "edit"
              },
              "target": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "images": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "src": {
                      "type": "string"
                    },
                    "alt": {
                      "type": "string"
                    },
                    "width": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "height": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "src"
                  ],
                  "additionalProperties": false
                }
              },
              "content": {
                "allOf": [
                  {
                    "$ref": "#/definitions/__schema0"
                  }
                ]
              },
              "id": {
                "type": "string"
              },
              "instant": {
                "type": "boolean"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "delete"
              },
              "target": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "instant": {
                "type": "boolean"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "readReceipt"
              },
              "by": {
                "type": "string"
              },
              "target": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "instant": {
                "type": "boolean"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "system"
              },
              "from": {
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "images": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "src": {
                      "type": "string"
                    },
                    "alt": {
                      "type": "string"
                    },
                    "width": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "height": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    }
                  },
                  "required": [
                    "src"
                  ],
                  "additionalProperties": false
                }
              },
              "content": {
                "allOf": [
                  {
                    "$ref": "#/definitions/__schema0"
                  }
                ]
              },
              "id": {
                "type": "string"
              },
              "instant": {
                "type": "boolean"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "delay"
              },
              "duration": {
                "type": "number",
                "minimum": 0
              },
              "id": {
                "type": "string"
              },
              "instant": {
                "type": "boolean"
              }
            },
            "required": [
              "type",
              "duration"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  },
  "required": [
    "version",
    "meta",
    "participants",
    "pacing",
    "timeline"
  ],
  "additionalProperties": false,
  "definitions": {
    "__schema0": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "text"
              },
              "spans": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "text"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "code"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "bold"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "italic"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "strike"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "link"
                        },
                        "href": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "href"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "mention"
                        },
                        "label": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "label"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "emoji"
                        },
                        "value": {
                          "type": "string"
                        },
                        "shortcode": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            },
            "required": [
              "type",
              "spans"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "image"
              },
              "src": {
                "type": "string"
              },
              "alt": {
                "type": "string"
              },
              "width": {
                "type": "number",
                "exclusiveMinimum": 0
              },
              "height": {
                "type": "number",
                "exclusiveMinimum": 0
              }
            },
            "required": [
              "type",
              "src"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "header"
              },
              "text": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "text"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "section"
              },
              "spans": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "text"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "code"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "bold"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "italic"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "strike"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "link"
                        },
                        "href": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "href"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "mention"
                        },
                        "label": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "label"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "emoji"
                        },
                        "value": {
                          "type": "string"
                        },
                        "shortcode": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "value"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              },
              "text": {
                "type": "string"
              },
              "accessory": {
                "oneOf": [
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "button"
                      },
                      "label": {
                        "type": "string"
                      },
                      "href": {
                        "type": "string"
                      },
                      "style": {
                        "type": "string",
                        "enum": [
                          "primary",
                          "danger"
                        ]
                      }
                    },
                    "required": [
                      "type",
                      "label"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "image"
                      },
                      "src": {
                        "type": "string"
                      },
                      "alt": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "type",
                      "src"
                    ],
                    "additionalProperties": false
                  }
                ]
              },
              "fields": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "spans": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "text"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "value"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "code"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "value"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "bold"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "value"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "italic"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "value"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "strike"
                              },
                              "value": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "value"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "link"
                              },
                              "href": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "href"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "mention"
                              },
                              "label": {
                                "type": "string"
                              },
                              "id": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "label"
                            ],
                            "additionalProperties": false
                          },
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string",
                                "const": "emoji"
                              },
                              "value": {
                                "type": "string"
                              },
                              "shortcode": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "value"
                            ],
                            "additionalProperties": false
                          }
                        ]
                      }
                    },
                    "text": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "context"
              },
              "elements": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "text"
                        },
                        "spans": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "text"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "code"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "bold"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "italic"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "strike"
                                  },
                                  "value": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "value"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "link"
                                  },
                                  "href": {
                                    "type": "string"
                                  },
                                  "label": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "href"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "mention"
                                  },
                                  "label": {
                                    "type": "string"
                                  },
                                  "id": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "label"
                                ],
                                "additionalProperties": false
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "type": {
                                    "type": "string",
                                    "const": "emoji"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "shortcode": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "type",
                                  "value"
                                ],
                                "additionalProperties": false
                              }
                            ]
                          }
                        },
                        "text": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type"
                      ],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "image"
                        },
                        "src": {
                          "type": "string"
                        },
                        "alt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "src"
                      ],
                      "additionalProperties": false
                    }
                  ]
                }
              }
            },
            "required": [
              "type",
              "elements"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "divider"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "actions"
              },
              "elements": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "button"
                    },
                    "label": {
                      "type": "string"
                    },
                    "href": {
                      "type": "string"
                    },
                    "style": {
                      "type": "string",
                      "enum": [
                        "primary",
                        "danger"
                      ]
                    }
                  },
                  "required": [
                    "type",
                    "label"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type",
              "elements"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "codeblock"
              },
              "text": {
                "type": "string"
              },
              "lang": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "text"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "attachment"
              },
              "color": {
                "type": "string"
              },
              "content": {
                "$ref": "#/definitions/__schema0"
              }
            },
            "required": [
              "type",
              "content"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": {}
          }
        ]
      }
    }
  }
}
