import type { CustomObjectFieldDerivedAggregatedField, CustomObjectFieldFormulaAttrMetas, CustomObjectFieldRqlDefinition, CustomObjectFieldSection as RestCustomObjectFieldSection } from "../../../resources/custom-objects/fields.mjs"; import type { AnyCustomObjectDefinition, BooleanFieldDefinition, CurrencyFieldDefinition, CustomObjectIdentity, DateFieldDefinition, DatetimeFieldDefinition, EmailFieldDefinition, FileFieldDefinition, FormulaFieldDefinition, LongTextFieldDefinition, LookupFieldDefinition, LookupTarget, NativeModelTarget, NumberFieldDefinition, ParentChildFieldDefinition, PercentageFieldDefinition, PhoneFieldDefinition, RadioFieldDefinition, SectionDefinition, SelectFieldDefinition, TextFieldDefinition, TimeFieldDefinition, UrlFieldDefinition } from "./types.mjs"; /** * Internal helper for field factories that expose `required` and `section`. * * @typeParam TRequired - Literal boolean carried through to derived input types. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ interface BooleanLikeProps { readonly required?: TRequired; readonly section?: TSectionKey; } /** * Internal helper for choice-based field factories. * * @typeParam TRequired - Literal boolean carried through to derived input types. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ interface ChoiceProps extends BooleanLikeProps { readonly options: readonly string[]; } /** * Internal helper for numeric field factories that support decimal-place metadata. * * @typeParam TRequired - Literal boolean carried through to derived input types. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ interface NumericProps extends BooleanLikeProps { readonly decimalPlaces?: number; } /** * Internal presentation properties shared by every field factory. * * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ interface CommonFieldProps { readonly displayName: string; readonly description: string; readonly section?: TSectionKey; readonly enableHistory?: boolean; readonly formulaAttributeMetas?: CustomObjectFieldFormulaAttrMetas; readonly derivedAggregatedField?: CustomObjectFieldDerivedAggregatedField; readonly rqlDefinition?: CustomObjectFieldRqlDefinition; readonly restSection?: RestCustomObjectFieldSection; } /** * Declares a native Rippling model target for lookup fields. * * @param apiName - Native model API name, for example `'Employee'`. * @returns Immutable native-model target descriptor for lookup fields. * @typeParam TApiName - Native model api name, for example `'Employee'`. */ export declare function nativeModel(apiName: TApiName): NativeModelTarget; /** * Defines a single-line text field. * * @param props - Text-field metadata and presentation properties. * @returns Immutable text field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function text(props: CommonFieldProps & BooleanLikeProps & { readonly unique?: boolean; readonly maxLength?: number; }): TextFieldDefinition; /** * Defines a multi-line text field. * * @param props - Long-text field metadata and presentation properties. * @returns Immutable long-text field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function longText(props: CommonFieldProps & BooleanLikeProps & { readonly maxLength?: number; }): LongTextFieldDefinition; /** * Defines an email-address field. * * @param props - Email-field metadata and presentation properties. * @returns Immutable email field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function email(props: CommonFieldProps & BooleanLikeProps & { readonly unique?: boolean; }): EmailFieldDefinition; /** * Defines a URL field. * * @param props - URL-field metadata and presentation properties. * @returns Immutable URL field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function url(props: CommonFieldProps & BooleanLikeProps): UrlFieldDefinition; /** * Defines a phone-number field. * * @param props - Phone-field metadata and presentation properties. * @returns Immutable phone field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function phone(props: CommonFieldProps & BooleanLikeProps): PhoneFieldDefinition; /** * Defines a numeric field. * * @param props - Number-field metadata and presentation properties. * @returns Immutable number field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function number(props: CommonFieldProps & NumericProps & { readonly unique?: boolean; }): NumberFieldDefinition; /** * Defines a currency field. * * @param props - Currency-field metadata and presentation properties. * @returns Immutable currency field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function currency(props: CommonFieldProps & NumericProps & { readonly currency?: string; }): CurrencyFieldDefinition; /** * Defines a percentage field. * * @param props - Percentage-field metadata and presentation properties. * @returns Immutable percentage field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function percentage(props: CommonFieldProps & BooleanLikeProps): PercentageFieldDefinition; /** * Defines a date-only field. * * @param props - Date-field metadata and presentation properties. * @returns Immutable date field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function date(props: CommonFieldProps & BooleanLikeProps): DateFieldDefinition; /** * Defines a date-time field. * * @param props - Datetime-field metadata and presentation properties. * @returns Immutable datetime field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function datetime(props: CommonFieldProps & BooleanLikeProps): DatetimeFieldDefinition; /** * Defines a time-of-day field. * * @param props - Time-field metadata and presentation properties. * @returns Immutable time field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function time(props: CommonFieldProps & BooleanLikeProps): TimeFieldDefinition; /** * Defines a multi-select choice field. * * @param props - Multi-select field metadata and presentation properties. * @returns Immutable multi-select field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function select(props: CommonFieldProps & ChoiceProps): SelectFieldDefinition; /** * Defines a single-select radio field. * * @param props - Radio-field metadata and presentation properties. * @returns Immutable radio field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function radio(props: CommonFieldProps & ChoiceProps): RadioFieldDefinition; /** * Defines a boolean field. * * @param props - Boolean-field metadata and presentation properties. * @returns Immutable boolean field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function boolean(props: CommonFieldProps & BooleanLikeProps): BooleanFieldDefinition; /** * Defines a file attachment field. * * @param props - File-field metadata and presentation properties. * @returns Immutable file field definition. * @typeParam TRequired - Whether the field is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function file(props: CommonFieldProps & BooleanLikeProps & { readonly allowedType: 'images' | 'documents' | 'any'; }): FileFieldDefinition; /** * Defines a many-to-one lookup field. * * @param target - Target object or native model referenced by the lookup. * @param props - Lookup-field metadata and presentation properties. * @returns Immutable lookup field definition. * @typeParam TTarget - Target object or native model referenced by the lookup. * @typeParam TRequired - Whether the lookup is required during record creation. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function lookup(target: TTarget, props: CommonFieldProps & BooleanLikeProps & { readonly relatedDataLabel?: string; readonly lookupFilterRqlCondition?: string; }): LookupFieldDefinition; /** * Defines a parent-child relationship field. * * @param target - Parent object definition referenced by the relationship. * @param props - Parent-child field metadata and presentation properties. * @returns Immutable parent-child field definition. * @typeParam TTarget - Parent object definition referenced by the relationship. * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ export declare function parentChild, TSectionKey extends string | undefined = string | undefined>(target: TTarget, props: CommonFieldProps & { readonly relatedDataLabel?: string; readonly parentChildType?: 'PRIMARY' | 'SECONDARY'; readonly enableParentOwnerInheritance?: boolean; readonly section?: TSectionKey; }): ParentChildFieldDefinition, TSectionKey>; /** Public helper surface for read-only formula fields. */ export interface FormulaHelpers { /** * Defines a text-valued formula field. * * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ text(props: CommonFieldProps & { readonly formula: string; readonly maxLength: number; }): FormulaFieldDefinition<'formula-text', string, TSectionKey>; /** * Defines a numeric formula field. * * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ number(props: CommonFieldProps & { readonly formula: string; }): FormulaFieldDefinition<'formula-number', number, TSectionKey>; /** * Defines a boolean formula field. * * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ boolean(props: CommonFieldProps & { readonly formula: string; }): FormulaFieldDefinition<'formula-boolean', boolean, TSectionKey>; /** * Defines a currency-valued formula field. * * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ currency(props: CommonFieldProps & { readonly formula: string; }): FormulaFieldDefinition<'formula-currency', number, TSectionKey>; /** * Defines a percentage-valued formula field. * * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ percentage(props: CommonFieldProps & { readonly formula: string; }): FormulaFieldDefinition<'formula-percentage', number, TSectionKey>; /** * Defines a date-valued formula field. * * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ date(props: CommonFieldProps & { readonly formula: string; }): FormulaFieldDefinition<'formula-date', string, TSectionKey>; /** * Defines a URL-valued formula field. * * @typeParam TSectionKey - Allowed section-key union for the enclosing object. */ url(props: CommonFieldProps & { readonly formula: string; }): FormulaFieldDefinition<'formula-url', string, TSectionKey>; } /** Typed helpers for read-only formula fields. */ export declare const formula: FormulaHelpers; /** * Immutable helper for authoring section maps in reusable fragments. * * @param definitions - Section definitions to freeze and preserve as-is. * @returns Frozen section-definition map retaining the caller's key/value types. * @typeParam TSections - Concrete section map to preserve in the returned value. */ export declare function sections>>(definitions: TSections): TSections; export {}; //# sourceMappingURL=fields.d.mts.map