function autocomplete(token, cb) {
    const ret = (cb) => {
        APIRequest(`/cards/autocomplete?q=${token}`, (cards) => {
            cb(Array.isArray(cards) ? cards : [cards]);
        }, true);
    };
    if (cb) {
        ret(cb);
    }
    else {
        return new Promise((resolve, reject) => ret(resolve));
    }
}
/**
 * Attempts to autocomplete the specified token, returning a list of possible matches.
 * @param token The token to search for.
 * @param cb An optional callback to pass names to.
 * @returns A promise, if no callback is specified. Otherwise nothing.
 */
Attempts to autocomplete the specified token, returning a list of possible matches.
@param token The token to search for.
@param cb An optional callback to pass names to.
@returns A promise, if no callback is specified. Otherwise nothing.
Attempts to autocomplete the specified token returning a list of possible matches . @param token The token to search for . @param cb An optional callback to pass names to . @returns A promise if no callback is specified . Otherwise nothing .
function autocomplete(token, cb) {
    const ret = (cb) => {
        APIRequest(`/cards/autocomplete?q=${token}`, (cards) => {
            cb(Array.isArray(cards) ? cards : [cards]);
        }, true);
    };
    if (cb) {
        ret(cb);
    }
    else {
        return new Promise((resolve, reject) => ret(resolve));
    }
}
function autocomplete ( token , cb ) { const ret = ( cb ) => { APIRequest ( ` ${ token } ` , ( cards ) => { cb ( Array . isArray ( cards ) ? cards : [ cards ] ) ; } , true ) ; } ; if ( cb ) { ret ( cb ) ; } else { return new Promise ( ( resolve , reject ) => ret ( resolve ) ) ; } }
Attempts to autocomplete the specified token, returning a list of possible matches.
Attempts to autocomplete the specified token returning a list of possible matches .