diff --git a/services/web/frontend/stories/decorators/scope.tsx b/services/web/frontend/stories/decorators/scope.tsx index f592bfb90a..150b6efa58 100644 --- a/services/web/frontend/stories/decorators/scope.tsx +++ b/services/web/frontend/stories/decorators/scope.tsx @@ -10,7 +10,7 @@ import { } from '../fixtures/compile' import useFetchMock from '../hooks/use-fetch-mock' -const scopeWatchers = [] +const scopeWatchers: [string, (value: any) => void][] = [] const initialize = () => { const user: User = { @@ -46,10 +46,10 @@ const initialize = () => { const scope = { user, project, - $watch: (key, callback) => { + $watch: (key: string, callback: () => void) => { scopeWatchers.push([key, callback]) }, - $applyAsync: callback => { + $applyAsync: (callback: () => void) => { window.setTimeout(() => { callback() for (const [key, watcher] of scopeWatchers) { @@ -57,7 +57,7 @@ const initialize = () => { } }, 0) }, - $on: (eventName, callback) => { + $on: (eventName: string, callback: () => void) => { // }, $broadcast: () => {}, @@ -101,7 +101,7 @@ const initialize = () => { }, editorManager: { getCurrentDocId: () => 'foo', - openDoc: (id, options) => { + openDoc: (id: string, options: unknown) => { console.log('open doc', id, options) }, }, @@ -166,7 +166,7 @@ const initialize = () => { return ide } -export const ScopeDecorator = Story => { +export const ScopeDecorator = (Story: any) => { // mock compile on load useFetchMock(fetchMock => { mockCompile(fetchMock) diff --git a/services/web/frontend/stories/hooks/use-scope.tsx b/services/web/frontend/stories/hooks/use-scope.tsx index 5add9c0f90..42d9595331 100644 --- a/services/web/frontend/stories/hooks/use-scope.tsx +++ b/services/web/frontend/stories/hooks/use-scope.tsx @@ -5,7 +5,7 @@ import { useLayoutEffect, useRef } from 'react' * Merge properties with the scope object, for use in Storybook stories */ export const useScope = (scope: Record) => { - const scopeRef = useRef | null>(null) + const scopeRef = useRef(null) if (scopeRef.current === null) { scopeRef.current = scope } diff --git a/services/web/frontend/stories/settings/add-email-input.stories.tsx b/services/web/frontend/stories/settings/add-email-input.stories.tsx index 03c89fb549..e62e370f03 100644 --- a/services/web/frontend/stories/settings/add-email-input.stories.tsx +++ b/services/web/frontend/stories/settings/add-email-input.stories.tsx @@ -1,7 +1,7 @@ import useFetchMock from './../hooks/use-fetch-mock' import Input from '../../js/features/settings/components/emails/add-email/input' -export const EmailInput = args => { +export const EmailInput = (args: any) => { useFetchMock(fetchMock => fetchMock.get(/\/institutions\/domains/, [ { diff --git a/services/web/frontend/stories/settings/sso-alert.stories.tsx b/services/web/frontend/stories/settings/sso-alert.stories.tsx index 529f61e8f1..889bc3fc90 100644 --- a/services/web/frontend/stories/settings/sso-alert.stories.tsx +++ b/services/web/frontend/stories/settings/sso-alert.stories.tsx @@ -1,7 +1,7 @@ import EmailsSection from '../../js/features/settings/components/emails-section' import { SSOAlert } from '../../js/features/settings/components/emails/sso-alert' -export const Info = args => { +export const Info = (args: any) => { window.metaAttributesCache = new Map() window.metaAttributesCache.set('ol-institutionLinked', { universityName: 'Overleaf University', @@ -9,7 +9,7 @@ export const Info = args => { return } -export const InfoWithEntitlement = args => { +export const InfoWithEntitlement = (args: any) => { window.metaAttributesCache = new Map() window.metaAttributesCache.set('ol-institutionLinked', { universityName: 'Overleaf University', @@ -18,7 +18,7 @@ export const InfoWithEntitlement = args => { return } -export const NonCanonicalEmail = args => { +export const NonCanonicalEmail = (args: any) => { window.metaAttributesCache = new Map() window.metaAttributesCache.set('ol-institutionLinked', { universityName: 'Overleaf University', @@ -30,7 +30,7 @@ export const NonCanonicalEmail = args => { return } -export const Error = args => { +export const Error = (args: any) => { window.metaAttributesCache = new Map() window.metaAttributesCache.set('ol-samlError', { translatedMessage: 'There was an Error', @@ -38,7 +38,7 @@ export const Error = args => { return } -export const ErrorTranslated = args => { +export const ErrorTranslated = (args: any) => { window.metaAttributesCache = new Map() window.metaAttributesCache.set('ol-samlError', { translatedMessage: 'Translated Error Message', @@ -47,7 +47,7 @@ export const ErrorTranslated = args => { return } -export const ErrorWithTryAgain = args => { +export const ErrorWithTryAgain = (args: any) => { window.metaAttributesCache = new Map() window.metaAttributesCache.set('ol-samlError', { message: 'There was an Error',