• Robert Knight's avatar
    Augment and fix JSDoc so that src/sidebar/util typechecks · 1ec861b7
    Robert Knight authored
    In addition to `src/sidebar/util`, it was also necessary to update types in
    `src/sidebar/host-config.js` and `src/sidebar/build-thread.js` as these
    are used from `src/sidebar/util`.
    
    In the process I also found a case where the `call` function in
    `postmessage-json-rpc.js` was being called with the wrong arguments in
    some cases. The `timeout` parameter was passed in place of the `params`
    argument.
    
     - Add stubs type definitions for objects returned from the Hypothesis
       API in `src/types/api.js`
    
     - Add and fix sufficient JSDoc type declarations that all JS files in
       src/sidebar/util typecheck.
    
     - Explicitly ignore a small number of expressions that TypeScript
       cannot typecheck using `// @ts-ignore`
    
     - Change several expressions from `expr` to `/** @type {Type} */
       (expr)` to narrow types down in cases where TS can't automatically
       infer the type.
    1ec861b7
url.js 1.04 KB