easy-template-x-angular-expressions
Version:
Angular expressions support for easy-template-x
41 lines (40 loc) • 1.45 kB
TypeScript
import { PathFilter } from './pathFilter';
import { IMap } from './types';
export type AngularFilter = (value: any) => any;
export declare class ResolverOptions {
/**
* If set to a non-empty string the resolver will require the tag name to
* have this prefix (ignoring leading whitespace).
*
* Default: false
*/
requiredPrefix?: string | false;
/**
* The path filter is used to determine which path parts to consider when
* traversing the data object to construct the expression scope. Path parts
* that returns `false` are skipped and the traversal moves to the next
* part.
*/
pathFilter?: PathFilter;
/**
* Setting this option to `true` instructs the resolver to fallback to the default `easy-template-x` data resolver.
* Setting it to `false` will return `undefined` instead.
*
* The fallback is used in the following cases:
*
* 1. Empty path.
* 2. Numeric path parts (loop iteration index).
* 3. When the `requiredPrefix` is specified and the tag name does not meet the requirement.
*
* Default: true
*/
defaultFallback?: boolean;
/**
* Map of Angular filters.
*
* **Notice**: The filters are global. That is, filters of one Resolver may
* override filters of another Resolver.
*/
angularFilters?: IMap<AngularFilter>;
constructor(initial?: Partial<ResolverOptions>);
}