import { CustomFieldSection } from "./custom-field-section.js"; import { type ExistingManifestContextOptions } from "./existing-manifest-context.js"; import type { ManifestComponentDeletion, ManifestScope } from "./manifest-builder.js"; export declare const CUSTOM_FIELD_TYPES: readonly ["TEXT", "DATE", "NUMBER", "CURRENCY", "PERCENTAGE", "SELECT", "FILE", "ID", "RADIO", "TEXTAREA", "RANGE", "REFERENCE_ID", "BOOLEAN", "ADDRESS", "OG_REFERENCE_FIELD", "EMAIL", "URL"]; export type CustomFieldType = (typeof CUSTOM_FIELD_TYPES)[number]; export type CustomFieldApiName = `${string}__cfv2`; export type CustomFieldUniqueIDCharacterType = 'DIGITS_ONLY' | 'TEXT_ONLY' | 'DIGITS_TEXT_BOTH'; type CustomFieldSimpleType = Exclude; export type CustomFieldDataType = { fieldType: CustomFieldSimpleType; } | { fieldType: 'NUMBER'; decimalPlaces?: number | null; } | { fieldType: 'CURRENCY'; currency?: string | null; } | { fieldType: 'SELECT' | 'RADIO'; options: readonly string[]; } | { fieldType: 'ID'; numberOfCharacters?: number | null; characterType?: CustomFieldUniqueIDCharacterType | null; } | { fieldType: 'OG_REFERENCE_FIELD'; referencedModelRqlName: string; }; export type CustomFieldPermissionClassification = 'BASIC_PERSONAL_INFO' | 'PERSONAL_INFO' | 'SENSITIVE_PERSONAL_INFO' | 'BASIC_EMPLOYMENT_INFO' | 'EMPLOYMENT_INFO' | 'SENSITIVE_EMPLOYMENT_INFO'; export type CustomFieldReadAccess = 'ALL_ACCESS' | 'ADMIN_ACCESS' | 'ADMIN_AND_EMPLOYEE_ACCESS'; export type CustomFieldWriteAccess = 'EMPLOYEE_ACCESS' | 'ADMIN_ACCESS' | 'ADMIN_AND_EMPLOYEE_ACCESS' | 'NO_ACCESS'; export type CustomFieldCollectionTiming = 'NONE' | 'HIRING' | 'ONBOARDING' | 'TERMINATING'; export type CustomFieldDefaultValue = { value: string; rqlDefinitionFormula?: never; } | { value?: never; rqlDefinitionFormula: string; }; /** Properties shared by formula and user-input custom fields. */ export interface CustomFieldBaseProps { fieldId?: string; name: string; section: CustomFieldSection; modelRqlName: ModelRqlName; dataType: CustomFieldDataType; apiName: CustomFieldApiName; description?: string | null; displayOrder?: number | null; } type NonSensitiveCustomFieldPermissionClassification = Exclude; /** Permission properties required for every Employee custom field. */ export type EmployeeCustomFieldPermissionProps = { applicableGroupId: string; } & ({ fieldReadAccess: 'ALL_ACCESS'; fieldPermissionClassification: NonSensitiveCustomFieldPermissionClassification; } | { fieldReadAccess: 'ADMIN_ACCESS' | 'ADMIN_AND_EMPLOYEE_ACCESS'; fieldPermissionClassification: CustomFieldPermissionClassification; }); /** Optional permission properties used by non-Employee custom fields. */ export interface NonEmployeeCustomFieldPermissionProps { fieldPermissionClassification?: CustomFieldPermissionClassification | null; fieldReadAccess?: CustomFieldReadAccess | null; applicableGroupId?: string | null; } export type CustomFieldPermissionProps = ModelRqlName extends 'Employee' ? EmployeeCustomFieldPermissionProps : NonEmployeeCustomFieldPermissionProps; interface CustomFieldUserInputOptions { rqlDefinitionFormula?: null; required?: boolean | null; tip?: string | null; defaultValue?: CustomFieldDefaultValue | null; } type EmployeeCustomFieldUserInputAccess = { collectDuring: 'ONBOARDING'; fieldReadAccess: 'ALL_ACCESS' | 'ADMIN_AND_EMPLOYEE_ACCESS'; fieldWriteAccess: 'EMPLOYEE_ACCESS' | 'ADMIN_AND_EMPLOYEE_ACCESS' | 'NO_ACCESS'; } | { collectDuring?: 'NONE' | 'HIRING' | 'TERMINATING' | null; fieldWriteAccess: CustomFieldWriteAccess; }; interface NonEmployeeCustomFieldUserInputAccess { collectDuring?: CustomFieldCollectionTiming | null; fieldWriteAccess?: CustomFieldWriteAccess | null; } type CustomFieldUserInputAccess = ModelRqlName extends 'Employee' ? EmployeeCustomFieldUserInputAccess : NonEmployeeCustomFieldUserInputAccess; interface CustomFieldFormulaOptions { rqlDefinitionFormula: string; fieldWriteAccess: 'NO_ACCESS'; collectDuring?: null; required?: null; tip?: null; defaultValue?: null; } /** A calculated custom field whose value cannot be edited directly. */ export type FormulaCustomFieldProps = CustomFieldBaseProps & CustomFieldPermissionProps & CustomFieldFormulaOptions; /** A custom field whose value is supplied by a user or a default value. */ export type UserInputCustomFieldProps = CustomFieldBaseProps & CustomFieldPermissionProps & CustomFieldUserInputOptions & CustomFieldUserInputAccess; /** A formula or user-input custom field on the given model. */ export type CustomFieldProps = FormulaCustomFieldProps | UserInputCustomFieldProps; /** A calculated Employee custom field. */ export type EmployeeFormulaCustomFieldProps = FormulaCustomFieldProps<'Employee'>; /** An Employee custom field whose value is supplied by a user or a default value. */ export type EmployeeUserInputCustomFieldProps = UserInputCustomFieldProps<'Employee'>; /** Any supported Employee custom field. */ export type EmployeeCustomFieldProps = EmployeeFormulaCustomFieldProps | EmployeeUserInputCustomFieldProps; /** A Custom Field V2 field on a native or custom object. */ export declare class CustomField { static readonly componentType: "CUSTOM_FIELD_V2"; static toDeletionIdentifier(customFieldId: string): ManifestComponentDeletion; private readonly _fieldId; private readonly props; constructor(scope: ManifestScope, props: CustomFieldProps); static loadFromExisting(fieldIdOrApiName: string, options?: ExistingManifestContextOptions): CustomField; /** @internal Hydrates a custom field from existing manifest wire JSON. */ static _fromExistingComponent(scope: ManifestScope, component: Record, section: CustomFieldSection): CustomField; getFieldId(): string; getApiName(): CustomFieldApiName; getModelRqlName(): string; toDict(): Record; } export {}; //# sourceMappingURL=custom-field.d.ts.map