-
Notifications
You must be signed in to change notification settings - Fork 56
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
Type fixes & acceptance tests #23
Conversation
What compile errors were you getting? |
Thanks @mike-north, especially for hooking up tests. @paulblyth If you ever have a moment I'd like to get your review on this as well. |
you had Lines 12 to 14 in 8c7d9f0
and are using it in several places without providing a generic argument Line 3 in 8c7d9f0
Line 8 in 8c7d9f0
(and more) Additionally, the types around parent/child connection methods weren't offering any type safety, or properly taking into account that {
add(number, number): number
} turns into {
add(number, number): Promise<number>
} |
Remaining test failures are likely due to forks not having access to your sauce labs credentials (in travis, forks have no environment variables for security reasons). You could probably just open a different PR on a branch in this repo and close this one |
types/index.d.ts
Outdated
iframe: HTMLIFrameElement; | ||
} | ||
|
||
type ConnectionMethods<T = {}> = { [P in keyof T]: () => Promise<any> }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the new default type parameter that fixes the compile errors. {}
is effectively any non-null, non-undefined value. object
may be a more reasonable default, but it would potentially break some consumers and necessitate a major release
My bad... Nice PR though! |
In the file that gets emitted as lib/index.d.ts, my IDE (Webstorm) is flagging this line:
It says: |
Oddly, I don't get that flag in types/index.d.ts. I might need to research this one. |
Ah, it's because tsconfig.json isn't in |
typically I like to keep the |
Published in 3.0.5. |
Thanks again for putting the work into this. |
IConnectionObject
#22dtslint
, w/ acceptance tests based around README examples