@scratch-compiler/types
v0.1.1
Published
Shared Scratch type definitions
Readme
@scratch-compiler/types
Shared TypeScript types for Scratch project JSON (project.json) and related compiler/runtime structures.
Install
npm i @scratch-compiler/typesUsage
import type { ScratchProject, ScratchTarget, ScratchBlock } from "@scratch-compiler/types";
function findStage(project: ScratchProject): ScratchTarget | undefined {
return project.targets.find((t) => t.isStage);
}
function isTopLevelHat(block: ScratchBlock): boolean {
return !!block.topLevel && block.parent === null;
}