Skip to content

Latest commit

 

History

History
166 lines (84 loc) · 2.68 KB

ChafaModule.md

File metadata and controls

166 lines (84 loc) · 2.68 KB

chafa-wasm


chafa-wasm / ChafaModule

Interface: ChafaModule

An object that contains the Chafa WebAssembly module API.

Indexable

[x: string | number | symbol]: any

Properties

decodeImage()

decodeImage: (image, callback) => void

Decodes a PNG, JPEG or WebP image into an ImageDataLike object. If an already decoded image is specified, it will be left as is.

Parameters

image

ArrayBufferLike | ImageDataLike

callback

Callback<ImageDataLike>

Returns

void


imageToAnsi()

imageToAnsi: (image, config, callback) => void

Converts an image into an ANSI string.

Parameters

image

ArrayBufferLike | ImageDataLike

config

PartialChafaConfig

callback

Callback<object>

Returns

void


imageToCanvas()

imageToCanvas: (image, config, callback) => void

Converts an image into a Chafa canvas pointer.

Parameters

image

ArrayBufferLike | ImageDataLike

config

PartialChafaConfig

callback

Callback<object>

Returns

void


imageToConsoleLogArgs()

imageToConsoleLogArgs: (image, config, callback) => void

Converts an image into an array of console.log arguments.

Parameters

image

ArrayBufferLike | ImageDataLike

config

PartialChafaConfig

callback

Callback<object>

Returns

void


imageToHtml()

imageToHtml: (image, config, callback) => void

Converts an image into an HTML string.

Parameters

image

ArrayBufferLike | ImageDataLike

config

PartialChafaConfig

callback

Callback<object>

Returns

void


imageToMatrix()

imageToMatrix: (image, config, callback) => void

Converts an image into a matrix of characters.

Parameters

image

ArrayBufferLike | ImageDataLike

config

PartialChafaConfig

callback

Callback<object>

Returns

void