import { AutoEncoder } from '@simonbackx/simple-encoding'; import { ResolutionRequest } from '../../files/ResolutionRequest.js'; import { PropertyFilter } from '../../filters/PropertyFilter.js'; import { PermissionLevel } from '../../PermissionLevel.js'; import { ObjectWithRecords } from '../ObjectWithRecords.js'; import { type RecordAnswer } from './RecordAnswer.js'; import { TranslatedString } from '../../TranslatedString.js'; export type RecordFilterOptions = { level?: PermissionLevel; additionalFilter?: (record: RecordSettings) => boolean; }; export declare enum RecordType { /** * Show a checkbox to the user so they can check the value on/off * It is possible to add a textarea as soon as the checkbox is selected if the extra property is set. */ Checkbox = "Checkbox", /** * Select one (or none if not required) */ ChooseOne = "ChooseOne", /** * Select one, zero or more from a menu * The way this is shown will differ depending on the minimum or maximum setting. e.g. when exactly one * item should be selected, we could show it with a dropdown menu */ MultipleChoice = "MultipleChoice", /** * Small text input */ Text = "Text", /** * Big text input */ Textarea = "Textarea", /** * Address input */ Address = "Address", Phone = "Phone", Email = "Email", Date = "Date", Price = "Price", Image = "Image", File = "File", Integer = "Integer" } export declare enum FileType { PDF = "PDF", Word = "Word", Excel = "Excel" } export declare function getRecordTypeName(type: RecordType): string; export declare enum RecordWarningType { Info = "Info", Warning = "Warning", Error = "Error" } export declare class RecordWarning extends AutoEncoder { id: string; text: TranslatedString; type: RecordWarningType; /** * Show a warning if the associated value is falsy */ inverted: boolean; static get sort(): (warning1: RecordWarning, warning2: RecordWarning) => 0 | 1 | -1; get icon(): " exclamation-two red" | " exclamation yellow" | " info-text"; } export declare class RecordChoice extends AutoEncoder { id: string; name: TranslatedString; description: TranslatedString; /** * Show a warning if selected (or not selected if inverted) */ warning: RecordWarning | null; } export declare class BaseRecordSettings extends AutoEncoder { id: string; /** * Short name (used mainly for displaying the information) */ name: TranslatedString; } export declare class RecordSettings extends BaseRecordSettings { /** * When used with checkbox: checkbox needs to get checked (e.g accept terms, confirm age...) * Multiple choice: minimum one selection required * Text: required input */ required: boolean; /** * Whether you need permission to collect this information */ sensitive: boolean; /** * Only used for checkboxes */ askComments: boolean; type: RecordType; /** * In case of multiple choice: the values you can choose from with optional additional information */ choices: RecordChoice[]; /** * Label used for input (depending on the type) * Checkbox: text next to checkbox * Text inputs: label field above the input * If empty: name is used */ label: TranslatedString; /** * Text underneath the label in case of a checkbox. * For other types: below the input */ description: TranslatedString; inputPlaceholder: TranslatedString; commentsDescription: TranslatedString; /** * Show a warning if selected / entered (or not selected/entered if inverted) */ warning: RecordWarning | null; /** * Only for images */ resolutions?: ResolutionRequest[]; /** * Only for files */ fileType?: FileType | null; externalPermissionLevel: PermissionLevel; filter: PropertyFilter | null; getDiffValue(): string; validate(answers: Map, requiredCategory?: boolean): void; checkPermissionForUserManager(level: PermissionLevel): boolean; get excelColumns(): { name: string; width?: number; defaultCategory?: string; }[]; isEnabled(filterValue: T, options?: RecordFilterOptions): boolean; duplicate(): this; } //# sourceMappingURL=RecordSettings.d.ts.map