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

[Types] Some missing type declarations #3096

Open
KiddoV opened this issue Sep 11, 2024 · 0 comments
Open

[Types] Some missing type declarations #3096

KiddoV opened this issue Sep 11, 2024 · 0 comments
Assignees
Labels
state/awaiting-investigation Anything which needs more investigation type/types Anything related to types

Comments

@KiddoV
Copy link
Contributor

KiddoV commented Sep 11, 2024

There are a few missing and wrong type declarations throughout all modules. I’m taking note of them, and once I have enough, I will create a PR for it.

Dropdown

Missing:

{
        /**
         * Clears the remote api cache once.
         */
        (behavior: 'clear cache'): JQuery;
}

Dropdown.DropdownSettings

Missing:

{
        /**
         * Whether search selection will force currently selected choice when element is blurred.
         * If a 'select' tag with a required attribute was used, the 'forceSelection' setting will be set to 'true' automatically.
         * @default false
         */
        forceSelection: boolean;
}

Wrong declaration:

{
        onNoResults(searchValue: string): boolean; //<== change `void` to `boolean`
        
        onSearch(): void | false; //<== this should return `void or false`
}

Form

Wrong signature:

{
        /**
         * Validates field, updates UI, and calls 'onSuccess' or 'onFailure'.
         */
        (behavior: 'validate field', fieldName: string): boolean; //<= return `boolean` not `void`
}

All Modules

Wrong declaration:

{
        /**
         * Callback after popup is hidden.
         */
        onHidden(this: JQuery, element?: JQuery<HTMLElement>): void;}
        
        //Some callback should return `element` as HTMLElement instead of JQuery<HTMLElement>. Need to check on all callbacks again!

More to come...

@KiddoV KiddoV added state/awaiting-investigation Anything which needs more investigation state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels Sep 11, 2024
@lubber-de lubber-de added type/types Anything related to types and removed state/awaiting-triage Any issues or pull requests which haven't yet been triaged type/bug Any issue which is a bug or PR which fixes a bug labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state/awaiting-investigation Anything which needs more investigation type/types Anything related to types
Projects
None yet
Development

No branches or pull requests

2 participants