improve attribute type
This commit is contained in:
@@ -6,13 +6,12 @@ export type Extensions = (Extension | NodeExtension | MarkExtension)[]
|
|||||||
|
|
||||||
export type Attribute = {
|
export type Attribute = {
|
||||||
default: any,
|
default: any,
|
||||||
rendered?: boolean,
|
rendered?: false,
|
||||||
renderHTML?: (attributes: {
|
} | {
|
||||||
[key: string]: any,
|
default: any,
|
||||||
}) => any,
|
rendered?: true,
|
||||||
parseHTML?: (node: HTMLElement) => {
|
renderHTML: (attributes: { [key: string]: any }) => any,
|
||||||
[key: string]: any,
|
parseHTML: (node: HTMLElement) => { [key: string]: any },
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Attributes = {
|
export type Attributes = {
|
||||||
@@ -22,7 +21,12 @@ export type Attributes = {
|
|||||||
export type ExtensionAttribute = {
|
export type ExtensionAttribute = {
|
||||||
type: string,
|
type: string,
|
||||||
name: string,
|
name: string,
|
||||||
attribute: Required<Attribute>,
|
attribute: {
|
||||||
|
default: any,
|
||||||
|
rendered: boolean,
|
||||||
|
renderHTML: (attributes: { [key: string]: any }) => any,
|
||||||
|
parseHTML: (node: HTMLElement) => { [key: string]: any },
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GlobalAttributes = {
|
export type GlobalAttributes = {
|
||||||
|
|||||||
Reference in New Issue
Block a user