Skip to content

Remove as any - #52

Merged
frouaix merged 2 commits into
mainfrom
cleanup/asany
May 2, 2026
Merged

frouaix merged 2 commits into
mainfrom
cleanup/asany

Conversation

@frouaix

@frouaix frouaix commented May 1, 2026 •

Copy link
Copy Markdown
Owner

Co-authored-by: Copilot copilot@github.com

Description

Brief description of changes.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Build/tooling change

Validation

  • pnpm build passes
  • pnpm build:examples passes
  • Manual verification completed (if applicable)

Checklist

  • Code follows project conventions
  • Documentation updated if needed
  • No unrelated changes included

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings May 1, 2026 01:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors several areas of the Vitrine monorepo to remove as any casts by introducing properly typed helpers and APIs in core rendering/event code and updating demos/GUI accordingly.

Changes:

  • GUI slider: replace props-mutation drag state (as any) with a WeakMap-backed drag state helper.
  • Core: add typed APIs to avoid as any for transform stack mutation, tooltip extraction, and canvas state operations (shadow/filter/blend/clip).
  • Demo: tighten blend mode typing by using BlendMode and removing as any.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/gui/src/GUI/slider/transformSlider.ts Replaces props as any drag state storage with a typed WeakMap state.
packages/demo/demos/line-styles.ts Uses BlendMode type and removes blendMode as any.
packages/core/src/transform.ts Adds TransformStack.setCurrent() to avoid mutating private internals via as any.
packages/core/src/events.ts Removes props as any tooltip checks by returning typed tooltip results.
packages/core/src/core/renderer-immediate.ts Routes shadow/filter/blend/clip through RenderContext methods and uses setCurrent() instead of as any.
packages/core/src/core/context.ts Extends RenderContext/Canvas2DContext with typed shadow/filter/blend/clip helpers.

Comment thread packages/core/src/core/renderer-immediate.ts Outdated
Comment thread packages/core/src/core/renderer-immediate.ts
Comment thread packages/core/src/core/context.ts
Co-authored-by: Copilot <copilot@github.com>
@frouaix
frouaix merged commit 0f7a9e8 into main May 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants