refactor: remove AnyObject type

This commit is contained in:
Philipp Kühn
2021-04-21 09:43:31 +02:00
parent d720d77e8d
commit 1c8ca95de2
64 changed files with 108 additions and 196 deletions

View File

@@ -1,10 +1,10 @@
import { Extension, Command, AnyObject } from '@tiptap/core'
import { Extension, Command } from '@tiptap/core'
import { yCursorPlugin } from 'y-prosemirror'
export interface CollaborationCursorOptions {
provider: any,
user: { [key: string]: any },
render (user: { [key: string]: any }): HTMLElement,
user: Record<string, any>,
render (user: Record<string, any>): HTMLElement,
onUpdate: (users: { clientId: string, [key: string]: any }[]) => null,
}
@@ -14,12 +14,12 @@ declare module '@tiptap/core' {
/**
* Update details of the current user
*/
user: (attributes: AnyObject) => Command,
user: (attributes: Record<string, any>) => Command,
}
}
}
const awarenessStatesToArray = (states: Map<number, { [key: string]: any }>) => {
const awarenessStatesToArray = (states: Map<number, Record<string, any>>) => {
return Array.from(states.entries()).map(([key, value]) => {
return {
clientId: key,