import { Entity } from '@backstage/catalog-model';
import { Config } from '@backstage/config';
import { EntityProvider, EntityProviderConnection } from '@backstage/plugin-catalog-node';
import { GroupTransformer, MicrosoftGraphProviderConfig, ProviderConfigTransformer, OrganizationTransformer, UserTransformer } from '../microsoftGraph';
import { LoggerService, SchedulerService, SchedulerServiceTaskRunner } from '@backstage/backend-plugin-api';
/**
 * Options for {@link MicrosoftGraphOrgEntityProvider}.
 *
 * @public
 */
export type MicrosoftGraphOrgEntityProviderOptions = MicrosoftGraphOrgEntityProviderLegacyOptions | {
    /**
     * The logger to use.
     */
    logger: LoggerService;
    /**
     * The refresh schedule to use.
     *
     * @remarks
     *
     * If you pass in 'manual', you are responsible for calling the `read` method
     * manually at some interval.
     *
     * But more commonly you will pass in the result of
     * {@link @backstage/backend-plugin-api#SchedulerService.createScheduledTaskRunner}
     * to enable automatic scheduling of tasks.
     */
    schedule?: 'manual' | SchedulerServiceTaskRunner;
    /**
     * Scheduler used to schedule refreshes based on
     * the schedule config.
     */
    scheduler?: SchedulerService;
    /**
     * The function that transforms a user entry in msgraph to an entity.
     * Optionally, you can pass separate transformers per provider ID.
     */
    userTransformer?: UserTransformer | Record<string, UserTransformer>;
    /**
     * The function that transforms a group entry in msgraph to an entity.
     * Optionally, you can pass separate transformers per provider ID.
     */
    groupTransformer?: GroupTransformer | Record<string, GroupTransformer>;
    /**
     * The function that transforms an organization entry in msgraph to an entity.
     * Optionally, you can pass separate transformers per provider ID.
     */
    organizationTransformer?: OrganizationTransformer | Record<string, OrganizationTransformer>;
    /**
     * The function that transforms provider config dynamically.
     */
    providerConfigTransformer?: ProviderConfigTransformer | Record<string, ProviderConfigTransformer>;
};
/**
 * Legacy options for {@link MicrosoftGraphOrgEntityProvider}
 * based on `catalog.processors.microsoftGraphOrg`.
 *
 * @public
 * @deprecated This interface exists for backwards compatibility only and will be removed in the future.
 */
export interface MicrosoftGraphOrgEntityProviderLegacyOptions {
    /**
     * A unique, stable identifier for this provider.
     *
     * @example "production"
     */
    id: string;
    /**
     * The target that this provider should consume.
     *
     * Should exactly match the "target" field of one of the provider
     * configuration entries.
     */
    target: string;
    /**
     * The logger to use.
     */
    logger: LoggerService;
    /**
     * The refresh schedule to use.
     *
     * @remarks
     *
     * If you pass in 'manual', you are responsible for calling the `read` method
     * manually at some interval.
     *
     * But more commonly you will pass in the result of
     * {@link @backstage/backend-plugin-api#SchedulerService.createScheduledTaskRunner}
     * to enable automatic scheduling of tasks.
     */
    schedule: 'manual' | SchedulerServiceTaskRunner;
    /**
     * The function that transforms a user entry in msgraph to an entity.
     */
    userTransformer?: UserTransformer;
    /**
     * The function that transforms a group entry in msgraph to an entity.
     */
    groupTransformer?: GroupTransformer;
    /**
     * The function that transforms an organization entry in msgraph to an entity.
     */
    organizationTransformer?: OrganizationTransformer;
    /**
     *  The function that transforms provider config dynamically.
     */
    providerConfigTransformer?: ProviderConfigTransformer;
}
/**
 * Reads user and group entries out of Microsoft Graph, and provides them as
 * User and Group entities for the catalog.
 *
 * @public
 */
export declare class MicrosoftGraphOrgEntityProvider implements EntityProvider {
    private options;
    private connection?;
    private scheduleFn?;
    static fromConfig(configRoot: Config, options: MicrosoftGraphOrgEntityProviderOptions): MicrosoftGraphOrgEntityProvider[];
    /**
     * @deprecated Exists for backwards compatibility only and will be removed in the future.
     */
    private static fromLegacyConfig;
    constructor(options: {
        id: string;
        provider: MicrosoftGraphProviderConfig;
        logger: LoggerService;
        userTransformer?: UserTransformer;
        groupTransformer?: GroupTransformer;
        organizationTransformer?: OrganizationTransformer;
        providerConfigTransformer?: ProviderConfigTransformer;
    });
    /** {@inheritdoc @backstage/plugin-catalog-node#EntityProvider.getProviderName} */
    getProviderName(): string;
    /** {@inheritdoc @backstage/plugin-catalog-node#EntityProvider.connect} */
    connect(connection: EntityProviderConnection): Promise<void>;
    /**
     * Runs one complete ingestion loop. Call this method regularly at some
     * appropriate cadence.
     */
    read(options?: {
        logger?: LoggerService;
    }): Promise<void>;
    private schedule;
}
export declare function withLocations(providerId: string, entity: Entity): Entity;
