diff --git a/pkg/interface/src/logic/lib/formGroup.ts b/pkg/interface/src/logic/lib/formGroup.ts index db679f2d3..91a18532f 100644 --- a/pkg/interface/src/logic/lib/formGroup.ts +++ b/pkg/interface/src/logic/lib/formGroup.ts @@ -6,13 +6,15 @@ interface IFormGroupContext { onDirty: (id: string, touched: boolean) => void; onErrors: (id: string, errors: boolean) => void; submitAll: () => Promise; + addReset: (id: string, r: any) => any; } const fallback: IFormGroupContext = { addSubmit: () => {}, onDirty: () => {}, onErrors: () => {}, - submitAll: () => Promise.resolve() + submitAll: () => Promise.resolve(), + addReset: () => {} }; export const FormGroupContext = React.createContext(fallback); diff --git a/pkg/interface/src/logic/lib/hark.ts b/pkg/interface/src/logic/lib/hark.ts index c99d00726..a3f215668 100644 --- a/pkg/interface/src/logic/lib/hark.ts +++ b/pkg/interface/src/logic/lib/hark.ts @@ -89,6 +89,7 @@ export function describeNotification(notification: IndexedNotification) { return `New comment${plural ? 's' : ''} on`; case 'note': return `New Note${plural ? 's' : ''} in`; + // @ts-ignore case 'edit-note': return `updated ${pluralize('note', plural)} in`; case 'mention': @@ -105,6 +106,7 @@ export function describeNotification(notification: IndexedNotification) { if('group' in notification.index) { return group(notification.index.group); } else if('graph' in notification.index) { + // @ts-ignore needs better type guard const contents = notification.notification?.contents?.graph ?? [] as Post[]; return graph(notification.index.graph, contents.length > 1, _.uniq(_.map(contents, 'author')).length === 1) diff --git a/pkg/interface/src/logic/lib/publish.ts b/pkg/interface/src/logic/lib/publish.ts index 22fd166cc..8fa32d5e0 100644 --- a/pkg/interface/src/logic/lib/publish.ts +++ b/pkg/interface/src/logic/lib/publish.ts @@ -76,7 +76,7 @@ export function editPost(rev: number, noteId: BigInteger, title: string, body: s return nodes; } -export function getLatestRevision(node: GraphNode): [number, string, string, Post] { +export function getLatestRevision(node: GraphNode): [number, string, any, Post] { const empty = [1, '', '', buntPost()] as [number, string, string, Post]; const revs = node.children?.get(bigInt(1)); if(!revs) { diff --git a/pkg/interface/src/logic/lib/useLocalStorageState.ts b/pkg/interface/src/logic/lib/useLocalStorageState.ts index 5e35a6a76..d64b9f6d0 100644 --- a/pkg/interface/src/logic/lib/useLocalStorageState.ts +++ b/pkg/interface/src/logic/lib/useLocalStorageState.ts @@ -17,7 +17,7 @@ interface SetStateFunc { } // See microsoft/typescript#37663 for filed bug type SetState = T extends any ? SetStateFunc : never; -export function useLocalStorageState(key: string, initial: T) { +export function useLocalStorageState(key: string, initial: T): any { const [state, _setState] = useState(() => retrieve(key, initial)); useEffect(() => { diff --git a/pkg/interface/src/logic/lib/util.tsx b/pkg/interface/src/logic/lib/util.tsx index b482fe336..a9f778cf0 100644 --- a/pkg/interface/src/logic/lib/util.tsx +++ b/pkg/interface/src/logic/lib/util.tsx @@ -458,6 +458,7 @@ export const useHovering = (): useHoveringInterface => { export function withHovering(Component: React.ComponentType) { return React.forwardRef((props, ref) => { const { hovering, bind } = useHovering(); + // @ts-ignore needs type signature on return? return }) }