angular-odata
Version:
Client side OData typescript library for Angular
29 lines (28 loc) • 960 B
TypeScript
import { AnnotationConfig } from '../types';
export declare class ODataAnnotation {
term: string;
string?: string;
bool?: boolean;
int?: number;
permissions?: string[];
properties?: string[];
constructor(annot: AnnotationConfig);
}
export declare class ODataAnnotatable {
annotations: ODataAnnotation[];
constructor(config: {
annotations?: AnnotationConfig[];
});
/**
* Find an annotation inside the annotatable.
* @param predicate Function that returns true if the annotation match.
* @returns The annotation that matches the predicate.
*/
findAnnotation(predicate: (annot: ODataAnnotation) => boolean): ODataAnnotation | undefined;
/**
* Find an annotation inside the annotatable and return its value.
* @param term The term of the annotation to find.
* @returns The value of the annotation.
*/
annotatedValue<T>(term: string | RegExp): T | undefined;
}