mirror of
https://github.com/morten-olsen/mini-loader.git
synced 2026-02-08 01:36:26 +01:00
27 lines
433 B
TypeScript
27 lines
433 B
TypeScript
import { send } from '../utils.js';
|
|
|
|
type ArtifactCreateEvent = {
|
|
type: 'artifact:create';
|
|
payload: {
|
|
name: string;
|
|
data: string;
|
|
};
|
|
};
|
|
|
|
const create = async (name: string, data: Buffer | string) => {
|
|
await send({
|
|
type: 'artifact:create',
|
|
payload: {
|
|
name,
|
|
data: data.toString('base64'),
|
|
},
|
|
});
|
|
};
|
|
|
|
const artifacts = {
|
|
create,
|
|
};
|
|
|
|
export type { ArtifactCreateEvent };
|
|
export { artifacts };
|