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

Example of using globals + namespace + interface #209

Open
basickarl opened this issue Nov 24, 2020 · 0 comments
Open

Example of using globals + namespace + interface #209

basickarl opened this issue Nov 24, 2020 · 0 comments

Comments

@basickarl
Copy link

basickarl commented Nov 24, 2020

Hello! I'm trying to convert my TypeScript to JavaScript + JSDoc but can't seem to get around some things. Unfortunately the examples on more advanced JSDoc are pretty scarce, I'm wondering if anyone could help translate the following into JSDoc:

declare global {
    namespace jest {
        interface Matchers<R> {
            toBeWithMessage(result: boolean, message: string): R;
        }
    }
}

I've so far:

/**
 * @namespace jest
 */

/**
 * @interface Matchers
 * @memberof jest
 */

/**
 * @function
 * @name Matchers#toBeWithMessage
 * @param {boolean} result
 * @param {string} message
 */

Or is it correct? Unfortunetly TypeScript oes not support @interface or any other advanced features https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html as stated.

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

1 participant