interface BlockUtility {
    _nowObj: { now(): number };
    nowObj: { now(): number };
    runtime: Runtime;
    sequencer: Sequencer;
    stackFrame: StackFrame;
    startHats: (
        opcode: string,
        matchFields?: Record<string, unknown>,
        target?: RenderedTarget,
    ) => Thread[];
    target: RenderedTarget;
    thread: Thread;
    getParam(name: string): ScratchCompatibleValue;
    getProcedureParamNamesAndIds(): [string[], string[]];
    getProcedureParamNamesIdsAndDefaults(): [string[], string[], string[]];
    initParams(): void;
    ioQuery<Device extends keyof IODevices>(
        device: Device,
        func: keyof IODevices[Device],
        args: unknown[],
    ): unknown;
    pushParam(name: string, value: ScratchCompatibleValue): void;
    stackTimerFinished(): boolean;
    stackTimerNeedsInit(): boolean;
    startBranch(branchNumber: number, isLoop: boolean): void;
    startStackTimer(milliseconds: number): void;
    stopAll(): void;
    stopOtherTargetThreads(): void;
    stopThisScript(): void;
    yield(): void;
    yieldTick(): void;
}

Properties

_nowObj: { now(): number }
nowObj: { now(): number }
runtime: Runtime
sequencer: Sequencer
stackFrame: StackFrame
startHats: (
    opcode: string,
    matchFields?: Record<string, unknown>,
    target?: RenderedTarget,
) => Thread[]

Use instead of runtime.startHats inside blocks.

thread: Thread

Methods

  • Returns [string[], string[]]

  • Returns [string[], string[], string[]]

  • Parameters

    • branchNumber: number
    • isLoop: boolean

    Returns void

  • Parameters

    • milliseconds: number

    Returns void