I have a ES6-style function that is defined using function composition with asyncPipe.
import { getItemAsync } from 'expo-secure-store';
const asyncPipe = (...fns) => x => fns.reduce(async (y, f) => f(await y), x);
const getToken = () => getItemAsync('token');
const liftedGetToken = async ({ ...rest }) => ({
  token: await getToken(),
  ...rest,
});
const liftedFetch = ({ body, route, token, method = 'GET' } = {}) =>
  fetch(route, {
    ...(body && { body: JSON.stringify(body) }),
    headers: {
      'Content-Type': 'application/json',
      ...(token && { Authorization: `Bearer ${token}` }),
    },
    method,
  });
const json = res => res.json();
/**
 * @method
 * @param {Object} fetchSettings the settings for the fetch request
 * @param {Object} fetchSettings.body the body of the request
 * @param {string} fetchSettings.route the URL of the request
 * @param {string} fetchSettings.method the method of the request
 * @param {string} fetchSettings.token should only be used for testing and unauthenticated requests
 */
const request = asyncPipe(liftedGetToken, liftedFetch, json);
As you can see I tried adding a JSDoc description to it. But when I use it anywhere my editor, VSCode, doesn't suggest its parameters. How do you declare these kinds of functions with JSDoc? And how do I get params for this function to work with Intellisense?
 
     
    

 
    