diff --git a/core/renderers/common/constants.ts b/core/renderers/common/constants.ts index 75063f9b4..1954839f1 100644 --- a/core/renderers/common/constants.ts +++ b/core/renderers/common/constants.ts @@ -93,6 +93,16 @@ export type DynamicShape = { /** An object containing sizing and type information about a shape. */ export type Shape = BaseShape|DynamicShape; +/** + * Returns whether the shape is dynamic or not. + * + * @param shape The shape to check for dynamic-ness. + * @returns Whether the shape is a dynamic shape or not. + */ +export function isDynamicShape(shape: Shape): shape is DynamicShape { + return (shape as DynamicShape).isDynamic; +} + /** * An object that provides constants for rendering blocks. * @@ -185,7 +195,7 @@ export class ConstantProvider { EXTERNAL_VALUE_INPUT_PADDING = 2; EMPTY_STATEMENT_INPUT_HEIGHT: number; - START_POINT: AnyDuringMigration; + START_POINT: string; /** Height of SVG path for jagged teeth at the end of collapsed blocks. */ JAGGED_TEETH_HEIGHT = 12; @@ -289,9 +299,7 @@ export class ConstantProvider { embossFilterId = ''; /** The element to use for highlighting, or null if not set. */ - // AnyDuringMigration because: Type 'null' is not assignable to type - // 'SVGElement'. - private embossFilter_: SVGElement = null as AnyDuringMigration; + private embossFilter_: SVGElement|null = null; /** * The ID of the disabled pattern, or the empty string if no pattern is set. @@ -303,9 +311,7 @@ export class ConstantProvider { /** * The element to use for disabled blocks, or null if not set. */ - // AnyDuringMigration because: Type 'null' is not assignable to type - // 'SVGElement'. - private disabledPattern_: SVGElement = null as AnyDuringMigration; + private disabledPattern_: SVGElement|null = null; /** * The ID of the debug filter, or the empty string if no pattern is set. @@ -315,14 +321,10 @@ export class ConstantProvider { /** * The element to use for a debug highlight, or null if not set. */ - // AnyDuringMigration because: Type 'null' is not assignable to type - // 'SVGElement'. - private debugFilter_: SVGElement = null as AnyDuringMigration; + private debugFilter_: SVGElement|null = null; /** The