diff options
-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; } |