Add web api types

This commit is contained in:
Hetu Nandu 2023-06-14 17:29:15 +05:30
parent 69a5e7663b
commit 5313332108
10 changed files with 14 additions and 10 deletions

View File

@ -66,6 +66,7 @@
"@tinymce/tinymce-react": "^3.13.0", "@tinymce/tinymce-react": "^3.13.0",
"@types/google.maps": "^3.51.0", "@types/google.maps": "^3.51.0",
"@types/react-page-visibility": "^6.4.1", "@types/react-page-visibility": "^6.4.1",
"@types/web": "^0.0.99",
"@uppy/core": "^1.16.0", "@uppy/core": "^1.16.0",
"@uppy/dashboard": "^1.16.0", "@uppy/dashboard": "^1.16.0",
"@uppy/file-input": "^1.4.22", "@uppy/file-input": "^1.4.22",

View File

@ -668,7 +668,6 @@ function EvaluatedValuePopup(props: Props) {
}} }}
onMouseLeave={() => { onMouseLeave={() => {
const id = setTimeout(() => setContentHovered(false), 500); const id = setTimeout(() => setContentHovered(false), 500);
// @ts-expect-error: setTimeout return type mismatch
setTimeoutId(id); setTimeoutId(id);
}} }}
preparedStatementViewer={ preparedStatementViewer={

View File

@ -195,7 +195,6 @@ function GitConnection({ isImport }: Props) {
}, []); }, []);
const stopShowingCopiedAfterDelay = () => { const stopShowingCopiedAfterDelay = () => {
// @ts-expect-error: setTimeout return type mismatch
timerRef.current = setTimeout(() => { timerRef.current = setTimeout(() => {
setShowCopied(false); setShowCopied(false);
}, 2000); }, 2000);

View File

@ -48,7 +48,6 @@ export const useCanvasDragToScroll = (
behavior: "smooth", behavior: "smooth",
}); });
} }
// @ts-expect-error: setTimeout return type mismatch
scrollTimeOut.push(setTimeout(scrollFn, 100 * Math.max(0.4, speed))); scrollTimeOut.push(setTimeout(scrollFn, 100 * Math.max(0.4, speed)));
} }
}; };

View File

@ -231,7 +231,7 @@ function* fetchDynamicValueSaga(
} }
// Call the API to fetch the dynamic values // Call the API to fetch the dynamic values
const response: ApiResponse = yield call( const response: ApiResponse<{ trigger?: unknown }> = yield call(
PluginsApi.fetchDynamicFormValues, PluginsApi.fetchDynamicFormValues,
url, url,
{ {
@ -243,7 +243,6 @@ function* fetchDynamicValueSaga(
}, },
); );
dynamicFetchedValues.isLoading = false; dynamicFetchedValues.isLoading = false;
// @ts-expect-error: we don't know what the response will be
if (response.responseMeta.status === 200 && "trigger" in response.data) { if (response.responseMeta.status === 200 && "trigger" in response.data) {
dynamicFetchedValues.data = response.data.trigger; dynamicFetchedValues.data = response.data.trigger;
dynamicFetchedValues.hasFetchFailed = false; dynamicFetchedValues.hasFetchFailed = false;

View File

@ -61,10 +61,8 @@ class MockWorkerClass implements WorkerClass {
body: { data: message.body.data }, body: { data: message.body.data },
}; };
this.sendEvent({ data: response }); this.sendEvent({ data: response });
// @ts-expect-error: setTimeout return type mismatch
this.responses.delete(counter); this.responses.delete(counter);
}, this.delayMilliSeconds); }, this.delayMilliSeconds);
// @ts-expect-error: setTimeout return type mismatch
this.responses.add(counter); this.responses.add(counter);
} }

View File

@ -408,7 +408,6 @@ class ButtonGroupComponent extends React.Component<
}; };
}); });
// @ts-expect-error: setTimeout return type mismatch
this.timer = setTimeout(() => { this.timer = setTimeout(() => {
this.setState(() => { this.setState(() => {
return { return {

View File

@ -2421,7 +2421,6 @@ class TableWidgetV2 extends BaseWidget<TableWidgetProps, WidgetState> {
* We need to let the evaulations compute derived property (filteredTableData) * We need to let the evaulations compute derived property (filteredTableData)
* before we clear the editableCell to avoid the text flickering * before we clear the editableCell to avoid the text flickering
*/ */
// @ts-expect-error: setTimeout return type mismatch
this.inlineEditTimer = setTimeout(clear, 100); this.inlineEditTimer = setTimeout(clear, 100);
} }
}; };

View File

@ -1,6 +1,9 @@
const _originalFetch = self.fetch; const _originalFetch = self.fetch;
export function fetch(...args: Parameters<typeof _originalFetch>) { export function fetch(...args: Parameters<typeof _originalFetch>) {
const request = new Request(args[0], { ...args[1], credentials: "omit" }); const request = new Request(args[0] as string, {
...args[1],
credentials: "omit",
});
return _originalFetch(request); return _originalFetch(request);
} }

View File

@ -8223,6 +8223,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/web@npm:^0.0.99":
version: 0.0.99
resolution: "@types/web@npm:0.0.99"
checksum: 5298e64fc9db63f7da840dff77cd770c0568d3162eac406aa74e3a251c58377d370398a1d9402feb4fc49afa615808ac85be966e59fa96677a23dfd1df89ef9a
languageName: node
linkType: hard
"@types/webfontloader@npm:1.6.33": "@types/webfontloader@npm:1.6.33":
version: 1.6.33 version: 1.6.33
resolution: "@types/webfontloader@npm:1.6.33" resolution: "@types/webfontloader@npm:1.6.33"
@ -9593,6 +9600,7 @@ __metadata:
"@types/tinycolor2": ^1.4.2 "@types/tinycolor2": ^1.4.2
"@types/to-json-schema": ^0.2.1 "@types/to-json-schema": ^0.2.1
"@types/toposort": ^2.0.3 "@types/toposort": ^2.0.3
"@types/web": ^0.0.99
"@types/webfontloader": 1.6.33 "@types/webfontloader": 1.6.33
"@types/zipcelx": ^1.5.0 "@types/zipcelx": ^1.5.0
"@typescript-eslint/eslint-plugin": ^5.54.1 "@typescript-eslint/eslint-plugin": ^5.54.1