diff --git a/README.md b/README.md index 0923fda..00f15b4 100644 --- a/README.md +++ b/README.md @@ -362,6 +362,9 @@ bot.login("super_secret_token"); # Changelog +## v1.4.24 +- Re added typings + ## v1.4.23 - Fixed import issue - Added Denoise() diff --git a/package.json b/package.json index 8f79359..ceeb2a5 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "discord-image-generation", - "version": "1.4.23", + "version": "1.4.24", "description": "discord-image-generation is a powerful module that allow you to generate awesome images.", "main": "src/index.js", + "types": "typings/index.d.ts", "scripts": { "test": "node tests/test.js" }, diff --git a/src/module/gif/blink.js b/src/module/gif/blink.js index 976b639..9ade12c 100644 --- a/src/module/gif/blink.js +++ b/src/module/gif/blink.js @@ -5,6 +5,7 @@ module.exports = class Blink { async getImage(delay, ...images) { if (!images || images.length < 2) return console.error(`You must provide at least two images.`); + if (isNaN(delay)) return console.error(`You must provide a valid delay.`); for (const image of images) { let isValid = await validateURL(image); if (!isValid) return console.error(`You must provide a valid image URL or buffer.`); diff --git a/typings/index.d.ts b/typings/index.d.ts new file mode 100644 index 0000000..c8e52f0 --- /dev/null +++ b/typings/index.d.ts @@ -0,0 +1,128 @@ +declare abstract class ImageGenerator { + abstract getImage(...args: any[]): Promise; +} + +declare class DefaultImageGenerator extends ImageGenerator { + getImage(avatar: string): Promise; +} + +export class Blur extends ImageGenerator { + getImage(avatar: string, level?: number): Promise; +} + +export class Gay extends DefaultImageGenerator { } + +export class Geryscale extends DefaultImageGenerator { } + +export class Invert extends DefaultImageGenerator { } + +export class Sepia extends DefaultImageGenerator { } + +export class Blink extends ImageGenerator { + getImage(delay: number, ...avatar: any[]): Promise; +} + +export class Triggered extends DefaultImageGenerator { } + +export class Ad extends DefaultImageGenerator { } + +export class Affect extends DefaultImageGenerator { } + +export class Batslap extends ImageGenerator { + getImage(avatar: string, avatar2: string): Promise; +} + +export class Beautiful extends DefaultImageGenerator { } + +export class Bed extends ImageGenerator { + getImage(avatar: string, avatar2: string): Promise; +} + +export class Bobross extends DefaultImageGenerator { } + +export class Clown extends DefaultImageGenerator { } + +export class ConfusedStonk extends DefaultImageGenerator { } + +export class Deepfry extends DefaultImageGenerator { } + +export class Delete extends DefaultImageGenerator { } + +export class DiscordBlack extends DefaultImageGenerator { } + +export class DiscordBlue extends DefaultImageGenerator { } + +export class DoubleStonk extends ImageGenerator { + getImage(avatar: string, avatar2: string): Promise; +} + +export class Facepalm extends DefaultImageGenerator { } + +export class Heartbreaking extends DefaultImageGenerator { } + +export class Hitler extends DefaultImageGenerator { } + +export class Jail extends DefaultImageGenerator { } + +export class Karaba extends DefaultImageGenerator { } + +export class Kiss extends ImageGenerator { + getImage(avatar: string, avatar2: string): Promise; +} + +export class LisaPresentation extends ImageGenerator { + getImage(text: string): Promise; +} + +export class Mikkelsen extends DefaultImageGenerator { } + +export class Mms extends DefaultImageGenerator { } + +export class NotStonk extends DefaultImageGenerator { } + +export class Podium extends ImageGenerator { + getImage( + avatar: string, + avatar2: string, + avatar3: string, + name: string, + name2: string, + name3: string + ): Promise; +} + +export class Poutine extends DefaultImageGenerator { } + +export class Rip extends DefaultImageGenerator { } + +export class Snyder extends DefaultImageGenerator { } + +export class Spank extends ImageGenerator { + getImage(avatar: string, avatar2: string): Promise; +} + +export class Stonk extends DefaultImageGenerator { } + +export class Tatoo extends DefaultImageGenerator { } + +export class Thomas extends DefaultImageGenerator { } + +export class Trash extends DefaultImageGenerator { } + +export class Wanted extends ImageGenerator { + getImage(avatar: string, currency: string): Promise; +} + +export class Circle extends DefaultImageGenerator { } + +export class Color extends ImageGenerator { + getImage(color: string): Promise; +} + +export class Denoise extends ImageGenerator { + getImage(avatar: string, level?: number): Promise; +} + +export class Mirror extends ImageGenerator { + getImage(avatar: string, horizontal?: boolean, vertical?: boolean): Promise; +}