interface ScratchGUIState {
    alerts: {
        alertsList: {
            alertId?: Alert;
            alertType: AlertType;
            closeButton?: boolean;
            content?: Element;
            extensionId?: string;
            iconSpinner?: boolean;
            iconURL?: string;
            level: AlertLevel;
            message?: string;
            showDownload?: boolean;
            showReconnect?: boolean;
            showSaveNow?: boolean;
        }[];
        visible: boolean;
    };
    assetDrag: {
        currentOffset: null
        | { x: number; y: number };
        dragging: boolean;
        dragType?: DragType;
        img: null | string;
        index?: number;
        payload?: DragPayload;
    };
    blockDrag: boolean;
    cards: {
        activeDeckId: null
        | string;
        content: Record<string, unknown>;
        dragging: boolean;
        expanded: boolean;
        step: number;
        visible: boolean;
        x: number;
        y: number;
    };
    colorPicker: { active: boolean; callback(color: string): void };
    connectionModal: { extensionId: null | string };
    customProcedures: {
        active: boolean;
        callback: null | (mutation: Element) => void;
        mutator: null | Element;
    };
    editorTab: { activeTabIndex: ActiveTabIndex };
    fontsLoaded: boolean;
    hoveredTarget: { receivedBlocks: boolean; sprite: null | string };
    menus: Record<ScratchGUI.Menu, boolean>;
    micIndicator: boolean;
    modals: Record<ScratchGUI.Modal, boolean>;
    mode: {
        hasEverEnteredEditor: boolean;
        isFullScreen: boolean;
        isPlayerOnly: boolean;
        showBranding: boolean;
    };
    monitorLayout: {
        monitors: Record<
            string,
            {
                lowerEnd: { x: number; y: number };
                upperStart: { x: number; y: number };
            },
        >;
        savedMonitorPositions: Record<string, { x: number; y: number }>;
    };
    monitors: OrderedMap;
    projectChanged: boolean;
    projectState: {
        error: unknown;
        loadingState: LoadingState;
        projectData: null
        | ProjectData;
        projectId: string;
    };
    projectTitle: string;
    restoreDeletion: {
        deletedItem: ""
        | DeletedItemType;
        restoreFun: null | () => void;
    };
    stageSize: { stageSize: StageDisplaySize };
    targets: {
        editingTarget?: null | string;
        highlightedTargetId: null | string;
        highlightedTargetTime: null | number;
        sprites: Record<string, RenderedTarget & { order: number }>;
        stage: {} | RenderedTarget;
    };
    timeout: { autoSaveTimeoutId: null
    | number };
    toolbox: { toolboxXML: string };
    vm: VM;
    vmStatus: { running: boolean; started: boolean; turbo: boolean };
    workspaceMetrics: {
        targets: Record<
            string,
            { scale: number; scrollX: number; scrollY: number },
        >;
    };
}

Properties

alerts: {
    alertsList: {
        alertId?: Alert;
        alertType: AlertType;
        closeButton?: boolean;
        content?: Element;
        extensionId?: string;
        iconSpinner?: boolean;
        iconURL?: string;
        level: AlertLevel;
        message?: string;
        showDownload?: boolean;
        showReconnect?: boolean;
        showSaveNow?: boolean;
    }[];
    visible: boolean;
}
assetDrag: {
    currentOffset: null | { x: number; y: number };
    dragging: boolean;
    dragType?: DragType;
    img: null | string;
    index?: number;
    payload?: DragPayload;
}
blockDrag: boolean
cards: {
    activeDeckId: null | string;
    content: Record<string, unknown>;
    dragging: boolean;
    expanded: boolean;
    step: number;
    visible: boolean;
    x: number;
    y: number;
}
colorPicker: { active: boolean; callback(color: string): void }
connectionModal: { extensionId: null | string }
customProcedures: {
    active: boolean;
    callback: null | (mutation: Element) => void;
    mutator: null | Element;
}
editorTab: { activeTabIndex: ActiveTabIndex }
fontsLoaded: boolean
hoveredTarget: { receivedBlocks: boolean; sprite: null | string }
menus: Record<ScratchGUI.Menu, boolean>
micIndicator: boolean
modals: Record<ScratchGUI.Modal, boolean>
mode: {
    hasEverEnteredEditor: boolean;
    isFullScreen: boolean;
    isPlayerOnly: boolean;
    showBranding: boolean;
}
monitorLayout: {
    monitors: Record<
        string,
        {
            lowerEnd: { x: number; y: number };
            upperStart: { x: number; y: number };
        },
    >;
    savedMonitorPositions: Record<string, { x: number; y: number }>;
}
monitors: OrderedMap
projectChanged: boolean
projectState: {
    error: unknown;
    loadingState: LoadingState;
    projectData: null | ProjectData;
    projectId: string;
}
projectTitle: string
restoreDeletion: {
    deletedItem: "" | DeletedItemType;
    restoreFun: null | () => void;
}
stageSize: { stageSize: StageDisplaySize }

Type declaration

  • stageSize: StageDisplaySize

    Will only be large or small. Large constrained is determined elsewhere.

targets: {
    editingTarget?: null | string;
    highlightedTargetId: null | string;
    highlightedTargetTime: null | number;
    sprites: Record<string, RenderedTarget & { order: number }>;
    stage: {} | RenderedTarget;
}
timeout: { autoSaveTimeoutId: null | number }
toolbox: { toolboxXML: string }
vm: VM
vmStatus: { running: boolean; started: boolean; turbo: boolean }
workspaceMetrics: {
    targets: Record<
        string,
        { scale: number; scrollX: number; scrollY: number },
    >;
}