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

Mismatch between post-robot and @types/post-robot #109

Open
malsabbagh opened this issue Apr 28, 2022 · 1 comment
Open

Mismatch between post-robot and @types/post-robot #109

malsabbagh opened this issue Apr 28, 2022 · 1 comment

Comments

@malsabbagh
Copy link

I noticed a couple of instances that would be nice to fix.

once definition doesn't return cancel function in its type. It should return

export function once(
    name: string,
    options?: ServerOptionsType | HandlerType,
    handler?: HandlerType,
): ZalgoPromise<{ source: any; origin: string; data: object }> & CancelableType;

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/post-robot/index.d.ts#L39-L43

HandlerType doesn't allow non-promise functions it should be both

type HandlerType = (event: {
    source: CrossDomainWindowType,
    origin: string,
    data: any
}) => ZalgoPromise<any> | void;

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/post-robot/index.d.ts#L15-L19

I didn't go over all other definitions, I just noticed these two, there could be more issues.

@Cijin
Copy link

Cijin commented Sep 7, 2023

I can take this up, have been busy since I wrote the definitions couple of years ago.
@mstuart

Thank you @malsabbagh for pointing these out :)

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

No branches or pull requests

2 participants