diff --git a/core/insertion_marker_manager.ts b/core/insertion_marker_manager.ts index c7b13ff2406..c4e01847d64 100644 --- a/core/insertion_marker_manager.ts +++ b/core/insertion_marker_manager.ts @@ -52,12 +52,6 @@ const DUPLICATE_BLOCK_ERROR = 'The insertion marker ' + 'you are using a mutator, make sure your domToMutation method is ' + 'properly defined.'; -export enum PreviewType { - INSERTION_MARKER = 0, - INPUT_OUTLINE = 1, - REPLACEMENT_FADE = 2, -} - /** * Class that controls updates to connections during drags. It is primarily * responsible for finding the closest eligible connection and highlighting or @@ -65,11 +59,6 @@ export enum PreviewType { * @alias Blockly.InsertionMarkerManager */ export class InsertionMarkerManager { - /** - * An enum describing different kinds of previews the InsertionMarkerManager - * could display. - */ - static PREVIEW_TYPE = PreviewType; private readonly topBlock_: BlockSvg; private readonly workspace_: WorkspaceSvg; @@ -790,3 +779,18 @@ export class InsertionMarkerManager { return result; } } + +export namespace InsertionMarkerManager { + /** + * An enum describing different kinds of previews the InsertionMarkerManager + * could display. + */ + export enum PREVIEW_TYPE { + INSERTION_MARKER = 0, + INPUT_OUTLINE = 1, + REPLACEMENT_FADE = 2, + } +} + +export type PreviewType = InsertionMarkerManager.PREVIEW_TYPE; +export const PreviewType = InsertionMarkerManager.PREVIEW_TYPE; diff --git a/core/rendered_connection.ts b/core/rendered_connection.ts index c218f0dbb01..71af18833ca 100644 --- a/core/rendered_connection.ts +++ b/core/rendered_connection.ts @@ -47,30 +47,11 @@ interface PathLeftShape { /** Maximum randomness in workspace units for bumping a block. */ const BUMP_RANDOMNESS = 10; -enum TrackedState { - WILL_TRACK = -1, - UNTRACKED = 0, - TRACKED = 1, -} - /** * Class for a connection between blocks that may be rendered on screen. * @alias Blockly.RenderedConnection */ export class RenderedConnection extends Connection { - /** - * Enum for different kinds of tracked states. - * - * WILL_TRACK means that this connection will add itself to - * the db on the next moveTo call it receives. - * - * UNTRACKED means that this connection will not add - * itself to the database until setTracking(true) is explicitly called. - * - * TRACKED means that this connection is currently being tracked. - */ - static TrackedState = TrackedState; - // TODO(b/109816955): remove '!', see go/strict-prop-init-fix. sourceBlock_!: BlockSvg; private readonly db_: ConnectionDB; @@ -566,3 +547,25 @@ export class RenderedConnection extends Connection { } } } + +export namespace RenderedConnection { + /** + * Enum for different kinds of tracked states. + * + * WILL_TRACK means that this connection will add itself to + * the db on the next moveTo call it receives. + * + * UNTRACKED means that this connection will not add + * itself to the database until setTracking(true) is explicitly called. + * + * TRACKED means that this connection is currently being tracked. + */ + export enum TrackedState { + WILL_TRACK = -1, + UNTRACKED = 0, + TRACKED = 1, + } +} + +export type TrackedState = RenderedConnection.TrackedState; +export const TrackedState = RenderedConnection.TrackedState;