UNPKG

@robotlegsjs/core

Version:

An architecture-based IoC framework for JavaScript/TypeScript

20 lines (19 loc) 769 B
import { IInjector } from "../api/IInjector"; /** * <p>A guard can be a function, object or class.</p> * * <p>When a function is provided it is expected to return a boolean when called.</p> * * <p>When an object is provided it is expected to expose an "approve" method * that returns a boolean.</p> * * <p>When a class is provided, an instance of that class will be instantiated and tested. * If an injector is provided the instance will be created using that injector, * otherwise the instance will be created manually.</p> * * @param guards An array of guards * @param injector An optional Injector * * @return A boolean value of false if any guard returns false */ export declare function guardsApprove(guards: any[], injector?: IInjector): boolean;