From b5cd8390002f9ffd59cdea6bd908f3be21bc6330 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Sun, 11 Sep 2022 13:06:41 -0700 Subject: [PATCH] chore: remove AnyDuringMigration from common renderer (#6402) * chore: remove AnyDuringMigration from common renderer * chore: remove AnyDuringMigration in common drawer * chore: format * chore: add dividers back * chore: format --- core/renderers/common/constants.ts | 44 +++---- core/renderers/common/debugger.ts | 16 +-- core/renderers/common/drawer.ts | 56 +++----- core/renderers/common/i_path_object.ts | 39 +++--- core/renderers/common/info.ts | 43 +++--- core/renderers/common/marker_svg.ts | 174 +++++++++++-------------- core/renderers/common/path_object.ts | 23 ++-- core/renderers/geras/drawer.ts | 2 +- core/renderers/geras/info.ts | 12 +- core/renderers/measurables/icon.ts | 1 + core/renderers/thrasos/info.ts | 10 +- core/renderers/zelos/drawer.ts | 10 +- core/renderers/zelos/info.ts | 2 +- 13 files changed, 189 insertions(+), 243 deletions(-) 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