UNPKG

@egodigital/nef

Version:

Managed Extensibility Framework like library written for Node.js

47 lines (46 loc) 2 kB
/** * This file is part of the @egodigital/nef distribution. * Copyright (c) e.GO Digital GmbH, Aachen, Germany (https://www.e-go-digital.com/) * * @egodigital/nef is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, version 3. * * @egodigital/nef is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import { CatalogBase } from './CatalogBase'; import { ComposablePartCatalog } from '../index'; /** * A predicate for 'FilteredCatalog<TCatalog>' class. * * @param {any} cls The current class. * @param {number} index The zero-based index inside the container. * @param {TCatalog} catalog The underlying catalog. * * @return {boolean} Class matches criteria or not. */ export declare type FilteredCatalogPredicate<TCatalog extends ComposablePartCatalog = ComposablePartCatalog> = (cls: any, index: number, catalog: TCatalog) => boolean; /** * A catalog, which filters the exports of a base catalog. */ export declare class FilteredCatalog<TCatalog extends ComposablePartCatalog = ComposablePartCatalog> extends CatalogBase { readonly catalog: TCatalog; readonly predicate: FilteredCatalogPredicate<TCatalog>; /** * Initializes a new instance of that class. * * @param {TCatalog} catalog The underlying (base) catalog. * @param {FilteredCatalogPredicate<TCatalog>} predicate The predicate to use. */ constructor(catalog: TCatalog, predicate: FilteredCatalogPredicate<TCatalog>); /** @inheritdoc */ getClasses(): Promise<any[]>; /** @inheritdoc */ getClassesSync(): any[]; }