-
Notifications
You must be signed in to change notification settings - Fork 14
fix: add types #87
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: add types #87
Conversation
|
LGTM. I'm just curious how we can test this type def somehow? |
|
Have you considered migrating the project to typescript and generating the types export from the source? |
|
@kevinv11n done. |
| // Provides temporary backward compatibility for wire-protocol reform (lwc > 1.5.0). This code | ||
| // should be removed once all adapters are migrated to the the API. | ||
| const wireAdaptersRegistryHack = global.wireAdaptersRegistryHack || new Map(); | ||
| const wireAdaptersRegistryHack = (globalThis as any).wireAdaptersRegistryHack || new Map(); |
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 file is deprecated, so, I didn't add any types for this.
| } | ||
|
|
||
| function validateAdapterId(adapterId) { | ||
| function validateAdapterId(adapterId: 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.
These functions are deprecated, so I just put any everywhere.
src/__tests__/index.test.ts
Outdated
|
|
||
| it('throws error when no adapter id', () => { | ||
| expect(() => { | ||
| // @ts-ignore |
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.
Is this because the function is deprecated? Maybe add a comment to explain?
src/adapters/TestWireAdapter.ts
Outdated
| * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT | ||
| */ | ||
|
|
||
| export interface HttpFetchResponse { |
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.
In README there is a type/object called FetchResponse that looks bit different than here. Is it the same type or maybe we need to update README?
|
LGTM overall with only minor comments. Do you think we need to update README to include an example in TS? Also I'm curious on how did you test this on core or as a consumer of the package? |
Add Typescript definitions to the API.