Skip to content

Commit

Permalink
Updating types
Browse files Browse the repository at this point in the history
  • Loading branch information
S-Traut committed Mar 29, 2022
1 parent 0e417fa commit dabd156
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
24 changes: 20 additions & 4 deletions types/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ declare module "dotosb" {
private layers: Map<string, Array<Sprite>>;

createSprite(path: string, options?: Partial<SpriteOptions>): Sprite;
createAnimation(path: string, frame_count: number, frame_delay: number, options?: Partial<AnimationOptions>): Animation;
write(file_path: string, quiet?: boolean): void;
addSprite(sprite: Sprite): void;
toString(): string;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit dabd156

Please sign in to comment.