UNPKG

2.35 kBTypeScriptView Raw
1import { Entity } from '../entity';
2import { EdmTypeShared } from '../edm-types';
3import { Field, FieldOptions } from './field';
4import { ConstructorOrField } from './constructor-or-field';
5import { ComplexTypeNamespace } from './complex-type-namespace';
6/**
7 * Represents a field of an entity or a complex type, that can have a collection as value.
8 * @typeparam EntityT - Type of the entity the field belongs to.
9 * @typeparam CollectionFieldT - Type of of elements of the collection. This can either be an EDM type or complex type.
10 * @typeparam NullableT - Boolean type that represents whether the field is nullable.
11 * @typeparam SelectableT - Boolean type that represents whether the field is selectable.
12 */
13export declare class CollectionField<EntityT extends Entity, CollectionFieldT extends EdmTypeShared<'any'> | Record<string, any> = any, NullableT extends boolean = false, SelectableT extends boolean = false> extends Field<EntityT, NullableT, SelectableT> {
14 readonly _fieldOf: ConstructorOrField<EntityT>;
15 readonly _fieldType: CollectionFieldType<CollectionFieldT>;
16 /**
17 * Creates an instance of CollectionField.
18 * @param fieldName - Actual name of the field used in the OData request.
19 * @param _fieldOf - The constructor of the entity or the complex type field this field belongs to.
20 * @param _fieldType - Edm type of the field according to the metadata description.
21 * @param fieldOptions - Optional settings for this field.
22 */
23 constructor(fieldName: string, _fieldOf: ConstructorOrField<EntityT>, _fieldType: CollectionFieldType<CollectionFieldT>, fieldOptions?: FieldOptions<NullableT, SelectableT>);
24 /**
25 * Gets the path to the complex type property represented by this.
26 * @returns The path to the complex type property.
27 */
28 fieldPath(): string;
29}
30/**
31 * Convenience type to reflect the type of the instances of a collection field.
32 * The actual type of the elements for complex type collections is [[ComplexTypeNamespace]].
33 * @typeparam CollectionFieldT - Type of of elements of the collection. This can either be an EDM type or complex type.
34 */
35export declare type CollectionFieldType<CollectionFieldT extends EdmTypeShared<'any'> | Record<string, any>> = CollectionFieldT | ComplexTypeNamespace<CollectionFieldT>;
36//# sourceMappingURL=collection-field.d.ts.map
\No newline at end of file