All modules are self-contained with JSDoc comments auto-extracted to API docs.
File: src/modules/changes/index.ts
Manages document changes as immutable operations.
Key Methods:
edit(elementId, content) - Edit elementinsert(content, metadata, options) - Insert elementdelete(elementId) - Delete elementundo() / redo() - History navigationgetCurrentState() - Get document stategetOperations() - Get operation historyFile: src/modules/comments/index.ts
Parses and manipulates CriticMarkup.
Key Methods:
parse(markdown) - Parse CriticMarkup tokensrenderToHTML(markdown) - Convert to styled HTMLaccept(markdown, match) / reject(...) - Resolve changesacceptAll(markdown) / rejectAll(markdown) - Bulk operationsMarkup: {++add++}, {--del--}, {~~old~>new~~}, {>>comment<<}, {==highlight==}
File: src/modules/markdown/index.ts
Converts markdown to HTML and plain text.
Key Methods:
renderSync(markdown) / render(markdown) - To HTMLrenderInline(markdown) - Inline renderingrenderElement(content, type, level) - Element-awaretoPlainText(markdown) - Extract plain textsetEnableCriticMarkup(enabled) - Toggle CriticMarkupsetAllowRawHtml(allow) - HTML safetyFeatures: CommonMark + GFM, cached renderer, XSS prevention
File: src/modules/ui/
UI components and interactions.
Submodules:
change-summary.ts:
calculateSummary() - Aggregate statsrenderDashboard() - Create UIexportSummary() - Export as markdownsearch-find.ts:
performSearch() - Execute searchnextMatch() / previousMatch() - NavigateopenSearchPanel() / closeSearchPanel() - Control UIFile: src/modules/git/index.ts
Methods: commit(), push(), pull()
File: src/modules/user/index.ts
Methods: authenticate(), getCurrentUser(), hasPermission()
Class:
/**
* Brief description
*
* @example
* const instance = new MyClass(config);
*/
export class MyClass {}
Method:
/**
* What it does
*
* @param param1 - Description
* @returns Description
* @throws ErrorType - When
*/
method(param1: Type): ReturnType {}
npm run build # Generates docs/generated/api/
npm run test # All tests
npm run test -- changes.test.ts # Specific module
npm run test:watch # Watch mode
src/modules/your-module/tests/unit/your-module.test.tsnpm run test && npm run buildmain.ts
├── UIModule
│ ├── ChangesModule
│ ├── CommentsModule
│ ├── MarkdownModule
│ └── UserModule
├── GitModule
└── TranslationModule
Modules are decoupled with public APIs.