import { CardPosition, CardWithLine, MarkdownPoint } from '..'; import { Card } from './card'; import { CabinetApi } from './card-client'; import { CardsSearch } from './cards-search'; import { CabinetCardIdentifier } from './cci'; import { MarkdownOption } from './markdown-option'; export declare class CabinetNode { onCabinetFileChangeLoaded: (currentCards: string, currentFileName: string) => void | undefined; directory: string; ccjFilename: string; ccjFileFullPath: string; readonly cabinetApi: CabinetApi; private _cards; get cards(): Card[]; set cards(value: Card[]); get cardCount(): number; localCardsSearch: CardsSearch; /** * @param directory - directory where ccj file is located * @param ccjFilename - ccj file name, default to 'test_point_cards.json' */ constructor(directory: string, ccjFilename?: string); checkIfCcjExists(): boolean; backupCcjFile(): void; private loadCards; private loadSearch; hasCardById(id: string): boolean; reloadCards(): void; getCardById(id: string): Card | null; getCciByCard(card: Card): CabinetCardIdentifier; getCardByCci(cci: CabinetCardIdentifier): Card | null; addCard(cardToAdd: Card, writeToFile?: boolean): void; addCards(cards: Card[]): void; addCardByJson(jsonString: string): void; addCardsFromJson(jsonString: string): void; getCardsFromJson(jsonString: string): Card[]; deleteAllCards(confirm?: boolean): void; writeCcjFile(): void; emitFileChangeEvent(): void; searchLocalCards(pattern: string): Card[]; getCardsMarkdown(cards: Card[], opt?: MarkdownOption): string; exportCardsMarkdownToFile(cards: Card[], filename: string): void; extractCardsFromTextByCci(text: string): Card[] | null; getAllCardsByCciFromText(fullText: string): Card[] | null; getAllCardsByCciWithLineFromText(fullText: string): CardWithLine[] | null; getLineByIndex(startIndex: number, endIndex: number, lines: string[]): { start: CardPosition; end: CardPosition; } | null; extractAllCcisFromText(fullText: string): CabinetCardIdentifier[] | null; fetchAllCardsFromText(fullText: string): Promise; fetchCardsByIdFromApi(ids: string[]): Promise; replaceCciWithMdInFullText(mdFullText: string, opt?: MarkdownOption): string; getFullMdDraft(md: string, opt?: MarkdownOption): string; getFullHtmlDraft(md: string, opt?: MarkdownOption): string; parseMdStructure: (mdString: string) => MarkdownPoint[]; private isNode; private isInline; private isParagraph; private getNextInlineTokens; private getNextParagraphInline; /** * Get the line number of the end of the markdown heading or list item */ private getEndLineNumber; /** * Get all inline content between the current node and the next node * @param tokens * @param currentIndex */ private getAllInlineParagraphsAfter; /** * Get all paragraph content, i.e. content without any markdown marker, between the current node and the next node * @param tokens * @param currentIndex */ private getAllBodyParagraphsAfter; /** * Get cards by tag keys */ getCardsByTagKeys(tagKeys: string[]): Card[]; }