11import escapeHTML from "escape-html" ;
22import { Resvg } from "@resvg/resvg-js" ;
33import parseBoolean from "@barudakrosul/parse-boolean" ;
4- import getData from "../src/getData" ;
4+ import { getData , GetData } from "../src/getData" ;
55import card from "../src/card" ;
66import { themes , Themes } from "../themes/index" ;
77import { isValidHexColor , isValidGradient } from "../src/common/utils" ;
@@ -16,7 +16,7 @@ import { isValidHexColor, isValidGradient } from "../src/common/utils";
1616 * @property {string } borderColor - Color for borders.
1717 * @property {string } strokeColor - Color for strokes.
1818 * @property {string } usernameColor - Color for the username.
19- * @property {any } bgColor - Background color or gradient.
19+ * @property {string|string[] } bgColor - Background color or gradient.
2020 * @property {string } Title - Add custom title (optional).
2121 * @property {string } Locale - Locale setting.
2222 * @property {number|string } borderWidth - Width of borders.
@@ -38,7 +38,7 @@ type UiConfig = {
3838 borderColor : string ;
3939 strokeColor : string ;
4040 usernameColor : string ;
41- bgColor : any ;
41+ bgColor : string | string [ ] ;
4242 Title : string | undefined ;
4343 Locale : string ;
4444 borderWidth : number | string ;
@@ -74,9 +74,9 @@ function generateXML(data: any): string {
7474 *
7575 * @param {any } req - The request object from the client.
7676 * @param {any } res - The response object to send data back to the client.
77- * @returns {Promise<any > } - A promise that resolves when the photo profile is generated and sent.
77+ * @returns {Promise<void > } - A promise that resolves when the photo profile is generated and sent.
7878 */
79- async function readmeStats ( req : any , res : any ) : Promise < any > {
79+ async function readmeStats ( req : any , res : any ) : Promise < void > {
8080 try {
8181 const username = escapeHTML ( req . query . username ) ;
8282 const photoQuality = Math . max ( 0 , Math . min ( parseInt ( escapeHTML ( req . query . photo_quality || "15" ) ) , 100 ) ) ;
@@ -130,7 +130,7 @@ async function readmeStats(req: any, res: any): Promise<any> {
130130 }
131131 }
132132
133- const fetchStats = await getData ( username ) ;
133+ const fetchStats : GetData = await getData ( username ) ;
134134 res . setHeader ( "Cache-Control" , "s-maxage=7200, stale-while-revalidate" ) ;
135135
136136 if ( uiConfig . Format === "json" ) {
0 commit comments