TypeScript type definitions for ChurchTools extension points.
This package provides TypeScript contracts for all ChurchTools extension points. These contracts define:
- Data structures that ChurchTools provides to extensions
- Events FROM ChurchTools that extensions can listen to
- Events TO ChurchTools that extensions can emit
npm install @churchtools/extension-pointsImport the types you need in your extension (example here: a custom tab in the finance module):
import type { FinanceTabData } from '@churchtools/extension-points';
import type { EntryPoint } from './lib/main';
// Use the types for type-safe extension development
const mainEntryPoint: EntryPoint<FinanceTabData> = ({ data, on, emit, element }) => {
console.log('AccountingPeriodId:', data.accountingPeriodId);
on('accountingPeriod:changed', (newAccountingPeriodData) => {
console.log('Accounting period changed: ', newAccountingPeriodData.accountingPeriodId);
// update the tab content accordingly
});
element.innerHTML = '<h1>My Extension</h1>';
};There are two fix module extension points:
Location: ChurchTools main menu → Extension module
Purpose: Render extension as a standalone module with its own menu entry
import type { MainModuleData, MainModuleEvents, MainModuleEmits } from '@churchtools/extension-points'; // or:
import type { MainModuleContract } from '@churchtools/extension-points';Data: MainModuleData
Events FROM ChurchTools: MainModuleEvents
Events TO ChurchTools: MainModuleEmits
Location: Admin → Extensions → Extension Settings
Purpose: Render admin configuration interface
import type { AdminData, AdminEvents, AdminEmits } from '@churchtools/extension-points'; // or:
import type { AdminContract } from '@churchtools/extension-points';E.g. a new tab in the person module, calendar appointment dialog, finance module, etc.
Location: Finance module, extra tab
Purpose: Display any custom finance information in a new tab
import type { FinanceTabData, FinanceTabEvents, FinanceTabEmits } from '@churchtools/extension-points'; // or:
import type { FinanceTabContract } from '@churchtools/extension-points';E.g. custom display of data in the calendar appointment edit dialog, person details, group details, etc.
Location: Calendar appointment edit dialog, first tab, below the other appointment fields
Purpose: Display any custom appointment information in the appointment edit dialog
import type { AppointmentDialogDetailData, AppointmentDialogDetailEvents, AppointmentDialogDetailEmits } from '@churchtools/extension-points'; // or:
import type { AppointmentDialogDetailContract } from '@churchtools/extension-points';Each extension point exports:
- Data interface - Data provided by ChurchTools
- Events interface - Events FROM ChurchTools (that you listen to)
- Emits interface - Events TO ChurchTools (that you emit)
- Contract type - Combined contract
Example:
export interface MainModuleData { /* ... */ }
export interface MainModuleEvents { /* ... */ }
export interface MainModuleEmits { /* ... */ }
export type MainModuleContract = {
data: MainModuleData;
events: MainModuleEvents;
emits: MainModuleEmits;
};This package contains only TypeScript type definitions. No runtime code is included.
# Install dependencies
npm install
# Build type definitions
npm run build
# Output: dist/Extension point definitions are maintained by ChurchTools. If you need a new extension point or want to propose changes:
- Open an issue describing the use case
- Submit a pull request with the type definitions
MIT
- Contact: extensions@churchtools.de
- Forum: ChurchTools Forum
- Issues: GitHub Issues