/* clayterm.h — WASM terminal rendering engine for Clay UI */

#ifndef CLAYTERM_H
#define CLAYTERM_H

#include <stdint.h>

#include "cell.h"

struct Clayterm;

/* WASM exports */
int clayterm_size(int w, int h);
struct Clayterm *init(void *mem, int w, int h);
void reduce(struct Clayterm *ct, uint32_t *buf, int len, int mode, int row);
char *output(struct Clayterm *ct);
int length(struct Clayterm *ct);
void measure(int ret, int txt);

int element_info_count(void);
int element_info_name_len(int index);
int element_info_name_ptr(int index);
float element_info_x(int index);
float element_info_y(int index);
float element_info_w(int index);
float element_info_h(int index);

int pointer_over_count(void);
int pointer_over_id_string_length(int index);
int pointer_over_id_string_ptr(int index);

#endif
