mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 09:01:17 -08:00
fix typecheck
This commit is contained in:
4 files changed
+10
-5
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { getLinks, toPlainText } from './output';
|
||||
import type { ParagraphElement } from './slate';
|
||||
import type { CustomElement, ParagraphElement } from './slate';
|
||||
import { BlockType } from './types';
|
||||
|
||||
describe('getLinks', () => {
|
||||
@@ -42,7 +42,7 @@ describe('getLinks', () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
const links = getLinks([node as any]);
|
||||
const links = getLinks([node as unknown as CustomElement]);
|
||||
expect(links).toHaveLength(0);
|
||||
});
|
||||
|
||||
|
||||
Vendored
+6
-1
@@ -47,7 +47,12 @@ export type CommandElement = {
|
||||
children: Text[];
|
||||
};
|
||||
|
||||
export type InlineElement = Text | LinkElement | MentionElement | EmoticonElement | CommandElement;
|
||||
export type InlineElement =
|
||||
| FormattedText
|
||||
| LinkElement
|
||||
| MentionElement
|
||||
| EmoticonElement
|
||||
| CommandElement;
|
||||
|
||||
export type ParagraphElement = {
|
||||
type: BlockType.Paragraph;
|
||||
|
||||
@@ -22,7 +22,7 @@ export const matrixSpoilerExtension = {
|
||||
text: match[1],
|
||||
tokens: [] as Tokens.Generic[],
|
||||
};
|
||||
this.lexer.inlineTokens(token.text, token.tokens);
|
||||
this.lexer.inlineTokens(token.text!, token.tokens);
|
||||
return token;
|
||||
}
|
||||
return undefined;
|
||||
|
||||
@@ -19,7 +19,7 @@ export const matrixSubscriptExtension = {
|
||||
text: match[1],
|
||||
tokens: [] as Tokens.Generic[],
|
||||
};
|
||||
this.lexer.inlineTokens(token.text, token.tokens);
|
||||
this.lexer.inlineTokens(token.text!, token.tokens);
|
||||
return token;
|
||||
}
|
||||
return undefined;
|
||||
|
||||
Reference in new issue
Block a user