import { Static, Type } from "@sinclair/typebox";
import { TypeCompiler } from "@sinclair/typebox/compiler";

export const manifestT = Type.Object({
	picobook_version: Type.Number(),
	id: Type.String(),
	version: Type.String(),
	carts: Type.Array(Type.String()),
	repo: Type.String(),
	author: Type.String(),
	title: Type.Optional(Type.String()),
	readme: Type.Optional(Type.String()),
});

export const ManifestType = TypeCompiler.Compile(manifestT);

export type PicobookManifest = Static<typeof manifestT>;