diff --git a/app/components/HoverPreview/Components.tsx b/app/components/HoverPreview/Components.tsx index b37b75b75..d2486f378 100644 --- a/app/components/HoverPreview/Components.tsx +++ b/app/components/HoverPreview/Components.tsx @@ -17,7 +17,7 @@ const StyledText = styled(Text)` `; export const Preview = styled(Link)` - cursor: ${(props: any) => + cursor: ${(props: { as?: string }) => props.as === "div" ? "default" : "var(--pointer)"}; border-radius: 4px; box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.3), diff --git a/shared/editor/commands/createAndInsertLink.ts b/shared/editor/commands/createAndInsertLink.ts index 856d646d2..fa62326ec 100644 --- a/shared/editor/commands/createAndInsertLink.ts +++ b/shared/editor/commands/createAndInsertLink.ts @@ -1,6 +1,7 @@ import { Node } from "prosemirror-model"; import { EditorView } from "prosemirror-view"; import { toast } from "sonner"; +import type { Dictionary } from "~/hooks/useDictionary"; function findPlaceholderLink(doc: Node, href: string) { let result: { pos: number; node: Node } | undefined; @@ -37,7 +38,7 @@ const createAndInsertLink = async function ( title: string, href: string, options: { - dictionary: any; + dictionary: Dictionary; nested?: boolean; onCreateLink: (title: string, nested?: boolean) => Promise; } diff --git a/shared/editor/commands/insertFiles.ts b/shared/editor/commands/insertFiles.ts index a03bbc6d3..35e0f9c93 100644 --- a/shared/editor/commands/insertFiles.ts +++ b/shared/editor/commands/insertFiles.ts @@ -2,6 +2,7 @@ import * as Sentry from "@sentry/react"; import { EditorView } from "prosemirror-view"; import { toast } from "sonner"; import { v4 as uuidv4 } from "uuid"; +import type { Dictionary } from "~/hooks/useDictionary"; import FileHelper from "../lib/FileHelper"; import uploadPlaceholderPlugin, { findPlaceholder, @@ -9,7 +10,7 @@ import uploadPlaceholderPlugin, { export type Options = { /** Dictionary object containing translation strings */ - dictionary: any; + dictionary: Dictionary; /** Set to true to force images and videos to become file attachments */ isAttachment?: boolean; /** Set to true to replace any existing image at the users selection */ diff --git a/shared/editor/nodes/CodeFence.ts b/shared/editor/nodes/CodeFence.ts index 4b409455d..412ec914b 100644 --- a/shared/editor/nodes/CodeFence.ts +++ b/shared/editor/nodes/CodeFence.ts @@ -58,7 +58,7 @@ import zig from "refractor/lang/zig"; import { toast } from "sonner"; import { Primitive } from "utility-types"; -import { Dictionary } from "~/hooks/useDictionary"; +import type { Dictionary } from "~/hooks/useDictionary"; import { UserPreferences } from "../../types"; import Storage from "../../utils/Storage"; import { isMac } from "../../utils/browser"; diff --git a/shared/utils/Storage.ts b/shared/utils/Storage.ts index af82e49c0..1e2de4a09 100644 --- a/shared/utils/Storage.ts +++ b/shared/utils/Storage.ts @@ -1,3 +1,5 @@ +import { Primitive } from "utility-types"; + /** * Storage is a wrapper class for localStorage that allow safe usage when * localStorage is not available. @@ -41,7 +43,7 @@ class Storage { * @param fallback The fallback value if the key doesn't exist. * @returns The value or undefined if it doesn't exist. */ - public get(key: string, fallback?: any) { + public get(key: string, fallback?: Primitive) { try { const value = this.interface.getItem(key); if (typeof value === "string") { @@ -79,7 +81,7 @@ class MemoryStorage { return this.data[key] || null; } - setItem(key: string, value: any) { + setItem(key: string, value: Primitive) { return (this.data[key] = String(value)); }