import type { LICENSE_FEATURES, InstanceType } from '@n8n/constants'; import { type Constructable } from '@n8n/di'; import type { NodeLoader } from 'n8n-workflow'; export interface BaseEntity { hasId(): boolean; save(options?: unknown): Promise; remove(options?: unknown): Promise; softRemove(options?: unknown): Promise; recover(options?: unknown): Promise; reload(): Promise; } export interface CreatedAtEntity { createdAt: Date; } export interface TimestampedEntity extends CreatedAtEntity { updatedAt: Date; } export interface TimestampedIdEntity extends TimestampedEntity { id: string; } export type EntityClass = new () => BaseEntity | TimestampedIdEntity | TimestampedEntity | CreatedAtEntity; export type ModuleSettings = Record; export type ModuleContext = Record; export interface ModuleInterface { init?(): Promise; shutdown?(): Promise; commands?(): Promise; entities?(): Promise; settings?(): Promise; context?(): Promise; nodeLoaders?(): Promise; } export type ModuleClass = Constructable; export type LicenseFlag = (typeof LICENSE_FEATURES)[keyof typeof LICENSE_FEATURES]; export type BackendModuleOptions = { name: string; licenseFlag?: LicenseFlag | LicenseFlag[]; instanceTypes?: InstanceType[]; }; export declare const BackendModule: (opts: BackendModuleOptions) => ClassDecorator;