genankjs
Version:
generate anki card
66 lines • 1.56 kB
TypeScript
import type { PackageConfig, MediaFile } from './types.js';
import type { Deck } from './deck.js';
import type { Model } from './model.js';
export declare class Package {
decks: Deck[];
models: Model[];
media: MediaFile[];
constructor(config?: PackageConfig);
/**
* Add a deck to the package
*/
addDeck(deck: Deck): void;
/**
* Add a model to the package
*/
addModel(model: Model): void;
/**
* Add media file to the package
*/
addMedia(mediaFile: MediaFile): void;
/**
* Add multiple media files to the package
*/
addMediaFiles(mediaFiles: MediaFile[]): void;
/**
* Create the SQLite database
*/
private createDatabase;
/**
* Create the Anki database schema
*/
private createTables;
/**
* Insert collection metadata
*/
private insertCollectionData;
/**
* Insert models (not needed as they're in collection)
*/
private insertModels;
/**
* Insert decks (not needed as they're in collection)
*/
private insertDecks;
/**
* Insert notes into the database
*/
private insertNotes;
/**
* Insert cards into the database
*/
private insertCards;
/**
* Create media.json file
*/
private createMediaJson;
/**
* Write the package to a file
*/
writeToFile(filename: string): Promise<void>;
/**
* Generate the .apkg file as a buffer
*/
writeToBuffer(): Promise<Buffer>;
}
//# sourceMappingURL=package.d.ts.map