Remove as any - #52
Merged
Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
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 aWeakMap-backed drag state helper. - Core: add typed APIs to avoid
as anyfor transform stack mutation, tooltip extraction, and canvas state operations (shadow/filter/blend/clip). - Demo: tighten blend mode typing by using
BlendModeand removingas 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. |
Co-authored-by: Copilot <copilot@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Co-authored-by: Copilot copilot@github.com
Description
Brief description of changes.
Type of Change
Validation
pnpm buildpassespnpm build:examplespassesChecklist