headplane/app/integration/integration.ts

12 lines
345 B
TypeScript
Raw Normal View History

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export interface IntegrationFactory<T = any> {
2024-12-31 10:30:14 +05:30
name: string;
context: T;
isAvailable: (context: T) => Promise<boolean> | boolean;
onConfigChange?: (context: T) => Promise<void> | void;
}
2024-12-31 10:30:14 +05:30
export function createIntegration<T>(options: IntegrationFactory<T>) {
return options;
}