# @types/lolcatjs

> TypeScript definitions for lolcatjs

Latest version **2.4.1** (published 2024-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/lolcatjs
pnpm add @types/lolcatjs
yarn add @types/lolcatjs
bun add @types/lolcatjs
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.4.1 |
| Published | 2024-02-24 |
| First published | 2024-02-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51354 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/lolcatjs
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lolcatjs
- npm.io page: https://npm.io/package/@types/lolcatjs

## Recent versions

- 2.4.1 (latest) — 2024-02-24
- 2.4.0 — 2024-02-13

## README

# Installation
> `npm install --save @types/lolcatjs`

# Summary
This package contains type definitions for lolcatjs (https://github.com/robertmarsal/lolcatjs#readme).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lolcatjs.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lolcatjs/index.d.ts)
````ts
// Project: lolcatjs
/**
 * Takes a frequency and an index and returns an RGB color.
 * @param freq
 * @param i
 * @returns An object representing an RGB color.
 */
export function rainbow(freq: number, i: number): Rgb;

/**
 * Takes a character and an RGB color and writes it to the stdout.
 * @param char
 * @param colors
 * @returns void
 */
export function colorize(char: string, colors: Rgb): void;

/**
 *  Takes a string and an RGB color and writes it to the stdout.
 * @param colorize
 * @param line
 * @returns void
 */
export function printlnPlain(colorize: ColorizeFunction, line: string[]): void;

/**
 * Takes a colorize function and a line, and prints the line with an animation if sleep is true.
 * @param colorize
 * @param line
 * @returns void
 */
export function printlnAnimated(colorize: ColorizeFunction, line: string[]): void;

/**
 * Takes a line and prints it to the stdout.
 * @param line
 * @returns void
 */
export function printIn(line: string[]): void;

/**
 * Reads data from the stdin, splits it into lines, and prints each line.
 * @returns Promise<void>
 */
export function fromPipe(): Promise<void>;

/**
 * Reads data from a file, splits it into lines, and prints each line.
 * @param file
 * @returns Promise<void>
 */
export function fromFile(file: string): Promise<void>;

/**
 * Takes a string, splits it into lines, and prints each line.
 * @param string
 * @returns void
 */
export function fromString(string: string): void;

/**
 * Initializes the module, tries to require the 'sleep' module for animations.
 * If the 'sleep' module is not available, it falls back to no animations.
 * @returns null
 */
export function init(): null;

/*~ You can declare types that are available via importing the module */
export interface Options {
    animate: boolean;
    duration: number;
    seed: number;
    speed: number;
    spread: number;
    freq: number;
    debug: boolean;
}

export interface Rgb {
    red: number;
    green: number;
    blue: number;
}

export type ColorizeFunction = (char: string, colors: Rgb) => void;

/*~ You can declare properties of the module using const, let, or var */
export const sleep: number | null;
export const options: Options;
export const colors: Rgb;

````

### Additional Details
 * Last updated: Sat, 24 Feb 2024 06:36:06 GMT
 * Dependencies: none

# Credits
These definitions were written by [Younis Ahmed](https://github.com/Younis-Ahmed).

---
_Source: https://npm.io/package/@types/lolcatjs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
