From 67bfeb261a597611d65bf72c06a281aff2ec87a8 Mon Sep 17 00:00:00 2001 From: Paul Chavard Date: Wed, 23 Feb 2022 13:24:51 +0100 Subject: [PATCH] chore(eslint): fix gon types --- app/javascript/components/shared/queryClient.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/javascript/components/shared/queryClient.ts b/app/javascript/components/shared/queryClient.ts index b309753eb..e4f6651ca 100644 --- a/app/javascript/components/shared/queryClient.ts +++ b/app/javascript/components/shared/queryClient.ts @@ -2,6 +2,17 @@ import { QueryClient, QueryFunction } from 'react-query'; import { getJSON, isNumeric } from '@utils'; import { matchSorter } from 'match-sorter'; +type Gon = { + gon: { + autocomplete?: { + api_geo_url?: string; + api_adresse_url?: string; + api_education_url?: string; + }; + }; +}; +declare const window: Window & typeof globalThis & Gon; + const API_EDUCATION_QUERY_LIMIT = 5; const API_GEO_QUERY_LIMIT = 5; const API_ADRESSE_QUERY_LIMIT = 5; @@ -16,7 +27,7 @@ const API_ADRESSE_QUERY_LIMIT = 5; const API_GEO_COMMUNES_QUERY_LIMIT = 60; const { api_geo_url, api_adresse_url, api_education_url } = - (window as any).gon.autocomplete || {}; + window.gon.autocomplete || {}; type QueryKey = readonly [ scope: string,