mirror of
https://github.com/dotwee/obsidian-raindropio-plugin.git
synced 2026-07-22 17:00:29 +00:00
- Introduce Jest as the testing framework and configure it for the project. - Add initial test cases for block and note parsing functionalities. - Update ESLint configuration to include test files and adjust global settings. - Modify package.json to include test scripts and dependencies for Jest. - Enhance GitHub workflows to run tests during linting and release processes.
35 lines
744 B
TypeScript
35 lines
744 B
TypeScript
import type { CachedMetadata } from "obsidian";
|
|
|
|
export class Notice {
|
|
constructor(public message: string) {}
|
|
}
|
|
|
|
export class Plugin {}
|
|
|
|
export class PluginSettingTab {}
|
|
|
|
export class MarkdownView {
|
|
file: unknown = null;
|
|
}
|
|
|
|
export class TFile {
|
|
path = "";
|
|
}
|
|
|
|
export class ItemView {}
|
|
|
|
export class Setting {}
|
|
|
|
export function getAllTags(metadata: CachedMetadata): string[] | null {
|
|
const tags = new Set<string>();
|
|
|
|
for (const tag of metadata.tags ?? []) {
|
|
if (tag.tag) tags.add(tag.tag);
|
|
}
|
|
|
|
for (const frontmatterTag of metadata.frontmatter?.tags ?? []) {
|
|
if (typeof frontmatterTag === "string") tags.add(frontmatterTag.startsWith("#") ? frontmatterTag : `#${frontmatterTag}`);
|
|
}
|
|
|
|
return tags.size > 0 ? Array.from(tags) : null;
|
|
}
|