import { JSONObject } from "kuzzle-sdk"; import { KuzzleRequest } from "../request"; /** * Base class for all controllers */ export declare class BaseController { protected __actions: Set; constructor(); get _actions(): Set; _addAction(name: any, fn: any): void; /** * Check if the provided action name exists within that controller. * This check's purpose is to prevent actions leak by making actions exposure * explicit. * * @param name */ _isAction(name: string): boolean; } export declare class NativeController extends BaseController { protected ask: (event: string, ...args: any[]) => Promise; protected pipe: (event: string, ...args: any[]) => Promise; constructor(actions?: any[]); /** * Controller optional initialization method. * Used to perform asynchronous initialization safely: the funnel will wait * for all controllers to be initialized before accepting requests. */ init(): Promise; translateKoncorde(koncordeFilters: JSONObject): Promise; /** * Throws if the body contain one of the specified attribute * * @param request * @param paths */ assertBodyHasNotAttributes(request: KuzzleRequest, ...paths: string[]): void; /** * Throws if the strategy does not exists * * @todo move this method in some kind of "Security" class */ assertIsStrategyRegistered(strategy: string): void; /** * Throw if some target have: * - missing properties * - invalid types * - unauthorized values * * @param Array of targets * @param options.allowEmptyCollections */ assertTargetsAreValid(targets: Array<{ index: string; collections?: string[]; }>, { allowEmptyCollections }?: { allowEmptyCollections?: boolean; }): void; _hasMultiTargets(str: string): boolean; /** * Throws if page size exceeed Kuzzle limits * * @param asked * @throws */ assertNotExceedMaxFetch(asked: number): void; /** * Throws if number of documents exceeed Kuzzle limits * * @param asked * @throws */ assertNotExceedMaxWrite(asked: number): void; }