1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

TypeScript: Updated compile target, addressed issues

This commit is contained in:
Dan Brown
2025-07-23 15:41:55 +01:00
parent 3b9c0b34ae
commit 2668aae09b
7 changed files with 7 additions and 7 deletions

View File

@ -175,7 +175,7 @@ export type NodeKey = string;
export class LexicalNode { export class LexicalNode {
// Allow us to look up the type including static props // Allow us to look up the type including static props
['constructor']!: KlassConstructor<typeof LexicalNode>; declare ['constructor']: KlassConstructor<typeof LexicalNode>;
/** @internal */ /** @internal */
__type: string; __type: string;
/** @internal */ /** @internal */

View File

@ -24,7 +24,7 @@ export interface DecoratorNode<T> {
/** @noInheritDoc */ /** @noInheritDoc */
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
export class DecoratorNode<T> extends LexicalNode { export class DecoratorNode<T> extends LexicalNode {
['constructor']!: KlassConstructor<typeof DecoratorNode<T>>; declare ['constructor']: KlassConstructor<typeof DecoratorNode<T>>;
constructor(key?: NodeKey) { constructor(key?: NodeKey) {
super(key); super(key);
} }

View File

@ -55,7 +55,7 @@ export interface ElementNode {
/** @noInheritDoc */ /** @noInheritDoc */
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
export class ElementNode extends LexicalNode { export class ElementNode extends LexicalNode {
['constructor']!: KlassConstructor<typeof ElementNode>; declare ['constructor']: KlassConstructor<typeof ElementNode>;
/** @internal */ /** @internal */
__first: null | NodeKey; __first: null | NodeKey;
/** @internal */ /** @internal */

View File

@ -22,7 +22,7 @@ export type SerializedLineBreakNode = SerializedLexicalNode;
/** @noInheritDoc */ /** @noInheritDoc */
export class LineBreakNode extends LexicalNode { export class LineBreakNode extends LexicalNode {
['constructor']!: KlassConstructor<typeof LineBreakNode>; declare ['constructor']: KlassConstructor<typeof LineBreakNode>;
static getType(): string { static getType(): string {
return 'linebreak'; return 'linebreak';
} }

View File

@ -44,7 +44,7 @@ export type SerializedParagraphNode = Spread<
/** @noInheritDoc */ /** @noInheritDoc */
export class ParagraphNode extends CommonBlockNode { export class ParagraphNode extends CommonBlockNode {
['constructor']!: KlassConstructor<typeof ParagraphNode>; declare ['constructor']: KlassConstructor<typeof ParagraphNode>;
/** @internal */ /** @internal */
__textFormat: number; __textFormat: number;
__textStyle: string; __textStyle: string;

View File

@ -284,7 +284,7 @@ export interface TextNode {
/** @noInheritDoc */ /** @noInheritDoc */
// eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
export class TextNode extends LexicalNode { export class TextNode extends LexicalNode {
['constructor']!: KlassConstructor<typeof TextNode>; declare ['constructor']: KlassConstructor<typeof TextNode>;
__text: string; __text: string;
/** @internal */ /** @internal */
__format: number; __format: number;

View File

@ -2,7 +2,7 @@
"include": ["resources/js/**/*"], "include": ["resources/js/**/*"],
"exclude": ["resources/js/wysiwyg/lexical/yjs/*"], "exclude": ["resources/js/wysiwyg/lexical/yjs/*"],
"compilerOptions": { "compilerOptions": {
"target": "es2019", "target": "es2022",
"module": "commonjs", "module": "commonjs",
"rootDir": "./resources/js/", "rootDir": "./resources/js/",
"baseUrl": "./", "baseUrl": "./",