import { Constants, KnoraDate, ReadTextValueAsXml, ReadValue, ResourcePropertyDefinition } from '@dasch-swiss/dsp-js'; import { JDNConvertibleCalendar } from 'jdnconvertiblecalendar'; export declare class ValueService { private readonly _readTextValueAsString; private readonly _readTextValueAsXml; private readonly _readTextValueAsHtml; constants: typeof Constants; constructor(); /** * Given a value, determines the type or class representing it. * * For text values, this method determines the specific class in use. * For all other types, the given type is returned. * * @param value the given value. */ getValueTypeOrClass(value: ReadValue): string; /** * Given a ResourcePropertyDefinition of a #hasText property, determines the class representing it. * * @param resourcePropDef the given ResourcePropertyDefinition. */ getTextValueClass(resourcePropDef: ResourcePropertyDefinition): string; /** * Given the ObjectType of a PropertyDefinition, compares it to the provided value type. * Primarily used to check if a TextValue type is equal to one of the readonly strings in this class. * * @param objectType PropertyDefinition ObjectType * @param valueType Value type (ReadValue, DeleteValue, BaseValue, etc.) */ compareObjectTypeWithValueType(objectType: string, valueType: string): boolean; /** * Determines if a text can be edited using the text editor. * * @param textValue the text value to be checked. */ isTextEditable(textValue: ReadTextValueAsXml): boolean; /** * Determines if the given value can be edited. * * @param valueTypeOrClass the type or class of the given value. * @param value the given value. * @param propertyDef the given values property definition. */ isReadOnly(valueTypeOrClass: string, value: ReadValue, propertyDef: ResourcePropertyDefinition): boolean; /** * Calculates the number of days in a month for a given year. * * @param calendar the date's calendar. * @param year the date's year. * @param month the date's month. */ calculateDaysInMonth(calendar: string, year: number, month: number): number; /** * Given a historical date (year), returns the astronomical year. * * @param year year of the given date. * @param era era of the given date. * @param calendar calendar of the given date. */ convertHistoricalYearToAstronomicalYear(year: number, era: string, calendar: string): number; /** * Given a Knora calendar date, creates a JDN calendar date * taking into account precision. * * @param date the Knora calendar date. */ createJDNCalendarDateFromKnoraDate(date: KnoraDate): JDNConvertibleCalendar; }