/// <reference types="node" />
import type { InteractionResults } from '../../../templates/types/oidc-provider';
import type Provider from '../../../templates/types/oidc-provider';
import type { RepresentationMetadata } from '../../http/representation/RepresentationMetadata';
import type { Interaction } from './InteractionHandler';
import Dict = NodeJS.Dict;
/**
 * A JSON object.
 */
export type Json = string | number | boolean | Dict<Json> | Json[];
/**
 * Contains a JSON object and any associated metadata.
 * Similar to a {@link Representation} but with all the data in memory instead of as a stream
 * and specific to JSON.
 */
export interface JsonRepresentation<T extends Dict<Json> = Dict<Json>> {
    json: T;
    metadata?: RepresentationMetadata;
}
/**
 * Asserts `oidcInteraction` is defined, throws the correct error in case this is not the case.
 * The error contains the relevant error code that can be used to explain more extensively what the issue is
 * and why an OIDC interaction is needed.
 *
 * @param oidcInteraction - Interaction object to check.
 */
export declare function assertOidcInteraction(oidcInteraction?: Interaction): asserts oidcInteraction is Interaction;
/**
 * The prompt that is used to track the account ID of a user during an OIDC interaction.
 * The already existing `login` prompt in the {@link InteractionResults}
 * is used to track the WebID that is chosen in an OIDC interaction.
 */
export declare const ACCOUNT_PROMPT = "account";
/**
 * {@link InteractionResults} extended with our custom key for tracking a user's account ID.
 */
export type AccountInteractionResults = {
    [ACCOUNT_PROMPT]?: string;
} & InteractionResults;
/**
 * Updates the `oidcInteraction` object with the necessary data in case a prompt gets updated.
 * @param oidcInteraction - Interaction to update.
 * @param result - New data to add to the interaction.
 * @param mergeWithLastSubmission - If this new data needs to be merged with already existing data in the interaction.
 */
export declare function finishInteraction(oidcInteraction: Interaction, result: AccountInteractionResults, mergeWithLastSubmission: boolean): Promise<string>;
/**
 * Removes the WebID, the `accountId`, from the OIDC session object,
 * allowing us to replace it with a new value.
 * If there is no session in the Interaction, nothing will happen.
 * @param provider - The OIDC provider.
 * @param oidcInteraction - The current interaction.
 */
export declare function forgetWebId(provider: Provider, oidcInteraction: Interaction): Promise<void>;
