Files
NapCatQQ/.pnpm-store/v3/files/1d/6b22d59d0f42175334c0330c7f79193fa5910f9552b4cde87d6f625d4dbc3e04714683b68f81412f7eff0e2f796cdb9da5b0cd49855beb1c36b066ecdc31d1
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

35 lines
932 B
Plaintext

import type { Formattable, Root } from './abstract/blot.js';
import LeafBlot from './abstract/leaf.js';
class EmbedBlot extends LeafBlot implements Formattable {
public static formats(_domNode: HTMLElement, _scroll: Root): any {
return undefined;
}
public format(name: string, value: any): void {
// super.formatAt wraps, which is what we want in general,
// but this allows subclasses to overwrite for formats
// that just apply to particular embeds
super.formatAt(0, this.length(), name, value);
}
public formatAt(
index: number,
length: number,
name: string,
value: any,
): void {
if (index === 0 && length === this.length()) {
this.format(name, value);
} else {
super.formatAt(index, length, name, value);
}
}
public formats(): { [index: string]: any } {
return this.statics.formats(this.domNode, this.scroll);
}
}
export default EmbedBlot;