Skip to content

[FIX] Fix TypeScript errors in common/pcui/element components#1699

Merged
willeastcott merged 5 commits intomainfrom
pcui-errors
Jan 22, 2026
Merged

[FIX] Fix TypeScript errors in common/pcui/element components#1699
willeastcott merged 5 commits intomainfrom
pcui-errors

Conversation

@willeastcott
Copy link
Contributor

@willeastcott willeastcott commented Jan 21, 2026

Summary

  • Fix TypeScript compilation errors across 14 PCUI element components by adding proper type declarations
  • Standardize Args interface definitions to extend base PCUI types (ElementArgs, ContainerArgs, SelectInputArgs)
  • Declare all private class properties with explicit types
  • Remove unused _isColorPickerOpen property from ColorInput

Changes

Type Definition Pattern
Changed all component argument types from type aliases to interface extending the appropriate base PCUI Args interface:

// Before
type MyComponentArgs = { ... }

// After
interface MyComponentArgs extends ElementArgs { ... }

Files Updated

  • element-asset-input.ts - Args interface consistency
  • element-asset-list.ts - Args interface consistency
  • element-batchgroup-input.ts - Extend SelectInputArgs, declare properties
  • element-bundles-input.ts - Extend SelectInputArgs, declare properties
  • element-color-input.ts - Extend ElementArgs, declare properties, remove dead code
  • element-curve-input.ts - Extend ElementArgs, declare properties
  • element-drop-manager.ts - Extend ContainerArgs, declare properties
  • element-drop-target.ts - Extend ElementArgs, declare properties
  • element-entity-input.ts - Extend ElementArgs, declare properties
  • element-gradient-input.ts - Extend ElementArgs, declare properties
  • element-layers-input.ts - Extend SelectInputArgs, declare properties
  • element-table.ts - Extend ContainerArgs, declare properties, define TableColumn interface
  • element-table-row.ts - Extend ContainerArgs, declare properties
  • element-table-cell.ts - Extend ContainerArgs

Common Fixes Applied

  • Constructor parameters now have default values (args = {})

  • Use spread syntax for merging args with defaults

  • Cast Canvas.dom to HTMLCanvasElement for getContext() calls

  • Cast DOM elements (ChildNode, parentNode) to appropriate types for property access

  • Add explicit types to event handler functions

  • I confirm I have read the contributing guidelines

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes TypeScript compilation errors across 14 PCUI element components by adding proper type declarations, standardizing argument interfaces, and declaring private class properties with explicit types.

Changes:

  • Converted type aliases to interface declarations extending appropriate PCUI base types (ElementArgs, ContainerArgs, SelectInputArgs)
  • Added explicit type declarations for all private class properties
  • Fixed spelling errors in comments ('Neutralise' → 'Neutralize', 'optimisations' → 'optimizations', 'seach' → 'search', 'mouesup' → 'mouseup')
  • Removed unused _isColorPickerOpen property from ColorInput

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
template-thumbnail-renderer.ts Fixed spelling of "Neutralise" to "Neutralize" in comment
element-table.ts Extended ContainerArgs, added TableColumn interface, declared all private properties with types, added type casts for DOM manipulation
element-table-row.ts Extended ContainerArgs, declared all private properties with types
element-table-cell.ts Extended ContainerArgs, updated constructor arg handling
element-layers-input.ts Extended SelectInputArgs, declared private properties, added proper type annotations
element-gradient-input.ts Extended ElementArgs, declared all private properties, added canvas type casts
element-entity-input.ts Extended ElementArgs, declared private properties, changed flexGrow from number to string
element-drop-target.ts Extended ElementArgs, declared private properties, added type annotations
element-drop-manager.ts Extended ContainerArgs, declared private properties, fixed 'mouesup' → 'mouseup' typo
element-curve-input.ts Extended ElementArgs, declared all private properties with types
element-color-input.ts Extended ElementArgs, declared private properties, removed unused _isColorPickerOpen
element-bundles-input.ts Extended SelectInputArgs, declared private properties, added return type to _addTag
element-batchgroup-input.ts Extended SelectInputArgs, declared private properties with types
element-asset-thumbnail.ts Fixed spelling of "optimisations" to "optimizations" in comment
element-asset-list.ts Extended ElementArgs, fixed spelling of "seach" to "search" in comment
element-asset-input.ts Extended ElementArgs, simplified constructor argument handling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@willeastcott willeastcott merged commit aeb0b52 into main Jan 22, 2026
3 checks passed
@willeastcott willeastcott deleted the pcui-errors branch January 22, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants