Skip to content

Commit

Permalink
chore: cleanup TS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
petyosi committed Mar 18, 2024
1 parent d63f8dc commit 87a5f05
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/plugins/core/NestedLexicalEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { mergeRegister } from '@lexical/utils'
import { VoidEmitter } from '../../utils/voidEmitter'
import { isPartOftheEditorUI } from '../../utils/isPartOftheEditorUI'
import { useCellValues, usePublisher } from '@mdxeditor/gurx'
import { DirectiveNode } from '../directives'

/**
* The value of the {@link NestedEditorsContext} React context.
Expand Down Expand Up @@ -107,9 +108,8 @@ export function useMdastNodeUpdater<T extends Mdast.RootContent>() {
parentEditor.update(
() => {
$addUpdateTag('history-push')
const currentNode = $getNodeByKey(lexicalNode.getKey())
const currentNode = $getNodeByKey(lexicalNode.getKey()) as typeof lexicalNode
if (currentNode) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
currentNode.setMdastNode({ ...mdastNode, ...node })
}
},
Expand Down
10 changes: 6 additions & 4 deletions src/plugins/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -754,10 +754,12 @@ export const insertDecoratorNode$ = Signal<() => DecoratorNode<unknown>>((r) =>
} else {
$insertNodeToNearestRoot(node)
}
if ('select' in node && typeof node.select === 'function') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
setTimeout(() => node.select())
}
setTimeout(() => {
if ('select' in node && typeof node.select === 'function') {
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
node.select()
}
})
})

setTimeout(() => {
Expand Down
2 changes: 0 additions & 2 deletions src/plugins/directives/DirectiveNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export type SerializedDirectiveNode = Spread<
SerializedLexicalNode
>

let GENERATION = 0
/**
* A lexical node that represents an image. Use {@link "$createDirectiveNode"} to construct one.
* @group Directive
Expand Down Expand Up @@ -52,7 +51,6 @@ export class DirectiveNode extends DecoratorNode<React.JSX.Element> {
constructor(mdastNode: Directives, key?: NodeKey) {
super(key)
this.__mdastNode = mdastNode
this.generation = GENERATION++
}

/**
Expand Down

0 comments on commit 87a5f05

Please sign in to comment.