import { EastFunction, GetFieldFunction, StructFunction } from '../functions'; import { EastType, StructType } from '../types'; import { Expression, ExpressionTypeOf } from './core'; /** * Construct a struct from an expressions for each field. * * @param fields a record of {@link Expression}s defining the struct * * @category Expression * @see {@link GetField} * * @example * ```typescript * // ... * // Create an aggregate struct with product data * ProductData: Struct({ * Id: Variable("ProductId", StringType), * Name: Variable("ProductName", StringType), * UnitPrice: Variable("ProductPrice", FloatType), * StockLevel: Variable("ProductStockLevel", IntegerType), * StockTakeDate: Variable("ProductStockTakeDate", DateTimeType), * }), * // ... * ``` */ export declare function Struct>>(fields: T): StructFunction<{ type: "Struct"; value: { [K in keyof T]: ExpressionTypeOf; }; }>; /** * Fetch the value of one of a struct's fields. * * @param struct the {@link Expression} for the input struct * @param field the name of field to fetch * * @category Expression * @see {@link Struct} * * @example * ```typescript * // ... * // Get the name of the product from the product data * ProductName: GetField( * Variable(product_data, StructType({ * Id: StringType, * Name: StringType, * UnitPrice: FloatType, * StockLevel: IntegerType, * StockTakeDate: DateTimeType, * }), * "Name" * ), * // ... * ``` */ export declare function GetField(struct: EastFunction, field: K): GetFieldFunction;