import { Repository } from 'typeorm';
import { User } from './entities/user.entity';
import { CreateUserDto } from './dtos/create-user.dto';
import { CreateEmailTemplateDto } from './dtos/create-email-template.dto';
import { CreateSmsTemplateDto } from './dtos/create-sms-template.dto';
import { SignUpDto } from './dtos/sign-up.dto';
import { Readable } from 'stream';
import { CreateMediaStorageProviderMetadataDto } from './dtos/create-media-storage-provider-metadata.dto';
import { DatasourceType } from './dtos/create-model-metadata.dto';
import { CreateModuleMetadataDto } from './dtos/create-module-metadata.dto';
import { CreateRoleMetadataDto } from './dtos/create-role-metadata.dto';
import { CreateSecurityRuleDto } from './dtos/create-security-rule.dto';
import { FieldMetadata } from './entities/field-metadata.entity';
import { Media } from './entities/media.entity';
import { DashboardQuestion } from './entities/dashboard-question.entity';
import { ComputedFieldMetadata } from './helpers/solid-registry';
import { SqlExpression } from './services/question-data-providers/chartjs-sql-data-provider.service';
import { CreateDashboardDto } from './dtos/create-dashboard.dto';
import { AiInteraction } from './entities/ai-interaction.entity';
import { ActiveUserData } from './interfaces/active-user-data.interface';
import { SecurityRuleConfig } from './dtos/security-rule-config.dto';
import { SecurityRule } from './entities/security-rule.entity';
export interface FieldCrudManager {
    validate(dto: any, files: Array<Express.Multer.File>): ValidationError[] | Promise<ValidationError[]>;
    transformForCreate(dto: any, ctxt?: any): any | Promise<any>;
}
export interface ValidationError {
    field: string;
    error: string;
}
export interface MediaStorageProvider<T> {
    store(files: Express.Multer.File[], entity: T, mediaFieldMetadata: FieldMetadata): Promise<Media[]>;
    delete(entity: T, mediaFieldMetadata: FieldMetadata): Promise<void>;
    deleteByMediaRecord(media: Media): Promise<void>;
    retrieve(entity: T, mediaFieldMetadata: FieldMetadata): Promise<Media[]>;
    storeStreams(streamPairs: [Readable, string][], entity: T, mediaFieldMetadata: FieldMetadata): Promise<Media[]>;
}
export interface ModuleMetadataConfiguration {
    moduleMetadata?: CreateModuleMetadataDto;
    roles?: CreateRoleMetadataDto[];
    users?: SignUpDto[];
    actions?: any[];
    menus?: any[];
    views?: any[];
    emailTemplates?: CreateEmailTemplateDto[];
    smsTemplates?: CreateSmsTemplateDto[];
    mediaStorageProviders?: CreateMediaStorageProviderMetadataDto[];
    securityRules?: CreateSecurityRuleDto[];
    dashboards?: CreateDashboardDto[];
}
export declare enum SettingLevel {
    SystemEnv = "system-env",
    SystemAdminReadonly = "system-admin-readonly",
    SystemAdminEditable = "system-admin-editable",
    InternalUser = "internal-user"
}
export type SettingControlType = 'shortText' | 'longText' | 'numeric' | 'boolean' | 'date' | 'datetime' | 'mediaSingle' | 'selectionStatic' | 'custom';
export interface SettingOption {
    label: string;
    value: string | number | boolean;
}
export interface SettingDefinition<T = any> {
    moduleName: string;
    key: string;
    value: T;
    level: SettingLevel;
    encrypted?: boolean;
    label?: string;
    description?: string;
    placeholder?: string;
    group?: string;
    sortOrder?: number;
    controlType?: SettingControlType;
    options?: SettingOption[];
    settingsWidget?: string;
}
export interface AdminSettingDefinition<T = any> extends SettingDefinition<T> {
    editable: boolean;
}
export interface AdminSettingsResponse<T = any> {
    data: AdminSettingDefinition<T>[];
}
export interface ISettingsProvider {
    getSettings(): SettingDefinition[];
}
export interface CodeGenerationOptions {
    moduleId?: number;
    moduleUserKey?: string;
    modelId?: number;
    modelUserKey?: string;
    fieldIdsForRemoval?: number[];
    fieldNamesForRemoval?: string[];
    dryRun?: boolean;
}
export interface TriggerMcpClientOptions {
    aiInteractionId: number;
    moduleName: string;
}
export interface McpResponse {
    success: boolean;
    request: string;
    response: string;
    model?: string;
    tools_invoked?: string[];
    tool_calls?: any[];
    duration_ms?: number;
    errors?: string[];
    error_trace?: string[];
    content_type?: string;
}
export interface ISelectionProviderContext {
    limit: number;
    offset: number;
    formValues: Record<string, any>;
    validateOnSave?: boolean;
}
export interface ISelectionProviderValues {
    label: string;
    value: string;
}
export interface ISelectionProvider<T extends ISelectionProviderContext> {
    help(): string;
    name(): string;
    value(optionValue: string, ctxt: T): Promise<ISelectionProviderValues | any>;
    values(query: any, ctxt: T): Promise<readonly ISelectionProviderValues[]>;
}
export interface IDashboardVariableSelectionProvider<T extends ISelectionProviderContext> extends ISelectionProvider<T> {
}
export interface IMcpToolResponseHandler {
    apply(aiInteraction: AiInteraction): any;
}
export interface QuestionSqlDataProviderContext {
    expressions?: SqlExpression[];
}
export interface IDashboardQuestionDataProvider<TContext, TData> {
    help(): string;
    name(): string;
    getData(question: DashboardQuestion, ctxt?: TContext): Promise<TData[] | TData>;
}
export interface IComputedFieldProvider<T> {
    help(): string;
    name(): string;
    valueType(): string;
    computeValue(dto: any, ctxt: T): Promise<string | number>;
}
export interface IEntityComputedFieldProvider {
    help(): string;
    name(): string;
}
export interface IEntityPreComputeFieldProvider<TTriggerEntity, TContext, TValue = void> extends IEntityComputedFieldProvider {
    preComputeValue(triggerEntity: TTriggerEntity, computedFieldMetadata: ComputedFieldMetadata<TContext>): Promise<TValue>;
}
export interface IEntityPostComputeFieldProvider<TTriggerEntity, TContext> extends IEntityComputedFieldProvider {
    postComputeAndSaveValue(triggerEntity: TTriggerEntity, computedFieldMetadata: ComputedFieldMetadata<TContext>): Promise<void>;
}
export interface ISolidDatabaseModule {
    name(): string;
    type(): DatasourceType;
}
export declare enum EventType {
    USER_REGISTERED = "user.registered"
}
export declare class EventDetails<T> {
    type: any;
    payload: T;
    constructor(type: any, payload: T);
}
export interface IExtensionUserCreationProvider<T extends User = User, TDto extends CreateUserDto = CreateUserDto> {
    readonly repo: Repository<T>;
    buildExtensionEntity(dto: TDto): Promise<T>;
    roles(dto: TDto): string[];
}
export interface IMail<TResponse = unknown> {
    sendEmail(to: string, subject: string, body: string, shouldQueueEmails: boolean, wrapperAttachments?: MailAttachmentWrapper[], attachments?: MailAttachment[], parentEntity?: any, parentEntityId?: any, cc?: string[], bcc?: string[], from?: string): Promise<TResponse>;
    sendEmailUsingTemplate(to: string, templateName: string, templateParams: any, shouldQueueEmails: boolean, wrapperAttachments?: MailAttachmentWrapper[], attachments?: MailAttachment[], parentEntity?: any, parentEntityId?: any, cc?: string[], bcc?: string[], from?: string): Promise<TResponse>;
}
export interface ISMS {
    sendSMS(to: string, body: string, shouldQueueSms: boolean): Promise<any>;
    sendSMSUsingTemplate(to: string, templateName: string, templateParams: any, shouldQueueSms: boolean): Promise<any>;
}
export interface IWhatsAppTransport {
    sendWhatsAppMessage(to: string, templateId: string, parameters: any, parentEntity?: any, parentEntityId?: any): Promise<any>;
}
export interface MailAttachmentWrapper {
    relativePath?: string;
    attachment?: MailAttachment;
}
export interface MailAttachment {
    filename: string;
    templatePath?: string;
    templateParams?: any;
    content?: string | Buffer;
    contentType?: string;
    path?: string;
}
export declare enum BrokerType {
    RabbitMQ = "rabbitmq",
    Database = "database",
    Redis = "redis"
}
export interface QueuesModuleOptions {
    name: string;
    type: BrokerType;
    queueName: string;
    prefetch?: number;
    persistToDatabase?: boolean;
}
export type MediaWithFullUrl = Media & {
    _full_url: string;
};
export type ErrorCode = string;
export type ErrorMeta = {
    message: string;
    httpStatus?: number;
};
export type ErrorRule = {
    code: ErrorCode;
    priority?: number;
    match: (combinedErrorText: string) => boolean;
    meta: ErrorMeta;
};
export interface IErrorCodeProvider {
    name(): string;
    rules(): ReadonlyArray<ErrorRule>;
    resolve?(code: ErrorCode): ErrorMeta | undefined;
}
export type PlanStep = CreateNewFileStep | RegisterNestProviderStep | AddMethodToExistingClassStep | RegisterSolidXExtensionComponentStep | AddListViewButtonStep | AddFormViewButtonStep | AddImportStep;
export interface AddImportStep {
    type: "addImport";
    path: string;
    importStatement: string;
    overwrite?: boolean;
    rationale?: string;
}
export interface CreateNewFileStep {
    type: "createNewFile";
    path: string;
    content: string;
    overwrite?: boolean;
    rationale?: string;
}
export interface RegisterNestProviderStep {
    type: "registerNestProvider";
    modulePath: string;
    providerClassName: string;
    importFrom: string;
    registerIn: Array<"providers" | "exports">;
    uniqueGuard?: boolean;
    rationale?: string;
}
export interface AddMethodToExistingClassStep {
    type: "addMethodToExistingClass";
    path: string;
    className: string;
    methodName: string;
    content: string;
    importStatements?: string[];
    rationale?: string;
}
export interface RegisterSolidXExtensionComponentStep {
    type: "registerSolidXExtensionComponent";
    path: string;
    content?: string;
    importExtensionComponent?: string;
}
export interface AddListViewButtonStep {
    type: "addListViewButton";
    moduleName?: string;
    modelName?: string;
    buttonType?: string;
    content?: string;
}
export interface AddFormViewButtonStep {
    type: "addFormViewButton";
    moduleName?: string;
    modelName?: string;
    buttonType?: string;
    content?: string;
}
export interface McpComputedProviderResponse {
    plan: PlanStep[];
}
export interface ISecurityRuleConfigProvider {
    securityRuleConfig(activeUser: ActiveUserData, securityRule: SecurityRule): Promise<SecurityRuleConfig>;
}
export interface AwsS3Config {
    S3_AWS_ACCESS_KEY: string;
    S3_AWS_SECRET_KEY: string;
    S3_AWS_REGION_NAME: string;
}
export type NoInfer<T> = [T][T extends any ? 0 : never];
export type AuditEventType = 'insert' | 'update' | 'delete';
export interface AuditQueuePayload {
    eventType: AuditEventType;
    modelName: string;
    entityId: string | number | null;
    occurredAt: string;
    after?: any;
    before?: any;
    updatedColumnNames?: string[];
    userId?: number | null;
}
//# sourceMappingURL=interfaces.d.ts.map