Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remaining enums that weren't properly exported #6251

Merged
merged 4 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions core/insertion_marker_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,13 @@ 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
* unhighlighting it as needed during a drag.
* @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;

Expand Down Expand Up @@ -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;
41 changes: 22 additions & 19 deletions core/rendered_connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;