From dabd15640c95cb6796dd2bb0e57809573b81e2bc Mon Sep 17 00:00:00 2001 From: s-traut Date: Tue, 29 Mar 2022 19:25:11 +0200 Subject: [PATCH] Updating types --- package.json | 2 +- types/types.d.ts | 24 ++++++++++++++++++++---- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3fab989..4b41e6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dotosb", - "version": "1.6.4", + "version": "1.6.5", "description": "Simple, dependency free osb file parser", "main": "index.js", "keywords": ["parser", "text", "file", "osb", "motion-design", "no-deps"], diff --git a/types/types.d.ts b/types/types.d.ts index 4ea3f72..ada9bad 100644 --- a/types/types.d.ts +++ b/types/types.d.ts @@ -3,6 +3,7 @@ declare module "dotosb" { private layers: Map>; createSprite(path: string, options?: Partial): Sprite; + createAnimation(path: string, frame_count: number, frame_delay: number, options?: Partial): Animation; write(file_path: string, quiet?: boolean): void; addSprite(sprite: Sprite): void; toString(): string; @@ -90,13 +91,28 @@ declare module "dotosb" { toString(): string; } + class Animation extends Sprite {} + type SpriteOptions = { - layer?: String; - origin?: String; - x?: Number; - y?: Number; + layer?: string; + origin?: string; + x?: number; + y?: number; }; + enum LoopType { + LoopOnce = "LoopOnce", + LoopForever = "LoopForever" + } + + type AnimationOptions = { + layer?: string; + origin?: string; + x?: number, + y?: number, + loop_type?: LoopType + } + type OsbEvent = { type: string; easing: number;