import { DatabaseProviderBase, UserInfo } from '@memberjunction/core';
import { UserViewEntityExtended } from '@memberjunction/core-entities';
import { GraphQLSchema } from 'graphql';
import sql from 'mssql';
export type UserPayload = {
    email: string;
    userRecord: any;
    sessionId: string;
    isSystemUser?: boolean;
    apiKey?: string;
};
export type AppContext = {
    dataSource: sql.ConnectionPool;
    userPayload: UserPayload;
    queryRunner?: sql.Request;
    dataSources: DataSourceInfo[];
    providers: Array<ProviderInfo>;
};
export declare class ProviderInfo {
    provider: DatabaseProviderBase;
    type: 'Admin' | 'Read-Write' | 'Read-Only' | 'Other';
}
export declare class DataSourceInfo {
    dataSource: sql.ConnectionPool;
    host: string;
    port: number;
    instance?: string;
    database: string;
    userName: string;
    type: "Admin" | "Read-Write" | "Read-Only" | "Other";
    constructor(init: {
        dataSource: sql.ConnectionPool;
        type: "Admin" | "Read-Write" | "Read-Only" | "Other";
        host: string;
        port: number;
        database: string;
        userName: string;
    });
}
export type DirectiveBuilder = {
    typeDefs: string;
    transformer: (schema: GraphQLSchema) => GraphQLSchema;
};
export type RunViewGenericParams = {
    viewInfo: UserViewEntityExtended;
    provider: DatabaseProviderBase;
    extraFilter: string;
    orderBy: string;
    userSearchString: string;
    excludeUserViewRunID?: string;
    overrideExcludeFilter?: string;
    saveViewResults?: boolean;
    fields?: string[];
    ignoreMaxRows?: boolean;
    maxRows?: number;
    startRow?: number;
    excludeDataFromAllPriorViewRuns?: boolean;
    forceAuditLog?: boolean;
    auditLogDescription?: string;
    resultType?: string;
    userPayload?: UserPayload;
};
export declare class MJServerEvent {
    type: 'setupComplete' | 'requestReceived' | 'requestCompleted' | 'requestFailed';
    dataSources: DataSourceInfo[];
    userPayload: UserPayload;
    systemUser: UserInfo;
}
export declare const MJ_SERVER_EVENT_CODE = "MJ_SERVER_EVENT";
export declare function raiseEvent(type: MJServerEvent['type'], dataSources: DataSourceInfo[], userPayload: UserPayload, component?: any): Promise<void>;
//# sourceMappingURL=types.d.ts.map