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

Add typing for perspective #157

Merged
merged 1 commit into from
Jul 19, 2018
Merged

Conversation

segarman
Copy link
Contributor

No description provided.

}

export type ValuesByType = {
[ key in TypeNames ]: Array<string>
Copy link
Contributor

Choose a reason for hiding this comment

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

For primitives it's better to use string[] for arrays.

Copy link
Contributor Author

@segarman segarman Jul 16, 2018

Choose a reason for hiding this comment

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

https://palantir.github.io/tslint/rules/array-type/
we use "generic" on our project, hence Array<T> over T[]
but happy to change if you want me to

Copy link
Contributor

@LukeSheard LukeSheard Jul 18, 2018

Choose a reason for hiding this comment

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

Sure, since there's no tslint setup of similar and they're equivalent let's just go with this for now. We can always change later - I just normally go with "array-simple" but consistency makes sense.

NONE = 'none',
}

enum NUMBER_AGGREGATES {
Copy link
Contributor

Choose a reason for hiding this comment

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

These might potentially be better as Enums rather than strings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they are enums, or you mean to create a global enum with all of them and NUMBER, STRING, BOOLEAN to be just a subset of them?

Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking that maybe we can take the aggregate keywords and Enum those. But I couldn't find a nice way to make them all align up. Since these are private I'll take another look later and we can hoist them into private enums later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks

@timkpaine
Copy link
Member

timkpaine commented Jul 19, 2018

given that the jupyterlab sub package is already in typescript, typing should also be added there (instead of the current <any> casts).

@texodus
Copy link
Member

texodus commented Jul 19, 2018

Looks great, thanks!

@texodus texodus merged commit a0652c9 into finos:master Jul 19, 2018
@timkpaine
Copy link
Member

shouldn't the jupyterlab package use this

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.

4 participants