@sap-cloud-sdk/core
Version:
SAP Cloud SDK for JavaScript core
36 lines • 2.35 kB
TypeScript
import { Entity } from '../entity';
import { EdmTypeShared } from '../edm-types';
import { Field, FieldOptions } from './field';
import { ConstructorOrField } from './constructor-or-field';
import { ComplexTypeNamespace } from './complex-type-namespace';
/**
* Represents a field of an entity or a complex type, that can have a collection as value.
* @typeparam EntityT - Type of the entity the field belongs to.
* @typeparam CollectionFieldT - Type of of elements of the collection. This can either be an EDM type or complex type.
* @typeparam NullableT - Boolean type that represents whether the field is nullable.
* @typeparam SelectableT - Boolean type that represents whether the field is selectable.
*/
export 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> {
readonly _fieldOf: ConstructorOrField<EntityT>;
readonly _fieldType: CollectionFieldType<CollectionFieldT>;
/**
* Creates an instance of CollectionField.
* @param fieldName - Actual name of the field used in the OData request.
* @param _fieldOf - The constructor of the entity or the complex type field this field belongs to.
* @param _fieldType - Edm type of the field according to the metadata description.
* @param fieldOptions - Optional settings for this field.
*/
constructor(fieldName: string, _fieldOf: ConstructorOrField<EntityT>, _fieldType: CollectionFieldType<CollectionFieldT>, fieldOptions?: FieldOptions<NullableT, SelectableT>);
/**
* Gets the path to the complex type property represented by this.
* @returns The path to the complex type property.
*/
fieldPath(): string;
}
/**
* Convenience type to reflect the type of the instances of a collection field.
* The actual type of the elements for complex type collections is [[ComplexTypeNamespace]].
* @typeparam CollectionFieldT - Type of of elements of the collection. This can either be an EDM type or complex type.
*/
export declare type CollectionFieldType<CollectionFieldT extends EdmTypeShared<'any'> | Record<string, any>> = CollectionFieldT | ComplexTypeNamespace<CollectionFieldT>;
//# sourceMappingURL=collection-field.d.ts.map