halfnelson / nativescript-source-to-jsx-def

Walk nativescript source to generate JSX types for `svelte-type-checker-vscode`
Other
4 stars 1 forks source link

Inconsistent casing in event handlers (for Svelte typings) #17

Open shirakaba opened 4 years ago

shirakaba commented 4 years ago

I noticed that (for Svelte) your Property change event handlers are all lowercased, while your 'direct' event handlers use camel-casing. Is this as intended?

// ui/action-bar/action-bar.d.ts
type ActionItemAttributes = ViewBaseAttributes & {
    onTap?: (args: EventData) => void;
    ontextchange?: (args: PropertyChangeData) => void;
};

e.g. https://github.com/halfnelson/nativescript-source-to-jsx-def/blob/69292a74a9fb7454ddb33e7880b913327946cd05/sveltenative-jsx.d.ts#L94-L95

halfnelson commented 4 years ago

Looks like a bug. I am using meta data I attach to the property to determine whether to lowercase it. I need it camel case for determining original event name like you do. I must have those set with wrong property type.

On Tue, 28 Apr 2020, 12:32 am Jamie Birch, notifications@github.com wrote:

I noticed that (for Svelte) your Property change event handlers are all lowercased, while your 'direct' event handlers use camel-casing. Is this as intended?

// ui/action-bar/action-bar.d.tstype ActionItemAttributes = ViewBaseAttributes & { onTap?: (args: EventData) => void; ontextchange?: (args: PropertyChangeData) => void; };

e.g. https://github.com/halfnelson/nativescript-source-to-jsx-def/blob/69292a74a9fb7454ddb33e7880b913327946cd05/sveltenative-jsx.d.ts#L94-L95

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/halfnelson/nativescript-source-to-jsx-def/issues/17, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEGS5AV5SQDF6WN764NVXTROWJONANCNFSM4MR7HMDQ .