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;