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: added better types #2213

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

vasav-prashar
Copy link

@vasav-prashar vasav-prashar commented Feb 7, 2023

@hristoterezov @saghul @bgrozev can you please review this.

@jitsi-jenkins
Copy link

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

Parth0105
Parth0105 previously approved these changes Feb 8, 2023
@@ -7,7 +7,10 @@ describe( "/service/authentication/AuthenticationEvents members", () => {
IDENTITY_UPDATED,
AuthenticationEvents,
...others
} = exported as any; // TODO: remove cast after typescript conversion

Choose a reason for hiding this comment

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

@hristoterezov @saghul @bgrozev can you please review this.

@saghul
Copy link
Member

saghul commented Feb 9, 2023

Sorry, what are you fixing here? "other" is still unaccounted for.

@Parth0105
Copy link

Parth0105 commented Feb 9, 2023

Sorry, what are you fixing here? "other" is still unaccounted for.

only thing exported from import * as exported from "./AuthenticationEvents"; is IDENTITY_UPDATED: 'authentication.identity_updated'

const AuthenticationEvents = {
    /**
     * Event callback arguments:
     * function(authenticationEnabled, userIdentity)
     * authenticationEnabled - indicates whether authentication has been enabled
     *                         in this session
     * userIdentity - if user has been logged in then it contains user name. If
     *                contains 'null' or 'undefined' then user is not logged in.
     */
    IDENTITY_UPDATED: 'authentication.identity_updated'
};

can just replace

{
        IDENTITY_UPDATED,
        AuthenticationEvents,
        ...others
 }

with { IDENTITY_UPDATED }

@Parth0105
Copy link

Sorry, what are you fixing here? "other" is still unaccounted for.

@saghul

@saghul
Copy link
Member

saghul commented Feb 9, 2023

The whole point of that test is to make sure we don't miss any other exports. Maybe I'm missing something...

@Parth0105
Copy link

Parth0105 commented Feb 9, 2023

The whole point of that test is to make sure we don't miss any other exports. Maybe I'm missing something...

{
        IDENTITY_UPDATED: string,
        AuthenticationEvents: { IDENTITY_UPDATED: string },
} & { [key: string]: unknown }

i guess this would be a better type then taking into account any unneeded exports? @saghul

Copy link
Contributor

@NewEraCracker NewEraCracker left a comment

Choose a reason for hiding this comment

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

PTAL

service/authentication/AuthenticationEvents.spec.ts Outdated Show resolved Hide resolved
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.

5 participants