Skip to content

Commit

Permalink
fix: update types
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik K committed Nov 28, 2023
1 parent b3d82f2 commit 71fff56
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 5 deletions.
107 changes: 107 additions & 0 deletions typings/plugins/Leaderboard.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
export = Leaderboard;
/**
* @example
* const leaderboard = new canvabase.Leaderboard()
.setOpacity(0.7)
.setScoreMessage("Score:"
.addBachground(
"image",
"https://i.imgur.com/h3b4KZI_d.webp?maxwidth=760&fidelity=grand"
)
.setColors({
box: "#212121",
username: "#ffffff",
score: "#ffffff",
firstRank: "#FFD700",
secondRank: "#C0C0C0",
thirdRank: "#CD7F32",
})
.addUserData([
{
top: 1,
avatar: "https://cdn.discordapp.com/embed/avatars/0.png",
tag: "DominikDominikDominikDomi3nikDominikDominik",
score: 5555,
},
{
top: 2,
avatar: "https://cdn.discordapp.com/embed/avatars/1.png",
tag: "That Man",
score: 1337,
},
{
top: 3,
avatar: "https://cdn.discordapp.com/embed/avatars/3.png",
tag: "Sky",
score: 1054,
},
{
top: 4,
avatar: "https://cdn.discordapp.com/embed/avatars/4.png",
tag: "FortniteFriend",
score: 903,
},
{
top: 5,
avatar: "https://cdn.discordapp.com/embed/avatars/5.png",
tag: "Forgetfulskybro",
score: 0,
},
]);
leaderboard.build().then((img) => {
canvabase.write("./test/leaderboard.png", img);
});
})
});
*/
declare class Leaderboard {
/**
* .addUserData
* @param {Array||object} usersData [{ top: int, avatar: "string", tag: "string", score: int}]
* @returns {Leaderboard}
* @example addUserData([{ top: 1, avatar: "https://image.com/image.png", tag: "dominikdev", score: 5 }])
*/
addUserData(usersData: any): Leaderboard;
usersData: any;
/**
* .setScoreMessage
* @param {string} message Set Custom Score Message
* @returns {Leaderboard}
* @example setScoreMessage("Message")
*/
setScoreMessage(message: string): Leaderboard;
scoreMessage: string;
/**
* .setColors
* @param {object} colors {box: "hexcolor", username: "hexcolor", score: "hexcolor", firstRank: "hexcolor", secondRank: "hexcolor", thirdRank: "hexcolor"}
* @returns {Leaderboard}
* @example setColors({ box: '#212121', username: '#ffffff', score: '#ffffff', firstRank: '#FFD700', secondRank: '#C0C0C0', thirdRank: '#CD7F32' })
*/
setColors(colors: object): Leaderboard;
colors: any;
/**
* Sets the opacity of the element.
*
* @param {number} opacity The opacity value, must be between 0 and 1.
* @returns {Leaderboard} The calling object for chaining.
* @example setOpacity(0.6)
*/
setOpacity(opacity?: number): Leaderboard;
opacity: number;
/**
* Sets the background of the element.
*
* @param {string} type The type of background: "image" or "color".
* @param {string} value The value of the background: an URL for an image or a hex color code.
* @returns {Leaderboard} The calling object for chaining.
* @example addBachground("image","https://image.com/image.png")
* @example addBachground("color","#ff2f")
*/
addBachground(type: string, value: string): Leaderboard;
background: {};
build(): Promise<Buffer>;
}
//# sourceMappingURL=Leaderboard.d.ts.map
1 change: 1 addition & 0 deletions typings/plugins/Leaderboard.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions typings/plugins/Welcomer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ export = Welcomer;
*/
declare class Welcomer {
/**
*
* @param {String} color
* @returns {String}
*/
*
* @param {String} color
* @returns {String}
*/
color: string;
/**
*
Expand Down
2 changes: 1 addition & 1 deletion typings/plugins/Welcomer.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 71fff56

Please sign in to comment.