#[@types/chrome] await chrome.proxy.settings.get({}) - Void function return value is used

12 messages · Page 1 of 1 (latest)

quartz basin
#

Good afternoon. IDE highlights the following error: Void function return value is used
When I get to the announcement:

get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void;

It seems to me that the error occurs because the use of Promise is not prescribed
The same warning is for:

await chrome.privacy.network.webRTCIPHandlingPolicy.get({});
modern cypress
#

are you sure that chrome.proxy.settings.get actually returns a promise? the error is because according to the type definitions it doesn't return anything

quartz basin
modern cypress
quartz basin
#

"name": "@types/chrome",
"version": "0.0.251",

glass fieldBOT
#
/**
 * Gets the value of a setting.
 * @param details Which setting to consider.
 */
get(details: ChromeSettingGetDetails, callback?: DetailsCallback): void;
modern cypress
#

if you're confident that return type is wrong you could consider contributing a change to @types/chrome to update it

#

in case this part isn't obvious, you could also just use the callback (and wrap it in a promise yourself if needed)

quartz basin