🏷️ Update tagName to optionally be an array
The `Registry` [already allows][1] the `tagName` property to be an
array.
This change updates the types to reflect that.
[1]: 634e50f4d7/src/registry.ts (L127)
This commit is contained in:
parent
457b32d8a2
commit
671c213f17
@ -18,7 +18,7 @@ At the very minimum a Blot must be named with a static `blotName` and associated
|
||||
class Blot {
|
||||
static blotName: string;
|
||||
static className: string;
|
||||
static tagName: string;
|
||||
static tagName: string | string[];
|
||||
static scope: Scope;
|
||||
|
||||
domNode: Node;
|
||||
|
||||
@ -6,7 +6,7 @@ import Scope from '../../scope';
|
||||
export interface BlotConstructor {
|
||||
blotName: string;
|
||||
className?: string;
|
||||
tagName: string;
|
||||
tagName: string | string[];
|
||||
new (scroll: Root, node: Node, value?: any): Blot;
|
||||
create(value?: any): Node;
|
||||
}
|
||||
@ -25,7 +25,7 @@ export interface Blot extends LinkedNode {
|
||||
defaultChild?: BlotConstructor;
|
||||
requiredContainer?: BlotConstructor;
|
||||
scope: Scope;
|
||||
tagName: string;
|
||||
tagName: string | string[];
|
||||
};
|
||||
|
||||
attach(): void;
|
||||
|
||||
@ -5,7 +5,7 @@ import ParentBlot from './parent';
|
||||
class ContainerBlot extends ParentBlot {
|
||||
public static blotName = 'container';
|
||||
public static scope = Scope.BLOCK_BLOT;
|
||||
public static tagName: string;
|
||||
public static tagName: string | string[];
|
||||
|
||||
public prev!: BlockBlot | ContainerBlot | null;
|
||||
public next!: BlockBlot | ContainerBlot | null;
|
||||
|
||||
@ -8,7 +8,7 @@ class ShadowBlot implements Blot {
|
||||
public static className: string;
|
||||
public static requiredContainer: BlotConstructor;
|
||||
public static scope: Scope;
|
||||
public static tagName: string;
|
||||
public static tagName: string | string[];
|
||||
|
||||
public static create(value: any): Node {
|
||||
if (this.tagName == null) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user