diff options
author | lonkaars <loek@pipeframe.xyz> | 2021-05-13 16:33:12 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2021-05-13 16:33:12 +0200 |
commit | 967123ed915634b8303007daca312666bc5d3906 (patch) | |
tree | 44fe94fabe058f7afda2b43e8b6a26c659b5068b | |
parent | 0baafb6e8a0409e45e387febb197c53acde78c89 (diff) |
fix schema
-rw-r--r-- | timeline.schema.json | 107 | ||||
-rw-r--r-- | timeline.ts | 2 |
2 files changed, 107 insertions, 2 deletions
diff --git a/timeline.schema.json b/timeline.schema.json index 8493d49..aa12da1 100644 --- a/timeline.schema.json +++ b/timeline.schema.json @@ -2,6 +2,34 @@ "$ref": "#/definitions/timeline", "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { + "delaySlide": { + "additionalProperties": false, + "properties": { + "clickThroughBehaviour": { + "enum": [ + "ImmediatelySkip", + "PlayOut" + ], + "type": "string" + }, + "delay": { + "type": "number" + }, + "frame": { + "type": "number" + }, + "type": { + "$ref": "#/definitions/keyframeTypes" + } + }, + "required": [ + "clickThroughBehaviour", + "delay", + "frame", + "type" + ], + "type": "object" + }, "keyframeTypes": { "enum": [ "default", @@ -11,6 +39,42 @@ ], "type": "string" }, + "loopSlide": { + "additionalProperties": false, + "properties": { + "beginFrame": { + "type": "number" + }, + "clickThroughBehaviour": { + "enum": [ + "ImmediatelySkip", + "PlayOut" + ], + "type": "string" + }, + "frame": { + "type": "number" + }, + "playbackType": { + "enum": [ + "PingPong", + "Normal" + ], + "type": "string" + }, + "type": { + "$ref": "#/definitions/keyframeTypes" + } + }, + "required": [ + "beginFrame", + "clickThroughBehaviour", + "frame", + "playbackType", + "type" + ], + "type": "object" + }, "slide": { "additionalProperties": false, "properties": { @@ -35,6 +99,34 @@ ], "type": "object" }, + "speedChangeSlide": { + "additionalProperties": false, + "properties": { + "clickThroughBehaviour": { + "enum": [ + "ImmediatelySkip", + "PlayOut" + ], + "type": "string" + }, + "frame": { + "type": "number" + }, + "newFramerate": { + "type": "number" + }, + "type": { + "$ref": "#/definitions/keyframeTypes" + } + }, + "required": [ + "clickThroughBehaviour", + "frame", + "newFramerate", + "type" + ], + "type": "object" + }, "timeline": { "additionalProperties": false, "properties": { @@ -46,7 +138,20 @@ }, "slides": { "items": { - "$ref": "#/definitions/slide" + "anyOf": [ + { + "$ref": "#/definitions/slide" + }, + { + "$ref": "#/definitions/delaySlide" + }, + { + "$ref": "#/definitions/speedChangeSlide" + }, + { + "$ref": "#/definitions/loopSlide" + } + ] }, "type": "array" } diff --git a/timeline.ts b/timeline.ts index bb0892e..8bb4d98 100644 --- a/timeline.ts +++ b/timeline.ts @@ -20,7 +20,7 @@ export interface loopSlide extends slide { } export default interface timeline { - slides: slide[]; + slides: Array<slide | delaySlide | speedChangeSlide | loopSlide>; framecount: number; framerate: number; } |