Skip to content

Commit

Permalink
feat(): add more chainable methods
Browse files Browse the repository at this point in the history
  • Loading branch information
AlenVelocity committed Nov 8, 2021
1 parent cfed3af commit bfd5a04
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions src/Sticker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,7 @@ export class Sticker {
this.metadata.id = id
return this
}

/**
* Set background color for `full` images
* @param background - Background color
* @returns
* @example
* const sticker = new Sticker('./image.png')
* sticker.setBackground('#000000')
* sticker.build()
*/
public setBackground = (background: Color): this => {
this.metadata.background = background
return this
}


/**
* Set the sticker category
* @param categories - Sticker Category
Expand All @@ -157,6 +143,36 @@ export class Sticker {
return this
}

/**
* Set the sticker type
* @param {StickerTypes|string}[type] - Sticker Type
* @returns {this}
*/
public setType = (type: StickerTypes | string): this => {
this.metadata.type = type
return this
}

/**
* Set the sticker quality
* @param {number}[quality] - Sticker Quality
* @returns {this}
*/
public setQuality = (quality: number): this => {
this.metadata.quality = quality
return this
}

/**
* Set the background color for `full` images
* @param {Color}[background] - Background color
* @returns {this}
*/
public setBackground = (background: Color): this => {
this.metadata.background = background
return this
}

/**
* @deprecated
* Use the `Sticker.build()` method instead
Expand Down

0 comments on commit bfd5a04

Please sign in to comment.