Skip to content

Commit

Permalink
📝 Add comments to tiny
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuapp committed Apr 29, 2024
1 parent e71673c commit 433e87b
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions src/tiny.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,135 @@ function init(open: number, close: number) {
};
}

/**
* Set text at reset
* @param str text to reset
*/
export const reset: (str: string) => string = init(0, 0);
/**
* Set text at bold
* @param str text to bold
*/
export const bold: (str: string) => string = init(1, 22);
/**
* Set text at dim
* @param str text to dim
*/
export const dim: (str: string) => string = init(2, 22);
/**
* Set text at italic
* @param str text to italic
*/
export const italic: (str: string) => string = init(3, 23);
/**
* Set text at underline
* @param str text to underline
*/
export const underline: (str: string) => string = init(4, 24);
/**
* Set text at inverse
* @param str text to inverse
*/
export const inverse: (str: string) => string = init(7, 27);
/**
* Set text at hidden
* @param str text to hidden
*/
export const hidden: (str: string) => string = init(8, 28);
/**
* Set text at strikethrough
* @param str text to strikethrough
*/
export const strikethrough: (str: string) => string = init(9, 29);

/**
* Set text at black
* @param str text to black
*/
export const black: (str: string) => string = init(30, 39);
/**
* Set text at red
* @param str text to red
*/
export const red: (str: string) => string = init(31, 39);
/**
* Set text at green
* @param str text to green
*/
export const green: (str: string) => string = init(32, 39);
/**
* Set text at yellow
* @param str text to yellow
*/
export const yellow: (str: string) => string = init(33, 39);
/**
* Set text at blue
* @param str text to blue
*/
export const blue: (str: string) => string = init(34, 39);
/**
* Set text at magenta
* @param str text to magenta
*/
export const magenta: (str: string) => string = init(35, 39);
/**
* Set text at cyan
* @param str text to cyan
*/
export const cyan: (str: string) => string = init(36, 39);
/**
* Set text at white
* @param str text to white
*/
export const white: (str: string) => string = init(37, 39);
/**
* Set text at gray
* @param str text to gray
*/
export const gray: (str: string) => string = init(90, 39);

/**
* Set background at black
* @param str background to black
*/
export const bgBlack: (str: string) => string = init(40, 49);
/**
* Set background at red
* @param str background to red
*/
export const bgRed: (str: string) => string = init(41, 49);
/**
* Set background at green
* @param str background to green
*/
export const bgGreen: (str: string) => string = init(42, 49);
/**
* Set background at yellow
* @param str background to yellow
*/
export const bgYellow: (str: string) => string = init(43, 49);
/**
* Set background at blue
* @param str background to blue
*/
export const bgBlue: (str: string) => string = init(44, 49);
/**
* Set background at magenta
* @param str background to magenta
*/
export const bgMagenta: (str: string) => string = init(45, 49);
/**
* Set background at cyan
* @param str background to cyan
*/
export const bgCyan: (str: string) => string = init(46, 49);
/**
* Set background at white
* @param str background to white
*/
export const bgWhite: (str: string) => string = init(47, 49);
/**
* Set background at gray
* @param str background to gray
*/
export const bgGray: (str: string) => string = init(100, 49);

0 comments on commit 433e87b

Please sign in to comment.