Skip to main content
Home

Built and signed on GitHub Actions

TypeScript definition for project.json of .sb3

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a year ago (0.1.7)
interface Block

Definition for a block

Properties

A string naming the block.

optional
comment: string

Comment associated with the block

optional
inputs: { [id: string]: Input; }

An object associating names with arrays representing inputs into which other blocks may be dropped, including C mouths. The first element of each array is 1 if the input is a shadow, 2 if there is no shadow, and 3 if there is a shadow but it is obscured by the input. The second is either the ID of the input or an array representing it as described in the table below. If there is an obscured shadow, the third element is its ID or an array representing it.

optional
fields: { [id: string]: Fields; }

Fields are text boxes, drop-down menus, etc. These are used directly in blocks where there is an input into which one cannot drop a reporter. However, more often than not, one should be able to do this; in this case no field exists directly in the block, but an input does, and that input may have a shadow block in it.

An object associating names with arrays representing fields. The first element of each array is the field's value. For certain fields, such as variable and broadcast dropdown menus, there is also a second element, which is the ID of the field's value.

optional
next: string | null

The ID of the following block or null.

False if the block has a parent and true otherwise.

optional
parent: string | null

If the block is a stack block and is preceded, this is the ID of the preceding block. If the block is the first stack block in a C mouth, this is the ID of the C block. If the block is an input to another block, this is the ID of that other block. Otherwise it is null.

optional
shadow: boolean

True if this is a shadow block and false otherwise.

optional
x: number

X position of the block

optional
y: number

Y position of the block

Mutation data for the block

See

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@pnsk-lab/sb3-types

Import symbol

import { type Block } from "@pnsk-lab/sb3-types";
or

Import directly with a jsr specifier

import { type Block } from "jsr:@pnsk-lab/sb3-types";

Add Package

pnpm i jsr:@pnsk-lab/sb3-types
or (using pnpm 10.8 or older)
pnpm dlx jsr add @pnsk-lab/sb3-types

Import symbol

import { type Block } from "@pnsk-lab/sb3-types";

Add Package

yarn add jsr:@pnsk-lab/sb3-types
or (using Yarn 4.8 or older)
yarn dlx jsr add @pnsk-lab/sb3-types

Import symbol

import { type Block } from "@pnsk-lab/sb3-types";

Add Package

vlt install jsr:@pnsk-lab/sb3-types

Import symbol

import { type Block } from "@pnsk-lab/sb3-types";

Add Package

npx jsr add @pnsk-lab/sb3-types

Import symbol

import { type Block } from "@pnsk-lab/sb3-types";

Add Package

bunx jsr add @pnsk-lab/sb3-types

Import symbol

import { type Block } from "@pnsk-lab/sb3-types";