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

Improving types #88

Open
AlexRMU opened this issue Nov 16, 2023 · 1 comment
Open

Improving types #88

AlexRMU opened this issue Nov 16, 2023 · 1 comment

Comments

@AlexRMU
Copy link

AlexRMU commented Nov 16, 2023

https://github.com/Tommertom/svelte-ionic-app/blob/e4c7652342c49376dfe74d2d8e41288a36fceacd/index.d.ts#L558C12

For boolean attributes, the correct value type would be:

type Boolean = `${boolean}` | boolean | undefined | null;
@AlexRMU
Copy link
Author

AlexRMU commented Nov 16, 2023

In order to write less code and to ensure that the types are always up-to-date and correct, they do not need to be written manually, but taken directly from the source:

import type { DatetimeChangeEventDetail, JSX } from "@ionic/core";
interface IonDatetime_Old {
    "clear-text"?: string;
    "on:ionChange"?: (event: CustomEvent<DatetimeChangeEventDetail> & { target: HTMLIonDatetimeElement }) => void;
}
type IonDatetime_New = {
    "clear-text": JSX.IonDatetime["clearText"];
    "on:ionChange": JSX.IonDatetime["onIonChange"];
};

But comments need to be copied.

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

No branches or pull requests

1 participant