Skip to content

Commit

Permalink
fix: remaining enums that weren't properly exported (#6251)
Browse files Browse the repository at this point in the history
* fix: remaining enums that weren't properly exported

* chore: format

* fix: add enum value exports

* chore: format
  • Loading branch information
BeksOmega authored Jun 29, 2022
1 parent e36a103 commit 7eb56ea
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 30 deletions.
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 @@ -788,3 +777,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;

0 comments on commit 7eb56ea

Please sign in to comment.