mirror of
https://github.com/gnoxnahte/obsidian-auto-embed.git
synced 2026-07-22 09:50:24 +00:00
25 lines
No EOL
561 B
TypeScript
25 lines
No EOL
561 B
TypeScript
import { PluginSettings } from "main";
|
|
|
|
export abstract class EmbedBase {
|
|
readonly name: string;
|
|
// To identify if the anchor link matches the embed type
|
|
readonly regex: RegExp;
|
|
|
|
abstract createEmbed(
|
|
link: string,
|
|
settings: Readonly<PluginSettings>,
|
|
): HTMLElement;
|
|
|
|
onload?(): void;
|
|
|
|
onunload?(): void;
|
|
|
|
onErrorCreatingEmbed(): HTMLElement {
|
|
const errorMsg = "Error with codepen url";
|
|
const error = createEl("p");
|
|
error.setText(errorMsg);
|
|
|
|
console.log(errorMsg);
|
|
return error;
|
|
}
|
|
} |