UNPKG

1.36 kBTypeScriptView Raw
1import { interfaces } from 'inversify';
2import { Filter } from './filter';
3export declare type ContributionType = interfaces.ServiceIdentifier<any>;
4export declare const ContributionFilterRegistry: unique symbol;
5export interface ContributionFilterRegistry {
6 /**
7 * Add filters to be applied for every type of contribution.
8 */
9 addFilters(types: '*', filters: Filter<Object>[]): void;
10 /**
11 * Given a list of contribution types, register filters to apply.
12 * @param types types for which to register the filters.
13 */
14 addFilters(types: ContributionType[], filters: Filter<Object>[]): void;
15 /**
16 * Applies the filters for the given contribution type. Generic filters will be applied on any given type.
17 * @param toFilter the elements to filter
18 * @param type the contribution type for which potentially filters were registered
19 * @returns the filtered elements
20 */
21 applyFilters<T extends Object>(toFilter: T[], type: ContributionType): T[];
22}
23export declare const FilterContribution: unique symbol;
24/**
25 * Register filters to remove contributions.
26 */
27export interface FilterContribution {
28 /**
29 * Use the registry to register your contribution filters.
30 */
31 registerContributionFilters(registry: ContributionFilterRegistry): void;
32}
33//# sourceMappingURL=contribution-filter.d.ts.map
\No newline at end of file