mirror of
https://github.com/google/blockly.git
synced 2026-01-26 18:20:10 +01:00
* chore(deps): Add pretter-plugin-organize-imports * chore: Remove insignificant blank lines in import sections Since prettier-plugin-organize-imports sorts imports within sections separated by blank lines, but preserves the section divisions, remove any blank lines that are not dividing imports into meaningful sections. Do not remove blank lines separating side-effect-only imports from main imports. * chore: Remove unneded eslint-disable directives * chore: Organise imports
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2019 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
// Former goog.module ID: Blockly.blockRendering.Connection
|
|
|
|
import type {RenderedConnection} from '../../rendered_connection.js';
|
|
import type {ConstantProvider, Shape} from '../common/constants.js';
|
|
import {Measurable} from './base.js';
|
|
import {Types} from './types.js';
|
|
|
|
/**
|
|
* The base class to represent a connection and the space that it takes up on
|
|
* the block.
|
|
*/
|
|
export class Connection extends Measurable {
|
|
shape: Shape;
|
|
isDynamicShape: boolean;
|
|
highlighted: boolean;
|
|
|
|
/**
|
|
* @param constants The rendering constants provider.
|
|
* @param connectionModel The connection object on the block that this
|
|
* represents.
|
|
*/
|
|
constructor(
|
|
constants: ConstantProvider,
|
|
public connectionModel: RenderedConnection,
|
|
) {
|
|
super(constants);
|
|
|
|
this.type |= Types.CONNECTION;
|
|
|
|
this.shape = this.constants_.shapeFor(connectionModel);
|
|
this.isDynamicShape = 'isDynamic' in this.shape && this.shape.isDynamic;
|
|
|
|
this.highlighted = connectionModel.isHighlighted();
|
|
}
|
|
}
|