Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix GutterTooltip and GutterKeyboardEvent declarations #5715

Merged
merged 1 commit into from
Jan 9, 2025

Conversation

jperals
Copy link
Contributor

@jperals jperals commented Jan 9, 2025

Issue #, if available: n/a

Description of changes:

The usage of typeof prevents consumers from reading the type properties. In our case, this triggers TypeScript errors here like:

Property 'isInAnnotationLane' does not exist on type 'typeof GutterKeyboardEvent'. ts(2339)

Applying the change in this PR to the local ace-builds package fixes this error and the type properties are available to TS as expected.

I assume the typeof was copied over unintentionally from the previous line.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Pull Request Checklist:

Copy link

github-actions bot commented Jan 9, 2025

One of the public type files has been updated, plase make sure there are no backwards incompatible changes done in the PR.

@jperals jperals changed the title fix: Remove unnecesary typeof from type imports in declarations fix: Fix GutterTooltip and GutterKeyboardEvent declarations Jan 9, 2025
@jperals jperals marked this pull request as ready for review January 9, 2025 12:39
@@ -27,8 +27,8 @@ export namespace Ace {
type DragdropHandler = import("./src/mouse/dragdrop_handler").DragdropHandler;
type AppConfig = import("./src/lib/app_config").AppConfig;
type Config = typeof import("./src/config");
type GutterTooltip = typeof import( "./src/mouse/default_gutter_handler").GutterTooltip;
type GutterKeyboardEvent = typeof import( "./src/keyboard/gutter_handler").GutterKeyboardEvent;
type GutterTooltip = import( "./src/mouse/default_gutter_handler").GutterTooltip;

Choose a reason for hiding this comment

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

Might be worth leaving a comment here on why this is important

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note that line 29 is the one using typeof. Not using it is the default/straightforward case. If a comment is needed, it should be rather for why it is needed on that line —but I don't have the context to tell (maybe it isn't :))

@akoreman akoreman merged commit 2c8bf91 into ajaxorg:master Jan 9, 2025
1 check 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.

3 participants