/// <reference path="../adonis-typings/index.d.ts" />
/// <reference types="@adonisjs/encryption/build/adonis-typings" />
import { ViewContract } from '@ioc:Adonis/Core/View';
import { CsrfOptions } from '@ioc:Adonis/Addons/Shield';
import { EncryptionContract } from '@ioc:Adonis/Core/Encryption';
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext';
/**
 * A class to encapsulate the logic of verifying and generating
 * CSRF tokens.
 */
export declare class Csrf {
    private options;
    private encryption;
    private viewProvider?;
    /**
     * Factory for generate csrf secrets and tokens
     */
    private tokens;
    /**
     * An array of methods on which the CSRF validation should be enforced.
     */
    private whitelistedMethods;
    /**
     * An array of routes to be ignored from CSRF validation
     */
    private routesToIgnore;
    /**
     * Name of the csrf section key stored inside the session store
     */
    private secretSessionKey;
    constructor(options: CsrfOptions, encryption: EncryptionContract, viewProvider?: ViewContract | undefined);
    /**
     * Find if a request should be validated or not
     */
    private shouldValidateRequest;
    /**
     * Read csrf token from one of the following sources.
     *
     * - `_csrf` input
     * - `x-csrf-token` header
     * - Or `x-xsrf-token` header. The header value must be set by
     *   reading the `XSRF-TOKEN` cookie.
     */
    private getCsrfTokenFromRequest;
    /**
     * Share csrf helper methods with the view engine.
     */
    private shareCsrfViewLocals;
    /**
     * Generate a new csrf token using the csrf secret extracted from session.
     */
    private generateCsrfToken;
    /**
     * Return the existing CSRF secret from the session or create a
     * new one. Newly created secret is persisted to session at
     * the same time
     */
    private getCsrfSecret;
    /**
     * Handle csrf verification. First, get the secret,
     * next, check if the request method should be
     * verified. Next, attach the newly generated
     * csrf token to the request object.
     */
    handle(ctx: HttpContextContract): Promise<void>;
}
/**
 * A factory function that returns a new function to enforce CSRF
 * protection
 */
export declare function csrfFactory(options: CsrfOptions, encryption: EncryptionContract, viewProvider?: ViewContract): any;
