/** * An integer number */ declare type int = number; /** * A number, potentially with decimals */ declare type float = number; /** * An alternative name for the global type Element. * * UI5 defines its own type sap.ui.core.Element, which, in the scope of the sap.ui.core * namespace, hides the global type. As there are other entities in the same namespace * that refer to the global Element in their signatures, this naming conflict can cause * type mismatches between sap.ui.core code and other code subclassing from it. * * To avoid these issues, the alternative name can be used in sap.ui.core signatures. * * @todo check if HTMLElement could be used instead in UI5 method signatures */ declare type global_Element = Element; declare type jQuery = JQuery; declare namespace jQuery { export type Event = JQuery.Event; export type Deferred = JQuery.Deferred; export type Promise = JQuery.Promise; } declare namespace QUnit { export type Assert = globalThis.Assert; } interface JQuery extends Iterable { /** * Adds the given ID reference to the aria-describedby attribute. */ addAriaDescribedBy( /** * The ID reference of an element */ sId: string, /** * whether prepend or not */ bPrepend?: boolean ): jQuery; /** * Adds the given ID reference to the aria-labelledby attribute. */ addAriaLabelledBy( /** * The ID reference of an element */ sId: string, /** * Whether prepend or not */ bPrepend?: boolean ): jQuery; /** * Extension function to the jQuery.fn which identifies SAPUI5 controls in the given jQuery context. * @deprecated As of version 1.106, use {@link sap.ui.core.Element.closestTo} instead. */ control( /** * Whether or not to respect the associated DOM elements to a control via data-sap-ui-related attribute. */ includeRelated?: boolean ): sap.ui.core.Control[]; /** * Extension function to the jQuery.fn which identifies SAPUI5 controls in the given jQuery context. * @deprecated As of version 1.106, use {@link sap.ui.core.Element.closestTo} instead. */ control( /** * Parameter to return the control instance at the given index in the array. */ index: int, /** * Whether or not to respect the associated DOM elements to a control via data-sap-ui-related attribute. */ includeRelated?: boolean ): sap.ui.core.Control | null; /** * Gets the position of the cursor in an element that supports cursor positioning. */ cursorPos(): int; /** * Sets the position of the cursor in an element that supports cursor positioning. */ cursorPos( /** * The cursor position to set */ iPos: int ): jQuery; /** * Disable HTML elements selection. */ disableSelection(): jQuery; /** * Enable HTML elements to get selected. */ enableSelection(): jQuery; /** * Returns the first focusable domRef in a given container (the first element of the collection) */ firstFocusableDomRef(): Element; /** * Retrieve the selected text in the first element of the collection. * * Note: This feature is only supported for input element’s type of text, search, url, tel and password. */ getSelectedText(): string; /** * Returns true if the first element has a set tabindex. */ hasTabIndex(): boolean; /** * Returns the last focusable domRef in a given container */ lastFocusableDomRef(): Element; /** * Gets the next parent DOM element with a given attribute and attribute value starting above the first given element */ parentByAttribute( /** * Name of the attribute */ sAttribute: string, /** * Value of the attribute (optional) */ sValue: string ): Element; /** * Returns a rectangle describing the current visual positioning of the first DOM object in the collection * (or null if no element was given). */ rect(): object; /** * Returns whether a point described by X and Y is inside this Rectangle's boundaries. */ rectContains( /** * The X coordinate */ posX: int, /** * The Y coordinate */ posY: int ): boolean; /** * Removes the given ID reference from the aria-describedby attribute. */ removeAriaDescribedBy( /** * The ID reference of an element */ sId: string ): jQuery; /** * Removes the given ID reference from the aria-labelledby attribute. */ removeAriaLabelledBy( /** * The ID reference of an element */ sId: string ): jQuery; /** * Returns the scrollLeft value of the first element in the given jQuery collection in right-to-left mode. * * Precondition: The element is rendered in RTL mode. * * Reason for this method is that the major browsers use three different values for the same scroll position * when in RTL mode. This method hides those differences and returns/applies the same value that would be * returned in LTR mode: The distance in px how far the given container is scrolled away from the leftmost * scroll position. * * Returns "undefined" if no element is given. */ scrollLeftRTL(): int | undefined; /** * Sets the scrollLeft value of the first element in the given jQuery collection in right-to-left mode. * * Precondition: The element is rendered in RTL mode. * * Reason for this method is that the major browsers use three different values for the same scroll position * when in RTL mode. This method hides those differences and returns/applies the same value that would be * returned in LTR mode: The distance in px how far the given container is scrolled away from the leftmost * scroll position. */ scrollLeftRTL( /** * The desired scroll position */ iPos: int ): jQuery; /** * Returns the MIRRORED scrollLeft value of the first element in the given jQuery collection in right-to-left mode. * * Precondition: The element is rendered in RTL mode. * * Reason for this method is that the major browsers return three different values for the same scroll position * when in RTL mode. This method hides those differences and returns the value that would be returned in LTR mode * if the UI would be mirrored horizontally: The distance in px how far the given container is scrolled away * from the rightmost scroll position. * * Returns "undefined" if no element is in the given jQuery collection. */ scrollRightRTL(): int | undefined; /** * Sets the text selection in the first element of the collection. * * Note: This feature is only supported for input element's type of text, search, url, tel and password. */ selectText( /** * Start position of the selection (inclusive) */ iStart: int, /** * End position of the selection (exclusive) */ iEnd: int ): jQuery; /** * Get the z-index for an element. */ zIndex(): number; /** * Set the z-index for an element. */ zIndex( /** * The z-index to set */ zIndex: int ): jQuery; } declare module "sap/ui/thirdparty/jquery" { export default jQuery; } declare module "sap/ui/thirdparty/qunit-2" { export default QUnit; } declare namespace sap { interface IUI5DefineDependencyNames { "sap/ui/thirdparty/jquery": undefined; "sap/ui/thirdparty/qunit-2": undefined; } } // For Library Version: 1.149.0 declare module "sap/base/assert" { /** * A simple assertion mechanism that logs a message when a given condition is not met. * * **Note:** Calls to this method might be removed when the JavaScript code is optimized during build. Therefore, * callers should not rely on any side effects of this method. * * @since 1.58 */ export default function assert( /** * Result of the checked assertion */ bResult: boolean, /** * Message that will be logged when the result is `false`. In case this is a function, the return value * of the function will be displayed. This can be used to execute complex code only if the assertion fails. */ vMessage: string | (() => any) ): void; } declare module "sap/base/i18n/date/CalendarType" { /** * The types of `Calendar`. * * @since 1.120 */ enum CalendarType { /** * The Thai buddhist calendar */ Buddhist = "Buddhist", /** * The Gregorian calendar */ Gregorian = "Gregorian", /** * The Islamic calendar */ Islamic = "Islamic", /** * The Japanese emperor calendar */ Japanese = "Japanese", /** * The Persian Jalali calendar */ Persian = "Persian", } export default CalendarType; } declare module "sap/base/i18n/date/CalendarWeekNumbering" { /** * The `CalendarWeekNumbering` enum defines how to calculate calendar weeks. Each value defines: * - The first day of the week, * - the first week of the year. * * @since 1.120 */ enum CalendarWeekNumbering { /** * The default calendar week numbering: * * The framework determines the week numbering scheme; currently it is derived from the active format locale. * Future versions of UI5 might select a different week numbering scheme. */ Default = "Default", /** * Official calendar week numbering in most of Europe (ISO 8601 standard): * Monday is first day of the week, the week containing January 4th is first week of the year. */ ISO_8601 = "ISO_8601", /** * Official calendar week numbering in much of the Middle East (Middle Eastern calendar): * Saturday is first day of the week, the week containing January 1st is first week of the year. */ MiddleEastern = "MiddleEastern", /** * Official calendar week numbering in the United States, Canada, Brazil, Israel, Japan, and other countries * (Western traditional calendar): * Sunday is first day of the week, the week containing January 1st is first week of the year. */ WesternTraditional = "WesternTraditional", } export default CalendarWeekNumbering; } declare module "sap/base/i18n/Formatting" { import CalendarType from "sap/base/i18n/date/CalendarType"; import CalendarWeekNumbering from "sap/base/i18n/date/CalendarWeekNumbering"; import LanguageTag from "sap/base/i18n/LanguageTag"; /** * Configuration for formatting specific parameters * * @since 1.120 */ interface Formatting { /** * Adds custom currencies. There is a special currency code named "DEFAULT" that is optional. In case it * is set it is used for all currencies not contained in the list, otherwise currency digits as defined * by the CLDR are used as a fallback. * * **Note:** Adding custom currencies affects all applications running with the current UI5 core instance. * * @since 1.120 */ addCustomCurrencies( /** * A map with the currency code as key and a custom currency definition as value; already existing custom * currencies are replaced, new ones are added; the custom currency code must contain at least one non-digit * character, so that the currency part can be distinguished from the amount part; see {@link #.getCustomCurrencies Formatting.getCustomCurrencies } * for an example */ mCurrencies?: Record ): void; /** * Adds custom units. * * **Note:** Adding custom units affects all applications running with the current UI5 core instance. * * @since 1.123 */ addCustomUnits( /** * A map with the unit code as key and a custom unit definition as value; already existing custom units * are replaced, new ones are added; see {@link #.getCustomUnits Formatting.getCustomUnits} for an example */ mUnits: Record ): void; /** * Attaches the `fnFunction` event handler to the {@link #event:change change} event of `module:sap/base/i18n/Formatting`. * * @since 1.120 */ attachChange( /** * The function to be called when the event occurs */ fnFunction: (p1: Formatting$ChangeEvent) => void ): void; /** * Detaches event handler `fnFunction` from the {@link #event:change change} event of this `module:sap/base/i18n/Formatting`. * * @since 1.120 */ detachChange( /** * Function to be called when the event occurs */ fnFunction: (p1: Formatting$ChangeEvent) => void ): void; /** * Returns the currently set ABAP date format (its id) or undefined if none has been set. * * @since 1.120 * * @returns ID of the ABAP date format, if not set or set to `""`, `undefined` will be returned */ getABAPDateFormat(): | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "A" | "B" | "C" | undefined; /** * Returns the currently set ABAP number format (its id) or undefined if none has been set. * * @since 1.120 * * @returns ID of the ABAP number format, if not set or set to `""`, `undefined` will be returned */ getABAPNumberFormat(): " " | "X" | "Y" | undefined; /** * Returns the currently set ABAP time format (its id) or undefined if none has been set. * * @since 1.120 * * @returns ID of the ABAP date format, if not set or set to `""`, `undefined` will be returned */ getABAPTimeFormat(): "0" | "1" | "2" | "3" | "4" | undefined; /** * Returns the calendar type which is being used in locale dependent functionality. * * When it's explicitly set by calling `setCalendarType`, the set calendar type is returned. Otherwise, * the calendar type is determined by checking the format settings and current locale. * * @since 1.120 * * @returns the current calendar type, e.g. `Gregorian` */ getCalendarType(): CalendarType; /** * Returns the calendar week numbering algorithm used to determine the first day of the week and the first * calendar week of the year, see {@link module:sap/base/i18n/date/CalendarWeekNumbering CalendarWeekNumbering}. * * @since 1.120 * * @returns The calendar week numbering algorithm */ getCalendarWeekNumbering(): CalendarWeekNumbering; /** * Gets the custom currencies that have been set via {@link #.addCustomCurrencies Formatting.addCustomCurrencies } * or {@link #.setCustomCurrencies Formatting.setCustomCurrencies}. There is a special currency code named * "DEFAULT" that is optional. If it is set it is used for all currencies not contained in the list, otherwise * currency digits as defined by the CLDR are used as a fallback. * * @since 1.120 * * @returns A map with the currency code as key and a custom currency definition containing the number of * decimals as value; or `undefined` if there are no custom currencies */ getCustomCurrencies(): Record | undefined; /** * Returns the currently set customizing data for Islamic calendar support. * * See: {@link module:sap/base/i18n/Formatting.CustomIslamicCalendarData} * * @since 1.120 * * @returns Returns an array that contains the customizing data. Each element in the array has properties: * dateFormat, islamicMonthStart, gregDate. For details, please see {@link #.setCustomIslamicCalendarData} */ getCustomIslamicCalendarData(): CustomIslamicCalendarData[] | undefined; /** * Gets the custom units that have been set via {@link #.addCustomUnits Formatting.addCustomUnits} or {@link #.setCustomUnits Formatting.setCustomUnits}. * * @since 1.123 * * @returns A map with the unit code as key and a custom unit definition containing a display name and different * unit patterns as value; or `undefined` if there are no custom units */ getCustomUnits(): Record | undefined; /** * Returns the currently set date pattern or undefined if no pattern has been defined. * * @since 1.120 * * @returns The resulting date pattern */ getDatePattern( /** * The date style (short, medium, long or full) */ sStyle: "short" | "medium" | "long" | "full" ): string; /** * Returns the LanguageTag to be used for formatting. * * If no such LanguageTag has been defined, this method falls back to the language, see {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage()}. * * If any user preferences for date, time or number formatting have been set, and if no format LanguageTag * has been specified, then a special private use subtag is added to the LanguageTag, indicating to the * framework that these user preferences should be applied. * * @since 1.120 * * @returns the format LanguageTag */ getLanguageTag(): LanguageTag; /** * Returns the currently set number symbol of the given type or undefined if no symbol has been defined. * * @since 1.120 * * @returns A non-numerical symbol used as part of a number for the given type, e.g. for locale de_DE: * * - "group": "." (grouping separator) * - "decimal": "," (decimal separator) * - "plusSign": "+" (plus sign) * - "minusSign": "-" (minus sign) */ getNumberSymbol( /** * the type of symbol */ sType: "group" | "decimal" | "plusSign" | "minusSign" ): string; /** * Returns the currently set time pattern or undefined if no pattern has been defined. * * @since 1.120 * * @returns The resulting time pattern */ getTimePattern( /** * The time style (short, medium, long or full) */ sStyle: "short" | "medium" | "long" | "full" ): string; /** * Returns current trailingCurrencyCode configuration for new NumberFormatter instances * * @since 1.120 * * @returns Whether currency codes shall always be placed after the numeric value */ getTrailingCurrencyCode(): boolean; /** * Allows to specify one of the ABAP date formats. * * This method modifies the date patterns for 'short' and 'medium' style with the corresponding ABAP format. * When called with a null or undefined format id, any previously applied format will be removed. * * After changing the date format, the framework tries to update localization specific parts of the UI. * See the documentation of {@link module:sap/base/i18n/Localization.setLanguage Localization.setLanguage() } * for details and restrictions. * * @since 1.120 */ setABAPDateFormat( /** * ID of the ABAP date format, `""` will reset the date patterns for 'short' and 'medium' style to the locale-specific * ones. */ sFormatId?: | "" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "A" | "B" | "C" ): void; /** * Allows to specify one of the ABAP number format. * * This method will modify the 'group' and 'decimal' symbols. When called with a null or undefined format * id, any previously applied format will be removed. * * After changing the number format, the framework tries to update localization specific parts of the UI. * See the documentation of {@link module:sap/base/i18n/Localization.setLanguage Localization.setLanguage() } * for details and restrictions. * * @since 1.120 */ setABAPNumberFormat( /** * ID of the ABAP number format set, `""` will reset the 'group' and 'decimal' symbols to the locale-specific * ones. */ sFormatId?: "" | " " | "X" | "Y" ): void; /** * Allows to specify one of the ABAP time formats. * * This method sets the time patterns for 'short' and 'medium' style to the corresponding ABAP formats and * sets the day period texts to "AM"/"PM" or "am"/"pm" respectively. When called with a null or undefined * format id, any previously applied format will be removed. * * After changing the time format, the framework tries to update localization specific parts of the UI. * See the documentation of {@link module:sap/base/i18n/Localization.setLanguage Localization.setLanguage() } * for details and restrictions. * * @since 1.120 */ setABAPTimeFormat( /** * ID of the ABAP time format, `""` will reset the time patterns for 'short' and 'medium' style and the * day period texts to the locale-specific ones. */ sFormatId?: "" | "0" | "1" | "2" | "3" | "4" ): void; /** * Sets the new calendar type to be used from now on in locale dependent functionality (for example, formatting, * translation texts, etc.). * * @since 1.120 */ setCalendarType( /** * the new calendar type. Set it with null to clear the calendar type and the calendar type is calculated * based on the format settings and current locale. */ sCalendarType: (CalendarType | keyof typeof CalendarType) | null ): void; /** * Sets the calendar week numbering algorithm which is used to determine the first day of the week and the * first calendar week of the year, see {@link module:sap/base/i18n/date/CalendarWeekNumbering CalendarWeekNumbering}. * * @since 1.120 */ setCalendarWeekNumbering( /** * The calendar week numbering algorithm */ sCalendarWeekNumbering: | CalendarWeekNumbering | keyof typeof CalendarWeekNumbering ): void; /** * Replaces existing custom currencies by the given custom currencies. There is a special currency code * named "DEFAULT" that is optional. In case it is set, it is used for all currencies not contained in the * list, otherwise currency digits as defined by the CLDR are used as a fallback. * * **Note:** Setting custom units affects all applications running with the current UI5 core instance. * See: * {@link module:sap/base/i18n/Formatting.addCustomCurrencies Formatting.addCustomCurrencies} * * @since 1.120 */ setCustomCurrencies( /** * A map with the currency code as key and a custom currency definition as value; the custom currency code * must contain at least one non-digit character, so that the currency part can be distinguished from the * amount part; `mCurrencies` replaces the current custom currencies; if not given, all custom currencies * are deleted; see {@link #.getCustomCurrencies Formatting.getCustomCurrencies} for an example */ mCurrencies?: Record ): void; /** * Allows to specify the customizing data for Islamic calendar support * * See: {@link module:sap/base/i18n/Formatting.CustomIslamicCalendarData} * * @since 1.120 */ setCustomIslamicCalendarData( /** * Contains the customizing data for the support of Islamic calendar. One JSON object in the array represents * one row of data from Table TISLCAL */ aCustomCalendarData: CustomIslamicCalendarData[] ): void; /** * Replaces existing custom units by the given custom units. * * **Note:** Setting custom units affects all applications running with the current UI5 core instance. * See: * {@link module:sap/base/i18n/Formatting.addCustomUnits Formatting.addCustomUnits} * * @since 1.123 */ setCustomUnits( /** * A map with the unit code as key and a custom unit definition as value; `mUnits` replaces the current * custom units; if not given, all custom units are deleted; see {@link #.getCustomUnits Formatting.getCustomUnits } * for an example */ mUnits?: Record ): void; /** * Defines the preferred format pattern for the given date format style. * * Calling this method with a null or undefined pattern removes a previously set pattern. * * If a pattern is defined, it will be preferred over patterns derived from the current locale. * * See class {@link sap.ui.core.format.DateFormat DateFormat} for details about the pattern syntax. * * After changing the date pattern, the framework tries to update localization specific parts of the UI. * See the documentation of {@link module:sap/base/i18n/Localization.setLanguage Localization.setLanguage() } * for details and restrictions. * * @since 1.120 */ setDatePattern( /** * must be one of short, medium, long or full. */ sStyle: "short" | "medium" | "long" | "full", /** * the format pattern to be used in LDML syntax. */ sPattern: string ): void; /** * Sets a new language tag to be used from now on for retrieving language specific formatters. Modifying * this setting does not have an impact on the retrieval of translated texts! * * Can either be set to a concrete value (a BCP47 or Java locale compliant language tag) or to `null`. When * set to `null` (default value) then locale specific formatters are retrieved for the current language. * * After changing the format locale, the framework tries to update localization specific parts of the UI. * See the documentation of {@link module:sap/base/i18n/Localization.setLanguage Localization.setLanguage() } * for details and restrictions. * * **Note**: When a language tag is set, it has higher priority than a number, date or time format defined * with a call to `setABAPNumberFormat`, `setABAPDateFormat` or `setABAPTimeFormat`. * * **Note**: See documentation of {@link module:sap/base/i18n/Localization.setLanguage Localization.setLanguage() } * for restrictions. * * @since 1.120 */ setLanguageTag( /** * the new BCP47 compliant language tag; case doesn't matter and underscores can be used instead of hyphens * to separate components (compatibility with Java Locale IDs) */ vLanguageTag: string | LanguageTag | null ): void; /** * Defines the string to be used for the given number symbol. * * Calling this method with a null or undefined symbol removes a previously set symbol string. Note that * an empty string is explicitly allowed. * * If a symbol is defined, it will be preferred over symbols derived from the current locale. * * See class {@link sap.ui.core.format.NumberFormat NumberFormat} for details about the symbols. * * After changing the number symbol, the framework tries to update localization specific parts of the UI. * See the documentation of {@link module:sap/base/i18n/Localization.setLanguage Localization.setLanguage() } * for details and restrictions. * * @since 1.120 */ setNumberSymbol( /** * the type of symbol */ sType: "group" | "decimal" | "plusSign" | "minusSign", /** * will be used to represent the given symbol type */ sSymbol: string ): void; /** * Defines the preferred format pattern for the given time format style. * * Calling this method with a null or undefined pattern removes a previously set pattern. * * If a pattern is defined, it will be preferred over patterns derived from the current locale. * * See class {@link sap.ui.core.format.DateFormat DateFormat} for details about the pattern syntax. * * After changing the time pattern, the framework tries to update localization specific parts of the UI. * See the documentation of {@link module:sap/base/i18n/Localization.setLanguage Localization.setLanguage() } * for details and restrictions. * * @since 1.120 */ setTimePattern( /** * must be one of short, medium, long or full. */ sStyle: "short" | "medium" | "long" | "full", /** * the format pattern to be used in LDML syntax. */ sPattern: string ): void; /** * Define whether the NumberFormatter shall always place the currency code after the numeric value, with * the only exception of right-to-left locales, where the currency code shall be placed before the numeric * value. Default configuration setting is `true`. * * When set to `false` the placement of the currency code is done dynamically, depending on the configured * locale using data provided by the Unicode Common Locale Data Repository (CLDR). * * Each currency instance ({@link sap.ui.core.format.NumberFormat.getCurrencyInstance NumberFormat.getCurrencyInstance}) * will be created with this setting unless overwritten on instance level. * * @since 1.120 */ setTrailingCurrencyCode( /** * Whether currency codes shall always be placed after the numeric value */ bTrailingCurrencyCode: boolean ): void; } const Formatting: Formatting; export default Formatting; /** * Definition of a custom currency. */ export type CustomCurrency = { /** * The number of decimal digits to be used for the currency */ digits: int; }; /** * Customizing data for the support of Islamic calendar. Represents one row of data from Table TISLCAL. */ export type CustomIslamicCalendarData = { /** * The date format. Column DATFM in TISLCAL. */ dateFormat: "A" | "B"; /** * The Islamic date in format: 'yyyyMMdd'. Column ISLMONTHSTART in TISLCAL. */ islamicMonthStart: string; /** * The corresponding Gregorian date format: 'yyyyMMdd'. Column GREGDATE in TISLCAL. */ gregDate: string; }; /** * Definition of a custom unit. * See: * {@link sap.ui.core.LocaleData#getPluralCategories} */ export type CustomUnit = { /** * The unit's display name */ displayName: string; /** * The unit pattern for the plural form "zero"; `{0}` in the pattern is replaced by the number */ "unitPattern-count-zero"?: string; /** * The unit pattern for the plural form "one"; `{0}` in the pattern is replaced by the number */ "unitPattern-count-one"?: string; /** * The unit pattern for the plural form "two"; `{0}` in the pattern is replaced by the number */ "unitPattern-count-two"?: string; /** * The unit pattern for the plural form "few"; `{0}` in the pattern is replaced by the number */ "unitPattern-count-few"?: string; /** * The unit pattern for the plural form "many"; `{0}` in the pattern is replaced by the number */ "unitPattern-count-many"?: string; /** * The unit pattern for all other numbers which do not match the plural forms of the other given patterns; * `{0}` in the pattern is replaced by the number */ "unitPattern-count-other": string; }; /** * The formatting change event. Contains only the parameters which were changed. * * The list below shows the possible combinations of parameters available as part of the change event. * * * - {@link module:sap/base/i18n/Formatting.setLanguageTag Formatting.setLanguageTag}: * `languageTag` * - {@link module:sap/base/i18n/Formatting.setCustomIslamicCalendarData Formatting.setCustomIslamicCalendarData}: * * `customIslamicCalendarData` * - {@link module:sap/base/i18n/Formatting.setCalendarWeekNumbering Formatting.setCalendarWeekNumbering}: * * `calendarWeekNumbering` * - {@link module:sap/base/i18n/Formatting.setCalendarType Formatting.setCalendarType}: * `calendarType` * - {@link module:sap/base/i18n/Formatting.addCustomCurrencies Formatting.addCustomCurrencies} / {@link module:sap/base/i18n/Formatting.setCustomCurrencies Formatting.setCustomCurrencies}: * * `currency` * - {@link module:sap/base/i18n/Formatting.setABAPDateFormat Formatting.setABAPDateFormat} (all parameters * listed below): * `ABAPDateFormat` * - `"dateFormats-short"` * - `"dateFormats-medium"` * - {@link module:sap/base/i18n/Formatting.setABAPTimeFormat Formatting.setABAPTimeFormat} (all parameters * listed below): * `ABAPTimeFormat` * - `"timeFormats-short"` * - `"timeFormats-medium"` * - `"dayPeriods-format-abbreviated"` * - {@link module:sap/base/i18n/Formatting.setABAPNumberFormat Formatting.setABAPNumberFormat} (all parameters * listed below): * `ABAPNumberFormat` * - `"symbols-latn-group"` * - `"symbols-latn-decimal"` * - {@link module:sap/base/i18n/Formatting.setDatePattern Formatting.setDatePattern} (one of the parameters * listed below): * `"dateFormats-short"` * - `"dateFormats-medium"` * - `"dateFormats-long"` * - `"dateFormats-full"` * - {@link module:sap/base/i18n/Formatting.setTimePattern Formatting.setTimePattern} (one of the parameters * listed below): * `"timeFormats-short"` * - `"timeFormats-medium"` * - `"timeFormats-long"` * - `"timeFormats-full"` * - {@link module:sap/base/i18n/Formatting.setNumberSymbol Formatting.setNumberSymbol} (one of the parameters * listed below): * `"symbols-latn-group"` * - `"symbols-latn-decimal"` * - `"symbols-latn-plusSign"` * - `"symbols-latn-minusSign"` * * @since 1.120 */ export type Formatting$ChangeEvent = { /** * The formatting language tag. */ languageTag?: string; /** * The ABAP date format. */ ABAPDateFormat?: string; /** * The ABAP time format. */ ABAPTimeFormat?: string; /** * The ABAP number format. */ ABAPNumberFormat?: string; /** * The legacy date calendar customizing. */ legacyDateCalendarCustomizing?: object[]; /** * The calendar week numbering. */ calendarWeekNumbering?: object; /** * The calendar type. */ calendarType?: object; /** * The short date format. */ "dateFormats-short"?: string; /** * The medium date format. */ "dateFormats-medium"?: string; /** * The long date format. */ "dateFormats-long"?: string; /** * The full date format. */ "dateFormats-full"?: string; /** * The short time format. */ "timeFormats-short"?: string; /** * The medium time format. */ "timeFormats-medium"?: string; /** * The long time format. */ "timeFormats-long"?: string; /** * The full time format. */ "timeFormats-full"?: string; /** * The latin symbols group. */ "symbols-latn-group"?: string; /** * The latin symbols decimal. */ "symbols-latn-decimal"?: string; /** * The latin symbols plusSign. */ "symbols-latn-plusSign"?: string; /** * The latin symbols minusSign. */ "symbols-latn-minusSign"?: string; /** * The currency. */ currency?: Record; /** * The abbreviated day periods format. */ "dayPeriods-format-abbreviated"?: string[]; }; } declare module "sap/base/i18n/LanguageTag" { /** * Creates an LanguageTag instance. LanguageTag represents a BCP-47 language tag, consisting of a language, * script, region, variants, extensions and private use section. */ export default class LanguageTag { constructor( /** * the language tag identifier, in format en-US or en_US. */ sLanguageTag: string ); /** * Get the extension as a single string or `null`. * * The extension always consists of a singleton character (not 'x'), a hyphen '-' and one or more extension * token, each separated again with a hyphen. */ extension: string | null; /** * Get the extensions as an array of tokens. * * The leading singleton and the separating hyphens are not part of the result. If there is no extensions * section in the language tag, an empty array is returned. */ extensionSubtags: string[]; /** * Get the language. * * Note that the case might differ from the original script tag (Lower case is enforced as recommended by * BCP47/ISO639). */ language: string; /** * Get the region or `null` if none was specified. * * Note that the case might differ from the original script tag (Upper case is enforced as recommended by * BCP47/ISO3166-1). */ region: string; /** * Get the script or `null` if none was specified. * * Note that the case might differ from the original language tag (Upper case first letter and lower case * reminder enforced as recommended by BCP47/ISO15924) */ script: string | null; /** * Get the variants as a single string or `null`. * * Multiple variants are separated by a hyphen '-'. */ variant: string | null; /** * Get the variants as an array of individual variants. * * The separating hyphens are not part of the result. If there is no variant section in the language tag, * an empty array is returned. */ variantSubtags: string[]; } } declare module "sap/base/i18n/Localization" { import LanguageTag from "sap/base/i18n/LanguageTag"; /** * Configuration for localization specific parameters * * @since 1.118 */ interface Localization { /** * Attaches the `fnFunction` event handler to the {@link #event:change change} event of `module:sap/base/i18n/Localization`. * * @since 1.120.0 */ attachChange( /** * The function to be called when the event occurs */ fnFunction: (p1: Localization$ChangeEvent) => void ): void; /** * Detaches event handler `fnFunction` from the {@link #event:change change} event of this `module:sap/base/i18n/Localization`. * * @since 1.120.0 */ detachChange( /** * Function to be called when the event occurs */ fnFunction: (p1: Localization$ChangeEvent) => void ): void; /** * Returns the list of active terminologies defined via the Configuration. * * @since 1.119.0 * * @returns if no active terminologies are set, the default value `undefined` is returned. */ getActiveTerminologies(): string[] | undefined; /** * Returns a string that identifies the current language. * * The value returned by config method in most cases corresponds to the exact value that has been configured * by the user or application or that has been determined from the user agent settings. It has not been * normalized, but has been validated against a relaxed version of {@link http://www.ietf.org/rfc/bcp/bcp47.txt BCP47}, * allowing underscores ('_') instead of the suggested hyphens ('-') and not taking the case of letters * into account. * * The exceptions mentioned above affect languages that have been specified via the URL parameter `sap-language`. * That parameter by definition represents an SAP logon language code ('ABAP language'). Most but not all * of these language codes are valid ISO639 two-letter languages and as such are valid BCP47 language tags. * For better BCP47 compliance, the framework maps the following non-BCP47 SAP logon codes to a BCP47 substitute: * * ```javascript * * "ZH" --> "zh-Hans" // script 'Hans' added to distinguish it from zh-Hant * "ZF" --> "zh-Hant" // ZF is not a valid ISO639 code, use the compliant language + script 'Hant' * "1Q" --> "en-US-x-saptrc" // special language code for supportability (tracing), * represented as en-US with a private extension * "2Q" --> "en-US-x-sappsd" // special language code for supportability (pseudo translation), * represented as en-US with a private extension * "3Q" --> "en-US-x-saprigi" // special language code for the Rigi pseudo language, * represented as en-US with a private extension * ``` * * * Call {@link module:sap/base/i18n/Localization.getLanguageTag getLanguageTag} to get a {@link module:sap/base/i18n/LanguageTag LanguageTag } * object matching the language. For a normalized BCP47 tag, call {@link module:sap/base/i18n/LanguageTag.toString toString() } * on the returned `LanguageTag` * * @since 1.120.0 * * @returns Language string as configured */ getLanguage(): string; /** * Returns a LanguageTag object for the current language. * * The LanguageTag is derived from {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage}. * * @since 1.120.0 * * @returns The LanguageTag */ getLanguageTag(): LanguageTag; /** * Returns whether the page uses the RTL text direction. * * If no mode has been explicitly set (neither `true` nor `false`), the mode is derived from the current * language setting. * * @since 1.120.0 * * @returns whether the page uses the RTL text direction */ getRTL(): boolean; /** * Returns an SAP logon language for the current language. * * It will be returned in uppercase. e.g. "EN", "DE" * * @since 1.120.0 * * @returns The SAP logon language code for the current language */ getSAPLogonLanguage(): string; /** * Retrieves the configured IANA timezone ID. * * @since 1.120.0 * * @returns The configured IANA timezone ID, e.g. "America/New_York" */ getTimezone(): string; /** * Sets a new language to be used from now on for language/region dependent functionality (e.g. formatting, * data types, translated texts, ...). * * When the language can't be interpreted as a BCP47 language (using the relaxed syntax described in {@link #getLanguage}, * an error will be thrown. * * When the language has changed, the Localization will fire its {@link module:sap/base/i18n/Localization.change change } * event. * * Restrictions: * * The framework **does not** guarantee that already created, language dependent objects will be updated * by config call. It therefore remains best practice for applications to switch the language early, e.g. * before any language dependent objects are created. Applications that need to support more dynamic changes * of the language should listen to the `localizationChanged` event and adapt all language dependent objects * that they use (e.g. by rebuilding their UI). * * Currently, the framework notifies the following objects about a change of the localization settings before * it fires the `localizationChanged` event: * * * - date and number data types that are used in property bindings or composite bindings in existing Elements, * Controls, UIAreas or Components * - ResourceModels currently assigned to the Core, a UIArea, Component, Element or Control * - Elements or Controls that implement the `onLocalizationChanged` hook * * It furthermore derives the RTL mode from the new language, if no explicit RTL mode has been set. If the * RTL mode changes, the following additional actions will be taken: * * * - the URLs of already loaded library theme files will be changed * - the `dir` attribute of the page will be changed to reflect the new mode. * - all UIAreas will be invalidated (which results in a rendering of the whole UI5 UI) * * config method does not accept SAP language codes for `sLanguage`. Instead, a second parameter `sSAPLogonLanguage` * can be provided with an SAP language code corresponding to the given language. A given value will be * returned by the {@link module:sap/base/i18n/Localization.getSAPLogonLanguage getSAPLogonLanguage} method. * It is up to the caller to provide a consistent pair of BCP47 language and SAP language code. The SAP * language code is only checked to be of length 2 and must consist of letters or digits only. * * **Note**: When using config method please take note of and respect the above mentioned restrictions. * See: * http://scn.sap.com/docs/DOC-14377 * * @since 1.120.0 */ setLanguage( /** * the new language as a BCP47 compliant language tag; case doesn't matter and underscores can be used instead * of hyphens to separate components (compatibility with Java Locale IDs) */ sLanguage: string, /** * SAP language code that corresponds to the `sLanguage`; if a value is specified, future calls to `getSAPLogonLanguage` * will return that value; if no value is specified, the framework will use the ISO639 language part of * `sLanguage` as SAP Logon language. */ sSAPLogonLanguage?: string ): void; /** * Sets the character orientation mode to be used from now on. * * Can either be set to a concrete value (true meaning right-to-left, false meaning left-to-right) or to * `null` which means that the character orientation mode should be derived from the current language (incl. * region) setting. * * After changing the character orientation mode, the framework tries to update localization specific parts * of the UI. See the documentation of {@link module:sap/base/i18n/Localization.setLanguage setLanguage } * for details and restrictions. * * **Note**: See documentation of {@link module:sap/base/i18n/Localization.setLanguage setLanguage} for * restrictions. * * @since 1.120.0 */ setRTL( /** * new character orientation mode or `null` */ bRTL: boolean | null ): void; /** * Sets the timezone such that all date and time based calculations use config timezone. * * **Important:** It is strongly recommended to only use config API at the earliest point of time while * initializing a UI5 app. A later adjustment of the time zone should be avoided. It can lead to unexpected * data inconsistencies in a running application, because date objects could still be related to a previously * configured time zone. Instead, the app should be completely restarted with the new time zone. For more * information, see {@link https://ui5.sap.com/#/topic/6c9e61dc157a40c19460660ece8368bc Dates, Times, Timestamps, and Time Zones}. * * When the timezone has changed, the Localization will fire its {@link #event:change change} event. * * @since 1.120.0 */ setTimezone( /** * IANA timezone ID, e.g. "America/New_York". Use `null` to reset the timezone to the browser's local timezone. * An invalid IANA timezone ID will fall back to the browser's timezone. */ sTimezone?: string | null ): void; } const Localization: Localization; export default Localization; /** * The localization change event. Contains only the parameters which were changed. * * The list below shows the possible combinations of parameters available as part of the change event. * * * - {@link module:sap/base/i18n/Localization.setLanguage Localization.setLanguage}: * `language` * - `rtl?` (only if language change also changed RTL) * - {@link module:sap/base/i18n/Localization.setRTL Localization.setRTL}: * `rtl` * - {@link module:sap/base/i18n/Localization.setTimezone Localization.setTimezone}: * `timezone` * * @since 1.120.0 */ export type Localization$ChangeEvent = { /** * The newly set language. */ language?: string; /** * Whether the page uses the RTL text direction. */ rtl?: boolean; /** * The newly set timezone. */ timezone?: string; }; } declare module "sap/base/i18n/ResourceBundle" { /** * Contains locale-specific texts. * * If you need a locale-specific text within your application, you can use the resource bundle to load the * locale-specific file from the server and access the texts of it. * * Use {@link module:sap/base/i18n/ResourceBundle.create} to create an instance of sap/base/i18n/ResourceBundle * (.properties without any locale information, e.g. "mybundle.properties"), and optionally a locale. The * locale is defined as a string of the language and an optional country code separated by underscore (e.g. * "en_GB" or "fr"). If no locale is passed, the default locale is "en" if the SAPUI5 framework is not available. * Otherwise the default locale is taken from the SAPUI5 configuration. * * With the getText() method of the resource bundle, a locale-specific string value for a given key will * be returned. * * With the given locale, the resource bundle requests the locale-specific properties file (e.g. "mybundle_fr_FR.properties"). * If no file is found for the requested locale or if the file does not contain a text for the given key, * a sequence of fallback locales is tried one by one. First, if the locale contains a region information * (fr_FR), then the locale without the region is tried (fr). If that also can't be found or doesn't contain * the requested text, a fallback language will be used, if given (defaults to en (English), assuming that * most development projects contain at least English texts). If that also fails, the file without locale * (base URL of the bundle, often called the 'raw' bundle) is tried. * * If none of the requested files can be found or none of them contains a text for the given key, then the * key itself is returned as text. * * Exception: Fallback for "zh_HK" is "zh_TW" before "zh". * * @since 1.58 */ export default class ResourceBundle { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Creates and returns a new instance of {@link module:sap/base/i18n/ResourceBundle} using the given URL * and locale to determine what to load. * * Before loading the ResourceBundle, the locale is evaluated with a fallback chain. Sample fallback chain * for locale="de-DE" and fallbackLocale="fr_FR" `"de-DE" -> "de" -> "fr_FR" -> "fr" -> raw` * * Only those locales are considered for loading, which are in the supportedLocales array (if the array * is supplied and not empty). * * Note: The fallbackLocale should be included in the supportedLocales array. * * * @returns A new resource bundle or a Promise on that bundle (in asynchronous case) */ static create( /** * Parameters used to initialize the resource bundle */ mParams?: { /** * URL pointing to the base .properties file of a bundle (.properties file without any locale information, * e.g. "mybundle.properties") if not provided, `bundleUrl` or `bundleName` can be used; if both are set, * `bundleName` wins */ url?: string; /** * URL pointing to the base .properties file of a bundle (.properties file without any locale information, * e.g. "i18n/mybundle.properties") */ bundleUrl?: string; /** * UI5 module name in dot notation pointing to the base .properties file of a bundle (.properties file without * any locale information, e.g. "i18n.mybundle") */ bundleName?: string; /** * Optional locale (aka 'language tag') to load the texts for. Can either be a BCP47 language tag or a JDK * compatible locale string (e.g. "en-GB", "en_GB" or "en"). Defaults to the current session locale ({@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage}) * if available, otherwise to the provided `fallbackLocale` */ locale?: string; /** * Whether to include origin information into the returned property values */ includeInfo?: boolean; /** * List of supported locales (aka 'language tags') to restrict the fallback chain. Each entry in the array * can either be a BCP47 language tag or a JDK compatible locale string (e.g. "en-GB", "en_GB" or "en"). * An empty string (`""`) represents the 'raw' bundle. **Note:** The given language tags can use modern * or legacy ISO639 language codes. Whatever language code is used in the list of supported locales will * also be used when requesting a file from the server. If the `locale` contains a legacy language code * like "iw" and the `supportedLocales` contains [...,"he",...], "he" will be used in the URL. This mapping * works in both directions. */ supportedLocales?: string[]; /** * A fallback locale to be used after all locales derived from `locale` have been tried, but before the * 'raw' bundle is used. Can either be a BCP47 language tag or a JDK compatible locale string (e.g. "en-GB", * "en_GB" or "en"). To prevent a generic fallback, use the empty string (`""`). E.g. by providing `fallbackLocale: * ""` and `supportedLocales: ["en"]`, only the bundle "en" is requested without any fallback. */ fallbackLocale?: string; /** * map of terminologies. The key is the terminology identifier and the value is a ResourceBundle terminology * configuration. A terminology is a resource bundle configuration for a specific use case (e.g. "oil"). * It does neither have a `fallbackLocale` nor can it be enhanced with `enhanceWith`. */ terminologies?: Record; /** * The list of active terminologies, e.g. `["oil", "retail"]`. The order in this array represents the lookup * order. */ activeTerminologies?: string[]; /** * List of ResourceBundle configurations which enhance the current one. The order of the enhancements is * significant, because the lookup checks the last enhancement first. Each enhancement represents a ResourceBundle * with limited options ('bundleUrl', 'bundleName', 'terminologies', 'fallbackLocale', 'supportedLocales'). * Note: supportedLocales and fallbackLocale are inherited from the parent ResourceBundle if not present. */ enhanceWith?: Configuration[]; /** * Whether the first bundle should be loaded asynchronously Note: Fallback bundles loaded by {@link #getText } * are always loaded synchronously. **As of version 1.135, synchronous loading is deprecated.** The `async` * parameter must have the value `true`. */ async?: boolean; } ): ResourceBundle | Promise; /** * Returns a locale-specific string value for the given key sKey. * * The text is searched in this resource bundle according to the fallback chain described in {@link module:sap/base/i18n/ResourceBundle}. * If no text could be found, the key itself is used as text. * * Placeholders: * * A text can contain placeholders that will be replaced with concrete values when `getText` is called. * The replacement is triggered by the `aArgs` parameter. * * Whenever this parameter is given, then the text and the arguments are additionally run through the {@link module:sap/base/strings/formatMessage } * API to replace placeholders in the text with the corresponding values from the arguments array. The resulting * string is returned by `getText`. * * As the `formatMessage` API imposes some requirements on the input text (regarding curly braces and single * apostrophes), text authors need to be aware of the specifics of the `formatMessage` API. Callers of `getText`, * on the other side, should only supply `aArgs` when the text has been created with the `formatMessage` * API in mind. Otherwise, single apostrophes in the text might be removed unintentionally. * * When `getText` is called without `aArgs`, the `formatMessage` API is not applied and the transformation * reg. placeholders and apostrophes does not happen. * * For more details on the replacement mechanism refer to {@link module:sap/base/strings/formatMessage}. * * * @returns The value belonging to the key, if found; otherwise the key itself or `undefined` depending * on `bIgnoreKeyFallback`. */ getText( /** * Key to retrieve the text for */ sKey: string, /** * List of parameter values which should replace the placeholders "{n}" (n is the index) in * the found locale-specific string value. Note that the replacement is done whenever `aArgs` is given (not * `undefined`), no matter whether the text contains placeholders or not and no matter whether `aArgs` contains * a value for n or not. */ aArgs?: any[], /** * If set, `undefined` is returned instead of the key string, when the key is not found in any bundle or * fallback bundle. */ bIgnoreKeyFallback?: boolean ): string | undefined; /** * Checks whether a text for the given key can be found in the first loaded resource bundle or not. Neither * the custom resource bundles nor the fallback chain will be processed. * * This method allows to check for the existence of a text without triggering requests for the fallback * locales. * * When requesting the resource bundle asynchronously this check must only be used after the resource bundle * has been loaded. * * * @returns Whether the text has been found in the concrete bundle */ hasText( /** * Key to check */ sKey: string ): boolean; } /** * ResourceBundle Configuration * * A ResourceBundle Configuration holds information on where to load the ResourceBundle from using the fallback * chain and terminologies. The location is retrieved from the `bundleUrl` and `bundleName` parameters The * locale used is influenced by the `supportedLocales` and `fallbackLocale` parameters Terminologies of * this ResourceBundle are loaded via the `terminologies` parameter * * Note: If omitted, the supportedLocales and the fallbackLocale are inherited from the parent ResourceBundle * Configuration */ export type Configuration = { /** * URL pointing to the base .properties file of a bundle (.properties file without any locale information, * e.g. "i18n/mybundle.properties") */ bundleUrl?: string; /** * UI5 module name in dot notation pointing to the base .properties file of a bundle (.properties file without * any locale information, e.g. "i18n.mybundle") */ bundleName?: string; /** * List of supported locales (aka 'language tags') to restrict the fallback chain. Each entry in the array * can either be a BCP47 language tag or a JDK compatible locale string (e.g. "en-GB", "en_GB" or "en"). * An empty string (`""`) represents the 'raw' bundle. **Note:** The given language tags can use modern * or legacy ISO639 language codes. Whatever language code is used in the list of supported locales will * also be used when requesting a file from the server. If the `locale` contains a legacy language code * like "iw" and the `supportedLocales` contains [...,"he",...], "he" will be used in the URL. This mapping * works in both directions. */ supportedLocales?: string[]; /** * A fallback locale to be used after all locales derived from `locale` have been tried, but before the * 'raw' bundle is used. Can either be a BCP47 language tag or a JDK compatible locale string (e.g. "en-GB", * "en_GB" or "en"), defaults to "en" (English). To prevent a generic fallback, use the empty string (`""`). * E.g. by providing `fallbackLocale: ""` and `supportedLocales: ["en"]`, only the bundle "en" is requested * without any fallback. */ fallbackLocale?: string; /** * An object, mapping a terminology identifier (e.g. "oil") to a `ResourceBundle.TerminologyConfiguration`. * A terminology is a resource bundle configuration for a specific use case (e.g. "oil"). It does neither * have a `fallbackLocale` nor can it be enhanced with `enhanceWith`. */ terminologies?: Record; }; /** * ResourceBundle Terminology Configuration * * Terminologies represent a variant of a ResourceBundle. They can be used to provide domain specific texts, * e.g. for industries, e.g. "oil", "retail" or "health". While "oil" could refer to a user as "driller", * in "retail" a user could be a "customer" and in "health" a "patient". While "oil" could refer to a duration * as "hitch", in "retail" a duration could be a "season" and in "health" an "incubation period". * * Note: Terminologies do neither support a fallbackLocale nor nested terminologies in their configuration. */ export type TerminologyConfiguration = { /** * URL pointing to the base .properties file of a bundle (.properties file without any locale information, * e.g. "i18n/mybundle.properties") */ bundleUrl?: string; /** * UI5 module name in dot notation pointing to the base .properties file of a bundle (.properties file without * any locale information, e.g. "i18n.mybundle") */ bundleName?: string; /** * List of supported locales (aka 'language tags') to restrict the fallback chain. Each entry in the array * can either be a BCP47 language tag or a JDK compatible locale string (e.g. "en-GB", "en_GB" or "en"). * An empty string (`""`) represents the 'raw' bundle. **Note:** The given language tags can use modern * or legacy ISO639 language codes. Whatever language code is used in the list of supported locales will * also be used when requesting a file from the server. If the `locale` contains a legacy language code * like "iw" and the `supportedLocales` contains [...,"he",...], "he" will be used in the URL. This mapping * works in both directions. */ supportedLocales?: string[]; }; } declare module "sap/base/Log" { /** * A Logging API for JavaScript. * * Provides methods to manage a client-side log and to create entries in it. Each of the logging methods * {@link module:sap/base/Log.debug}, {@link module:sap/base/Log.info}, {@link module:sap/base/Log.warning}, * {@link module:sap/base/Log.error} and {@link module:sap/base/Log.fatal} creates and records a log entry, * containing a timestamp, a log level, a message with details and a component info. The log level will * be one of {@link module:sap/base/Log.Level} and equals the name of the concrete logging method. * * By using the {@link module:sap/base/Log.setLevel} method, consumers can determine the least important * log level which should be recorded. Less important entries will be filtered out. (Note that higher numeric * values represent less important levels). The initially set level depends on the mode that UI5 is running * in. When the optimized sources are executed, the default level will be {@link module:sap/base/Log.Level.ERROR}. * For normal (debug sources), the default level is {@link module:sap/base/Log.Level.DEBUG}. * * All logging methods allow to specify a **component**. These components are simple strings and don't have * a special meaning to the UI5 framework. However they can be used to semantically group log entries that * belong to the same software component (or feature). There are two APIs that help to manage logging for * such a component. With {@link module:sap/base/Log.getLogger}, one can retrieve a logger that automatically * adds the given `sComponent` as component parameter to each log entry, if no other component is specified. * Typically, JavaScript code will retrieve such a logger once during startup and reuse it for the rest * of its lifecycle. Second, the {@link module:sap/base/Log.setLevel}(iLevel, sComponent) method allows * to set the log level for a specific component only. This allows a more fine grained control about the * created logging entries. {@link module:sap/base/Log.getLevel} allows to retrieve the currently effective * log level for a given component. * * {@link module:sap/base/Log.getLogEntries} returns an array of the currently collected log entries. * * Furthermore, a listener can be registered to the log. It will be notified whenever a new entry is added * to the log. The listener can be used for displaying log entries in a separate page area, or for sending * it to some external target (server). * * @since 1.58 */ interface Log { /** * Enumeration of the configurable log levels that a Logger should persist to the log. * * Only if the current LogLevel is higher than the level {@link module:sap/base/Log.Level} of the currently * added log entry, then this very entry is permanently added to the log. Otherwise it is ignored. * * This enum is part of the 'sap/base/Log' module export and must be accessed by the property 'Level'. */ Level: typeof Level; /** * Allows to add a new listener that will be notified for new log entries. * * The given object must provide method `onLogEntry` and can also be informed about `onDetachFromLog`, `onAttachToLog` * and `onDiscardLogEntries`. */ addLogListener( /** * The new listener object that should be informed */ oListener: Listener ): void; /** * Creates a new debug-level entry in the log with the given message, details and calling component. */ debug( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged with * the stack. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; /** * Creates a new error-level entry in the log with the given message, details and calling component. */ error( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged together * with its stacktrace. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; /** * Creates a new fatal-level entry in the log with the given message, details and calling component. */ fatal( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged together * with its stacktrace. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; /** * Returns the log level currently effective for the given component. If no component is given or when no * level has been configured for a given component, the log level for the default component of this logger * is returned. * * * @returns The log level for the given component or the default log level */ getLevel( /** * Name of the component to retrieve the log level for */ sComponent?: string ): Level; /** * Returns the logged entries recorded so far as an array. * * Log entries are plain JavaScript objects with the following properties * timestamp {number} point in time when the entry was created level {module:sap/base/Log.Level} LogLevel * level of the entry message {string} message text of the entry The default amount of stored * log entries is limited to 3000 entries. * * * @returns an array containing the recorded log entries */ getLogEntries(): Entry[]; /** * Returns a dedicated logger for a component. * * The logger comes with the same API as the `sap/base/Log` module: * `#fatal` - see: {@link module:sap/base/Log.fatal} `#error` - see: {@link module:sap/base/Log.error } * `#warning` - see: {@link module:sap/base/Log.warning} `#info` - see: {@link module:sap/base/Log.info } * `#debug` - see: {@link module:sap/base/Log.debug} `#trace` - see: {@link module:sap/base/Log.trace } * `#setLevel` - see: {@link module:sap/base/Log.setLevel} `#getLevel` - see: {@link module:sap/base/Log.getLevel } * `#isLoggable` - see: {@link module:sap/base/Log.isLoggable} * * * @returns A logger with a specified component */ getLogger( /** * Name of the component which should be logged */ sComponent: string, /** * The default log level */ iDefaultLogLevel?: Level ): Logger; /** * Creates a new info-level entry in the log with the given message, details and calling component. */ info( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged with * the stack. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; /** * Checks whether logging is enabled for the given log level, depending on the currently effective log level * for the given component. * * If no component is given, the default component of this logger will be taken into account. * * * @returns Whether logging is enabled or not */ isLoggable( /** * The log level in question */ iLevel?: Level, /** * Name of the component to check the log level for */ sComponent?: string ): boolean; /** * Allows to remove a registered LogListener. */ removeLogListener( /** * The listener object that should be removed */ oListener: Listener ): void; /** * Defines the maximum `sap/base/Log.Level` of log entries that will be recorded. Log entries with a higher * (less important) log level will be omitted from the log. When a component name is given, the log level * will be configured for that component only, otherwise the log level for the default component of this * logger is set. For the global logger, the global default level is set. * * **Note**: Setting a global default log level has no impact on already defined component log levels. They * always override the global default log level. */ setLevel( /** * The new log level */ iLogLevel: Level, /** * The log component to set the log level for */ sComponent?: string ): void; /** * Creates a new trace-level entry in the log with the given message, details and calling component. */ trace( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged with * the stack. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; /** * Creates a new warning-level entry in the log with the given message, details and calling component. */ warning( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged together * with its stacktrace. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; } const Log: Log; export default Log; export type Entry = { /** * The number of milliseconds since the epoch */ timestamp: float; /** * Time string in format HH:mm:ss:mmmnnn */ time: string; /** * Date string in format yyyy-MM-dd */ date: string; /** * The level of the log entry, see {@link module:sap/base/Log.Level} */ level: Level; /** * The message of the log entry */ message: string; /** * The detailed information of the log entry */ details: string; /** * The component that creates the log entry */ component: string; /** * Callback that returns an additional support object to be logged in support mode. */ supportInfo?: () => any; }; /** * Enumeration of the configurable log levels that a Logger should persist to the log. * * Only if the current LogLevel is higher than the level {@link module:sap/base/Log.Level} of the currently * added log entry, then this very entry is permanently added to the log. Otherwise it is ignored. * * This enum is part of the 'sap/base/Log' module export and must be accessed by the property 'Level'. */ enum Level { /** * Trace level to log everything. */ ALL = "undefined", /** * Debug level. Use this for logging information necessary for debugging */ DEBUG = "undefined", /** * Error level. Use this for logging of erroneous but still recoverable situations */ ERROR = "undefined", /** * Fatal level. Use this for logging unrecoverable situations */ FATAL = "undefined", /** * Info level. Use this for logging information of purely informative nature */ INFO = "undefined", /** * Do not log anything */ NONE = "undefined", /** * Trace level. Use this for tracing the program flow. */ TRACE = "undefined", /** * Warning level. Use this for logging unwanted but foreseen situations */ WARNING = "undefined", } /** * Interface to be implemented by a log listener. * * Typically, a listener will at least implement the {@link #.onLogEntry} method, but in general, all methods * are optional. */ export interface Listener { __implements__sap_base_Log_Listener: boolean; /** * The function that is called once the Listener is attached */ onAttachToLog?( /** * The Log instance where the listener is attached */ oLog: Log ): void; /** * The function that is called once the Listener is detached */ onDetachFromLog?( /** * The Log instance where the listener is detached */ oLog: Log ): void; /** * The function that is called once log entries are discarded due to the exceed of total log entry amount */ onDiscardLogEntries?( /** * The discarded log entries */ aDiscardedEntries: Entry[] ): void; /** * The function that is called when a new log entry is created */ onLogEntry?( /** * The newly created log entry */ oLogEntry: Entry ): void; } /** * The logger comes with a subset of the API of the `sap/base/Log` module: * `#fatal` - see: {@link module:sap/base/Log.fatal} `#error` - see: {@link module:sap/base/Log.error } * `#warning` - see: {@link module:sap/base/Log.warning} `#info` - see: {@link module:sap/base/Log.info } * `#debug` - see: {@link module:sap/base/Log.debug} `#trace` - see: {@link module:sap/base/Log.trace } * `#setLevel` - see: {@link module:sap/base/Log.setLevel} `#getLevel` - see: {@link module:sap/base/Log.getLevel } * `#isLoggable` - see: {@link module:sap/base/Log.isLoggable} */ export interface Logger { __implements__sap_base_Log_Logger: boolean; /** * Creates a new debug-level entry in the log with the given message, details and calling component. */ debug( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged with * the stack. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; /** * Creates a new error-level entry in the log with the given message, details and calling component. */ error( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged together * with its stacktrace. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; /** * Creates a new fatal-level entry in the log with the given message, details and calling component. */ fatal( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged together * with its stacktrace. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; /** * Returns the log level currently effective for the given component. If no component is given or when no * level has been configured for a given component, the log level for the default component of this logger * is returned. * * * @returns The log level for the given component or the default log level */ getLevel( /** * Name of the component to retrieve the log level for */ sComponent?: string ): Level; /** * Creates a new info-level entry in the log with the given message, details and calling component. */ info( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged with * the stack. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; /** * Checks whether logging is enabled for the given log level, depending on the currently effective log level * for the given component. * * If no component is given, the default component of this logger will be taken into account. * * * @returns Whether logging is enabled or not */ isLoggable( /** * The log level in question */ iLevel?: Level, /** * Name of the component to check the log level for */ sComponent?: string ): boolean; /** * Defines the maximum `sap/base/Log.Level` of log entries that will be recorded. Log entries with a higher * (less important) log level will be omitted from the log. When a component name is given, the log level * will be configured for that component only, otherwise the log level for the default component of this * logger is set. For the global logger, the global default level is set. * * **Note**: Setting a global default log level has no impact on already defined component log levels. They * always override the global default log level. */ setLevel( /** * The new log level */ iLogLevel: Level, /** * The log component to set the log level for */ sComponent?: string ): void; /** * Creates a new trace-level entry in the log with the given message, details and calling component. */ trace( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged with * the stack. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; /** * Creates a new warning-level entry in the log with the given message, details and calling component. */ warning( /** * Message text to display */ sMessage: string, /** * Optional details about the message, might be omitted. Can be an Error object which will be logged together * with its stacktrace. */ vDetails?: string | Error, /** * Name of the component that produced the log entry */ sComponent?: string, /** * Callback that returns an additional support object to be logged in support mode. This function is only * called if support info mode is turned on via the Support Assistant. To avoid negative effects regarding * execution times and memory consumption, the returned object should be a simple immutable JSON object * with mostly static and stable content. */ fnSupportInfo?: Function ): void; } } declare module "sap/base/security/encodeCSS" { /** * Encode the string for inclusion into CSS string literals or identifiers. * * @since 1.58 * * @returns The encoded string */ export default function encodeCSS( /** * The string to be escaped */ sString: string ): string; } declare module "sap/base/security/encodeJS" { /** * Encode the string for inclusion into a JS string literal. * * @since 1.58 * * @returns The encoded string */ export default function encodeJS( /** * The string to be escaped */ sString: string ): string; } declare module "sap/base/security/encodeURL" { /** * Encode the string for inclusion into a URL parameter. * * Unescaped characters: alphabetic, decimal digits, -_. (hyphen, underscore, dot) * * @since 1.58 * * @returns The encoded string */ export default function encodeURL( /** * The string to be escaped */ sString: string ): string; } declare module "sap/base/security/encodeURLParameters" { /** * Encode a map of parameters into a combined URL parameter string. * * @since 1.58 * * @returns The URL encoded parameter string */ export default function encodeURLParameters( /** * The map of parameters to encode */ mParams: Record ): string; } declare module "sap/base/security/encodeXML" { /** * Encode the string for inclusion into XML content/attribute. * * @since 1.58 * * @returns The encoded string */ export default function encodeXML( /** * The string to be escaped */ sString: string ): string; } declare module "sap/base/security/URLListValidator" { /** * Registry to manage allowed URLs and validate against them. * * @since 1.85 */ interface URLListValidator { /** * Adds an allowed entry. * * Note: Adding the first entry to the list of allowed entries will disallow all URLs but the ones matching * the newly added entry. * * **Note**: It is strongly recommended to set a path only in combination with an origin (never set a path * alone). There's almost no case where checking only the path of a URL would allow to ensure its validity. */ add( /** * The protocol of the URL, can be falsy to allow all protocols for an entry e.g. "", "http", "mailto" */ protocol?: string, /** * The host of the URL, can be falsy to allow all hosts. A wildcard asterisk can be set at the beginning, * e.g. "examples.com", "*.example.com" */ host?: string, /** * The port of the URL, can be falsy to allow all ports, e.g. "", "8080" */ port?: string, /** * the path of the URL, e.g. "/my-news". Can be falsy to allow all paths. A wildcard asterisk can be set * at the end to ensure a path starts with the given string, e.g. "/my-example*". When using wildcards, * make sure to only provide normalized URLs to the validate function in order to mitigate the risk of path * traversal attacks. */ path?: string ): void; /** * Clears the allowed entries for URL validation. This makes all URLs allowed. */ clear(): void; /** * Gets the list of allowed entries. * * * @returns The allowed entries */ entries(): Entry[]; /** * Validates a URL. Check if it's not a script or other security issue. * * **Note**: It is strongly recommended to validate only absolute, normalized URLs. There's almost no case * where checking only the path of a URL would allow to ensure its validity. For compatibility reasons, * this API does not normalize URLs and cannot automatically resolve URLs relative to `document.baseURI`, * but callers should do so. In that case, and when the allow list is not empty, an entry for the origin * of `document.baseURI` must be added to the allow list. * * Any measures to mitigate path traversal or similar attack vectors must be taken by the caller, e.g. by * using the {@link https://developer.mozilla.org/docs/Web/API/URL URL} API to normalize the URL beforehand. * * Details: Splits the given URL into components and checks for allowed characters according to RFC 3986: * * * ```javascript * * authority = [ userinfo "@" ] host [ ":" port ] * userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) * host = IP-literal / IPv4address / reg-name * * IP-literal = "[" ( IPv6address / IPvFuture ) "]" * IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" ) * IPv6address = 6( h16 ":" ) ls32 * / "::" 5( h16 ":" ) ls32 * / [ h16 ] "::" 4( h16 ":" ) ls32 * / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 * / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 * / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 * / [ *4( h16 ":" ) h16 ] "::" ls32 * / [ *5( h16 ":" ) h16 ] "::" h16 * / [ *6( h16 ":" ) h16 ] "::" * ls32 = ( h16 ":" h16 ) / IPv4address * ; least-significant 32 bits of address * h16 = 1*4HEXDIG * ; 16 bits of address represented in hexadecimal * * IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet * dec-octet = DIGIT ; 0-9 * / %x31-39 DIGIT ; 10-99 * / "1" 2DIGIT ; 100-199 * / "2" %x30-34 DIGIT ; 200-249 * / "25" %x30-35 ; 250-255 * * reg-name = *( unreserved / pct-encoded / sub-delims ) * * pct-encoded = "%" HEXDIG HEXDIG * reserved = gen-delims / sub-delims * gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" * sub-delims = "!" / "$" / "&" / "'" / "(" / ")" * / "*" / "+" / "," / ";" / "=" * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" * pchar = unreserved / pct-encoded / sub-delims / ":" / "@" * * path = path-abempty ; begins with "/" or is empty * / path-absolute ; begins with "/" but not "//" * / path-noscheme ; begins with a non-colon segment * / path-rootless ; begins with a segment * / path-empty ; zero characters * * path-abempty = *( "/" segment ) * path-absolute = "/" [ segment-nz *( "/" segment ) ] * path-noscheme = segment-nz-nc *( "/" segment ) * path-rootless = segment-nz *( "/" segment ) * path-empty = 0 * segment = *pchar * segment-nz = 1*pchar * segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" ) * ; non-zero-length segment without any colon ":" * * query = *( pchar / "/" / "?" ) * * fragment = *( pchar / "/" / "?" ) * ``` * * * For the hostname component, we are checking for valid DNS hostnames according to RFC 952 / RFC 1123: * * * ```javascript * * hname = name *("." name) * name = let-or-digit ( *( let-or-digit-or-hyphen ) let-or-digit ) * ``` * * * When the URI uses the protocol 'mailto:', the address part is additionally checked against the most commonly * used parts of RFC 6068: * * * ```javascript * * mailtoURI = "mailto:" [ to ] [ hfields ] * to = addr-spec *("," addr-spec ) * hfields = "?" hfield *( "&" hfield ) * hfield = hfname "=" hfvalue * hfname = *qchar * hfvalue = *qchar * addr-spec = local-part "@" domain * local-part = dot-atom-text // not accepted: quoted-string * domain = dot-atom-text // not accepted: "[" *dtext-no-obs "]" * dtext-no-obs = %d33-90 / ; Printable US-ASCII * %d94-126 ; characters not including * ; "[", "]", or "\" * qchar = unreserved / pct-encoded / some-delims * some-delims = "!" / "$" / "'" / "(" / ")" / "*" * / "+" / "," / ";" / ":" / "@" * * Note: * A number of characters that can appear in MUST be * percent-encoded. These are the characters that cannot appear in * a URI according to [STD66] as well as "%" (because it is used for * percent-encoding) and all the characters in gen-delims except "@" * and ":" (i.e., "/", "?", "#", "[", and "]"). Of the characters * in sub-delims, at least the following also have to be percent- * encoded: "&", ";", and "=". Care has to be taken both when * encoding as well as when decoding to make sure these operations * are applied only once. * * ``` * * * When a list of allowed entries has been configured using {@link #add}, any URL that passes the syntactic * checks above, additionally will be tested against the content of this list. * * * @returns true if valid, false if not valid */ validate( /** * URL to be validated */ sUrl: string ): boolean; } const URLListValidator: URLListValidator; export default URLListValidator; /** * Entry object of the URLListValidator. */ export type Entry = { /** * The protocol of the URL, can be falsy to allow all protocols for an entry e.g. "", "http", "mailto" */ protocol?: string; /** * The host of the URL, can be falsy to allow all hosts. A wildcard asterisk can be set at the beginning, * e.g. "examples.com", "*.example.com" */ host?: string; /** * The port of the URL, can be falsy to allow all ports, e.g. "", "8080" */ port?: string; /** * the path of the URL, path of the url, can be falsy to allow all paths. A wildcard asterisk can be set * at the end, e.g. "/my-example*", "/my-news" */ path?: string; }; } declare module "sap/base/security/URLWhitelist" { /** * Entry object of the URLWhitelist. * * @deprecated As of version 1.85. use {@link module:sap/base/security/URLListValidator.Entry} instead. */ export type Entry = { /** * The protocol of the URL */ protocol: string; /** * The host of the URL */ host: string; /** * The port of the URL */ port: string; /** * the path of the URL */ path: string; }; } declare module "sap/base/strings/camelize" { /** * Transforms a hyphen separated string to a camel case string. * * @since 1.58 * * @returns The transformed string */ export default function camelize( /** * Hyphen separated string */ sString: string ): string; } declare module "sap/base/strings/capitalize" { /** * Converts first character of the string to upper case. * * @since 1.58 * * @returns String input with first character uppercase */ export default function capitalize( /** * String for which first character should be converted */ sString: string ): string; } declare module "sap/base/strings/escapeRegExp" { /** * Escapes all characters that would have a special meaning in a regular expression. * * This method can be used when a string with arbitrary content has to be integrated into a regular expression * and when the whole string should match literally. * * @since 1.58 * * @returns The escaped string */ export default function escapeRegExp( /** * String to escape */ sString: string ): string; } declare module "sap/base/strings/formatMessage" { /** * Creates a string from a pattern by replacing placeholders with concrete values. * * The syntax of the pattern is inspired by (but not fully equivalent to) the java.util.MessageFormat. * * Placeholders have the form `{ integer }`, where any occurrence of `{0}` is replaced by the value with * index 0 in `aValues`, `{1}` by the value with index 1 in `aValues` etc. * * To avoid interpretation of curly braces as placeholders, any non-placeholder fragment of the pattern * can be enclosed in single quotes. The surrounding single quotes will be omitted from the result. Single * quotes that are not meant to escape a fragment and that should appear in the result, need to be doubled. * In the result, only a single single quote will occur. * * Example: Pattern Strings * ```javascript * * formatMessage("Say {0}", ["Hello"]) -> "Say Hello" // normal use case * formatMessage("Say '{0}'", ["Hello"]) -> "Say {0}" // escaped placeholder * formatMessage("Say ''{0}''", ["Hello"]) -> "Say 'Hello'" // doubled single quote * formatMessage("Say '{0}'''", ["Hello"]) -> "Say {0}'" // doubled single quote in quoted fragment * ``` * In contrast to java.util.MessageFormat, format types or format styles are not supported. Everything * after the argument index and up to the first closing curly brace is ignored. Nested placeholders (as * supported by java.lang.MessageFormat for the format type choice) are not ignored but reported as a parse * error. * * This method throws an Error when the pattern syntax is not fulfilled (e.g. unbalanced curly braces, nested * placeholders or a non-numerical argument index). * * This method can also be used as a formatter within a binding. The first part of a composite binding will * be used as pattern, the following parts as aValues. If there is only one value and this value is an array * it will be handled like the default described above. * * @since 1.58 * * @returns The formatted result string */ export default function formatMessage( /** * A pattern string in the described syntax */ sPattern: string, /** * The values to be used instead of the placeholders. */ aValues?: any[] ): string; } declare module "sap/base/strings/hyphenate" { /** * Transforms a camel case string (camelCase) into a hyphen separated string (kebab-case). * * @since 1.58 * * @returns The transformed string */ export default function hyphenate( /** * camel case string */ sString: string ): string; } declare module "sap/base/util/array/diff" { /** * Calculates delta of old list and new list. * * This function implements the algorithm described in "A Technique for Isolating Differences Between Files" * (Commun. ACM, April 1978, Volume 21, Number 4, Pages 264-268). * * Items in the arrays are not compared directly. Instead, a substitute symbol is determined for each item * by applying the provided function `fnSymbol` to it. Items with strictly equal symbols are assumed to * represent the same logical item: * ```javascript * * fnSymbol(a) === fnSymbol(b) <=> a 'is logically the same as' b * ``` * As an additional constraint, casting the symbols to string should not modify the comparison result. * If this second constraint is not met, this method might report more diffs than necessary. * * If no symbol function is provided, a default implementation is used which applies `JSON.stringify` to * non-string items and reduces the strings to a hash code. It is not guaranteed that this default implementation * fulfills the above constraint in all cases, but it is a compromise between implementation effort, generality * and performance. If items are known to be non-stringifiable (e.g. because they may contain cyclic references) * or when hash collisions are likely, an own `symbol` function must be provided via the configuration object. * * The result of the diff is a sequence of update operations, each consisting of a `type` (either `"insert"`, * `"delete"` or `"replace"` when enabled via configuration object) and an `index`. By applying the operations * one after the other to the old array, it can be transformed to an array whose items are equal to the * new array. * * @since 1.58 * * @returns List of update operations */ export default function diff( /** * Old Array */ aOld: any[], /** * New Array */ aNew: any[], /** * Configuration object or a function to calculate substitute symbols for array items */ vConfigOrSymbol?: | { /** * Function to calculate substitute symbols for array items */ symbol?: Function; /** * Switch for the `replace` type which specifies that an item within the array has been changed */ replace?: boolean; } | Function ): Array<{ type: string; index: int; }>; } declare module "sap/base/util/array/uniqueSort" { /** * Sorts the given array in-place and removes any duplicates (identified by "==="). * * Uses Array#sort() * See: * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort * * Use `jQuery.uniqueSort()` for arrays of DOMElements. * * @since 1.58 * * @returns Same array as given (for chaining) */ export default function uniqueSort( /** * An Array of any type */ aArray: any[] ): any[]; } declare module "sap/base/util/clamp" { /** * Returns a value clamped between an upper bound 'max' and lower bound 'min'. * * @since 1.130 * * @returns clamped value */ export default function clamp( /** * value */ val: number, /** * lower bound */ min: number, /** * upper bound */ max: number ): number; } declare module "sap/base/util/deepClone" { /** * Creates a deep clone of the source value. * * Only arrays, JavaScript Date objects and objects that pass the {@link module:sap/base/util/isPlainObject isPlainObject } * check will be cloned. For other object types, a `TypeError` will be thrown as there's no standard way * to clone them. Primitive values (boolean, number, string) as well as `null` and `undefined` will be copied, * they have value semantics anyhow. * * `deepClone` is designed to match the semantics of {@link module:sap/base/util/deepEqual deepEqual}. Any * deeply cloned object should be deep-equal to the source. However, not every object that can be handled * by `deepEqual` can also be deeply cloned (e.g. `deepClone` fails on non-plain objects). * * To limit the time needed for a deep clone and to avoid endless recursion in case of cyclic structures, * the recursion depth is limited by the parameter `maxDepth`, which defaults to 10. When the recursion * depth exceeds the given limit, a `TypeError` is thrown. * * Note that object identities are not honored by the clone operation. If the original source contained * multiple references to the same plain object instance, the clone will contain a different clone for each * reference. * * @since 1.63 * * @returns A clone of the source value */ export default function deepClone( /** * Source value that shall be cloned */ src: any, /** * Maximum recursion depth for the clone operation, deeper structures will throw an error */ maxDepth?: int ): any; } declare module "sap/base/util/deepEqual" { /** * Compares the two given values for equality, especially by comparing the content. * * **Note:** Function does not work with comparing XML objects. * * @since 1.58 * * @returns Whether a and b are equal */ export default function deepEqual( /** * A value of any type */ a: any, /** * A value of any type */ b: any, /** * Maximum recursion depth */ maxDepth?: int, /** * Whether all existing properties in a are equal as in b */ contains?: boolean ): boolean; } declare module "sap/base/util/deepExtend" { /** * Performs object extension by merging source objects into a target object. Copies are always deep. * * If during merging a key in the target object exists it is overwritten with the source object's value. * Usage is the same as `jQuery.extend(true, ...)`. Values that are `undefined` are ignored. * * For shallow copies, you may use {@link module:sap/base/util/extend sap/base/util/extend} or `Object.assign`, * but note that `Object.assign` only copies enumerable and own properties and doesn't copy properties on * the prototype and non-enumerable properties. Also, values that are `undefined` are NOT ignored. * * @since 1.71 * * @returns the target object which is the result of the merge */ export default function deepExtend( /** * The object that will receive new properties */ target: object, /** * One or more objects which get merged into the target object */ ...source: object[] ): object; } declare module "sap/base/util/Deferred" { /** * Creates a `Deferred` instance which represents a future value. * * While a `Promise` can only be resolved or rejected by calling the respective methods in its constructor, * a `Deferred` can be resolved or rejected via `resolve` or `reject` methods at any point. A `Deferred` * object creates a `Promise` instance which functions as a proxy for the future result. This `Promise` * object can be accessed via the `promise` property of the `Deferred` object. * * @since 1.90 */ export default class Deferred { constructor(); /** * Promise instance of the Deferred */ promise: Promise; /** * Proxy call to the `reject` method of the wrapped Promise */ reject( /** * Failure reason */ reason?: any ): void; /** * Proxy call to the `resolve` method of the wrapped Promise */ resolve( /** * Fulfillment value */ value?: T ): void; } } declare module "sap/base/util/each" { /** * Iterates over elements of the given object or array. * * Numeric indexes are only used for instances of `Array`. For all other objects, including those with a * numeric `length` property, the properties are iterated by name. * * When `fnCallback` returns `false`, then the iteration stops (break). * * @since 1.58 * * @returns the given `oObject` */ export default function each( /** * object or array to enumerate the properties of */ oObject: object | any[], /** * function to call for each property name */ fnCallback: (this: any, p1: Key, p2: any) => boolean ): object | any[]; /** * The key that is passed to the callback as the first parameter */ export type Key = int | string; } declare module "sap/base/util/extend" { /** * Performs object extension by merging source objects into a target object. Generates a shallow copy. * * If during merging a key in the target object exists it is overwritten with the source object's value. * Usage is the same as `jQuery.extend(...)`. Values that are `undefined` are ignored. * * As alternative you may also use `Object.assign`, but note that `Object.assign` only copies enumerable * and own properties and doesn't copy properties on the prototype and non-enumerable properties. Also, * values that are `undefined` are NOT ignored. * * For deep copies, you may use {@link module:sap/base/util/deepExtend sap/base/util/deepExtend}. * * @since 1.71 * * @returns the target object which is the result of the merge */ export default function extend( /** * The object that will receive new properties */ target: object, /** * One or more objects which get merged into the target object */ ...source: object[] ): object; } declare module "sap/base/util/includes" { /** * Checks if value is included in collection. * * @since 1.58 * @deprecated As of version 1.90. Use the `Array.prototype.includes` or `String.prototype.includes` instead, * but note that `Array.prototype.includes` or `String.prototype.includes` fail when called on null values. * * @returns - true if value is in the collection, false otherwise */ export default function includes( /** * Collection to be checked */ vCollection: any[] | object | string, /** * The value to be checked */ vValue: any, /** * optional start index, negative start index will start from the end */ iFromIndex?: int ): boolean; } declare module "sap/base/util/isEmptyObject" { /** * Validates if the given object is empty, that is that it has no enumerable properties. * * Note that `null` and `undefined` comply with this definition of 'empty'. The behavior for non-object * values is undefined and might change in future. * * @since 1.65 * * @returns whether or not the given object is empty */ export default function isEmptyObject( /** * the object which is checked */ obj: Object ): boolean; } declare module "sap/base/util/isPlainObject" { /** * Checks whether the object is a plain object (created using "{}" or "new Object"). * * @since 1.58 * * @returns whether or not the object is a plain object (created using "{}" or "new Object"). */ export default function isPlainObject( /** * the object which is checked */ obj: Object ): boolean; } declare module "sap/base/util/merge" { /** * Performs object extension by merging source objects into a target object. Copies are always deep. * * If during merging a key in the target object exists it is overwritten with the source object's value. * Usage is the same as `jQuery.extend(true, ...)`, but values that are `undefined` are NOT ignored. * * For shallow copies, you may use `Object.assign`, but note that `Object.assign` only copies enumerable * and own properties and doesn't copy properties on the prototype and non-enumerable properties. * * @since 1.58 * * @returns the target object which is the result of the merge */ export default function merge( /** * The object that will receive new properties */ target: object, /** * One or more objects which get merged into the target object */ ...source: object[] ): object; } declare module "sap/base/util/now" { /** * Returns a high resolution timestamp in microseconds. The timestamp is based on 01/01/1970 00:00:00 (UNIX * epoch) as float with microsecond precision. The fractional part of the timestamp represents fractions * of a millisecond. Converting to a `Date` is possible by using `require(["sap/base/util/now"], function(now){new * Date(now());}` * * @since 1.58 * * @returns timestamp in microseconds */ export default function now(): float; } declare module "sap/base/util/ObjectPath" { /** * Manages an object path. * * The object path can be just created with {@link #.create}, then an empty nested object path will be created * from the provided string. If a value is set for an object path {@link #.set} it is also created if it * not already exists. Values can be retrieved from the objectpath with {@link #get}. * * @since 1.58 */ interface ObjectPath { /** * Creates a object path from the provided path in the provided root context. * * The provided path is used to navigate through the nested objects, starting with the root context. * * * @returns The newly created context object, e.g. base.my.test.module */ create( /** * Path as string where each name is separated by '.'. Can also be an array of names. */ vObjectPath: string | string[], /** * Root context where the path starts */ oRootContext?: Object ): Object; /** * Returns a value located in the provided path. If the provided path cannot be resolved completely, `undefined` * is returned. * * The provided object path is used to navigate through the nested objects, starting with the root context. * If no root context is provided, the object path begins with `globalThis`. * * * @returns Returns the value located in the provided path, or `undefined` if the path does not exist completely. */ get( /** * Path as string where each name is separated by '.'. Can also be an array of names. */ vObjectPath: string | string[], /** * Root context where the path starts */ oRootContext?: Object ): any | undefined; /** * Sets a value located in the provided path. * * The provided path is used to navigate through the nested objects, starting with the root context. * * **Note:** Ensures that the object path exists. */ set( /** * vObjectPath Path as string where each name is separated by '.'. Can also be an array of names. */ vObjectPath: string | string[], /** * The value to be set in the root context's object path */ vValue: any, /** * Root context where the path starts */ oRootContext?: Object ): void; } const ObjectPath: ObjectPath; export default ObjectPath; } declare module "sap/base/util/Properties" { /** * Represents a collection of string properties (key/value pairs). * * Each key and its corresponding value in the collection is a string, keys are case-sensitive. * * Use {@link module:sap/base/util/Properties.create} to create an instance of {@link module:sap/base/util/Properties}. * * The {@link #getProperty} method can be used to retrieve a value from the collection, {@link #setProperty } * to store or change a value for a key and {@link #getKeys} can be used to retrieve an array of all keys * that are currently stored in the collection. * * @since 1.58 */ export default class Properties { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Creates and returns a new instance of {@link module:sap/base/util/Properties}. * * If option 'url' is passed, immediately a load request for the given target is triggered. A property file * that is loaded can contain comments with a leading ! or #. The loaded property list does not contain * any comments. * * * @returns A new property collection (synchronous case) or `null` if the file could not be loaded and `returnNullIfMissing` * was set; in case of asynchronous loading, always a Promise is returned, which resolves with the property * collection or with `null` if the file could not be loaded and `returnNullIfMissing` was set to true */ static create( /** * Parameters used to initialize the property list */ mParams?: { /** * The URL to the .properties file which should be loaded */ url?: string; /** * Whether the .properties file should be loaded asynchronously or not */ async?: boolean; /** * A map of additional header key/value pairs to send along with the request (see `headers` option of `jQuery.ajax`) */ headers?: Record; /** * Whether `null` should be returned for a missing properties file; by default an empty collection is returned */ returnNullIfMissing?: boolean; } ): Properties | null | Promise; /** * Creates and returns a clone of the property collection. * * * @returns A clone of the property collection */ clone(): Properties; /** * Returns an array of all keys in the property collection. * * * @returns All keys in the property collection */ getKeys(): string[]; /** * Returns the value for the given key or `null` if the collection has no value for the key. * * Optionally, a default value can be given which will be returned if the collection does not contain a * value for the key; only non-empty default values are supported. * * * @returns Value for the given key or the default value or `null` if no default value or a falsy default * value was given */ getProperty( /** * Key to return the value for */ sKey: string, /** * Optional, a default value that will be returned if the requested key is not in the collection */ sDefaultValue?: string ): string | null; /** * Stores or changes the value for the given key in the collection. * * If the given value is not a string, the collection won't be modified. The key is always cast to a string. */ setProperty( /** * Key of the property */ sKey: string, /** * String value for the key */ sValue: string ): void; } } declare module "sap/base/util/uid" { /** * Creates and returns a pseudo-unique ID. * * No means for detection of overlap with already present or future UIDs. * * @since 1.58 * * @returns A pseudo-unique id. */ export default function uid(): string; } declare module "sap/base/util/UriParameters" { /** * Provides access to the individual parameters of a URL query string. * * This class parses the query string from a URL and provides access to the values of individual parameters. * There are methods to check whether the query string {@link #has contains a parameter (`has()`)}, to {@link #get get a single value (`get()`) } * for a parameter and to {@link #getAll get a list of all values (`getAll()`)} for a parameter. Another * method allows to {@link #keys iterate over all parameter names (`keys()`)}. * * Decoding: * * The constructor and the factory methods expect percentage encoded input whereas all other APIs expect * and return decoded strings. After parsing the query string, any plus sign (0x2b) in names or values is * replaced by a blank (0x20) and the resulting strings are percentage decoded (`decodeURIComponent`). * * Deprecation: * * This class is deprecated in favor of the URL web standard classes `URLSearchParams` / `URL`. * * `UriParameters.fromQuery(input)` can be migrated to `new URLSearchParams(input)` * * `UriParameters.fromURL(input)` can be migrated to `new URL(input).searchParams` * * Caveats: * * The API has already been designed to be a drop-in replacement but there are some important caveats to * consider when switching to the standard APIs `URLSearchParams` / `URL`: * - `new URL(input).searchParams` validates the given URL according to the WHATWG URL Standard ({@link https://url.spec.whatwg.org}). * `UriParameters.fromURL(input)` only extracts the query string from the given input but does not perform * any validation. * - In some edge cases, especially for incomplete/invalid encoding, decoding behaves differently. Decoding * in `UriParameters` is described in the section above. For details about the encoding/decoding of `URLSearchParams`, * see the WHATWG URL Standard ({@link https://url.spec.whatwg.org}). * - The `get` method's second parameter, `bAll`, is not available; use the `getAll` method instead. * - The `keys` method's return value contains an entry for every occurrence of the key within the query, * in the defined order and including duplicates. `UriParameters#keys()` yields unique key values, even * when there are multiple values for the same key. * - The internal `mParams` property is not available anymore (you should never access internal properties * of UI5 classes or objects). With the predecessor of this API, access to `mParams` was often used to check * whether a parameter is defined at all. Using the `has` method or checking the result of `get` against * `null` serves the same purpose. * * @since 1.68 * @deprecated As of version 1.119. See class description for details. */ export default class UriParameters { /** * See: * https://url.spec.whatwg.org/#interface-urlsearchparams */ constructor( /** * URL with parameters */ sURL?: string ); /** * Parses the given query string and returns an interface to access the individual parameters. * * Callers using `UriParameters.fromQuery(input)` can be migrated to `new URLSearchParams(input)` once that * API is available (or polyfilled) in all supported browsers. * * * @returns Object providing read access to the query parameters */ static fromQuery( /** * Query string to parse, a leading question mark (?) will be ignored */ sQuery?: string ): UriParameters; /** * Parses the query portion of the given URL and returns an object to access the individual parameters. * * Callers using `UriParameters.fromURL(input)` can be migrated to `new URL(input).searchParams` once that * API is available (or polyfilled) in all supported browsers. * * * @returns Object providing read access to the query parameters */ static fromURL( /** * to parse the query portion of. */ sURL: string ): UriParameters; /** * Returns the first value of the named query parameter. * * The value of the first occurrence of the parameter with name `sName` in the query string is returned. * If that first occurrence does not contain a value (it does not contain an equal sign), then an empty * string is returned. * * If (and only if) the parameter does not occur in the query string, `null` is returned. * * * @returns First value of the query parameter with the given name or `null` */ get( /** * Name of the query parameter to get the value for */ sName: string, /** * Whether all values for the parameter should be returned; the use of this parameter is deprecated and * highly discouraged; use the {@link #getAll} method instead */ bAll?: boolean ): string | null; /** * Returns all values of the query parameter with the given name. * * An array of string values of all occurrences of the parameter with the given name is returned. This array * is empty if (and only if) the parameter does not occur in the query string. * * * @returns Array with all values of the query parameter with the given name */ getAll( /** * Name of the query parameter */ sName: string ): string[]; /** * Checks whether a parameter occurs at least once in the query string. * * * @returns Whether the parameter has been defined */ has( /** * Name of the query parameter to check */ sName: string ): boolean; /** * Returns an iterator for all contained parameter names. * * * @returns Iterator for all parameter names. */ keys(): Iterator; } } declare module "sap/base/util/values" { /** * Returns values from an object. * * **Note:**Whenever possible, please try to use the native function `Object.values` instead. Especially, * if you don't need to rely on handling null values as argument. * * @since 1.58 * * @returns - array of object values, if object does not contain values, an empty array will be returned */ export default function values( /** * Object to be extracted */ mObject: Object | undefined ): any[]; } declare module "sap/base/util/Version" { /** * Represents a version consisting of major, minor, patch version, and suffix, for example '1.2.7-SNAPSHOT'. * * @since 1.58 */ export default class Version { /** * Returns a Version instance created from the given parameters. * * This function can either be called as a constructor (using `new`) or as a normal function. It always * returns an immutable Version instance. * * The parts of the version number (major, minor, patch, suffix) can be provided in several ways: * - Version("1.2.3-SNAPSHOT") - as a dot-separated string. Any non-numerical char or a dot followed by * a non-numerical char starts the suffix portion. Any missing major, minor or patch versions will be set * to 0. * - Version(1,2,3,"-SNAPSHOT") - as individual parameters. Major, minor and patch must be integer numbers * or empty, suffix must be a string not starting with digits. * - Version([1,2,3,"-SNAPSHOT"]) - as an array with the individual parts. The same type restrictions * apply as before. * - Version(otherVersion) - as a Version instance (cast operation). Returns the given instance instead * of creating a new one. * * To keep the code size small, this implementation mainly validates the single string variant. All other * variants are only validated to some degree. It is the responsibility of the caller to provide proper * parts. */ constructor( /** * the major part of the version (int) or any of the single parameter variants explained above. */ vMajor: int | string | any[] | Version, /** * the minor part of the version number */ iMinor?: int, /** * the patch part of the version number */ iPatch?: int, /** * the suffix part of the version number */ sSuffix?: string ); /** * Compares this version with a given one. * * The version with which this version should be compared can be given as a `sap/base/util/Version` instance, * as a string (e.g. `v.compareTo("1.4.5")`). Or major, minor, patch and suffix values can be given as separate * parameters (e.g. `v.compareTo(1, 4, 5)`) or in an array (e.g. `v.compareTo([1, 4, 5])`). * * * @returns 0, if the given version is equal to this version, a negative value if the given other version * is greater and a positive value otherwise */ compareTo( /** * The major part (an integer) of the version to compare to or the full version in any of the single parameter * variants, as documented for the {@link module:sap/base/util/Version constructor}. */ vOtherMajor: int | string | any[] | Version, /** * A minor version to compare to (only valid when `vOther` is a single integer) */ iOtherMinor?: int, /** * A patch version to compare to (only valid when `vOther` is a single integer) */ iOtherPatch?: int, /** * A version suffix like "-SNAPSHOT" to compare to (only valid when `vOther` is an integer) */ sOtherSuffix?: string ): int; /** * Returns the major version part of this version. * * * @returns the major version part of this version */ getMajor(): int; /** * Returns the minor version part of this version. * * * @returns the minor version part of this version */ getMinor(): int; /** * Returns the patch (or micro) version part of this version. * * * @returns the patch version part of this version */ getPatch(): int; /** * Returns the version suffix of this version. * * * @returns the version suffix of this version */ getSuffix(): string; /** * Checks whether this version is in the range of the given interval (start inclusive, end exclusive). * * The boundaries against which this version should be checked can be given as `sap/base/util/Version` instances * (e.g. `v.inRange(v1, v2)`), as strings (e.g. `v.inRange("1.4", "2.7")`) or as arrays (e.g. `v.inRange([1,4], * [2,7])`). * * * @returns `true` if this version is greater or equal to `vMin` and smaller than `vMax`, `false` otherwise. */ inRange( /** * the start of the range (inclusive) */ vMin: string | any[] | Version, /** * the end of the range (exclusive) */ vMax: string | any[] | Version ): boolean; /** * Returns a string representation of this version. * * * @returns a string representation of this version. */ toString(): string; } } declare module "sap/ui/util/XMLHelper" { /** * Error information as provided by the `DOMParser`. * * Note that the set of properties with meaningful content differs between browsers. */ export type XMLParseErrorInfo = { errorCode?: int; url?: sap.ui.core.URI; reason?: string; srcText?: string; line?: int; linepos?: int; filepos?: int; type?: "error" | "warning"; }; /** * Provides functionality for parsing XML formatted strings and serializing XML documents. * * @since 1.58 */ interface XMLHelper { /** * Extracts parse error information from the specified document (if any). * * If an error was found, the returned object contains a browser-specific subset of the properties described * in {@link module:sap/base/util/XMLHelper.XMLParseErrorInfo XMLParseErrorInfo}. Otherwise, it just contains * an `errorCode` property with value 0. * * * @returns A browser-specific error info object if errors were found, or an object with an errorCode * of 0 only */ getParseError( /** * The parsed XML document */ oDocument: XMLDocument ): XMLParseErrorInfo; /** * Parses the specified XML string into an XML document, using the native parsing functionality of the browser. * If an error occurs during parsing, a {@link module:sap/base/util/XMLHelper.XMLParseErrorInfo parse error info object } * is attached as the `parseError` property of the returned document. * * * @returns the parsed XML document with a `parseError` property as described in {@link #getParseError}. * An error occurred if the `errorCode` property of the `parseError` is not 0. */ parse( /** * An XML string */ sXMLText: string ): XMLDocument; /** * Serializes the specified DOM tree into a string representation. * See: * {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLSerializer/serializeToString} * * * @returns the serialized XML string */ serialize( /** * the XML document object to be serialized as string */ oXMLDocument: Node | Attr ): string; } const XMLHelper: XMLHelper; export default XMLHelper; } declare module "sap/ui/core/AnimationMode" { /** * Enumerable list with available animation modes. * * This enumerable is used to validate the animation mode. Animation modes allow to specify different animation * scenarios or levels. The implementation of the Control (JavaScript or CSS) has to be done differently * for each animation mode. * * @since 1.120 */ enum AnimationMode { /** * `basic` can be used for a reduced, more light-weight set of animations. */ basic = "basic", /** * `full` represents a mode with unrestricted animation capabilities. */ full = "full", /** * `minimal` includes animations of fundamental functionality. */ minimal = "minimal", /** * `none` deactivates the animation completely. */ none = "none", } export default AnimationMode; } declare module "sap/ui/core/ComponentRegistry" { /** * Registry of all `Component`s that currently exist. * * @since 1.120 */ interface ComponentRegistry { /** * Number of existing components. */ size: int; /** * Return an object with all instances of `sap.ui.core.Component`, keyed by their ID. * * Each call creates a new snapshot object. Depending on the size of the UI, this operation therefore might * be expensive. Consider to use the `forEach` or `filter` method instead of executing similar operations * on the returned object. * * **Note**: The returned object is created by a call to `Object.create(null)`, and therefore lacks all * methods of `Object.prototype`, e.g. `toString` etc. * * * @returns Object with all components, keyed by their ID */ all(): Record; /** * Returns an array with components for which the given `callback` returns a value that coerces to `true`. * * The expected signature of the callback is * ```javascript * * function callback(oComponent, sID) * ``` * where `oComponent` is the currently visited component instance and `sID` is the ID of that instance. * * If components are created or destroyed within the `callback`, then the behavior is not specified. Newly * added objects might or might not be visited. When a component is destroyed during the filtering and was * not visited yet, it might or might not be visited. As the behavior for such concurrent modifications * is not specified, it may change in newer releases. * * If a `thisArg` is given, it will be provided as `this` context when calling `callback`. The `this` value * that the implementation of `callback` sees, depends on the usual resolution mechanism. E.g. when `callback` * was bound to some context object, that object wins over the given `thisArg`. * * This function returns an array with all components matching the given predicate. The order of the components * in the array is not specified and might change between calls (over time and across different versions * of UI5). * * * @returns Array of components matching the predicate; order is undefined and might change in newer versions * of UI5 */ filter( /** * predicate against which each Component is tested */ callback: (p1: sap.ui.core.Component, p2: sap.ui.core.ID) => boolean, /** * context object to provide as `this` in each call of `callback` */ thisArg?: Object ): sap.ui.core.Component[]; /** * Calls the given `callback` for each existing component. * * The expected signature of the callback is * ```javascript * * function callback(oComponent, sID) * ``` * where `oComponent` is the currently visited component instance and `sID` is the ID of that instance. * * The order in which the callback is called for components is not specified and might change between calls * (over time and across different versions of UI5). * * If components are created or destroyed within the `callback`, then the behavior is not specified. Newly * added objects might or might not be visited. When a component is destroyed during the filtering and was * not visited yet, it might or might not be visited. As the behavior for such concurrent modifications * is not specified, it may change in newer releases. * * If a `thisArg` is given, it will be provided as `this` context when calling `callback`. The `this` value * that the implementation of `callback` sees, depends on the usual resolution mechanism. E.g. when `callback` * was bound to some context object, that object wins over the given `thisArg`. */ forEach( /** * Function to call for each Component */ callback: (p1: sap.ui.core.Component, p2: sap.ui.core.ID) => void, /** * Context object to provide as `this` in each call of `callback` */ thisArg?: Object ): void; /** * Retrieves a Component by its ID. * * When the ID is `null` or `undefined` or when there's no Component with the given ID, then `undefined` * is returned. * * * @returns Component with the given ID or `undefined` */ get( /** * ID of the Component to retrieve */ id: sap.ui.core.ID ): sap.ui.core.Component | undefined; } const ComponentRegistry: ComponentRegistry; export default ComponentRegistry; } declare module "sap/ui/core/ComponentSupport" { /** * The module `sap/ui/core/ComponentSupport` provides functionality which is used to find declared Components * in the HTML page and to create the Component instances which will be put into a {@link sap.ui.core.ComponentContainer}. * * The {@link module:sap/ui/core/ComponentSupport.run} function is called automatically once the module * has been required. This allows declarative support for components. * * Usage: To enable the `sap/ui/core/ComponentSupport` include it as the `oninit` module in the bootstrap: * * ```javascript * * * ``` * * * To load and render components inside the HTML page, a special data attribute has to be specified on the * respective DOM elements: `data-sap-ui-component`. All DOM elements marked with this data attribute will * be regarded as container elements for the created `ComponentContainer` instances. * * * ```javascript * * * ... *
*
* ... * * ``` * * * Configuration: All configuration settings for the `ComponentContainer` have to be defined as `data` attributes * on the respective HTML tags. Each data attribute will be interpreted as a setting and parsed considering * the data type of the matching property in the `ComponentContainer`. * * **NOTE:** The following `data` attributes for registering event handlers have been deprecated since UI5 * version 1.120 and won't work in the next major version because of the removal of accessing the global * namespace: * - `data-component-created` * - `data-component-failed` * * Alternatively, you can provide your own module in the bootstrap via `oninit`, in which you create an * instance of the {@link sap.ui.core.ComponentContainer ComponentContainer} in the JavaScript code. * * As HTML is case-insensitive, in order to define a property with upper-case characters, you have to "escape" * them with a hyphen character, similar to CSS attributes. The following code gives an example: * * * ```javascript * *
* ``` * * * **Beware:** * * The `ComponentSupport` module enforces asynchronous loading of the respective component and its library * dependencies. This is done by applying default settings for the following properties of the `ComponentContainer`: * * * - `async` {boolean} (**forced to `true`**) * - `manifest` {boolean|string} (**forced to `true` if no string is provided to ensure manifest first**) * * - `lifecycle` {sap.ui.core.ComponentLifecycle} (defaults to `Container`) * - `autoPrefixId` {boolean} (defaults to `true`) * * See {@link https://ui5.sap.com/#/topic/82a0fcecc3cb427c91469bc537ebdddf Declarative API for Initial Components}. * * @since 1.58.0 */ interface ComponentSupport { /** * Find all DOM elements with the attribute `data-sap-ui-component` and parse the attributes from these * DOM elements for the settings of the `ComponentContainer` which will be placed into these DOM elements. * * This function is called automatically once the module has been required. */ run(): void; } const ComponentSupport: ComponentSupport; export default ComponentSupport; } declare module "sap/ui/core/ControlBehavior" { import AnimationMode from "sap/ui/core/AnimationMode"; /** * Provides control behavior relevant configuration options * * @since 1.120 */ interface ControlBehavior { /** * Returns the current animation mode. * * @since 1.120 * * @returns The current animationMode */ getAnimationMode(): AnimationMode; /** * Returns whether the accessibility mode is enabled or not. * * @since 1.120 * * @returns whether the accessibility mode is enabled or not */ isAccessibilityEnabled(): boolean; /** * Sets the current animation mode. * * Expects an animation mode as string and validates it. If a wrong animation mode was set, an error is * thrown. If the mode is valid it is set, then the attributes `data-sap-ui-animation` and `data-sap-ui-animation-mode` * of the HTML document root element are also updated. If the `animationMode` is `AnimationMode.none` the * old `animation` property is set to `false`, otherwise it is set to `true`. * * @since 1.120 */ setAnimationMode( /** * A valid animation mode */ sAnimationMode: AnimationMode | keyof typeof AnimationMode ): void; } const ControlBehavior: ControlBehavior; export default ControlBehavior; } declare module "sap/ui/core/date/CalendarUtils" { import CalendarWeekNumbering from "sap/base/i18n/date/CalendarWeekNumbering"; /** * Provides calendar-related utilities. * * @since 1.108.0 */ interface CalendarUtils { /** * Resolves calendar week configuration. * * Returns an object with the following fields: * - `firstDayOfWeek`: specifies the first day of the week starting with `0` (which is Sunday) * - `minimalDaysInFirstWeek`: minimal days at the beginning of the year which define the first calendar * week * * @since 1.108.0 * * @returns The calendar week configuration, or `undefined for an invalid value of module:sap/base/i18n/date/CalendarWeekNumbering`. */ getWeekConfigurationValues( /** * The calendar week numbering; if omitted, the calendar week numbering of the configuration is used; see * {@link module:sap/base/i18n/Formatting.getCalendarWeekNumbering Formatting.getCalendarWeekNumbering}. * If this value is `Default` the returned calendar week configuration is derived from the given `oLocale`. */ sCalendarWeekNumbering?: | CalendarWeekNumbering | keyof typeof CalendarWeekNumbering, /** * The locale to use; if no locale is given, a locale for the currently configured language is used; see * {@link module:sap/base/i18n/Formatting.getLanguageTag Formatting.getLanguageTag}. Is only used when `sCalendarWeekNumbering` * is set to `Default`. */ oLocale?: sap.ui.core.Locale ): | { firstDayOfWeek: int; minimalDaysInFirstWeek: int; } | undefined; } const CalendarUtils: CalendarUtils; export default CalendarUtils; } declare module "sap/ui/core/date/UI5Date" { /** * A date implementation considering the configured time zone * * A subclass of JavaScript `Date` that considers the configured time zone, see {@link module:sap/base/i18n/Localization.getTimezone Localization.getTimezone}. * All JavaScript `Date` functions that use the local browser time zone, like `getDate`, `setDate`, and * `toString`, are overwritten and use the configured time zone to compute the values. * * Use {@link module:sap/ui/core/date/UI5Date.getInstance} to create new date instances. * * **Note:** Adjusting the time zone in a running application can lead to unexpected data inconsistencies. * For more information, see {@link module:sap/base/i18n/Localization.setTimezone Localization.setTimezone}. * * @since 1.111.0 */ export default class UI5Date extends Date { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Creates a date instance (either JavaScript Date or `UI5Date`) which considers the configured time zone * wherever JavaScript Date uses the local browser time zone, for example in `getDate`, `toString`, or `setHours`. * The supported parameters are the same as the ones supported by the JavaScript Date constructor. * * **Note:** Adjusting the time zone in a running application can lead to unexpected data inconsistencies. * For more information, see {@link module:sap/base/i18n/Localization.setTimezone Localization.setTimezone}. * See: * module:sap/base/i18n/Localization.getTimezone * * * @returns The date instance that considers the configured time zone in all local getters and setters. */ static getInstance( /** * Same meaning as in the JavaScript Date constructor */ vYearOrValue?: int | string | Date | UI5Date | null, /** * Same meaning as in the JavaScript Date constructor */ vMonthIndex?: int | string, /** * Same meaning as in the JavaScript Date constructor */ vDay?: int | string, /** * Same meaning as in the JavaScript Date constructor */ vHours?: int | string, /** * Same meaning as in the JavaScript Date constructor */ vMinutes?: int | string, /** * Same meaning as in the JavaScript Date constructor */ vSeconds?: int | string, /** * Same meaning as in the JavaScript Date constructor */ vMilliseconds?: int | string ): Date | UI5Date; /** * Returns the day of the month of this date instance according to the configured time zone, see `Date.prototype.getDate`. * * * @returns A number between 1 and 31 representing the day of the month of this date instance according * to the configured time zone */ getDate(): int; /** * Returns the day of the week of this date instance according to the configured time zone, see `Date.prototype.getDay`. * * * @returns A number between 0 (Sunday) and 6 (Saturday) representing the day of the week of this date instance * according to the configured time zone */ getDay(): int; /** * Returns the year of this date instance according to the configured time zone, see `Date.prototype.getFullYear`. * * * @returns The year of this date instance according to the configured time zone */ getFullYear(): int; /** * Returns the hours of this date instance according to the configured time zone, see `Date.prototype.getHours`. * * * @returns A number between 0 and 23 representing the hours of this date instance according to the configured * time zone */ getHours(): int; /** * Returns the milliseconds of this date instance according to the configured time zone, see `Date.prototype.getMilliseconds`. * * * @returns A number between 0 and 999 representing the milliseconds of this date instance according to * the configured time zone */ getMilliseconds(): int; /** * Returns the minutes of this date instance according to the configured time zone, see `Date.prototype.getMinutes`. * * * @returns A number between 0 and 59 representing the minutes of this date instance according to the configured * time zone */ getMinutes(): int; /** * Returns the month index of this date instance according to the configured time zone, see `Date.prototype.getMonth`. * * * @returns The month index between 0 (January) and 11 (December) of this date instance according to the * configured time zone */ getMonth(): int; /** * Returns the seconds of this date instance according to the configured time zone, see `Date.prototype.getSeconds`. * * * @returns A number between 0 and 59 representing the seconds of this date instance according to the configured * time zone */ getSeconds(): int; /** * Returns this date object to the given time represented by a number of milliseconds based on the UNIX * epoch, see `Date.prototype.getTime`. * * * @returns The timestamp in milliseconds of this date based on the UNIX epoch, or `NaN` if the date is * an invalid date */ getTime(): int; /** * Returns the difference in minutes between the UTC and the configured time zone for this date, see `Date.prototype.getTimezoneOffset`. * * * @returns The difference in minutes between the UTC and the configured time zone for this date */ getTimezoneOffset(): int; /** * Returns the day of the month of this date instance according to universal time, see `Date.prototype.getUTCDate`. * * * @returns A number between 1 and 31 representing the day of the month of this date instance according * to universal time */ getUTCDate(): int; /** * Returns the day of the week of this date instance according to universal time, see `Date.prototype.getUTCDay`. * * * @returns A number between 0 (Sunday) and 6 (Saturday) representing the day of the week of this date instance * according to universal time */ getUTCDay(): int; /** * Returns the year of this date instance according to universal time, see `Date.prototype.getUTCFullYear`. * * * @returns The year of this date instance according to universal time */ getUTCFullYear(): int; /** * Returns the hours of this date instance according to universal time, see `Date.prototype.getUTCHours`. * * * @returns A number between 0 and 23 representing the hours of this date instance according to universal * time */ getUTCHours(): int; /** * Returns the milliseconds of this date instance according to universal time, see `Date.prototype.getUTCMilliseconds`. * * * @returns A number between 0 and 999 representing the milliseconds of this date instance according to * universal time */ getUTCMilliseconds(): int; /** * Returns the minutes of this date instance according to universal time, see `Date.prototype.getUTCMinutes`. * * * @returns A number between 0 and 59 representing the minutes of this date instance according to universal * time */ getUTCMinutes(): int; /** * Returns the month index of this date instance according to universal time, see `Date.prototype.getUTCMonth`. * * * @returns The month index between 0 (January) and 11 (December) of this date instance according to universal * time */ getUTCMonth(): int; /** * Returns the seconds of this date instance according to universal time, see `Date.prototype.getUTCSeconds`. * * * @returns A number between 0 and 59 representing the seconds of this date instance according to universal * time */ getUTCSeconds(): int; /** * Returns the year of this date instance minus 1900 according to the configured time zone, see `Date.prototype.getYear`. * * @deprecated As of version 1.111. as it is deprecated in the base class JavaScript Date; use {@link #getFullYear } * instead * * @returns The year of this date instance minus 1900 according to the configured time zone */ getYear(): int; /** * Sets the day of the month for this date instance considering the configured time zone, see `Date.prototype.setDate`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setDate( /** * An integer representing the new day value, see `Date.prototype.setDate` */ iDay: int ): int; /** * Sets the year, month and day for this date instance considering the configured time zone, see `Date.prototype.setFullYear`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setFullYear( /** * An integer representing the new year value */ iYear: int, /** * An integer representing the new month index */ iMonth?: int, /** * An integer representing the new day value */ iDay?: int ): int; /** * Sets the hours, minutes, seconds and milliseconds for this date instance considering the configured time * zone, see `Date.prototype.setHours`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setHours( /** * An integer representing the new hour value */ iHours: int, /** * An integer representing the new minutes value */ iMinutes?: int, /** * An integer representing the new seconds value */ iSeconds?: int, /** * An integer representing the new milliseconds value */ iMilliseconds?: int ): int; /** * Sets the milliseconds for this date instance considering the configured time zone, see `Date.prototype.setMilliseconds`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setMilliseconds( /** * An integer representing the new milliseconds value */ iMilliseconds: int ): int; /** * Sets the minutes, seconds and milliseconds for this date instance considering the configured time zone, * see `Date.prototype.setMinutes`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setMinutes( /** * An integer representing the new minutes value */ iMinutes: int, /** * An integer representing the new seconds value */ iSeconds?: int, /** * An integer representing the new milliseconds value */ iMilliseconds?: int ): int; /** * Sets the month and day for this date instance considering the configured time zone, see `Date.prototype.setMonth`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setMonth( /** * An integer representing the new month index */ iMonth: int, /** * An integer representing the new day value */ iDay?: int ): int; /** * Sets the seconds and milliseconds for this date instance considering the configured time zone, see `Date.prototype.setSeconds`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setSeconds( /** * An integer representing the new seconds value */ iSeconds: int, /** * An integer representing the new milliseconds value */ iMilliseconds?: int ): int; /** * Sets this date object to the given time represented by a number of milliseconds based on the UNIX epoch * and resets the previously set date parts, see `Date.prototype.setTime`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setTime( /** * The date time in milliseconds based in the UNIX epoch */ iTime: int ): int; /** * Sets the day of the month for this date instance according to universal time, see `Date.prototype.setUTCDate`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setUTCDate( /** * An integer representing the new day value, see `Date.prototype.setUTCDate` */ iDay: int ): int; /** * Sets the year, month and day for this date instance according to universal time, see `Date.prototype.setUTCFullYear`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setUTCFullYear( /** * An integer representing the new year value */ iYear: int, /** * An integer representing the new month index */ iMonth?: int, /** * An integer representing the new day value */ iDay?: int ): int; /** * Sets the hours, minutes, seconds and milliseconds for this date instance according to universal time, * see `Date.prototype.setUTCHours`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setUTCHours( /** * An integer representing the new hour value */ iHours: int, /** * An integer representing the new minutes value */ iMinutes?: int, /** * An integer representing the new seconds value */ iSeconds?: int, /** * An integer representing the new milliseconds value */ iMilliseconds?: int ): int; /** * Sets the milliseconds for this date instance according to universal time, see `Date.prototype.setUTCMilliseconds`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setUTCMilliseconds( /** * An integer representing the new milliseconds value */ iMilliseconds: int ): int; /** * Sets the minutes, seconds and milliseconds for this date instance according to universal time, see `Date.prototype.setUTCMinutes`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setUTCMinutes( /** * An integer representing the new minutes value */ iMinutes: int, /** * An integer representing the new seconds value */ iSeconds?: int, /** * An integer representing the new milliseconds value */ iMilliseconds?: int ): int; /** * Sets the month and day for this date instance according to universal time, see `Date.prototype.setUTCMonth`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setUTCMonth( /** * An integer representing the new month index */ iMonth: int, /** * An integer representing the new day value */ iDay?: int ): int; /** * Sets the seconds and milliseconds for this date instance according to universal time, see `Date.prototype.setUTCSeconds`. * * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setUTCSeconds( /** * An integer representing the new seconds value */ iSeconds: int, /** * An integer representing the new milliseconds value */ iMilliseconds?: int ): int; /** * Sets the year for this date instance plus 1900 considering the configured time zone, see `Date.prototype.setYear`. * * @deprecated As of version 1.111. as it is deprecated in the base class JavaScript Date; use {@link #setFullYear } * instead * * @returns The milliseconds of the new timestamp based on the UNIX epoch, or `NaN` if the timestamp could * not be updated */ setYear( /** * The year which is to be set for this date. If iYear is a number between 0 and 99 (inclusive), then the * year for this date is set to 1900 + iYear. Otherwise, the year for this date is set to iYear. */ iYear: int ): int; /** * Returns the date portion of this date object interpreted in the configured time zone in English, see * `Date.prototype.toDateString`. * * * @returns The date portion of this date object interpreted in the configured time zone in English */ toDateString(): string; /** * Converts this date to a string, interpreting it in the UTC time zone, see `Date.prototype.toGMTString`. * * * @returns The converted date as string in the UTC time zone */ toGMTString(): string; /** * Converts this date to a string in ISO format in the UTC offset zero time zone, as denoted by the suffix * `Z`, see `Date.prototype.toISOString`. * * * @returns The converted date as a string in ISO format, in the UTC offset zero time zone */ toISOString(): string; /** * Returns a string representation of this date object, see `Date.prototype.toJSON`. * * * @returns The date object representation as a string */ toJSON(): string; /** * Returns a string with a language-dependent representation of the date part of this date object interpreted * by default in the configured time zone, see `Date.prototype.toLocaleDateString`. * * * @returns The language-dependent representation of the date part of this date object */ toLocaleDateString( /** * The locale used for formatting; by default, the string representation of {@link module:sap/base/i18n/Localization.getLanguageTag Localization.getLanguageTag} */ sLocale?: string, /** * The options object used for formatting, corresponding to the options parameter of the `Intl.DateTimeFormat` * constructor */ oOptions?: { /** * The IANA time zone ID; by default {@link module:sap/base/i18n/Localization.getTimezone Localization.getTimezone} */ timeZone?: string; } ): string; /** * Returns a string with a language-dependent representation of this date object interpreted by default * in the configured time zone, see `Date.prototype.toLocaleString`. * * * @returns The language-dependent representation of this date object */ toLocaleString( /** * The locale used for formatting; by default, the string representation of {@link module:sap/base/i18n/Localization.getLanguageTag Localization.getLanguageTag} */ sLocale?: string, /** * The options object used for formatting, corresponding to the options parameter of the `Intl.DateTimeFormat` * constructor */ oOptions?: { /** * The IANA time zone ID; by default {@link module:sap/base/i18n/Localization.getTimezone Localization.getTimezone} */ timeZone?: string; } ): string; /** * Returns a string with a language-dependent representation of the time part of this date object interpreted * by default in the configured time zone, see `Date.prototype.toLocaleTimeString`. * * * @returns The language-dependent representation of the time part of this date object */ toLocaleTimeString( /** * The locale used for formatting; by default, the string representation of {@link module:sap/base/i18n/Localization.getLanguageTag Localization.getLanguageTag} */ sLocale?: string, /** * The options object used for formatting, corresponding to the options parameter of the `Intl.DateTimeFormat` * constructor */ oOptions?: { /** * The IANA time zone ID; by default {@link module:sap/base/i18n/Localization.getTimezone Localization.getTimezone} */ timeZone?: string; } ): string; /** * Returns a string representing this date object interpreted in the configured time zone. * * * @returns A string representing this date object interpreted in the configured time zone */ toString(): string; /** * Returns the time portion of this date object interpreted in the configured time zone in English. * * * @returns The time portion of this date object interpreted in the configured time zone in English */ toTimeString(): string; /** * Converts this date to a string, interpreting it in the UTC time zone, see `Date.prototype.toUTCString`. * * * @returns The converted date as a string in the UTC time zone */ toUTCString(): string; /** * Returns the value of this date object in milliseconds based on the UNIX epoch, see `Date.prototype.valueOf`. * * * @returns The primitive value of this date object in milliseconds based on the UNIX epoch */ valueOf(): int; } } declare module "sap/ui/core/ElementRegistry" { /** * Registry of all `sap.ui.core.Element`s that currently exist. * * @since 1.120 */ interface ElementRegistry { /** * Number of existing elements. */ size: int; /** * Return an object with all instances of `sap.ui.core.Element`, keyed by their ID. * * Each call creates a new snapshot object. Depending on the size of the UI, this operation therefore might * be expensive. Consider to use the `forEach` or `filter` method instead of executing similar operations * on the returned object. * * **Note**: The returned object is created by a call to `Object.create(null)`, and therefore lacks all * methods of `Object.prototype`, e.g. `toString` etc. * * * @returns Object with all elements, keyed by their ID */ all(): Record; /** * Returns an array with elements for which the given `callback` returns a value that coerces to `true`. * * The expected signature of the callback is * ```javascript * * function callback(oElement, sID) * ``` * where `oElement` is the currently visited element instance and `sID` is the ID of that instance. * * If elements are created or destroyed within the `callback`, then the behavior is not specified. Newly * added objects might or might not be visited. When an element is destroyed during the filtering and was * not visited yet, it might or might not be visited. As the behavior for such concurrent modifications * is not specified, it may change in newer releases. * * If a `thisArg` is given, it will be provided as `this` context when calling `callback`. The `this` value * that the implementation of `callback` sees, depends on the usual resolution mechanism. E.g. when `callback` * was bound to some context object, that object wins over the given `thisArg`. * * This function returns an array with all elements matching the given predicate. The order of the elements * in the array is not specified and might change between calls (over time and across different versions * of UI5). * * * @returns Array of elements matching the predicate; order is undefined and might change in newer versions * of UI5 */ filter( /** * predicate against which each element is tested */ callback: (p1: sap.ui.core.Element, p2: sap.ui.core.ID) => boolean, /** * context object to provide as `this` in each call of `callback` */ thisArg?: Object ): sap.ui.core.Element[]; /** * Calls the given `callback` for each element. * * The expected signature of the callback is * ```javascript * * function callback(oElement, sID) * ``` * where `oElement` is the currently visited element instance and `sID` is the ID of that instance. * * The order in which the callback is called for elements is not specified and might change between calls * (over time and across different versions of UI5). * * If elements are created or destroyed within the `callback`, then the behavior is not specified. Newly * added objects might or might not be visited. When an element is destroyed during the filtering and was * not visited yet, it might or might not be visited. As the behavior for such concurrent modifications * is not specified, it may change in newer releases. * * If a `thisArg` is given, it will be provided as `this` context when calling `callback`. The `this` value * that the implementation of `callback` sees, depends on the usual resolution mechanism. E.g. when `callback` * was bound to some context object, that object wins over the given `thisArg`. */ forEach( /** * Function to call for each element */ callback: (p1: sap.ui.core.Element, p2: sap.ui.core.ID) => void, /** * Context object to provide as `this` in each call of `callback` */ thisArg?: Object ): void; /** * Retrieves an Element by its ID. * * When the ID is `null` or `undefined` or when there's no element with the given ID, then `undefined` is * returned. * * * @returns Element with the given ID or `undefined` */ get( /** * ID of the element to retrieve */ id: sap.ui.core.ID ): sap.ui.core.Element | undefined; } const ElementRegistry: ElementRegistry; export default ElementRegistry; } declare module "sap/ui/core/fieldhelp/FieldHelpUtil" { /** * Utility class to set field help information for controls for which field help information cannot be deduced * automatically from OData metadata or for which the automatically deduced field help needs to be overwritten. * These can be controls like filter fields that don't have OData property bindings. * * @since 1.133.0 */ export default class FieldHelpUtil { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Sets the field help information for the given element as `sap-ui-DocumentationRef` custom data. Note * that field help inferred from data bindings of control properties is overwritten by this method unless * an empty array is given in parameter `vDocumentationRefs`. */ static setDocumentationRef( /** * The element on which to set the field help */ oElement: sap.ui.core.Element, /** * The string value or an array of string values of `com.sap.vocabularies.Common.v1.DocumentationRef` OData * annotations, for example `"urn:sap-com:documentation:key?=type=DE&id=MY_ID&origin=MY_ORIGIN"`" */ vDocumentationRefs: string | string[] ): void; } } declare module "sap/ui/core/getCompatibilityVersion" { import Version from "sap/base/util/Version"; /** * Returns the used compatibility version for the given feature. * * @deprecated As of version 1.119. without a replacement. All features that have been controlled by a compatibility * version in UI5 1.x will abandon their legacy behavior, starting with the next major version. In other * words, they will behave as if compatibility version "edge" was configured. Due to this, no more access * to the compatibility version will be required starting with the next major version. * * @returns the used compatibility version */ export default function getCompatibilityVersion( /** * the key of desired feature */ sFeature: string ): Version; } declare module "sap/ui/core/InvisibleRenderer" { /** * Provides the default renderer for the controls that have set their `visible` property to `false`. * * @since 1.66.0 * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ interface InvisibleRenderer { /** * Creates the ID to be used for the invisible placeholder DOM element. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The ID used for the invisible placeholder of this element */ createInvisiblePlaceholderId( /** * The `control` instance for which to create the placeholder ID */ oControl: sap.ui.core.Control ): string; /** * Returns the placeholder DOM element of the provided control. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The placeholder DOM element */ getDomRef( /** * The `control` instance for which to get the placeholder DOM element */ oControl: sap.ui.core.Control ): HTMLElement | null; /** * Renders an invisible placeholder to identify the location of the invisible control within the DOM tree. * * The standard implementation renders an invisible element for controls with `visible:false` * to improve re-rendering performance. Due to the fault tolerance of the HTML5 standard, such * elements are accepted in many scenarios and won't appear in the render tree of the browser. However, * in some cases, controls might need to write a different element if is not an allowed element * (for example, within the or
  • group). In this case, the caller can require this module * and use the third parameter to define the HTML tag. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ render( /** * The `RenderManager` instance */ oRm?: sap.ui.core.RenderManager, /** * The instance of the invisible element */ oElement?: sap.ui.core.Element, /** * HTML tag of the invisible placeholder; void tags are not allowed. */ sTagName?: string ): void; } const InvisibleRenderer: InvisibleRenderer; export default InvisibleRenderer; } declare module "sap/ui/core/message/MessageType" { /** * Specifies possible message types. * * @since 1.118 */ enum MessageType { /** * Message is an error */ Error = "Error", /** * Message should be just an information */ Information = "Information", /** * Message has no specific level */ None = "None", /** * Message is a success message */ Success = "Success", /** * Message is a warning */ Warning = "Warning", } export default MessageType; } declare module "sap/ui/core/Messaging" { /** * Messaging provides a central place for managing `sap.ui.core.message.Message`s. * * @since 1.118.0 */ interface Messaging { /** * Add messages to Messaging */ addMessages( /** * Array of `Message` or single `Message` */ vMessages: sap.ui.core.message.Message | sap.ui.core.message.Message[] ): void; /** * Get the MessageModel * * * @returns oMessageModel The Message Model */ getMessageModel(): sap.ui.model.message.MessageModel; /** * Register MessageProcessor */ registerMessageProcessor( /** * The MessageProcessor */ oProcessor: sap.ui.core.message.MessageProcessor ): void; /** * When using the databinding type system, the validation/parsing of a new property value could fail. In * this case, a validationError/parseError event is fired. These events bubble up to the core. For registered * ManagedObjects, the Messaging attaches to these events and creates a `sap.ui.core.message.Message` (bHandleValidation=true) * for each of these errors and cancels the event bubbling. */ registerObject( /** * The sap.ui.base.ManagedObject */ oObject: sap.ui.base.ManagedObject, /** * Handle validationError/parseError events for this object. If set to true, the Messaging creates a Message * for each validation/parse error. The event bubbling is canceled in every case. */ bHandleValidation: boolean ): void; /** * Remove all messages */ removeAllMessages(): void; /** * Remove given Messages */ removeMessages( /** * The message(s) to be removed. */ vMessages: sap.ui.core.message.Message | sap.ui.core.message.Message[] ): void; /** * Deregister MessageProcessor */ unregisterMessageProcessor( /** * The MessageProcessor */ oProcessor: sap.ui.core.message.MessageProcessor ): void; /** * Unregister ManagedObject */ unregisterObject( /** * The sap.ui.base.ManagedObject */ oObject: sap.ui.base.ManagedObject ): void; /** * Update Messages by providing two arrays of old and new messages. * * The old ones will be removed, the new ones will be added. */ updateMessages( /** * Array of old messages to be removed */ aOldMessages: sap.ui.core.message.Message[], /** * Array of new messages to be added */ aNewMessages: sap.ui.core.message.Message[] ): void; } const Messaging: Messaging; export default Messaging; } declare module "sap/ui/core/StaticArea" { /** * Helper module to access the static area. * * The static area is a hidden DOM element with a unique ID and managed by the framework. It is typically * used for hidden or temporarily hidden elements like InvisibleText, Popup, Shadow, Blocklayer etc. * * All methods throw an `Error` when they are called before the document is ready. */ interface StaticArea { /** * Checks whether the given DOM element is part of the static area. * * * @returns Whether the given DOM reference is part of the static UIArea */ contains( /** * The DOM element to check */ oDomRef: Element ): boolean; /** * Returns the root element of the static, hidden area. * * It can be used e.g. for hiding elements like Popup, Shadow, Blocklayer etc. If it is not yet available, * a DIV element is created and appended to the body. * * * @returns the root DOM element of the static, hidden area */ getDomRef(): Element; /** * Returns the `UIArea` instance for the static area. If none exists yet, one gets created. * * * @returns The `UIArea` instance for the static area */ getUIArea(): sap.ui.core.UIArea; } const StaticArea: StaticArea; export default StaticArea; } declare module "sap/ui/core/syncStyleClass" { /** * Search ancestors of the given source DOM element for the specified CSS class name. * * If the class name is found, set it to the root DOM element of the target control. If the class name is * not found, it is also removed from the target DOM element. * * @since 1.58 * * @returns Target element */ export default function syncStyleClass( /** * CSS class name */ sStyleClass: string, /** * jQuery object, control or an id of the source element. */ vSource: jQuery | sap.ui.core.Control | string, /** * target jQuery object or a control. */ vDestination: jQuery | sap.ui.core.Control ): jQuery | Element; } declare module "sap/ui/core/Theming" { /** * Provides theming related API * * @since 1.118 */ interface Theming { /** * Attaches event handler `fnFunction` to the {@link #event:applied applied} event. * * The given handler is called when the the applied event is fired. If the theme is already applied the * handler will be called immediately. The handler stays attached to the applied event for future theme * changes. * * @since 1.118.0 */ attachApplied( /** * The function to be called, when the event occurs */ fnFunction: (p1: Theming$AppliedEvent) => void ): void; /** * Detaches event handler `fnFunction` from the {@link #event:applied applied} event * * The passed function must match the one used for event registration. * * @since 1.118.0 */ detachApplied( /** * The function to be called, when the event occurs */ fnFunction: (p1: Theming$AppliedEvent) => void ): void; /** * Returns the theme name * * @since 1.118 * * @returns the theme name */ getTheme(): string; /** * Notify content density changes * * @since 1.118.0 */ notifyContentDensityChanged(): void; /** * Sets the favicon. The path must be relative to the current origin. Absolute URLs are not allowed. * * @since 1.135 * * @returns A promise that resolves when the favicon has been set with undefined */ setFavicon( /** * A string containing a specific relative path to the favicon, 'true' to use a favicon from custom theme * or the default favicon in case no custom favicon is maintained, 'false' or undefined to disable the favicon */ vFavicon: string | boolean | undefined ): Promise; /** * Allows setting the theme name * * @since 1.118 */ setTheme( /** * the theme name */ sTheme: string ): void; } const Theming: Theming; export default Theming; /** * The theme applied Event. * * @since 1.118.0 */ export type Theming$AppliedEvent = { /** * The newly set theme. */ theme: string; }; } declare module "sap/ui/dom/containsOrEquals" { /** * Returns whether `oDomRefChild` is contained in or equal to `oDomRefContainer`. * * For compatibility reasons it returns `true` if `oDomRefContainer` and `oDomRefChild` are equal. * * This method intentionally does not operate on the jQuery object, as the original `jQuery.contains()` * method also does not do so. * * @since 1.58 * * @returns Whether `oDomRefChild` is contained in or equal to `oDomRefContainer` */ export default function containsOrEquals( /** * The container element */ oDomRefContainer: Element, /** * The child element (must not be a text node, must be an element) */ oDomRefChild: Element ): boolean; } declare module "sap/ui/dom/denormalizeScrollBeginRTL" { /** * For the given scroll position measured from the "beginning" of a container (the right edge in RTL mode) * this method returns the scrollLeft value as understood by the current browser in RTL mode. This value * is specific to the given DOM element, as the computation may involve its dimensions. * * So when oDomRef should be scrolled 2px from the beginning, the number "2" must be given as `iNormalizedScrollBegin` * and the result of this method (which may be a large or even negative number, depending on the browser) * can then be set as `oDomRef.scrollLeft` to achieve the desired (cross-browser-consistent) scrolling position. * Low values make the right part of the content visible, high values the left part. * * This method does no scrolling on its own, it only calculates the value to set (so it can also be used * for animations). * * Only use this method in RTL mode, as the behavior in LTR mode is undefined and may change! * * @since 1.58 * * @returns The scroll position that must be set for the DOM element */ export default function denormalizeScrollBeginRTL( /** * The distance from the rightmost position to which the element should be scrolled */ iNormalizedScrollBegin: int, /** * The DOM Element to which scrollLeft will be applied */ oDomRef: Element ): int; } declare module "sap/ui/dom/denormalizeScrollLeftRTL" { /** * For the given scrollLeft value this method returns the scrollLeft value as understood by the current * browser in RTL mode. This value is specific to the given DOM element, as the computation may involve * its dimensions. * * So when oDomRef should be scrolled 2px from the leftmost position, the number "2" must be given as `iNormalizedScrollLeft` * and the result of this method (which may be a large or even negative number, depending on the browser) * can then be set as `oDomRef.scrollLeft` to achieve the desired (cross-browser-consistent) scrolling position. * * This method does no scrolling on its own, it only calculates the value to set (so it can also be used * for animations). * * @since 1.58 * * @returns The scroll position that must be set for the DOM element */ export default function denormalizeScrollLeftRTL( /** * The distance from the leftmost position to which the element should be scrolled */ iNormalizedScrollLeft: int, /** * The DOM Element to which scrollLeft will be applied */ oDomRef: Element ): int; } declare module "sap/ui/dom/getOwnerWindow" { /** * Returns the window reference for a DomRef. * * @since 1.58 * * @returns Window reference */ export default function getOwnerWindow( /** * The DOM reference */ oDomRef: Element ): Window; } declare module "sap/ui/dom/getScrollbarSize" { /** * Returns the size (width of the vertical / height of the horizontal) native browser scrollbars. * * This function must only be used when the DOM is ready. * * @since 1.58 * * @returns Object with properties `width` and `height` (the values are of type number and are pixels). */ export default function getScrollbarSize( /** * The CSS class that should be added to the test element. */ sClasses?: string, /** * Force recalculation of size (e.g. when CSS was changed). When no classes are passed all calculated sizes * are reset. */ bForce?: boolean ): { width: number; height: number; }; } declare module "sap/ui/dom/includeScript" { /** * Includes the script (via * ``` * * * This is a shortcut for `sap.ui.getCore().setRoot()`. * * Internally, if a string is given that does not identify a UIArea or a control then implicitly a new `UIArea` * is created for the given DOM reference and the given control is added. * * @deprecated As of version 1.1. use {@link sap.ui.core.Control#placeAt Control#placeAt} instead. */ function setRoot( /** * a DOM Element or Id String of the UIArea */ oDomRef: string | Element | sap.ui.core.Control, /** * the Control that should be added to the `UIArea`. */ oControl: sap.ui.base.Interface | sap.ui.core.Control ): void; /** * Creates a Template for the given ID, DOM reference or a configuration object. * * If no parameter is defined, this function makes a lookup of DOM elements which are specifying a type * attribute. If the value of this type attribute matches a registered type then the content of this DOM * element will be used to create a new `Template` instance. * * If you want to lookup all kind of existing and known templates and parse them directly you can simply * call: * ```javascript * * sap.ui.template(); * ``` * * * To parse a concrete DOM element you can do so by using this function in the following way: * ```javascript * * sap.ui.template("theTemplateId"); * ``` * * * Or you can pass the reference to a DOM element and use this DOM element as a source for the template: * * ```javascript * * sap.ui.template(oDomRef); * ``` * * * The last option to use this function is to pass the information via a configuration object. This configuration * object can be used to pass a context for the templating framework when compiling the template: * ```javascript * * var oTemplateById = sap.ui.template({ * id: "theTemplateId", * context: { ... } * }); * * var oTemplateByDomRef = sap.ui.template({ * domref: oDomRef, * context: { ... } * }); * ``` * * * It can also be used to load a template from another file: * ```javascript * * var oTemplate = sap.ui.template({ * id: "myTemplate", * src: "myTemplate.tmpl" * }); * * var oTemplateWithContext = sap.ui.template({ * id: "myTemplate", * src: "myTemplate.tmpl", * context: { ... } * }); * ``` * * * @deprecated As of version 1.56. use an {@link sap.ui.core.mvc.XMLView XMLView} or {@link sap.ui.core.mvc.JSView JSView } * instead. * * @returns the created Template instance or in case of usage without parameters any array of templates * is returned */ function template( /** * the ID or the DOM reference to the template to lookup or a configuration object containing the src, type * and eventually the ID of the Template. */ oTemplate?: | string | Element | { /** * the ID of the Template / the ID of the DOM element containing the source of the Template */ id: string; /** * the DOM element containing the source of the Template */ domref: Element; /** * the type of the Template */ type?: string; /** * the context for the renderer/templating */ context?: object; /** * the URL to lookup the template (experimental!) */ src?: string; /** * the fully qualified name of the control to declare (experimental!) */ control: string; } ): sap.ui.core.tmpl.Template | sap.ui.core.tmpl.Template[]; /** * Defines or creates an instance of a template view. * * The behavior of this method depends on the signature of the call and on the current context. * * * - View Definition `sap.ui.templateview(sId, vView)`: Defines a view of the given name with the given * implementation. sId must be the views name, vView must be an object and can contain implementations for * any of the hooks provided by templateview * - View Instantiation `sap.ui.templateview(sId?, vView)`: Creates an instance of the view with the given * name (and id). * * Any other call signature will lead to a runtime error. If the id is omitted in the second variant, an * id will be created automatically. * * @deprecated As of version 1.56. use {@link sap.ui.core.mvc.XMLView} in combination with {@link topic:5ee619fc1370463ea674ee04b65ed83b XML Templating } * instead * * @returns the created TemplateView instance in the creation case, otherwise undefined */ function templateview( /** * id of the newly created view, only allowed for instance creation */ sId: string, /** * name or implementation of the view. */ vView: string | object ): sap.ui.core.mvc.TemplateView | undefined; /** * Defines or creates an instance of a template view. * * The behavior of this method depends on the signature of the call and on the current context. * * * - View Definition `sap.ui.templateview(sId, vView)`: Defines a view of the given name with the given * implementation. sId must be the views name, vView must be an object and can contain implementations for * any of the hooks provided by templateview * - View Instantiation `sap.ui.templateview(sId?, vView)`: Creates an instance of the view with the given * name (and id). * * Any other call signature will lead to a runtime error. If the id is omitted in the second variant, an * id will be created automatically. * * @deprecated As of version 1.56. use {@link sap.ui.core.mvc.XMLView} in combination with {@link topic:5ee619fc1370463ea674ee04b65ed83b XML Templating } * instead * * @returns the created TemplateView instance in the creation case, otherwise undefined */ function templateview( /** * name or implementation of the view. */ vView: string | object ): sap.ui.core.mvc.TemplateView | undefined; /** * Creates a view of the given type, name and with the given ID. * * @deprecated As of version 1.56. Use {@link sap.ui.core.mvc.View.extend View.extend} to define the view * class and {@link sap.ui.core.mvc.View.create View.create} to create view instances * * @returns the created View instance */ function view( /** * The ID of the newly created view, only allowed for instance creation. If no ID is given, an ID will be * generated. For view definition, skip this parameter and use `vView` as the first parameter. */ sId?: string, /** * The view name or view configuration object. */ vView?: | string | { /** * Specifies an ID for the view instance. If no ID is given, an ID will be generated. */ id?: object; /** * Corresponds to an XML module that can be loaded via the module system (vView.viewName + suffix ".view.xml"). */ viewName?: object; /** * The controller instance must be a valid controller implementation. The given controller instance overrides * the controller defined in the view definition. */ controller?: sap.ui.core.mvc.Controller; /** * Whether the view source is loaded asynchronously. In asynchronous mode, the view is returned empty, and * the view content is loaded asynchronously. */ async?: boolean; /** * Specifies what kind of view will be instantiated. All valid view types are listed in the enumeration * {@link sap.ui.core.mvc.ViewType}. */ type?: sap.ui.core.mvc.ViewType; /** * Holds application specific data. This data is available during the whole lifecycle of the view and the * controller, for example in the constructor and in the {@link sap.ui.core.mvc.Controller.onInit onInit } * hook. */ viewData?: object; /** * Holds a map from the specified preprocessor type (e.g. "xml") to an array of preprocessor configurations. * Each configuration consists of a `preprocessor` property (optional when registered as on-demand preprocessor) * and may contain further preprocessor-specific settings. */ preprocessors?: Map; } ): sap.ui.core.mvc.View; /** * Loads and instantiates an XML-based fragment. * * To instantiate a fragment that is already defined separately, call: * ```javascript * * sap.ui.xmlfragment(sId?, sFragmentName, oController?); * ``` * * * Advanced usage: * ```javascript * * sap.ui.xmlfragment(oFragmentConfig, oController?); * ``` * In addition to an `id`, the `oFragmentConfig` object can have either a `fragmentName` or a `fragmentContent` * property, but not both. * * @deprecated As of version 1.58. Refer to {@link topic:04129b2798c447368f4c8922c3c33cd7 Instantiation of Fragments}. * * @returns the instantiated root control(s) from the fragment content */ function xmlfragment( /** * ID of the created fragment which will be used as prefix to all contained control IDs. If the first argument * is not an ID, it must be either the fragment name (`sFragmentName`) or a configuration object (`oFragmentConfig`) * as specified below */ vId: | string | { /** * ID of the created fragment which will be used as prefix to all contained control IDs */ id?: string; /** * definition of the fragment content as an XML string that will be used instead of loading the content * from a separate `.fragment.xml` file. When this property is given, any given fragment name is ignored */ fragmentContent?: string; /** * resource name of the fragment module in dot notation without the `.fragment.xml` suffix from the file * name */ fragmentName?: string; }, /** * resource name of the fragment module as specified by `vId.fragmentName` or, in the advanced usage case, * an optional `oController` */ vFragment: string | sap.ui.core.mvc.Controller | object, /** * controller object to be used for methods or event handlers. Can be either the controller of an enclosing * view, a new controller instance, or a simple object with the necessary methods attached. Note that a * fragment has no runtime representation besides its contained controls. Therefore, there is no API to * retrieve the controller from the return value. Note also that fragments may require a controller to be * given and certain methods to be available */ oController?: sap.ui.core.mvc.Controller | object ): sap.ui.core.Control | sap.ui.core.Control[]; /** * Loads and instantiates an XML-based fragment. * * To instantiate a fragment that is already defined separately, call: * ```javascript * * sap.ui.xmlfragment(sId?, sFragmentName, oController?); * ``` * * * Advanced usage: * ```javascript * * sap.ui.xmlfragment(oFragmentConfig, oController?); * ``` * In addition to an `id`, the `oFragmentConfig` object can have either a `fragmentName` or a `fragmentContent` * property, but not both. * * @deprecated As of version 1.58. Refer to {@link topic:04129b2798c447368f4c8922c3c33cd7 Instantiation of Fragments}. * * @returns the instantiated root control(s) from the fragment content */ function xmlfragment( /** * resource name of the fragment module as specified by `vId.fragmentName` or, in the advanced usage case, * an optional `oController` */ vFragment: string | sap.ui.core.mvc.Controller | object, /** * controller object to be used for methods or event handlers. Can be either the controller of an enclosing * view, a new controller instance, or a simple object with the necessary methods attached. Note that a * fragment has no runtime representation besides its contained controls. Therefore, there is no API to * retrieve the controller from the return value. Note also that fragments may require a controller to be * given and certain methods to be available */ oController?: sap.ui.core.mvc.Controller | object ): sap.ui.core.Control | sap.ui.core.Control[]; /** * Instantiates an XMLView of the given name and with the given ID. * * The `vView` can either be the name of the module that contains the view definition or it can be a configuration * object with properties `viewName`, `viewContent` and a `controller` property (more properties are described * in the parameters section below). * * If a `viewName` is given, it behaves the same as when `vView` is a string: the named resource will be * loaded and parsed as XML. Alternatively, an already loaded view definition can be provided as `viewContent`, * either as XML string or as an already parsed XML document. Exactly one of `viewName` and `viewContent` * must be given, if none or both are given, an error will be reported. The `controller` property is optional * and can hold a controller instance. When given, it overrides the controller class defined in the view * definition. * * When property `async` is set to true, the view definition and the controller class (and its dependencies) * will be loaded asynchronously. Any controls used in the view might be loaded sync or async, depending * on the processingMode. Even when the view definition is provided as string or XML Document, controller * or controls might be loaded asynchronously. In any case a view instance will be returned synchronously * by this factory API, but its content (control tree) might appear only later. Also see {@link sap.ui.core.mvc.View#loaded}. * * **Note**: If an XML document is given, it might be modified during view construction. * * **Note**: On root level, you can only define content for the default aggregation, e.g. without adding * the `` tag. If you want to specify content for another aggregation of a view like `dependents`, * place it in a child control's dependents aggregation or add it by using {@link sap.ui.core.mvc.XMLView#addDependent}. * * **Note**: If you enable caching, you need to take care of the invalidation via keys. Automatic invalidation * takes only place if the UI5 version or the component descriptor (manifest.json) change. This is still * an experimental feature and may experience slight changes of the invalidation parameters or the cache * key format. * * Like with any other control, `sId` is optional and an ID will be created automatically. * * @deprecated As of version 1.56. Use {@link sap.ui.core.mvc.XMLView.create XMLView.create} to create view * instances * * @returns the created XMLView instance */ function xmlview( /** * ID of the newly created view */ sId: string, /** * Name of the view or a view configuration object as described above */ vView: | string | { /** * Name of the view resource in module name notation (without suffix) */ viewName?: string; /** * XML string or XML document that defines the view */ viewContent?: string | Document; /** * whether the view source is loaded asynchronously */ async?: boolean; /** * Cache configuration, only for `async` views; caching gets active when this object is provided with vView.cache.keys * array; keys are used to store data in the cache and for invalidation of the cache */ cache?: { /** * Array with strings or Promises resolving with strings */ keys?: Array>; }; /** * Preprocessors configuration, see {@link sap.ui.core.mvc.View} */ preprocessors?: object; /** * Controller instance to be used for this view */ controller?: sap.ui.core.mvc.Controller; } ): sap.ui.core.mvc.XMLView; /** * Instantiates an XMLView of the given name and with the given ID. * * The `vView` can either be the name of the module that contains the view definition or it can be a configuration * object with properties `viewName`, `viewContent` and a `controller` property (more properties are described * in the parameters section below). * * If a `viewName` is given, it behaves the same as when `vView` is a string: the named resource will be * loaded and parsed as XML. Alternatively, an already loaded view definition can be provided as `viewContent`, * either as XML string or as an already parsed XML document. Exactly one of `viewName` and `viewContent` * must be given, if none or both are given, an error will be reported. The `controller` property is optional * and can hold a controller instance. When given, it overrides the controller class defined in the view * definition. * * When property `async` is set to true, the view definition and the controller class (and its dependencies) * will be loaded asynchronously. Any controls used in the view might be loaded sync or async, depending * on the processingMode. Even when the view definition is provided as string or XML Document, controller * or controls might be loaded asynchronously. In any case a view instance will be returned synchronously * by this factory API, but its content (control tree) might appear only later. Also see {@link sap.ui.core.mvc.View#loaded}. * * **Note**: If an XML document is given, it might be modified during view construction. * * **Note**: On root level, you can only define content for the default aggregation, e.g. without adding * the `` tag. If you want to specify content for another aggregation of a view like `dependents`, * place it in a child control's dependents aggregation or add it by using {@link sap.ui.core.mvc.XMLView#addDependent}. * * **Note**: If you enable caching, you need to take care of the invalidation via keys. Automatic invalidation * takes only place if the UI5 version or the component descriptor (manifest.json) change. This is still * an experimental feature and may experience slight changes of the invalidation parameters or the cache * key format. * * Like with any other control, `sId` is optional and an ID will be created automatically. * * @deprecated As of version 1.56. Use {@link sap.ui.core.mvc.XMLView.create XMLView.create} to create view * instances * * @returns the created XMLView instance */ function xmlview( /** * Name of the view or a view configuration object as described above */ vView: | string | { /** * Name of the view resource in module name notation (without suffix) */ viewName?: string; /** * XML string or XML document that defines the view */ viewContent?: string | Document; /** * whether the view source is loaded asynchronously */ async?: boolean; /** * Cache configuration, only for `async` views; caching gets active when this object is provided with vView.cache.keys * array; keys are used to store data in the cache and for invalidation of the cache */ cache?: { /** * Array with strings or Promises resolving with strings */ keys?: Array>; }; /** * Preprocessors configuration, see {@link sap.ui.core.mvc.View} */ preprocessors?: object; /** * Controller instance to be used for this view */ controller?: sap.ui.core.mvc.Controller; } ): sap.ui.core.mvc.XMLView; /** * Provides a specialization of `sap.ui.core.Component` which represents a central application. * * @deprecated As of version 1.15.1. use a {@link sap.ui.core.Component} instead. * @experimental As of version 1.11.1. The Application concept is still under construction, so some implementation * details can be changed in future. */ namespace app { /** * Describes the settings that can be provided to the Application constructor. * * @deprecated As of version 1.15.1. The Component class is enhanced to take care about the Application * code. * @experimental As of version 1.11.1. The Application class is still under construction, so some implementation * details can be changed in future. */ interface $ApplicationSettings extends sap.ui.core.$ComponentSettings { root?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; config?: | any | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; rootComponent?: sap.ui.core.UIComponent; } /** * Describes the settings that can be provided to the MockServer constructor. * * @deprecated As of version 1.15.1. The mock server code has been moved to sap.ui.core.util - see {@link sap.ui.core.util.MockServer} * @experimental As of version 1.13.0. The mock server is still under construction, so some implementation * details can be changed in future. */ interface $MockServerSettings extends sap.ui.base.$ManagedObjectSettings {} /** * Abstract application class. Extend this class to create a central application class. * * @deprecated As of version 1.15.1. The Component class is enhanced to take care about the Application * code. * @experimental As of version 1.11.1. The Application class is still under construction, so some implementation * details can be changed in future. */ abstract class Application extends sap.ui.core.Component { /** * Creates an application instance, only one instance is allowed (singleton). * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * Initial settings for the new application instance */ mSettings?: sap.ui.app.$ApplicationSettings ); /** * Creates an application instance, only one instance is allowed (singleton). * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * Optional ID for the application; generated automatically if no non-empty ID is given. **Note:** this * can be omitted, no matter whether `mSettings` will be given or not */ sId?: string, /** * Initial settings for the new application instance */ mSettings?: sap.ui.app.$ApplicationSettings ); /** * Creates a new subclass of class sap.ui.app.Application with name `sClassName` and enriches it with the * information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.Component.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.app.Application. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ComponentMetadata; /** * Creates and returns the root component. Override this method in your application implementation, if you * want to override the default creation by metadata. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the root component */ createRootComponent(): sap.ui.core.UIComponent; /** * See: * sap.ui.core.Component#destroy */ destroy(): void; /** * Destroys the rootComponent in the aggregation {@link #getRootComponent rootComponent}. * * * @returns Reference to `this` in order to allow method chaining */ destroyRootComponent(): this; /** * Gets current value of property {@link #getConfig config}. * * * @returns Value of property `config` */ getConfig(): any; /** * Gets current value of property {@link #getRoot root}. * * * @returns Value of property `root` */ getRoot(): string; /** * Gets content of aggregation {@link #getRootComponent rootComponent}. */ getRootComponent(): sap.ui.core.UIComponent; /** * Returns the application root component. * * @since 1.13.1 * @deprecated As of version 1.14. superseded by {@link sap.ui.core.Component}. * * @returns The root component */ getView(): sap.ui.core.UIComponent; /** * The main method is called when the DOM and UI5 is completely loaded. Override this method in your Application * class implementation to execute code which relies on a loaded DOM / UI5. */ main(): void; /** * On before exit application hook. Override this method in your Application class implementation, to handle * cleanup before the real exit or to prompt a question to the user, if the application should be exited. * * * @returns return a string if a prompt should be displayed to the user confirming closing the application * (e.g. when the application is not yet saved). */ onBeforeExit(): string; /** * On error hook. Override this method in your Application class implementation to listen to unhandled errors. */ onError( /** * The error message. */ sMessage: string, /** * The file where the error occurred */ sFile: string, /** * The line number of the error */ iLine: number ): void; /** * On exit application hook. Override this method in your Application class implementation, to handle cleanup * of the application. */ onExit(): void; /** * Sets the configuration model. * * @since 1.13.1 */ setConfig( /** * the configuration model, the configuration object or a URI string to load a JSON configuration file. */ vConfig: string | object | sap.ui.model.Model ): void; /** * Sets a new value for property {@link #getRoot root}. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setRoot( /** * New value for property `root` */ sRoot: string ): this; /** * Sets the aggregated {@link #getRootComponent rootComponent}. * * * @returns Reference to `this` in order to allow method chaining */ setRootComponent( /** * The rootComponent to set */ oRootComponent: sap.ui.core.UIComponent ): this; } /** * Class to mock a server. * * @deprecated As of version 1.15.1. The mock server code has been moved to sap.ui.core.util - see {@link sap.ui.core.util.MockServer} * @experimental As of version 1.13.0. The mock server is still under construction, so some implementation * details can be changed in future. */ abstract class MockServer extends sap.ui.base.ManagedObject { /** * Creates a mocked server. This helps to mock all or some backend calls, e.g. for OData/JSON Models or * simple XHR calls, without changing the application code. This class can also be used for qunit tests. */ constructor( /** * optional map/JSON-object with initial property values, aggregated objects etc. for the new object */ mSettings?: sap.ui.app.$MockServerSettings, /** * scope object for resolving string based type and formatter references in bindings */ oScope?: object ); /** * Creates a mocked server. This helps to mock all or some backend calls, e.g. for OData/JSON Models or * simple XHR calls, without changing the application code. This class can also be used for qunit tests. */ constructor( /** * id for the new server object; generated automatically if no non-empty id is given Note: this can be omitted, * no matter whether `mSettings` will be given or not! */ sId?: string, /** * optional map/JSON-object with initial property values, aggregated objects etc. for the new object */ mSettings?: sap.ui.app.$MockServerSettings, /** * scope object for resolving string based type and formatter references in bindings */ oScope?: object ); } } /** * SAPUI5 base classes */ namespace base { namespace ManagedObject { namespace MetadataOptions { /** * An object literal describing an aggregation of a class derived from `sap.ui.base.ManagedObject`. See * {@link sap.ui.base.ManagedObject.MetadataOptions MetadataOptions} for details on its usage. */ type Aggregation = { /** * Type of the new aggregation. Must be the full global name of a ManagedObject subclass or a UI5 interface * (in dot notation, e.g. 'sap.m.Button'). */ type?: string; /** * The default class for the aggregation. If aggregation content is created from a plain object and no explicit * 'Type' is given (capital 'T'), the default class will be instantiated. */ defaultClass?: Function; /** * Whether the aggregation is a 0..1 (false) or a 0..n aggregation (true), defaults to true */ multiple?: boolean; /** * Singular name for 0..n aggregations. For 0..n aggregations the name by convention should be the plural * name. Methods affecting multiple objects in an aggregation will use the plural name (e.g. getItems(), * whereas methods that deal with a single object will use the singular name (e.g. addItem). The framework * knows a set of common rules for building the plural form of English nouns and uses these rules to determine * a singular name on its own. If that name is wrong, a singluarName can be specified with this property. */ singularName?: string; /** * Either 'hidden' or 'public', defaults to 'public'. Aggregations that belong to the API of a class must * be 'public' whereas 'hidden' aggregations typically are used for the implementation of composite classes * (e.g. composite controls). Only public aggregations are accepted by the constructor or by `applySettings` * or in declarative representations like an `XMLView`. Equally, only public aggregations are cloned. */ visibility?: "hidden" | "public"; /** * (Either can be omitted or set to the boolean value `true` or the magic string 'bindable'.) If set to * `true` or 'bindable', additional named methods `bindName` and `unbindName` are generated * as convenience. Despite its name, setting this flag is not mandatory to make the managed aggregation * bindable. The generic methods {@link #bindAggregation} and {@link #unbindAggregation} can always be used. */ bindable?: boolean | "bindable"; /** * If set, this defines a forwarding of objects added to this aggregation into an aggregation of another * ManagedObject - typically to an inner control within a composite control. This means that all adding, * removal, or other operations happening on the source aggregation are actually called on the target instance. * All elements added to the source aggregation will be located at the target aggregation (this means the * target instance is their parent). Both, source and target element will return the added elements when * asked for the content of the respective aggregation. If present, the named (non-generic) aggregation * methods will be called for the target aggregation. Aggregations can only be forwarded to non-hidden aggregations * of the same or higher multiplicity (i.e. an aggregation with multiplicity "0..n" cannot be forwarded * to an aggregation with multiplicity "0..1"). The target aggregation must also be "compatible" to the * source aggregation in the sense that any items given to the source aggregation must also be valid in * the target aggregation (otherwise the target element will throw a validation error). If the forwarded * elements use data binding, the target element must be properly aggregated by the source element to make * sure all models are available there as well. The aggregation target must remain the same instance across * the entire lifetime of the source control. Aggregation forwarding will behave unexpectedly when the content * in the target aggregation is modified by other actors (e.g. by the target element or by another forwarding * from a different source aggregation). Hence, this is not allowed. */ forwarding?: { /** * The name of the aggregation on the target into which the objects shall be forwarded. The multiplicity * of the target aggregation must be the same as the one of the source aggregation for which forwarding * is defined. */ aggregation: string; /** * A string which is appended to the ID of this ManagedObject to construct the ID of the target ManagedObject. * This is one of the two options to specify the target. This option requires the target instance to be * created in the init() method of this ManagedObject and to be always available. */ idSuffix?: string; /** * The name of the function on instances of this ManagedObject which returns the target instance. This second * option to specify the target can be used for lazy instantiation of the target. Note that either idSuffix * or getter must be given. Also note that the target instance returned by the getter must remain the same * over the entire lifetime of this ManagedObject and the implementation assumes that all instances return * the same type of object (at least the target aggregation must always be defined in the same class). */ getter?: string; /** * Whether any binding should happen on the forwarding target or not. Default if omitted is `false`, which * means any bindings happen on the outer ManagedObject. When the binding is forwarded, all binding methods * like updateAggregation, getBindingInfo, refreshAggregation etc. are called on the target element of the * forwarding instead of being called on this element. The basic aggregation mutator methods (add/remove * etc.) are only called on the forwarding target element. Without forwardBinding, they are called on this * element, but forwarded to the forwarding target, where they actually modify the aggregation. */ forwardBinding?: boolean; }; /** * Can be set to a valid CSS selector (as accepted by the {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelector Element.prototype.querySelector } * method). When set, it locates the DOM element that surrounds the aggregation's content. It should only * be set for aggregations that have a visual representation in the DOM. A DOM element surrounding the aggregation's * rendered content should be available in the DOM, even if the aggregation is empty or not rendered for * some reason. In cases where this is not possible or not intended, `getDomRefForSetting` can be overridden, * see below. * * The purpose of the selector is to allow other framework parts like drag and drop or design time tooling * to identify those DOM parts of a control or element that represent a specific aggregation without knowing * the control or element implementation in detail. * * As an extension to the standard CSS selector syntax, the selector string can contain the placeholder * `{id}` (multiple times). Before evaluating the selector in the context of an element or control, all * occurrences of the placeholder have to be replaced by the (potentially escaped) ID of that element or * control. In fact, any selector should start with `#{id}` to ensure that the query result is limited to * the desired element or control. * * **Note**: there is a convenience method {@link sap.ui.core.Element#getDomRefForSetting} that evaluates * the selector in the context of a concrete element or control instance. It also handles the placeholder * `{id}`. Only selected framework features may use that private method, it is not yet a public API and * might be changed or removed in future versions of UI5. However, instead of maintaining the `selector` * in the metadata, element and control classes can overwrite `getDomRefForSetting` to calculate or add * the appropriate DOM Element dynamically. */ selector?: string; /** * Flag that marks the aggregation as deprecated (defaults to false). May lead to an additional warning * log message at runtime when the aggregation is still used. For the documentation, also add a `@deprecated` * tag in the JSDoc, describing since when it is deprecated and what any alternatives are. */ deprecated?: boolean; /** * An optional list of alternative types that may be given instead of the main type. Alternative types may * only be simple types, no descendants of ManagedObject. An example of altTypes being used is the 'tooltip' * aggregation of `sap.ui.core.Element`, which accepts tooltip controls extending `sap.ui.core.TooltipBase` * with their own renderer and design, as well as plain strings, which will simply be displayed using the * browser's built-in tooltip functionality. */ altTypes?: string[]; /** * Only available for aggregations of a class extending `sap.ui.core.Element`, which is a subclass of `sap.ui.base.ManagedObject`! * Defines draggable and droppable configuration of the aggregation. If the `dnd` property is of type Boolean, * then the `draggable` and `droppable` configuration are both set to this Boolean value and the layout * (in case of enabled dnd) is set to default ("Vertical"). */ dnd?: | boolean | { /** * Defines whether elements from this aggregation are draggable or not. The default value is `false`. */ draggable?: boolean; /** * Defines whether the element is droppable (it allows being dropped on by a draggable element) or not. * The default value is `false`. */ droppable?: boolean; /** * The arrangement of the items in this aggregation. This setting is recommended for the aggregation with * multiplicity 0..n (`multiple: true`). Possible values are `Vertical` (e.g. rows in a table) and `Horizontal` * (e.g. columns in a table). It is recommended to use `Horizontal` layout if the visual arrangement of * the aggregation is two-dimensional. */ layout?: "Vertical" | "Horizontal"; }; }; /** * An object literal describing an association of a class derived from `sap.ui.base.ManagedObject`. See * {@link sap.ui.base.ManagedObject.MetadataOptions MetadataOptions} for details on its usage. */ type Association = { /** * Type of the new association */ type?: string; /** * Whether the association is a 0..1 (false) or a 0..n association (true), defaults to false (0..1) for * associations */ multiple?: boolean; /** * Custom singular name. This is only relevant for 0..n associations where the association name should be * defined in plural form and the framework tries to generate the singular form of it for certain places * where it is needed. To do so, the framework knows a set of common rules for building the plural form * of English nouns and uses these rules to determine a singular name on its own. If that name is wrong, * a singularName can be specified with this property. E.g. for an association named `items`, methods affecting * multiple objects in an association will use the plural name (`getItems()`), whereas methods that deal * with a single object will automatically use the generated singular name (e.g. `addItem(...)`). However, * the generated singular form for an association `news` would be `new`, which is wrong, so the singular * name "news" would need to be set. */ singularName?: string; /** * Either 'hidden' or 'public', defaults to 'public'. Associations that belong to the API of a class must * be 'public' whereas 'hidden' associations can only be used internally. Only public associations are accepted * by the constructor or by `applySettings` or in declarative representations like an `XMLView`. Equally, * only public associations are cloned. */ visibility?: "hidden" | "public"; /** * Flag that marks the association as deprecated (defaults to false). May lead to an additional warning * log message at runtime when the association is still used. For the documentation, also add a `@deprecated` * tag in the JSDoc, describing since when it is deprecated and what any alternatives are. */ deprecated?: boolean; }; /** * An object literal describing an event of a class derived from `sap.ui.base.ManagedObject`. See {@link sap.ui.base.ManagedObject.MetadataOptions MetadataOptions } * for details on its usage. */ type Event = { /** * Whether the event allows to prevented the default behavior of the event source */ allowPreventDefault?: boolean; /** * An object literal that describes the parameters of this event; the keys are the parameter names and the * values are objects with a 'type' property that specifies the type of the respective parameter. */ parameters?: Record< string, | { type: string; } | string >; /** * whether event bubbling is enabled on this event. When `true` the event is also forwarded to the parent(s) * of the object (see {@link sap.ui.base.EventProvider#getEventingParent}) until the bubbling of the event * is stopped or no parent is available anymore. */ enableEventBubbling?: boolean; /** * Flag that marks the event as deprecated (defaults to false). May lead to an additional warning log message * at runtime when the event is still used. For the documentation, also add a `@deprecated` tag in the JSDoc, * describing since when it is deprecated and what any alternatives are. */ deprecated?: boolean; }; /** * An object literal describing a property of a class derived from `sap.ui.base.ManagedObject`. See {@link sap.ui.base.ManagedObject.MetadataOptions MetadataOptions } * for details on its usage. */ type Property = { /** * Type of the new property. Must either be one of the built-in types 'string', 'boolean', 'int', 'float', * 'object', 'function' or 'any', or a type created and registered with {@link sap.ui.base.DataType.createType } * or an array type based on one of the previous types (e.g. 'int[]' or 'string[]', but not just 'array'). */ type: string; /** * Either 'hidden' or 'public', defaults to 'public'. Properties that belong to the API of a class must * be 'public' whereas 'hidden' properties can only be used internally. Only public properties are accepted * by the constructor or by `applySettings` or in declarative representations like an `XMLView`. Equally, * only public properties are cloned. */ visibility?: "hidden" | "public"; /** * If set to `true`, the property value will be {@link module:sap/base/util/deepClone deep cloned} on write * and read operations to ensure that the internal value can't be modified by the outside. The property * `byValue` is currently restricted to a `boolean` value. Other types are reserved for future use. Class * definitions must only use boolean values for the flag (or omit it), but readers of ManagedObject metadata * should handle any truthy value as `true` to be future safe. Note that using `byValue:true` has a performance * impact on property access and therefore should be used carefully. It also doesn't make sense to set this * option for properties with a primitive type (they have value semantic anyhow) or for properties with * arrays of primitive types (they are already cloned with a less expensive implementation). Defaults to * 'false'. */ byValue?: boolean; /** * A semantic grouping of the properties, intended to be used in design time tools. Allowed values are (case * sensitive): Accessibility, Appearance, Behavior, Data, Designtime, Dimension, Identification, Misc */ group?: | "Accessibility" | "Appearance" | "Behavior" | "Data" | "Designtime" | "Dimension" | "Identification" | "Misc"; /** * The default value for the property or null if there is no specific default value defined (the data type's * default becomes the default value in this case, e.g. `false` for boolean and the empty string for type * string). Omitting this property means the default value is `undefined`. */ defaultValue?: any; /** * (Either can be omitted or set to the boolean value `true` or the magic string 'bindable'.) If set to * `true` or 'bindable', additional named methods `bindName` and `unbindName` are generated * as convenience. Despite its name, setting this flag is not mandatory to make the managed property bindable. * The generic methods {@link #bindProperty} and {@link #unbindProperty} can always be used. */ bindable?: boolean | "bindable"; /** * Can be set to a valid CSS selector (as accepted by the {@link https://developer.mozilla.org/en-US/docs/Web/API/Element/querySelector Element.prototype.querySelector } * method). When set, it locates the DOM element that represents this property's value. It should only be * set for properties that have a visual text representation in the DOM. * * The purpose of the selector is to allow other framework parts or design time tooling to identify the * DOM parts of a control or element that represent a specific property without knowing the control or element * implementation in detail. * * As an extension to the standard CSS selector syntax, the selector string can contain the placeholder * `{id}` (multiple times). Before evaluating the selector in the context of an element or control, all * occurrences of the placeholder have to be replaced by the (potentially escaped) ID of that element or * control. In fact, any selector should start with `#{id}` to ensure that the query result is limited to * the desired element or control. * * **Note**: there is a convenience method {@link sap.ui.core.Element#getDomRefForSetting} that evaluates * the selector in the context of a concrete element or control instance. It also handles the placeholder * `{id}`. Only selected framework features may use that private method, it is not yet a public API and * might be changed or removed in future versions of UI5. However, instead of maintaining the `selector` * in the metadata, element and control classes can overwrite `getDomRefForSetting` and determine the DOM * element dynamically. */ selector?: string; /** * Flag that marks the property as deprecated (defaults to false). May lead to an additional warning log * message at runtime when the property is still used. For the documentation, also add a `@deprecated` tag * in the JSDoc, describing since when it is deprecated and what any alternatives are. */ deprecated?: boolean; }; } /** * Configuration for the binding of a managed aggregation of cardinality 0..n. * * `path` is the only mandatory property, all others are optional. */ type AggregationBindingInfo = { /** * Path in the model to bind to, either an absolute path or relative to the binding context for the corresponding * model; when the path contains a '>' sign, the string preceding it will override the `model` property * and the remainder after the '>' will be used as binding path */ path: string; /** * Name of the model to bind against; when `undefined` or omitted, the default model is used */ model?: string; /** * The template to clone for each item in the aggregation; either a template or a factory must be given */ template?: sap.ui.base.ManagedObject; /** * Whether the framework should assume that the application takes care of the lifecycle of the given template; * when set to `true`, the template can be used in multiple bindings, either in parallel or over time, and * the framework won't clone it when this `ManagedObject` is cloned; when set to `false`, the lifecycle * of the template is bound to the lifecycle of the binding, when the aggregation is unbound or when this * `ManagedObject` is destroyed, the template also will be destroyed, and when this `ManagedObject` is cloned, * the template will be cloned as well; the third option (`undefined`) only exists for compatibility reasons, * its behavior is not fully reliable and it may leak the template */ templateShareable?: boolean; /** * A factory function that will be called to create an object for each item in the aggregation; this is * an alternative to providing a template object and can be used when the objects should differ depending * on the binding context; the factory function will be called with two parameters: an ID that should be * used for the created object and the binding context for which the object has to be created; the function * must return an object appropriate for the bound aggregation */ factory?: ( p1: string, p2: sap.ui.model.Context ) => sap.ui.base.ManagedObject; /** * Whether the binding should be suspended initially */ suspended?: boolean; /** * the first entry of the list to be created */ startIndex?: int; /** * The amount of entries to be created (may exceed the size limit of the model) */ length?: int; /** * The initial sort order */ sorter?: sap.ui.model.Sorter | sap.ui.model.Sorter[]; /** * The predefined {@link sap.ui.model.FilterType.Application application filters} for this aggregation where * filter values are constants. */ filters?: sap.ui.model.Filter | sap.ui.model.Filter[]; /** * The predefined {@link sap.ui.model.FilterType.ApplicationBound bound application filters} for this aggregation. * Filter values support binding expressions. The aggregation updates its filters whenever a filter value * changes through data binding. Supported since 1.146.0. */ boundFilters?: sap.ui.model.Filter | sap.ui.model.Filter[]; /** * Name of the key property or a function getting the context as only parameter to calculate a key for entries. * This can be used to improve update behaviour in models, where a key is not already available. */ key?: string | ((p1: sap.ui.model.Context) => string); /** * Map of additional parameters for this binding; the names and value ranges of the supported parameters * depend on the model implementation, they should be documented with the `bindList` method of the corresponding * model class or with the model specific subclass of `sap.ui.model.ListBinding` */ parameters?: object; /** * A factory function to generate custom group visualization (optional). It should return a control suitable * to visualize a group header (e.g. a `sap.m.GroupHeaderListItem` for a `sap.m.List`). */ groupHeaderFactory?: (p1: { key: string; }) => sap.ui.base.ManagedObject; /** * Map of event handler functions keyed by the name of the binding events that they should be attached to. * The names and value ranges of the supported events depend on the model implementation and should be documented * with the model-specific subclass of `sap.ui.model.ListBinding`. */ events?: Record; }; /** * The structure of the "metadata" object which is passed when inheriting from sap.ui.base.ManagedObject * using its static "extend" method. See {@link sap.ui.base.ManagedObject.extend} for details on its usage. */ type MetadataOptions = sap.ui.base.Object.MetadataOptions & { /** * Name of the library that the new subclass should belong to. If the subclass is a control or element, * it will automatically register with that library so that authoring tools can discover it. By convention, * the name of the subclass should have the library name as a prefix, but subfolders are allowed, e.g. `sap.ui.layout.form.Form` * belongs to library `sap.ui.layout`. */ library?: string; /** * An object literal whose properties each define a new managed property in the ManagedObject subclass. * The value can either be a simple string which then will be assumed to be the type of the new property * or it can be an object literal with the following properties (see {@link sap.ui.base.ManagedObject.MetadataOptions.Property Property } * for details): type, visibility, byValue, group, defaultValue, bindable, selector Property names should * use camelCase notation, start with a lowercase letter and only use characters from the set [a-zA-Z0-9_$]. * If an aggregation in the literal is preceded by a JSDoc comment (doclet) and if the UI5 plugin and template * are used for JSDoc3 generation, the doclet will be used as generic documentation of the aggregation. * * For each public property 'foo', the following methods will be created by the "extend" method and will * be added to the prototype of the subclass: * - getFoo() - returns the current value of property 'foo'. Internally calls {@link #getProperty} * - setFoo(v) - sets 'v' as the new value of property 'foo'. Internally calls {@link #setProperty} * - bindFoo(c) - (only if property was defined to be 'bindable'): convenience function that wraps {@link #bindProperty } * * - unbindFoo() - (only if property was defined to be 'bindable'): convenience function that wraps {@link #unbindProperty } * For hidden properties, no methods are generated. */ properties?: Record< string, string | sap.ui.base.ManagedObject.MetadataOptions.Property >; /** * When specified, the default property must match the name of one of the properties defined for the new * subclass (either own or inherited). The named property can be used to identify the main property to be * used for bound data. E.g. the value property of a field control. */ defaultProperty?: string; /** * An object literal whose properties each define a new aggregation in the ManagedObject subclass. The value * can either be a simple string which then will be assumed to be the type of the new aggregation or it * can be an object literal with the following properties (see {@link sap.ui.base.ManagedObject.MetadataOptions.Aggregation Aggregation } * for details): type, multiple, singularName, visibility, bindable, forwarding, selector. Aggregation names * should use camelCase notation, start with a lowercase letter and only use characters from the set [a-zA-Z0-9_$]. * The name for a hidden aggregations might start with an underscore. If an aggregation in the literal is * preceded by a JSDoc comment (doclet) and if the UI5 plugin and template are used for JSDoc3 generation, * the doclet will be used as generic documentation of the aggregation. * * For each public aggregation 'item' of cardinality 0..1, the following methods will be created by the * "extend" method and will be added to the prototype of the subclass: * - getItem() - returns the current value of aggregation 'item'. Internally calls {@link #getAggregation } * with a default value of `undefined` * - setItem(o) - sets 'o' as the new aggregated object in aggregation 'item'. Internally calls {@link #setAggregation } * * - destroyItem(o) - destroy a currently aggregated object in aggregation 'item' and clears the aggregation. * Internally calls {@link #destroyAggregation} * - bindItem(c) - (only if aggregation was defined to be 'bindable'): convenience function that wraps * {@link #bindAggregation} * - unbindItem() - (only if aggregation was defined to be 'bindable'): convenience function that wraps * {@link #unbindAggregation} For a public aggregation 'items' of cardinality 0..n, the following * methods will be created: * - getItems() - returns an array with the objects contained in aggregation 'items'. Internally calls * {@link #getAggregation} with a default value of `[]` * - addItem(o) - adds an object as last element in the aggregation 'items'. Internally calls {@link #addAggregation } * * - insertItem(o,p) - inserts an object into the aggregation 'items'. Internally calls {@link #insertAggregation } * * - indexOfItem(o) - returns the position of the given object within the aggregation 'items'. Internally * calls {@link #indexOfAggregation} * - removeItem(v) - removes an object from the aggregation 'items'. Internally calls {@link #removeAggregation } * * - removeAllItems() - removes all objects from the aggregation 'items'. Internally calls {@link #removeAllAggregation } * * - destroyItems() - destroy all currently aggregated objects in aggregation 'items' and clears the aggregation. * Internally calls {@link #destroyAggregation} * - bindItems(c) - (only if aggregation was defined to be 'bindable'): convenience function that wraps * {@link #bindAggregation} * - unbindItems() - (only if aggregation was defined to be 'bindable'): convenience function that wraps * {@link #unbindAggregation} For hidden aggregations, no methods are generated. */ aggregations?: Record< string, string | sap.ui.base.ManagedObject.MetadataOptions.Aggregation >; /** * When specified, the default aggregation must match the name of one of the aggregations defined for the * new subclass (either own or inherited). The named aggregation will be used in contexts where no aggregation * is specified. E,g. when an object in an XMLView embeds other objects without naming an aggregation, as * in the following example: * ```javascript * * * * * * ``` */ defaultAggregation?: string; /** * An object literal whose properties each define a new association of the ManagedObject subclass. The value * can either be a simple string which then will be assumed to be the type of the new association or it * can be an object literal with the following properties (see {@link sap.ui.base.ManagedObject.MetadataOptions.Association Association } * for details): type, multiple, singularName, visibility Association names should use camelCase notation, * start with a lowercase letter and only use characters from the set [a-zA-Z0-9_$]. If an association in * the literal is preceded by a JSDoc comment (doclet) and if the UI5 plugin and template are used for JSDoc3 * generation, the doclet will be used as generic documentation of the association. * * For each association 'ref' of cardinality 0..1, the following methods will be created by the "extend" * method and will be added to the prototype of the subclass: * - getRef() - returns the current value of association 'item'. Internally calls {@link #getAssociation } * with a default value of `undefined` * - setRef(o) - sets 'o' as the new associated object in association 'item'. Internally calls {@link #setAssociation } * For a public association 'refs' of cardinality 0..n, the following methods will be created: * * - getRefs() - returns an array with the objects contained in association 'items'. Internally calls * {@link #getAssociation} with a default value of `[]` * - addRef(o) - adds an object as last element in the association 'items'. Internally calls {@link #addAssociation } * * - removeRef(v) - removes an object from the association 'items'. Internally calls {@link #removeAssociation } * * - removeAllRefs() - removes all objects from the association 'items'. Internally calls {@link #removeAllAssociation } * For hidden associations, no methods are generated. */ associations?: Record< string, string | sap.ui.base.ManagedObject.MetadataOptions.Association >; /** * An object literal whose properties each define a new event of the ManagedObject subclass. In this literal, * the property names are used as event names and the values are object literals describing the respective * event which can have the following properties (see {@link sap.ui.base.ManagedObject.MetadataOptions.Event Event } * for details): allowPreventDefault, parameters Event names should use camelCase notation, start with a * lower-case letter and only use characters from the set [a-zA-Z0-9_$]. If an event in the literal is preceded * by a JSDoc comment (doclet) and if the UI5 plugin and template are used for JSDoc3 generation, the doclet * will be used as generic documentation of the event. * * For each event 'Some' the following methods will be created by the "extend" method and will be added * to the prototype of the subclass: * - attachSome(fn,o) - registers a listener for the event. Internally calls {@link #attachEvent} * - detachSome(fn,o) - deregisters a listener for the event. Internally calls {@link #detachEvent} * - fireSome() - fire the event. Internally calls {@link #fireEvent} */ events?: Record< string, string | sap.ui.base.ManagedObject.MetadataOptions.Event >; /** * Name of a module that implements the designtime part. Alternatively `true` to indicate that the module's * file is named *.designtime.js with the same base name as the class itself. */ designtime?: string | boolean; /** * Special settings are an experimental feature and MUST NOT BE DEFINED in controls or applications outside * of the `sap.ui.core` library. There's no generic or general way how to set or get the values for special * settings. For the same reason, they cannot be bound against a model. If there's a way for consumers to * define a value for a special setting, it must be documented in the class that introduces the setting. */ specialSettings?: Record; }; /** * Configuration for the binding of a managed object * * `path` is the only mandatory property, all others are optional. */ type ObjectBindingInfo = { /** * Path in the model to bind to, either an absolute path or relative to the binding context for the corresponding * model. If the path contains a '>' sign, the string preceding it will override the `model` property, * and the remainder after the '>' sign will be used as binding path */ path: string; /** * Name of the model to bind against; when `undefined` or omitted, the default model is used */ model?: string; /** * Whether the binding is initially suspended */ suspended?: boolean; /** * Map of additional parameters for this binding; the names and value ranges of the supported parameters * depend on the model implementation and should be documented with the `bindContext` method of the corresponding * model class or with the model-specific subclass of `sap.ui.model.ContextBinding` */ parameters?: object; /** * Map of event handler functions keyed by the name of the binding events that they are attached to. The * names and value ranges of the supported events depend on the model implementation and should be documented * with the model-specific subclass of `sap.ui.model.ContextBinding`. */ events?: Record; }; /** * Configuration for the binding of a managed property. * * Exactly one of `path`, `value` or `parts` must be specified. The same configuration can be provided for * the parts of a composite binding, but nesting composite bindings in composite bindings is not yet supported. * * Aggregations with cardinality 0..1 that have a simple, alternative type (aka `altType`), can be bound * with the same kind of configuration, e.g. the `tooltip` aggregation of elements. */ type PropertyBindingInfo = { /** * Path in the model to bind to, either an absolute path or relative to the binding context for the corresponding * model; when the path contains a '>' sign, the string preceding it will override the `model` property * and the remainder after the '>' will be used as binding path */ path?: string; /** * Since 1.61, defines a static binding with the given value. */ value?: string; /** * Name of the model to bind against; when `undefined` or omitted, the default model is used */ model?: string; /** * Whether the binding should be suspended initially */ suspended?: boolean; /** * Function to convert model data into a property value */ formatter?: Function; /** * Whether the parameters to the formatter function should be passed as raw values. In this case the specified * types for the binding parts are not used and the values are not formatted. * * **Note**: use this flag only when using multiple bindings. If you use only one binding and want raw values * then simply don't specify a type for that binding. */ useRawValues?: boolean; /** * Whether the parameters to the formatter function should be passed as the related JavaScript primitive * values. In this case the values of the model are parsed by the {@link sap.ui.model.SimpleType#getModelFormat model format } * of the specified types from the binding parts. * * **Note**: use this flag only when using multiple bindings. */ useInternalValues?: boolean; /** * A type object, or the name or constructor of a type class which is used to create a type object. * * The type will be used for converting model data to a property value (aka "formatting") and vice versa * (in binding mode `TwoWay`, aka "parsing") */ type?: | sap.ui.model.Type | string | (new (p1?: object, p2?: object) => sap.ui.model.Type); /** * Format options to be used when creating the type instance; the structure of the options depends on the * given type class. If a type object is given as `type`, it won't be modified - the formatOptions * will be ignored */ formatOptions?: object; /** * Additional constraints to be used when constructing a type instance. Their structure depends on the given * type class. If a type object is given as `type`, it won't be modified - the `constraints` will be ignored */ constraints?: object; /** * Target type to be used by the type when formatting model data, for example "boolean" or "string" or "any"; * defaults to the property's type */ targetType?: string; /** * Binding mode to be used for this property binding (e.g. one way) */ mode?: sap.ui.model.BindingMode; /** * Map of additional parameters for this binding; the names and value ranges of the supported parameters * depend on the model implementation, they should be documented with the `bindProperty` method of the corresponding * model class or with the model specific subclass of `sap.ui.model.PropertyBinding` */ parameters?: object; /** * Map of event handler functions keyed by the name of the binding events that they should be attached to */ events?: Record; /** * Array of binding info objects for the parts of a composite binding; the structure of each binding info * is the same as described for the `oBindingInfo` as a whole. * * If a part is not specified as a binding info object but as a simple string, a binding info object will * be created with that string as `path`. The string may start with a model name prefix (see property `path`). * * **Note**: recursive composite bindings are currently not supported. Therefore, a part must not contain * a `parts` property. */ parts?: Array; }; } namespace Object { /** * The structure of the "metadata" object which is passed when inheriting from sap.ui.base.Object using * its static "extend" method. See {@link sap.ui.base.Object.extend} for details on its usage. */ type MetadataOptions = { /** * set of names of implemented interfaces (defaults to no interfaces) */ interfaces?: string[]; /** * flag that marks the class as abstract (purely informational, defaults to false) */ abstract?: boolean; /** * flag that marks the class as final (defaults to false) */ final?: boolean; /** * flag that marks the class as deprecated (defaults to false). May lead to an additional warning log message * at runtime when the object is still used. For the documentation, also add a `@deprecated` tag in the * JSDoc, describing since when it is deprecated and what any alternatives are. */ deprecated?: boolean; }; } /** * Contract for objects that can be pooled by an `ObjectPool`. * * Poolable objects must provide a no-arg constructor which is used by the pool to construct new, unused * objects. * * To be more convenient to use, poolable objects should implement their constructor in a way that it either * can be called with no arguments (used by the pool) or with the same signature as their {@link #init } * method (to be used by applications). */ interface Poolable { __implements__sap_ui_base_Poolable: boolean; /** * Called by the `ObjectPool` when this instance will be activated for a caller. * * The same method will be called after a new instance has been created by an otherwise exhausted pool. * * If the caller provided any arguments to {@link sap.ui.base.ObjectPool#borrowObject}, all arguments will * be propagated to this method. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ init( /** * the arguments which were given to {@link sap.ui.base.ObjectPool#borrowObject} */ ...args: any[] ): void; /** * Called by the object pool when an instance is returned to the pool. * * While no specific implementation is required, poolable objects in general should clean all caller specific * state (set to null) in this method to avoid memory leaks and to enforce garbage collection of the caller * state. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ reset(): void; } /** * Describes the settings that can be provided to the ManagedObject constructor. */ interface $ManagedObjectSettings { /** * Unique ID of this instance. If not given, a so called autoID will be generated by the framework. AutoIDs * use a unique prefix that must not be used for Ids that the application (or other code) creates. It can * be configured option 'autoIDPrefix', see {@link https://ui5.sap.com/#/topic/91f2d03b6f4d1014b6dd926db0e91070 Configuration Options and URL Parameters}. */ id?: sap.ui.core.ID; /** * A map of model instances to which the object should be attached. The models are keyed by their model * name. For the default model, String(undefined) is expected. */ models?: object; /** * A map of model instances to which the object should be attached. The models are keyed by their model * name. For the default model, String(undefined) is expected. */ bindingContexts?: object; /** * A map of model instances to which the object should be attached. The models are keyed by their model * name. For the default model, String(undefined) is expected. */ objectBindings?: object; /** * A map of model instances to which the object should be attached. The models are keyed by their model * name. For the default model, String(undefined) is expected. The special setting is only for internal * use. */ metadataContexts?: object; /** * Fired after a new value for a bound property has been propagated to the model. Only fired, when the binding * uses a data type. */ validationSuccess?: ( oEvent: ManagedObject$ValidationSuccessEvent ) => void; /** * Fired when a new value for a bound property should have been propagated to the model, but validating * the value failed with an exception. */ validationError?: (oEvent: ManagedObject$ValidationErrorEvent) => void; /** * Fired when a new value for a bound property should have been propagated to the model, but parsing the * value failed with an exception. */ parseError?: (oEvent: ManagedObject$ParseErrorEvent) => void; /** * Fired when a new value for a bound property should have been propagated from the model, but formatting * the value failed with an exception. */ formatError?: (oEvent: ManagedObject$FormatErrorEvent) => void; /** * Fired when models or contexts are changed on this object (either by calling setModel/setBindingContext * or due to propagation) */ modelContextChange?: (oEvent: sap.ui.base.Event) => void; } /** * Parameters of the ManagedObject#formatError event. */ interface ManagedObject$FormatErrorEventParameters { /** * ManagedObject instance whose property should have received the model update. */ element?: sap.ui.base.ManagedObject; /** * Name of the property for which the binding should have been updated. */ property?: string; /** * Data type used in the binding (if any). */ type?: sap.ui.model.Type; /** * New value (model representation) as propagated from the model. */ newValue?: any; /** * Old value (external representation) as previously stored in the ManagedObject. */ oldValue?: any; } /** * Parameters of the ManagedObject#modelContextChange event. */ interface ManagedObject$ModelContextChangeEventParameters {} /** * Parameters of the ManagedObject#parseError event. */ interface ManagedObject$ParseErrorEventParameters { /** * ManagedObject instance whose property initiated the model update. */ element?: sap.ui.base.ManagedObject; /** * Name of the property for which the bound model property should have been been updated. */ property?: string; /** * Data type used in the binding. */ type?: sap.ui.model.Type; /** * New value (external representation) as parsed by the binding. */ newValue?: any; /** * Old value (external representation) as previously stored in the ManagedObject. */ oldValue?: any; /** * Localized message describing the parse error */ message?: string; } /** * Parameters of the ManagedObject#validationError event. */ interface ManagedObject$ValidationErrorEventParameters { /** * ManagedObject instance whose property initiated the model update. */ element?: sap.ui.base.ManagedObject; /** * Name of the property for which the bound model property should have been been updated. */ property?: string; /** * Data type used in the binding. */ type?: sap.ui.model.Type; /** * New value (external representation) as parsed and validated by the binding. */ newValue?: any; /** * Old value (external representation) as previously stored in the ManagedObject. */ oldValue?: any; /** * Localized message describing the validation issues */ message?: string; } /** * Parameters of the ManagedObject#validationSuccess event. */ interface ManagedObject$ValidationSuccessEventParameters { /** * ManagedObject instance whose property initiated the model update. */ element?: sap.ui.base.ManagedObject; /** * Name of the property for which the bound model property has been updated. */ property?: string; /** * Data type used in the binding. */ type?: sap.ui.model.Type; /** * New value (external representation) as propagated to the model. * * **Note: **the model might modify (normalize) the value again and this modification will be stored in * the ManagedObject. The 'newValue' parameter of this event contains the value **before** such a normalization. */ newValue?: any; /** * Old value (external representation) as previously stored in the ManagedObject. */ oldValue?: any; } /** * Represents the type of properties in a `ManagedObject` class. * * Each type provides some metadata like its {@link #getName qualified name} or its {@link #getBaseType base type } * in case of a derived type. Array types provide information about the allowed {@link #getComponentType type of components } * in an array, enumeration types inform about the set of their allowed {@link #getEnumValues keys and values}. * * Each type has a method to {@link #isValid check whether a value is valid} for a property of that type. * * Already defined types can be looked up by calling {@link #.getType DataType.getType}, new types can only * be created by calling the factory method {@link #.createType DataType.createType}, calling the constructor * will throw an error. * * @since 0.9.0 */ class DataType { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Derives a new type from a given base type. * * Example: * * ```javascript * * * var fooType = DataType.createType('foo', { * isValid : function(vValue) { * return /^(foo(bar)?)$/.test(vValue); * } * }, DataType.getType('string')); * * fooType.isValid('foo'); // true * fooType.isValid('foobar'); // true * fooType.isValid('==foobar=='); // false * * ``` * * * If `mSettings` contains an implementation for `isValid`, then the validity check of the newly created * type will first execute the check of the base type and then call the given `isValid` function. * * Array types and enumeration types cannot be created with this method. They're created on-the-fly by {@link #.getType DataType.getType } * when such a type is looked up. * * **Note:** The creation of new primitive types is not supported. When a type is created without a base * type, it is automatically derived from the primitive type `any`. * * **Note:** If a type has to be used in classes, then the implementation of `isValid` must exactly have * the structure shown in the example above (single return statement, regular expression literal of the * form `/^(...)$/`, calling `/regex/.test()` on the given value). Only the inner part of the regular expression * literal can be different. * * * @returns The newly created type object */ static createType( /** * Unique qualified name of the new type */ sName: string, /** * Settings for the new type */ mSettings?: { /** * Default value for the type (inherited if not given) */ defaultValue?: any; /** * Additional validity check function for values of the type (inherited if not given) */ isValid?: Function; /** * Parse function that converts a locale independent string into a value of the type (inherited if not given) */ parseValue?: Function; }, /** * Base type for the new type */ vBase?: sap.ui.base.DataType | string ): sap.ui.base.DataType; /** * Looks up the type with the given name and returns it. * * See {@link https://ui5.sap.com/#/topic/ac56d92162ed47ff858fdf1ce26c18c4 Defining Control Properties } * for a list of the built-in primitive types and their semantics. * * The lookup consists of the following steps: * - When a type with the given name is already known, it will be returned * - When the name ends with a pair of brackets (`[]`), a type with the name in front of the brackets * (`name.slice(0,-2)`) will be looked up and an array type will be created with the looked-up type as its * component type. If the component type is `undefined`, `undefined` will be returned * - When a global property exists with the same name as the type and when the value of that property * is an instance of `DataType`, that instance will be returned * - When a global property exists with the same name as the type and when the value of that property * is a plain object (its prototype is `Object`), then an enum type will be created, based on the keys and * values in that object. The `parseValue` method of the type will accept any of the keys in the plain object * and convert them to the corresponding value; `isValid` will accept any of the values from the plain object's * keys. The `defaultValue` will be the value of the first key found in the plain object * - When a global property exist with any other, non-falsy value, a warning is logged and the primitive * type 'any' is returned * - If no such global property exist, an error is logged and `undefined` is returned * * UI Libraries and even components can introduce additional types. This method only checks * for types that either have been defined already, or that describe arrays of values of an already defined * type or types whose name matches the global name of a plain object (containing enum keys and values). * This method doesn't try to load modules that might contain type definitions. So before being able to * lookup and use a specific type, the module containing its definition has to be loaded. For that reason * it is suggested that controls (or `ManagedObject` classes in general) declare a dependency to all modules * (typically `some/lib/library.js` modules) that contain the type definitions needed by the specific control * or class definition. * * * @returns Type object or `undefined` when no such type has been defined yet */ static getType( /** * Qualified name of the type to retrieve */ sTypeName: string, /** * Metadata of the property */ oProperty?: sap.ui.base.ManagedObject.MetadataOptions.Property ): sap.ui.base.DataType | undefined; /** * Registers an enum under the given name. With version 2.0, registering an enum becomes mandatory when * said enum is to be used in properties of a {@link sap.ui.base.ManagedObject ManagedObject} subclass. * * Example: * * ```javascript * * DataType.registerEnum("my.enums.Sample", { * "A": "A", * "B": "B", * ... * }); * ``` * * * @since 1.120.0 */ static registerEnum( /** * the type name in dot syntax, e.g. sap.ui.my.EnumType */ sTypeName: string, /** * the enum content */ mContent: object ): void; /** * The base type of this type or undefined if this is a primitive type. * * * @returns Base type or `undefined` */ getBaseType(): sap.ui.base.DataType | undefined; /** * Returns the component type of this type or `undefined` if this is not an array type. * * * @returns Component type or `undefined` */ getComponentType(): sap.ui.base.DataType | undefined; /** * The default value for this type. Each type must define a default value. * * * @returns Default value of the data type. The type of the returned value must match the JavaScript type * of the data type (a string for string types etc.) */ getDefaultValue(): any; /** * Returns the object with keys and values from which this enum type was created or `undefined` if this * is not an enum type. * * * @returns Object with enum keys and values or `undefined` */ getEnumValues(): Record | undefined; /** * The qualified name of the data type. * * * @returns Name of the data type */ getName(): string; /** * Returns the most basic (primitive) type that this type has been derived from. * * If the type is a primitive type by itself, `this` is returned. * * * @returns Primitive type of this type */ getPrimitiveType(): sap.ui.base.DataType; /** * Whether this type is an array type. * * * @returns Whether this type is an array type */ isArrayType(): boolean; /** * Whether this type is an enumeration type. * * * @returns Whether this type is an enum type */ isEnumType(): boolean; /** * Checks whether the given value is valid for this type. * * To be implemented by concrete types. * * * @returns Whether the given value is valid for this data type (without conversion) */ isValid( /** * Value to be checked */ vValue: any ): boolean; /** * Normalizes the given value using the specified normalizer for this data type. * * If no normalizer has been set, the original value is returned. * * * @returns Normalized value */ normalize( /** * Value to be normalized */ oValue: any ): any; /** * Parses the given string value and converts it into the specific data type. * * * @returns Value in the correct internal format */ parseValue( /** * String representation for a value of this type */ sValue: string ): any; /** * Set or unset a normalizer function to be used for values of this data type. * * When a normalizer function has been set, it will be applied to values of this type whenever {@link #normalize } * is called. `ManagedObject.prototype.setProperty` calls the `normalize` method before setting a new value * to a property (normalization is applied on-write, not on-read). * * The `fnNormalize` function has the signature * ```javascript * * fnNormalize(value:any) : any * ``` * It will be called with a value for this type and should return a normalized value (which also must be * valid for the this type). There's no mean to reject a value. The `this` context of the function will * be this type. * * This method allows applications or application frameworks to plug-in a generic value normalization for * a type, e.g. to convert all URLs in some app-specific way before they are applied to controls. It is * not intended to break-out of the value range defined by a type. */ setNormalizer( /** * Function to apply for normalizing */ fnNormalizer: (p1: any) => any ): void; } /** * An Event object consisting of an ID, a source and a map of parameters. Implements {@link sap.ui.base.Poolable } * and therefore an event object in the event handler will be reset by {@link sap.ui.base.ObjectPool} after * the event handler is done. */ class Event< ParamsType extends Record = object, SourceType extends sap.ui.base.EventProvider = sap.ui.base.EventProvider, > extends sap.ui.base.Object implements sap.ui.base.Poolable { __implements__sap_ui_base_Poolable: boolean; /** * Creates an event with the given `sId`, linked to the provided `oSource` and enriched with the `mParameters`. */ constructor( /** * The ID of the event */ sId: string, /** * Source of the event */ oSource: SourceType, /** * Parameters for this event */ oParameters: ParamsType ); /** * Creates a new subclass of class sap.ui.base.Event with name `sClassName` and enriches it with the information * contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.base.Event. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Cancel bubbling of the event. * * **Note:** This function only has an effect if the bubbling of the event is supported by the event source. */ cancelBubble(): void; /** * Returns the id of the event. * * * @returns The ID of the event */ getId(): string; /** * Returns the value of the parameter with the given name. * * * @returns Value of the named parameter */ getParameter( /** * Name of the parameter to return */ sName: ParamName ): ParamsType[ParamName]; /** * Returns an object with all parameter values of the event. * * * @returns All parameters of the event */ getParameters(): ParamsType; /** * Returns the event provider on which the event was fired. * * * @returns The source of the event */ getSource(): T; /** * Init this event with its data. * * The `init` method is called by an object pool when the object is (re-)activated for a new caller. * * When no `oParameters` are given, an empty object is used instead. * See: * sap.ui.base.Poolable.prototype#init * * @ui5-protected Do not call from applications (only from related classes in the framework) */ init( /** * ID of the event */ sId: string, /** * Source of the event */ oSource: SourceType, /** * The event parameters */ oParameters?: ParamsType ): void; /** * Prevent the default action of this event. * * **Note:** This function only has an effect if preventing the default action of the event is supported * by the event source. */ preventDefault(): void; /** * Reset event data, needed for pooling. * See: * sap.ui.base.Poolable.prototype#reset * * @ui5-protected Do not call from applications (only from related classes in the framework) */ reset(): void; } /** * Provides eventing capabilities for objects like attaching or detaching event handlers for events which * are notified when events are fired. */ class EventProvider extends sap.ui.base.Object { /** * Creates an instance of EventProvider. */ constructor(); /** * Creates a new subclass of class sap.ui.base.EventProvider with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.base.EventProvider. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Attaches an event handler to the event with the given identifier. * * * @returns Returns `this` to allow method chaining */ attachEvent( /** * The identifier of the event to listen for */ sEventId: string, /** * An object that will be passed to the handler along with the event object when the event is fired */ oData: object, /** * The handler function to call when the event occurs. This function will be called in the context of the * `oListener` instance (if present) or on the event provider instance. The event object ({@link sap.ui.base.Event}) * is provided as first argument of the handler. Handlers must not change the content of the event. The * second argument is the specified `oData` instance (if present). */ fnFunction: Function, /** * The object that wants to be notified when the event occurs (`this` context within the handler function). * If it is not specified, the handler function is called in the context of the event provider. */ oListener?: object ): this; /** * Attaches an event handler to the event with the given identifier. * * * @returns Returns `this` to allow method chaining */ attachEvent( /** * The identifier of the event to listen for */ sEventId: string, /** * The handler function to call when the event occurs. This function will be called in the context of the * `oListener` instance (if present) or on the event provider instance. The event object ({@link sap.ui.base.Event}) * is provided as first argument of the handler. Handlers must not change the content of the event. The * second argument is the specified `oData` instance (if present). */ fnFunction: Function, /** * The object that wants to be notified when the event occurs (`this` context within the handler function). * If it is not specified, the handler function is called in the context of the event provider. */ oListener?: object ): this; /** * Attaches an event handler, called one time only, to the event with the given identifier. * * When the event occurs, the handler function is called and the handler registration is automatically removed * afterwards. * * * @returns Returns `this` to allow method chaining */ attachEventOnce( /** * The identifier of the event to listen for */ sEventId: string, /** * An object that will be passed to the handler along with the event object when the event is fired */ oData: object, /** * The handler function to call when the event occurs. This function will be called in the context of the * `oListener` instance (if present) or on the event provider instance. The event object ({@link sap.ui.base.Event}) * is provided as first argument of the handler. Handlers must not change the content of the event. The * second argument is the specified `oData` instance (if present). */ fnFunction: Function, /** * The object that wants to be notified when the event occurs (`this` context within the handler function). * If it is not specified, the handler function is called in the context of the event provider. */ oListener?: object ): this; /** * Attaches an event handler, called one time only, to the event with the given identifier. * * When the event occurs, the handler function is called and the handler registration is automatically removed * afterwards. * * * @returns Returns `this` to allow method chaining */ attachEventOnce( /** * The identifier of the event to listen for */ sEventId: string, /** * The handler function to call when the event occurs. This function will be called in the context of the * `oListener` instance (if present) or on the event provider instance. The event object ({@link sap.ui.base.Event}) * is provided as first argument of the handler. Handlers must not change the content of the event. The * second argument is the specified `oData` instance (if present). */ fnFunction: Function, /** * The object that wants to be notified when the event occurs (`this` context within the handler function). * If it is not specified, the handler function is called in the context of the event provider. */ oListener?: object ): this; /** * Cleans up the internal structures and removes all event handlers. * * The object must not be used anymore after destroy was called. * See: * sap.ui.base.Object#destroy */ destroy(): void; /** * Removes a previously attached event handler from the event with the given identifier. * * The passed parameters must match those used for registration with {@link #attachEvent} beforehand. * * * @returns Returns `this` to allow method chaining */ detachEvent( /** * The identifier of the event to detach from */ sEventId: string, /** * The handler function to detach from the event */ fnFunction: Function, /** * The object that wanted to be notified when the event occurred */ oListener?: object ): this; /** * Fires an {@link sap.ui.base.Event event} with the given settings and notifies all attached event handlers. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Returns `this` to allow method chaining. When `preventDefault` is supported on the fired event * the function returns `true` if the default action should be executed, `false` otherwise. */ fireEvent( /** * The identifier of the event to fire */ sEventId: string, /** * Parameters which should be carried by the event */ oParameters?: object, /** * Defines whether function `preventDefault` is supported on the fired event */ bAllowPreventDefault?: boolean, /** * Defines whether event bubbling is enabled on the fired event. Set to `true` the event is also forwarded * to the parent(s) of the event provider ({@link #getEventingParent}) until the bubbling of the event is * stopped or no parent is available anymore. */ bEnableEventBubbling?: boolean ): this | boolean; /** * Returns the parent in the eventing hierarchy of this object. * * Per default this returns null, but if eventing is used in objects, which are hierarchically structured, * this can be overwritten to make the object hierarchy visible to the eventing and enables the use of event * bubbling within this object hierarchy. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The parent event provider */ getEventingParent(): sap.ui.base.EventProvider | null; /** * Returns whether there are any registered event handlers for the event with the given identifier. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Whether there are any registered event handlers */ hasListeners( /** * The identifier of the event */ sEventId: string ): boolean; /** * Returns a string representation of this object. * * In case there is no class or id information, a simple static string is returned. Subclasses should override * this method. * * * @returns A string description of this event provider */ toString(): string; } /** * A class whose instances act as a facade for other objects. * * **Note:** If a class returns a facade in its constructor, only the defined functions will be visible, * no internals of the class can be accessed. */ class Interface { /** * Constructs a facade for the given object, containing only the named methods. * * For each method named in `aMethods`, a wrapper function will be added to the facade. When called, the * wrapper function calls the method with the same name in the original `oObject`, passing all its call * parameters to it without modification. A return value of the original method will be returned to the * caller. Before returning it, values of type `sap.ui.base.Object` will be replaced by their facades, calling * {@link sap.ui.base.Object#getInterface getInterface} on them. * * It is possible to create different facades exposing different sets of methods for the same object, but * as `getInterface` can only return one of those interfaces, the special handling of the return values * doesn't support multiple facades per object. */ constructor( /** * Object for which a facade should be created */ oObject: sap.ui.base.Object, /** * Names of the methods, that should be available in the new facade */ aMethods: string[] ); } /** * Base Class that introduces some basic concepts, such as, state management and data binding. * * New subclasses of ManagedObject are created with a call to {@link #.extend ManagedObject.extend} and * can make use of the following managed features: * * Properties: Managed properties represent the state of a ManagedObject. They can store a single value * of a simple data type (like 'string' or 'int'). They have a name (e.g. 'size') and methods to * get the current value (`getSize`), or to set a new value (`setSize`). When a property is modified by * calling the setter, the ManagedObject is marked as invalidated. A managed property can be bound against * a property in a {@link sap.ui.model.Model} by using the {@link #bindProperty} method. Updates to the * model property will be automatically reflected in the managed property and - if TwoWay databinding is * active, changes to the managed property will be reflected in the model. An existing binding can be removed * by calling {@link #unbindProperty}. * * If a ManagedObject is cloned, the clone will have the same values for its managed properties as the source * of the clone - if the property wasn't bound. If it is bound, the property in the clone will be bound * to the same model property as in the source. * * Details about the declaration of a managed property, the metadata that describes it and the set of methods * that are automatically generated to access it, can be found in the documentation of the {@link sap.ui.base.ManagedObject.extend extend } * method. * * Aggregations: Managed aggregations can store one or more references to other ManagedObjects. They are * a mean to control the lifecycle of the aggregated objects: one ManagedObject can be aggregated by at * most one parent ManagedObject at any time. When a ManagedObject is destroyed, all aggregated objects * are destroyed as well and the object itself is removed from its parent. That is, aggregations won't contain * destroyed objects or null/undefined. * * Aggregations have a name ('e.g 'header' or 'items'), a cardinality ('0..1' or '0..n') and * are of a specific type (which must be a subclass of ManagedObject as well or a UI5 interface). * A ManagedObject will provide methods to set or get the aggregated object for a specific aggregation of * cardinality 0..1 (e.g. `setHeader`, `getHeader` for an aggregation named 'header'). For an aggregation * of cardinality 0..n, there are methods to get all aggregated objects (`getItems`), to locate an object * in the aggregation (e.g. `indexOfItem`), to add, insert or remove a single aggregated object (`addItem`, * `insertItem`, `removeItem`) or to remove or destroy all objects from an aggregation (`removeAllItems`, * `destroyItems`). * * Details about the declaration of a managed aggregation, the metadata that describes the aggregation, * and the set of methods that are automatically generated to access it, can be found in the documentation * of the {@link sap.ui.base.ManagedObject.extend extend} method. * * Aggregations of cardinality 0..n can be bound to a collection in a model by using {@link #bindAggregation } * (and unbound again using {@link #unbindAggregation}). For each context in the model collection, a corresponding * object will be created in the managed aggregation, either by cloning a template object or by calling * a factory function. * * Aggregations also control the databinding context of bound objects: by default, aggregated objects inherit * all models and binding contexts from their parent object. * * When a ManagedObject is cloned, all aggregated objects will be cloned as well - but only if they haven't * been added by databinding. In that case, the aggregation in the clone will be bound to the same model * collection. * * Associations: Managed associations also form a relationship between objects, but they don't define a * lifecycle for the associated objects. They even can 'break' in the sense that an associated object might * have been destroyed already although it is still referenced in an association. For the same reason, the * internal storage for associations are not direct object references but only the IDs of the associated * target objects. * * Associations have a name ('e.g 'initialFocus'), a cardinality ('0..1' or '0..n') and are * of a specific type (which must be a subclass of ManagedObject as well or a UI5 interface). A ManagedObject * will provide methods to set or get the associated object for a specific association of cardinality 0..1 * (e.g. `setInitialFocus`, `getInitialFocus`). For an association of cardinality 0..n, there are methods * to get all associated objects (`getRefItems`), to add, insert or remove a single associated object (`addRefItem`, * `insertRefItem`, `removeRefItem`) or to remove all objects from an association (`removeAllRefItems`). * * Details about the declaration of a managed association, the metadata that describes it and the set of * methods that are automatically generated to access it, can be found in the documentation of the {@link sap.ui.base.ManagedObject.extend extend } * method. * * Associations can't be bound to the model. * * When a ManagedObject is cloned, the result for an association depends on the relationship between the * associated target object and the root of the clone operation. If the associated object is part of the * to-be-cloned object tree (reachable via aggregations from the root of the clone operation), then the * cloned association will reference the clone of the associated object. Otherwise the association will * reference the same object as in the original tree. When a ManagedObject is destroyed, other objects that * are only associated, are not affected by the destroy operation. * * Events: Managed events provide a mean for communicating important state changes to an arbitrary number * of 'interested' listeners. Events have a name and (optionally) a set of parameters. For * each event there will be methods to add or remove an event listener as well as a method to fire the event. * (e.g. `attachChange`, `detachChange`, `fireChange` for an event named 'change'). * * Details about the declaration of managed events, the metadata that describes the event, and the set of * methods that are automatically generated to access it, can be found in the documentation of the {@link sap.ui.base.ManagedObject.extend extend } * method. * * When a ManagedObject is cloned, all listeners registered for any event in the clone source are also registered * to the clone. Later changes are not reflected in any direction (neither from source to clone, nor vice * versa). * * Low Level APIs:: The prototype of ManagedObject provides several generic, low * level APIs to manage properties, aggregations, associations, and events. These generic methods are solely * intended for implementing higher level, non-generic methods that manage a single managed property etc. * (e.g. a function `setSize(value)` that sets a new value for property 'size'). {@link sap.ui.base.ManagedObject.extend } * creates default implementations of those higher level APIs for all managed aspects. The implementation * of a subclass then can override those default implementations with a more specific implementation, e.g. * to implement a side effect when a specific property is set or retrieved. It is therefore important to * understand that the generic low-level methods ARE NOT SUITABLE FOR GENERIC ACCESS to the state of a managed * object, as that would bypass the overriding higher level methods and their side effects. */ abstract class ManagedObject extends sap.ui.base.EventProvider { /** * Constructs and initializes a managed object with the given `sId` and settings. * * If the optional `mSettings` are given, they must be a simple object that defines values for properties, * aggregations, associations or events keyed by their name. * * **Valid Names and Value Ranges:** * * The property (key) names supported in the object literal are exactly the (case sensitive) names documented * in the JSDoc for the properties, aggregations, associations and events of the current class and its base * classes. Note that for 0..n aggregations and associations this name usually is the plural name, whereas * it is the singular name in case of 0..1 relations. * * The possible values for a setting depend on its kind: * - for simple properties, the value has to match the documented type of the property (no type conversion * occurs) * - for 0..1 aggregations, the value has to be an instance of the aggregated type, or an object literal * from which, the default class of the aggregation (or the corresponding aggregation type as fallback) * will be instantiated. * - for 0..n aggregations, the value has to be an array of instances of the aggregated type, a single * instance or an object literal from which the default class will be instantiated. * - for 0..1 associations, an instance of the associated type or an id (string) is accepted * - for 0..n associations, an array of instances of the associated type or of IDs is accepted * - for events, either a function (event handler) is accepted or an array of length 2 where the first * element is a function and the 2nd element is an object to invoke the method on; or an array of length * 3, where the first element is an arbitrary payload object, the second one is a function and the 3rd one * is an object to invoke the method on; or an array of arrays where each nested array has the 2 or 3 element * structure described before (multiple listeners). * * Each subclass should document the name and type of its supported settings in its constructor documentation. * * Example usage: * ```javascript * * new Dialog({ * title: "Some title text", // property of type "string" * showHeader: true, // property of type "boolean" * endButton: new Button(...), // 0..1 aggregation * content: [ // 0..n aggregation * new Input(...), * new Input(...) * ], * afterClose: function(oEvent) { ... } // event handler function * }); * ``` * * * Instead of static values and object instances, data binding expressions can be used, either embedded * in a string or as a binding info object as described in {@link #bindProperty} or {@link #bindAggregation}. * * Example usage: * ```javascript * * new Dialog({ * title: "{/title}", // embedded binding expression, points to a string property in the data model * ... * content: { // binding info object * path : "/inputItems", // points to a collection in the data model * template : new Input(...) * } * }); * ``` * * * Note that when setting string values, any curly braces and backslashes in those values need to be escaped, * so they are not interpreted as binding expressions. Use {@link #escapeSettingsValue} to do so. * * **Note:** As of version 1.120, providing aggregation content via an object literal is deprecated, in * case the object's type is given via the property 'Type' as a string, or is derived via the defined type * of the aggregation. Additionally, as of version 1.120, a ManagedObject subclass can specify a `defaultClass`, * e.g. for cases where only a single class is valid. Please refer to the {@link sap.ui.base.ManagedObject.MetadataOptions.Aggregation Aggregation } * documentation for more details on the `defaultClass`. * * Besides the settings documented below, ManagedObject itself supports the following special settings: * * - `id : sap.ui.core.ID` an ID for the new instance. Some subclasses (Element, Component) require * the id to be unique in a specific scope (e.g. an Element Id must be unique across all Elements, a Component * id must be unique across all Components). `models : object` a map of {@link sap.ui.model.Model } * instances keyed by their model name (alias). Each entry with key k in this object has the same * effect as a call `this.setModel(models[k], k);`. * - `bindingContexts : object` a map of {@link sap.ui.model.Context} instances keyed by their * model name. Each entry with key k in this object has the same effect as a call `this.setBindingContext(bindingContexts[k], * k);` * - `objectBindings : object` a map of binding paths keyed by the corresponding model name. Each * entry with key k in this object has the same effect as a call `this.bindObject(objectBindings[k], * k);` `metadataContexts : object` an array of single binding contexts keyed by the corresponding * model or context name. The purpose of the `metadataContexts` special setting is to deduce as much information * as possible from the binding context of the control in order to be able to predefine certain standard * properties like e.g. visible, enabled, tooltip,... * * The structure is an array of single contexts, where a single context is a map containing the following * keys: * - `path: string (mandatory)` The path to the corresponding model property or object, e.g. '/Customers/Name'. * A path can also be relative, e.g. 'Name' * - `model: string (optional)` The name of the model, in case there is no name then the undefined * model is taken * - `name: string (optional)` A name for the context to used in templating phase * - `kind: string (optional)` The kind of the adapter, either `field` for single properties or * `object` for structured contexts. `adapter: string (optional)` The path to an interpretion * class that dilivers control relevant data depending on the context, e.g. enabled, visible. If not supplied * the OData meta data is interpreted. The syntax for providing the `metadataContexts` is as follows: * `{SINGLE_CONTEXT1},...,{SINGLE_CONTEXTn}` or for simplicity in case there is only one context `{SINGLE_CONTEXT}`. * * Examples for such metadataContexts are: * - `{/Customers/Name}` a single part with an absolute path to the property Name of the Customers * entity set in the default model * - `{path: 'Customers/Name', model:'json'}` a single part with an absolute path to the property Name * of the Customers entity set in a named model * - `{parts: [{path: 'Customers/Name'},{path: 'editable', model: 'viewModel'}]}` a combination of single * binding contexts, one context from the default model and one from the viewModel */ constructor( /** * Optional map/JSON-object with initial property values, aggregated objects etc. for the new object */ mSettings?: sap.ui.base.$ManagedObjectSettings, /** * Scope object for resolving string based type and formatter references in bindings. When a scope object * is given, `mSettings` cannot be omitted, at least `null` or an empty object literal must be given. */ oScope?: object ); /** * Constructs and initializes a managed object with the given `sId` and settings. * * If the optional `mSettings` are given, they must be a simple object that defines values for properties, * aggregations, associations or events keyed by their name. * * **Valid Names and Value Ranges:** * * The property (key) names supported in the object literal are exactly the (case sensitive) names documented * in the JSDoc for the properties, aggregations, associations and events of the current class and its base * classes. Note that for 0..n aggregations and associations this name usually is the plural name, whereas * it is the singular name in case of 0..1 relations. * * The possible values for a setting depend on its kind: * - for simple properties, the value has to match the documented type of the property (no type conversion * occurs) * - for 0..1 aggregations, the value has to be an instance of the aggregated type, or an object literal * from which, the default class of the aggregation (or the corresponding aggregation type as fallback) * will be instantiated. * - for 0..n aggregations, the value has to be an array of instances of the aggregated type, a single * instance or an object literal from which the default class will be instantiated. * - for 0..1 associations, an instance of the associated type or an id (string) is accepted * - for 0..n associations, an array of instances of the associated type or of IDs is accepted * - for events, either a function (event handler) is accepted or an array of length 2 where the first * element is a function and the 2nd element is an object to invoke the method on; or an array of length * 3, where the first element is an arbitrary payload object, the second one is a function and the 3rd one * is an object to invoke the method on; or an array of arrays where each nested array has the 2 or 3 element * structure described before (multiple listeners). * * Each subclass should document the name and type of its supported settings in its constructor documentation. * * Example usage: * ```javascript * * new Dialog({ * title: "Some title text", // property of type "string" * showHeader: true, // property of type "boolean" * endButton: new Button(...), // 0..1 aggregation * content: [ // 0..n aggregation * new Input(...), * new Input(...) * ], * afterClose: function(oEvent) { ... } // event handler function * }); * ``` * * * Instead of static values and object instances, data binding expressions can be used, either embedded * in a string or as a binding info object as described in {@link #bindProperty} or {@link #bindAggregation}. * * Example usage: * ```javascript * * new Dialog({ * title: "{/title}", // embedded binding expression, points to a string property in the data model * ... * content: { // binding info object * path : "/inputItems", // points to a collection in the data model * template : new Input(...) * } * }); * ``` * * * Note that when setting string values, any curly braces and backslashes in those values need to be escaped, * so they are not interpreted as binding expressions. Use {@link #escapeSettingsValue} to do so. * * **Note:** As of version 1.120, providing aggregation content via an object literal is deprecated, in * case the object's type is given via the property 'Type' as a string, or is derived via the defined type * of the aggregation. Additionally, as of version 1.120, a ManagedObject subclass can specify a `defaultClass`, * e.g. for cases where only a single class is valid. Please refer to the {@link sap.ui.base.ManagedObject.MetadataOptions.Aggregation Aggregation } * documentation for more details on the `defaultClass`. * * Besides the settings documented below, ManagedObject itself supports the following special settings: * * - `id : sap.ui.core.ID` an ID for the new instance. Some subclasses (Element, Component) require * the id to be unique in a specific scope (e.g. an Element Id must be unique across all Elements, a Component * id must be unique across all Components). `models : object` a map of {@link sap.ui.model.Model } * instances keyed by their model name (alias). Each entry with key k in this object has the same * effect as a call `this.setModel(models[k], k);`. * - `bindingContexts : object` a map of {@link sap.ui.model.Context} instances keyed by their * model name. Each entry with key k in this object has the same effect as a call `this.setBindingContext(bindingContexts[k], * k);` * - `objectBindings : object` a map of binding paths keyed by the corresponding model name. Each * entry with key k in this object has the same effect as a call `this.bindObject(objectBindings[k], * k);` `metadataContexts : object` an array of single binding contexts keyed by the corresponding * model or context name. The purpose of the `metadataContexts` special setting is to deduce as much information * as possible from the binding context of the control in order to be able to predefine certain standard * properties like e.g. visible, enabled, tooltip,... * * The structure is an array of single contexts, where a single context is a map containing the following * keys: * - `path: string (mandatory)` The path to the corresponding model property or object, e.g. '/Customers/Name'. * A path can also be relative, e.g. 'Name' * - `model: string (optional)` The name of the model, in case there is no name then the undefined * model is taken * - `name: string (optional)` A name for the context to used in templating phase * - `kind: string (optional)` The kind of the adapter, either `field` for single properties or * `object` for structured contexts. `adapter: string (optional)` The path to an interpretion * class that dilivers control relevant data depending on the context, e.g. enabled, visible. If not supplied * the OData meta data is interpreted. The syntax for providing the `metadataContexts` is as follows: * `{SINGLE_CONTEXT1},...,{SINGLE_CONTEXTn}` or for simplicity in case there is only one context `{SINGLE_CONTEXT}`. * * Examples for such metadataContexts are: * - `{/Customers/Name}` a single part with an absolute path to the property Name of the Customers * entity set in the default model * - `{path: 'Customers/Name', model:'json'}` a single part with an absolute path to the property Name * of the Customers entity set in a named model * - `{parts: [{path: 'Customers/Name'},{path: 'editable', model: 'viewModel'}]}` a combination of single * binding contexts, one context from the default model and one from the viewModel */ constructor( /** * ID for the new managed object; generated automatically if no non-empty ID is given **Note:** this can * be omitted, no matter whether `mSettings` will be given or not! */ sId?: string, /** * Optional map/JSON-object with initial property values, aggregated objects etc. for the new object */ mSettings?: sap.ui.base.$ManagedObjectSettings, /** * Scope object for resolving string based type and formatter references in bindings. When a scope object * is given, `mSettings` cannot be omitted, at least `null` or an empty object literal must be given. */ oScope?: object ); /** * Escapes the given value so it can be used in the constructor's settings object. * * Use this method when passing static string values that might contain binding syntax characters. Without * escaping, curly braces in strings would be misinterpreted as data binding expressions. * * **Characters that are escaped:** * - `{` (opening curly brace) - binding expression start * - `}` (closing curly brace) - binding expression end * - `\` (backslash) - escape character itself * * Each of the above characters is prefixed with a backslash, e.g. `{foo}` becomes `\{foo\}`. * * **When to use:** * - Static string values containing curly braces that should be displayed literally * - Rendering escaped backslashes (e.g. expecting `\\\\` to result in `\\`) * - User input or external data used as property values in constructors * - JSON content that should not be parsed as bindings * * Example usage: * ```javascript * * new MyControl({ * // Without escaping: "{info}" would be interpreted as a binding to the path "info" * // With escaping: displays the literal text "{info}" * text: ManagedObject.escapeSettingsValue("{info}") * }); * ``` * * * **Note:** This is only needed when setting values via the constructor or {@link #applySettings}. Setter * method calls, e.g. `setText("{info}")` do not interpret binding syntax and thus do not require escaping. * * @since 1.52 * * @returns The escaped string value, or the original value if not a string */ static escapeSettingsValue( /** * Value to escape; only strings are escaped, other types (e.g. objects) are returned through unchanged. * Strings nested in objects must be escaped individually. */ vValue: any ): any; /** * Defines a new subclass of ManagedObject with name `sClassName` and enriches it with the information contained * in `oClassInfo`. * * `oClassInfo` can contain the same information that {@link sap.ui.base.Object.extend} already accepts, * plus the following new properties in the 'metadata' object literal (see {@link sap.ui.base.ManagedObject.MetadataOptions MetadataOptions } * for details on each of them): * - `library : string` * - `properties : object` * - `defaultProperty : string` * - `aggregations : object` * - `defaultAggregation : string` * - `associations : object` * - `events : object` * - `specialSettings : object` // this one is still experimental and not for public usage! * * Example: * ```javascript * * ManagedObject.extend('sap.mylib.MyClass', { * metadata : { * library: 'sap.mylib', * properties : { * value: 'string', * width: 'sap.ui.core.CSSSize', * height: { type: 'sap.ui.core.CSSSize', defaultValue: '100%'} * description: { type: 'string', defaultValue: '', selector: '#{id}-desc'} * }, * defaultProperty : 'value', * aggregations : { * header : { type: 'sap.mylib.FancyHeader', multiple : false } * items : 'sap.ui.core.Control', * buttons: { type: 'sap.mylib.Button', multiple : true, selector: '#{id} > .sapMLButtonsSection'} * }, * defaultAggregation : 'items', * associations : { * initiallyFocused : { type: 'sap.ui.core.Control' } * }, * events: { * beforeOpen : { * parameters : { * opener : { type: 'sap.ui.core.Control' } * } * } * }, * }, * * init: function() { * } * * }); // end of 'extend' call * ``` * * * * @returns The created class / constructor function */ static extend>( /** * Name of the class to be created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object. If not given, it defaults to `sap.ui.base.ManagedObjectMetadata`. */ FNMetaImpl?: Function ): Function; /** * Returns the metadata for the ManagedObject class. * * * @returns Metadata for the ManagedObject class. */ static getMetadata(): sap.ui.base.ManagedObjectMetadata; /** * Adds some entity `oObject` to the aggregation identified by `sAggregationName`. * * If the given object is not valid with regard to the aggregation (if it is not an instance of the type * specified for that aggregation) or when the method is called for an aggregation of cardinality 0..1, * then an Error is thrown (see {@link #validateAggregation}. * * If the aggregation already has content, the new object will be added after the current content. If the * new object was already contained in the aggregation, it will be moved to the end. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically add an object to an aggregation. Use * the concrete method addXYZ for aggregation 'XYZ' or the generic {@link #applySettings} instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Returns `this` to allow method chaining */ addAggregation( /** * the string identifying the aggregation that `oObject` should be added to. */ sAggregationName: string, /** * the object to add; if empty, nothing is added */ oObject: sap.ui.base.ManagedObject, /** * if true, this ManagedObject as well as the added child are not marked as changed */ bSuppressInvalidate?: boolean ): this; /** * Adds some object with the ID `sId` to the association identified by `sAssociationName` and marks this * ManagedObject as changed. * * This method does not avoid duplicates. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically add an object to an association. Use * the concrete method addXYZ for association 'XYZ' or the generic {@link #applySettings} instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Returns `this` to allow method chaining */ addAssociation( /** * the string identifying the association the object should be added to. */ sAssociationName: string, /** * the ID of the ManagedObject object to add; if empty, nothing is added; if a `sap.ui.base.ManagedObject` * is given, its ID is added */ sId: string | sap.ui.base.ManagedObject, /** * if true, this managed object as well as the newly associated object are not marked as changed */ bSuppressInvalidate?: boolean ): this; /** * Sets all the properties, aggregations, associations and event handlers as given in the object literal * `mSettings`. If a property, aggregation, etc. is not listed in `mSettings`, then its value is not changed * by this method. * * For properties and 0..1 aggregations/associations, any given setting overwrites the current value. For * 0..n aggregations, the given values are appended; event listeners are registered in addition to existing * ones. * * For the possible keys and values in `mSettings` see the general documentation in {@link sap.ui.base.ManagedObject } * or the specific documentation of the constructor of the concrete managed object class. * * * @returns Returns `this` to allow method chaining */ applySettings( /** * the settings to apply to this managed object */ mSettings: sap.ui.base.$ManagedObjectSettings, /** * Scope object to resolve types and formatters */ oScope?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:formatError formatError} event of this `sap.ui.base.ManagedObject`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.base.ManagedObject` itself. * * Fired when a new value for a bound property should have been propagated from the model, but formatting * the value failed with an exception. * * * @returns Reference to `this` in order to allow method chaining */ attachFormatError( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: ManagedObject$FormatErrorEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.base.ManagedObject` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:formatError formatError} event of this `sap.ui.base.ManagedObject`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.base.ManagedObject` itself. * * Fired when a new value for a bound property should have been propagated from the model, but formatting * the value failed with an exception. * * * @returns Reference to `this` in order to allow method chaining */ attachFormatError( /** * The function to be called when the event occurs */ fnFunction: (p1: ManagedObject$FormatErrorEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.base.ManagedObject` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:modelContextChange modelContextChange} event * of this `sap.ui.base.ManagedObject`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.base.ManagedObject` itself. * * Fired when models or contexts are changed on this object (either by calling setModel/setBindingContext * or due to propagation) * * * @returns Reference to `this` in order to allow method chaining */ attachModelContextChange( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.base.ManagedObject` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:modelContextChange modelContextChange} event * of this `sap.ui.base.ManagedObject`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.base.ManagedObject` itself. * * Fired when models or contexts are changed on this object (either by calling setModel/setBindingContext * or due to propagation) * * * @returns Reference to `this` in order to allow method chaining */ attachModelContextChange( /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.base.ManagedObject` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:parseError parseError} event of this `sap.ui.base.ManagedObject`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.base.ManagedObject` itself. * * Fired when a new value for a bound property should have been propagated to the model, but parsing the * value failed with an exception. * * * @returns Reference to `this` in order to allow method chaining */ attachParseError( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: ManagedObject$ParseErrorEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.base.ManagedObject` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:parseError parseError} event of this `sap.ui.base.ManagedObject`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.base.ManagedObject` itself. * * Fired when a new value for a bound property should have been propagated to the model, but parsing the * value failed with an exception. * * * @returns Reference to `this` in order to allow method chaining */ attachParseError( /** * The function to be called when the event occurs */ fnFunction: (p1: ManagedObject$ParseErrorEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.base.ManagedObject` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:validationError validationError} event of this * `sap.ui.base.ManagedObject`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.base.ManagedObject` itself. * * Fired when a new value for a bound property should have been propagated to the model, but validating * the value failed with an exception. * * * @returns Reference to `this` in order to allow method chaining */ attachValidationError( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: ManagedObject$ValidationErrorEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.base.ManagedObject` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:validationError validationError} event of this * `sap.ui.base.ManagedObject`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.base.ManagedObject` itself. * * Fired when a new value for a bound property should have been propagated to the model, but validating * the value failed with an exception. * * * @returns Reference to `this` in order to allow method chaining */ attachValidationError( /** * The function to be called when the event occurs */ fnFunction: (p1: ManagedObject$ValidationErrorEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.base.ManagedObject` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:validationSuccess validationSuccess} event of * this `sap.ui.base.ManagedObject`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.base.ManagedObject` itself. * * Fired after a new value for a bound property has been propagated to the model. Only fired, when the binding * uses a data type. * * * @returns Reference to `this` in order to allow method chaining */ attachValidationSuccess( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: ManagedObject$ValidationSuccessEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.base.ManagedObject` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:validationSuccess validationSuccess} event of * this `sap.ui.base.ManagedObject`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.base.ManagedObject` itself. * * Fired after a new value for a bound property has been propagated to the model. Only fired, when the binding * uses a data type. * * * @returns Reference to `this` in order to allow method chaining */ attachValidationSuccess( /** * The function to be called when the event occurs */ fnFunction: (p1: ManagedObject$ValidationSuccessEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.base.ManagedObject` itself */ oListener?: object ): this; /** * Bind an aggregation to the model. * * Whenever the corresponding model becomes available or changes (either via a call to {@link #setModel setModel } * or propagated from a {@link #getParent parent}), its {@link sap.ui.model.Model#bindList bindList} method * will be called to create a new {@link sap.ui.model.ListBinding ListBinding} with the configured binding * options. * * The bound aggregation will use the given template, clone it for each item which exists in the bound list * and set the appropriate binding context. * * This is a generic method which can be used to bind any aggregation to the model. A class may flag aggregations * in its metadata with `bindable: "bindable"` to get typed `bindSomething` and `unbindSomething` * methods for those aggregations. * * Also see {@link https://ui5.sap.com/#/topic/91f057786f4d1014b6dd926db0e91070 List Binding (Aggregation Binding) } * in the documentation. * * For more information on the `oBindingInfo.key` property and its usage, see {@link https://ui5.sap.com/#/topic/7cdff73f308b4b10bdf7d83b7aba72e7 Extended Change Detection}. * * Providing sorters and/or filters as positional parameters is deprecated as of 1.135.0. Provide them as * part of a `BindingInfo` object instead. * * * @returns Returns `this` to allow method chaining */ bindAggregation( /** * Name of a public aggregation to bind */ sName: string, /** * A `BindingInfo` object or just the path, if no further properties are required */ vBindingInfo: | sap.ui.base.ManagedObject.AggregationBindingInfo | string, /** * The template to clone for each item in the aggregation; either a template `Element` or a factory function * must be given */ vTemplate?: | sap.ui.base.ManagedObject | (( p1: string, p2: sap.ui.model.Context ) => sap.ui.base.ManagedObject) ): this; /** * Bind the object to the referenced entity in the model, which is used as the binding context to resolve * bound properties or aggregations of the object itself and all of its children relatively to the given * path. * * @deprecated As of version 1.11.1. please use {@link #bindObject} instead. * * @returns reference to the instance itself */ bindContext( /** * the binding path */ sPath: string ): this; /** * Bind the object to the referenced entity in the model. * * The entity is used as the binding context to resolve bound properties or aggregations of the object itself * and all of its children relatively to the given path. If a relative binding path is used, it will be * evaluated anew whenever the parent context changes. * * Whenever the corresponding model becomes available or changes (either via a call to {@link #setModel setModel } * or propagated from a {@link #getParent parent}), its {@link sap.ui.model.Model#bindContext bindContext } * method will be called to create a new {@link sap.ui.model.ContextBinding ContextBinding} with the configured * binding options. * * There's no difference between `bindObject` and {@link sap.ui.core.Element#bindElement bindElement}. Method * `bindObject` was introduced together with `ManagedObject` to make context bindings also available on * `ManagedObject`s. The new name was chosen to reflect that the binding is not necessarily applied to an * `Element`, it also could be applied to a component or some other `ManagedObject`. * * Also see {@link https://ui5.sap.com/#/topic/91f05e8b6f4d1014b6dd926db0e91070 Context Binding} in the * documentation. * * As of 1.135, providing 'parameters' as positional parameter is deprecated. Provide them as part of a * `BindingInfo` object instead. * * * @returns Returns `this` to allow method chaining */ bindObject( /** * A `BindingInfo` object or just the path, if no further properties are required */ vBindingInfo: sap.ui.base.ManagedObject.ObjectBindingInfo | string ): this; /** * Binds a property to the model. * * Whenever the corresponding model becomes available or changes (either via a call to {@link #setModel setModel } * or propagated from a {@link #getParent parent}), its {@link sap.ui.model.Model#bindProperty bindProperty } * method will be called to create a new {@link sap.ui.model.PropertyBinding PropertyBinding} with the configured * binding options. * * The Setter for the given property will be called by the binding with the value retrieved from the data * model. When the binding mode is `OneTime`, the property will be set only once. When it is `OneWay`, the * property will be updated whenever the corresponding data in the model changes. In mode `TwoWay`, changes * to the property (not originating in the model) will be reported back to the model (typical use case: * user interaction changes the value of a control). * * This is a generic method which can be used to bind any property to the model. A managed object may flag * any property in its metadata with `bindable: "bindable"` to additionally provide named methods to bind * and unbind the corresponding property. * * **Composite Binding** * A composite property binding which combines data from multiple model paths can be declared using the * `parts` parameter instead of `path`. The `formatter` function or a {@link sap.ui.model.CompositeType composite type } * then can be used to combine the parts, Properties with a composite binding are also known as "calculated * fields". * * Example: * ```javascript * * oTxt.bindValue({ * parts: [ * {path: "/firstName", type: "sap.ui.model.type.String"}, * {path: "myModel2>/lastName"} * ] * }); * ``` * * * Note that a composite binding will be forced into mode `OneWay` when one of the binding parts is not * in mode `TwoWay`. * * **Static Binding** * A StaticBinding allows to define static values within a `sap.ui.model.CompositeBinding`. It behaves * like a property binding but always returns the value that is stored in the binding itself. The binding * does not have a `sap.ui.model.Context`, a `sap.ui.model.Model` or a `oBindingInfo.path`. A StaticBinding * is created when a `oBindingInfo.value` is passed instead of a `oBindingInfo.path` or `oBindingInfo.parts[i].path`. * * Also see {@link sap.ui.model.StaticBinding StaticBinding} in the documentation. * * **Formatter Functions** * When a formatter function is specified for the binding or for a binding part, it will be called with * the value of the bound model property. After setting the initial property value, the formatter function * will only be called again when the bound model property changes (simple property binding) or when at * least one of the bound model properties changes (formatter function of a composite binding). Note that * a binding only monitors the bound model data for changes. Dependencies of the formatter implementation * to other model data is not known to the binding and changes won't be detected. * * When the formatter for a property binding (simple or composite) is called, the managed object will be * given as `this` context. For formatters of binding parts in a composite binding, this is not the case. * * Also see {@link https://ui5.sap.com/#/topic/91f0652b6f4d1014b6dd926db0e91070 Property Binding} in the * documentation. * * Providing a type, formatter, or bindingMode as a positional parameter is deprecated as of 1.135.0. Provide * them as part of a `BindingInfo` object instead. * * * @returns Returns `this` to allow method chaining */ bindProperty( /** * Name of a public property to bind; public aggregations of cardinality 0..1 that have an alternative, * simple type (e.g. "string" or "int") can also be bound with this method */ sName: string, /** * A `BindingInfo` object or just the path, if no further properties are required */ vBindingInfo: sap.ui.base.ManagedObject.PropertyBindingInfo | string ): this; /** * Clones a tree of objects starting with the object on which clone is called first (root object). * * The IDs within the newly created clone tree are derived from the original IDs by appending the given * `sIdSuffix` (if no suffix is given, one will be created; it will be unique across multiple clone calls). * * The `oOptions` configuration object can have the following properties: * - The boolean value `cloneChildren` specifies whether associations/aggregations will be cloned * - The boolean value `cloneBindings` specifies if bindings will be cloned Note: In case the configuration * `oOptions` is specified, the default values `true` no longer apply, which means in case `cloneChildren` * or `cloneBindings` is not specified, then this ia assumed to be `false` and associations/aggregations * or bindings are not cloned. * * For each cloned object, the following settings are cloned based on the metadata of the object and the * defined options: * - All properties that are not bound. If `cloneBindings` is `false`, also the bound properties will * be cloned; in general, values are referenced 1:1, not cloned. For some property types, however, the getters * or setters might clone the value (e.g. array types and properties using metadata option `byValue`) * - All aggregated objects that are not bound. If `cloneBindings` is `false`, also the ones that are * bound will be cloned; they are all cloned recursively using the same `sIdSuffix` * - All associated controls; when an association points to an object inside the cloned object tree, then * the cloned association will be modified so that it points to the clone of the target object. When the * association points to a managed object outside of the cloned object tree, then its target won't be changed. * * - All models set via `setModel()`; used by reference. * - All property and aggregation bindings (if `cloneBindings` is `true`); the pure binding information * (path, model name) is cloned, but all other information like template control or factory function, data * type or formatter function are copied by reference. The bindings themselves are created anew as they * are specific for the combination (object, property, model). As a result, any later changes to a binding * of the original object are not reflected in the clone, but changes to e.g the type or template etc. are. * * * Each clone is created by first collecting the above mentioned settings and then creating a new instance * with the normal constructor function. As a result, any side effects of mutator methods (`setProperty` * etc.) or init hooks are repeated during clone creation. There is no need to override `clone()` just to * reproduce these internal settings! * * Custom controls however can override `clone()` to implement additional clone steps. They usually will * first call `clone()` on the super class and then modify the returned clone accordingly. * * Applications **must never provide** the second parameter `aLocaleIds`. It is determined automatically * for the root object (and its non-existence also serves as an indicator for the root object). Specifying * it will break the implementation of `clone()`. * * * @returns Reference to the newly created clone */ clone( /** * a suffix to be appended to the cloned object ID */ sIdSuffix?: string, /** * an array of local IDs within the cloned hierarchy (internally used) */ aLocalIds?: string[], /** * Configuration object; when omitted, both properties default to `true`; when specified, undefined properties * default to `false` */ oOptions?: { /** * Whether associations and aggregations will be cloned */ cloneChildren?: boolean; /** * Whether bindings will be cloned */ cloneBindings?: boolean; } ): this; /** * Cleans up the resources associated with this object and all its aggregated children. * * After an object has been destroyed, it can no longer be used! * * Applications should call this method if they don't need the object any longer. */ destroy( /** * If `true`, this ManagedObject and all its ancestors won't be invalidated. * This flag should be used only during control development to optimize invalidation procedures. It should * not be used by any application code. */ bSuppressInvalidate?: boolean ): void; /** * Destroys (all) the managed object(s) in the aggregation named `sAggregationName` and empties the aggregation. * If the aggregation did contain any object, this ManagedObject is marked as changed. * * **Note:** Destroying an aggregation by calling this method (or indirectly via `destroyXYZ`) does * not call the named aggregation mutators (`setXYZ` for a 0..1 aggregation, `removeXYZ` for * a 0..n aggregation) for the aggregated children. Controls that implement side effects in those methods * therefore must also implement similar side effects in their `destroyXYZ` method. * * While this is understood as inconvenient, it was decided (February 2026, after a thorough investigation), * not to change it. Too many existing controls depend on the current behavior, and, even worse, would have * severe problems with a changed behavior. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically destroy all objects in an aggregation. * Use the concrete method `destroyXYZ` for aggregation 'XYZ' instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Returns `this` to allow method chaining */ destroyAggregation( /** * the name of the aggregation */ sAggregationName: string, /** * if true, this ManagedObject is not marked as changed */ bSuppressInvalidate?: boolean ): this; /** * Detaches event handler `fnFunction` from the {@link #event:formatError formatError} event of this `sap.ui.base.ManagedObject`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachFormatError( /** * The function to be called, when the event occurs */ fnFunction: (p1: ManagedObject$FormatErrorEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:modelContextChange modelContextChange} event * of this `sap.ui.base.ManagedObject`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachModelContextChange( /** * The function to be called, when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:parseError parseError} event of this `sap.ui.base.ManagedObject`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachParseError( /** * The function to be called, when the event occurs */ fnFunction: (p1: ManagedObject$ParseErrorEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:validationError validationError} event of * this `sap.ui.base.ManagedObject`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachValidationError( /** * The function to be called, when the event occurs */ fnFunction: (p1: ManagedObject$ValidationErrorEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:validationSuccess validationSuccess} event * of this `sap.ui.base.ManagedObject`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachValidationSuccess( /** * The function to be called, when the event occurs */ fnFunction: (p1: ManagedObject$ValidationSuccessEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Searches and returns all aggregated objects that pass the given check function. * * When the search is done recursively (`bRecursive === true`), it will be executed depth-first and ancestors * will be added to the result array before their descendants. * * If no check function is given, all aggregated objects will pass the check and be added to the result * array. * * When setting `bIncludeBindingTemplates` to `true`, binding templates will be included in the search. * * **Take care:** this operation might be expensive. * * * @returns Array of aggregated objects that passed the check */ findAggregatedObjects( /** * Whether the whole aggregation tree should be searched */ bRecursive?: boolean, /** * Objects for which this function returns a falsy value will not be added to the result array */ fnCondition?: (p1: sap.ui.base.ManagedObject) => boolean, /** * Whether binding templates should be included */ bIncludeBindingTemplates?: boolean ): sap.ui.base.ManagedObject[]; /** * Fires event {@link #event:formatError formatError} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireFormatError( /** * Parameters to pass along with the event */ mParameters?: sap.ui.base.ManagedObject$FormatErrorEventParameters ): this; /** * Fires event {@link #event:modelContextChange modelContextChange} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireModelContextChange( /** * Parameters to pass along with the event */ mParameters?: object ): this; /** * Fires event {@link #event:parseError parseError} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireParseError( /** * Parameters to pass along with the event */ mParameters?: sap.ui.base.ManagedObject$ParseErrorEventParameters ): this; /** * Fires event {@link #event:validationError validationError} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireValidationError( /** * Parameters to pass along with the event */ mParameters?: sap.ui.base.ManagedObject$ValidationErrorEventParameters ): this; /** * Fires event {@link #event:validationSuccess validationSuccess} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireValidationSuccess( /** * Parameters to pass along with the event */ mParameters?: sap.ui.base.ManagedObject$ValidationSuccessEventParameters ): this; /** * Returns the aggregated object(s) for the named aggregation of this ManagedObject. * * If the aggregation does not contain any objects(s), the given `oDefaultForCreation` (or `null`) is set * as new value of the aggregation and returned to the caller. * * **Note:** the need to specify a default value and the fact that it is stored as new value of a so far * empty aggregation is recognized as a shortcoming of this API but can no longer be changed for compatibility * reasons. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically read the content of an aggregation. * Use the concrete method getXYZ for aggregation 'XYZ' instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Aggregation array in case of 0..n-aggregations or the managed object or `null` in case of 0..1-aggregations */ getAggregation( /** * Name of the aggregation */ sAggregationName: string, /** * Object that is used in case the current aggregation is empty. If provided, it must be null for 0..1 aggregations * or an empty array for 0..n aggregations. If not provided, `null` is used. * * **Note:** When an empty array is given and used because the aggregation was not set before, then this * array will be used for the aggregation from thereon. Sharing the same empty array between different calls * to this method therefore is not possible and will result in inconsistencies. */ oDefaultForCreation?: sap.ui.base.ManagedObject | any[] ): sap.ui.base.ManagedObject | sap.ui.base.ManagedObject[] | null; /** * Returns the content of the association with the given name. * * For associations of cardinality 0..1, a single string with the ID of an associated object is returned * (if any). For cardinality 0..n, an array with the IDs of the associated objects is returned. * * If the association does not contain any objects(s), the given `oDefaultForCreation` is set as new value * of the association and returned to the caller. The only supported values for `oDefaultForCreation` are * `null` and `undefined` in the case of cardinality 0..1 and `null`, `undefined` or an empty array (`[]`) * in case of cardinality 0..n. If the argument is omitted, `null` is used independently from the cardinality. * * **Note:** the need to specify a default value and the fact that it is stored as new value of a so far * empty association is recognized as a shortcoming of this API but can no longer be changed for compatibility * reasons. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically retrieve the content of an association. * Use the concrete method getXYZ for association 'XYZ' instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the ID of the associated managed object or an array of such IDs; may be null if the association * has not been populated */ getAssociation( /** * the name of the association */ sAssociationName: string, /** * the value that is used in case the current aggregation is empty (only null or empty array is allowed) */ oDefaultForCreation: null | any[] ): string | string[] | null; /** * Get the binding object for a specific aggregation/property. * * * @returns the binding for the given name */ getBinding( /** * the name of the property or aggregation */ sName: string ): sap.ui.model.Binding | undefined; /** * Get the binding context of this object for the given model name. * * If the object does not have a binding context set on itself and has no own model set, it will use the * first binding context defined in its parent hierarchy. * * **Note:** to be compatible with future versions of this API, you must not use the following model names: * * - `null` * - empty string `""` * - string literals `"null"` or `"undefined"` Omitting the model name (or using the value `undefined`) * is explicitly allowed and refers to the default model. * * **Note:** A ManagedObject inherits binding contexts from the Core only when it is a descendant of a UIArea. * * * @returns The binding context of this object */ getBindingContext( /** * the name of the model or `undefined` */ sModelName?: string ): sap.ui.model.Context | null | undefined; /** * Returns the binding info for the given property or aggregation. * * The binding info contains information about path, binding object, format options, sorter, filter etc. * for the property or aggregation. As the binding object is only created when the model becomes available, * the `binding` property may be undefined. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns A binding info object, containing at least a `path` or `parts` property and, depending on the * binding type, additional properties */ getBindingInfo( /** * Name of the property or aggregation */ sName: string ): | sap.ui.base.ManagedObject.PropertyBindingInfo | sap.ui.base.ManagedObject.AggregationBindingInfo; /** * Get the binding path for a specific aggregation/property. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the binding path for the given name */ getBindingPath( /** * the name of the property or aggregation */ sName: string ): string | undefined; /** * Returns the parent managed object as new eventing parent to enable control event bubbling or `null` if * this object hasn't been added to a parent yet. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the parent event provider */ getEventingParent(): sap.ui.base.EventProvider | null; /** * Returns the object's ID. * * There is no guarantee or check or requirement for the ID of a `ManagedObject` to be unique. Only some * subclasses of `ManagedObject` introduce this as a requirement, e.g. `Component` or `Element`. All elements * existing in the same window at the same time must have different IDs. A new element will fail during * construction when the given ID is already used by another element. But there might be a component with * the same ID as an element or another `ManagedObject`. * * For the same reason, there is no general lookup for `ManagedObject`s via their ID. Only for subclasses * that enforce unique IDs, there might be lookup mechanisms (e.g. {@link sap.ui.core.Element#getElementById sap.ui.core.Element.getElementById } * for elements). * * * @returns The objects's ID. */ getId(): string; /** * Returns the metadata for the class that this object belongs to. * * * @returns Metadata for the class of the object */ getMetadata(): sap.ui.base.ManagedObjectMetadata; /** * Get the model to be used for data bindings with the given model name. If the object does not have a model * set on itself, it will use the first model defined in its parent hierarchy. * * The name can be omitted to reference the default model or it must be a non-empty string. * * **Note:** to be compatible with future versions of this API, you must not use the following model names: * * - `null` * - empty string `""` * - string literals `"null"` or `"undefined"` Omitting the model name (or using the value `undefined`) * is explicitly allowed and refers to the default model. * * * @returns oModel or undefined when there is no such model */ getModel( /** * name of the model to be retrieved */ sModelName?: string ): sap.ui.model.Model | undefined; /** * Get the object binding object for a specific model. * * **Note:** to be compatible with future versions of this API, you must not use the following model names: * * - `null` * - empty string `""` * - string literals `"null"` or `"undefined"` Omitting the model name (or using the value `undefined`) * is explicitly allowed and refers to the default model. * * * @returns Context binding for the given model name or `undefined` */ getObjectBinding( /** * Non-empty name of the model or `undefined` */ sModelName?: string ): sap.ui.model.ContextBinding | undefined; /** * Returns the origin info for the value of the given property. * * The origin info might contain additional information for translatable texts. The bookkeeping of this * information is not active by default and must be activated by configuration. Even then, it might not * be present for all properties and their values depending on where the value came form. * * If no origin info is available, `null` will be returned. * * * @returns |null} An object describing the origin of this property's value or `null` */ getOriginInfo( /** * Name of the property */ sPropertyName: string ): { source: string; locale: string; }; /** * Returns a map of all models assigned to this ManagedObject. * * The default model is available on key `undefined`. * * **Note:** Models propagated from the parent are not included. * * @since 1.88.0 * * @returns The models */ getOwnModels(): Record; /** * Returns the parent managed object or `null` if this object hasn't been added to a parent yet. * * The parent returned by this method is the technical parent used for data binding, invalidation, rendering * etc. It might differ from the object on which the application originally added this object (the so called * 'API parent'): some composite controls internally use hidden controls or containers to store their children. * This method will return the innermost container that technically contains this object as a child. * * **Example:** * * Assume that a `Dialog` internally uses a (hidden) `VerticalLayout` to store its content: * * * ```javascript * * Dialog (API parent) * \__ VerticalLayout (hidden composite part) * \__ Text (API child) * ``` * * * If you add some content by calling the `Dialog.prototype.addContent` API, this will lead to the following * observations: * * * ```javascript * * oDialog.addContent(oText); * console.log(oText.getParent() === oDialog); // false * console.log(oText.getParent() instanceof VerticalLayout); // true * console.log(oText.getParent().getParent() === oDialog); // true now, but might fail with later versions * ``` * * * Technically, from API perspective, `oText` is added as a child to `Dialog`. But internally, the `Dialog` * adds the child to the hidden `VerticalLayout` container. If you now call the `getParent` method of the * child, you will get the internal `VerticalLayout` object and not the `Dialog` API parent. * * **Note: ** The internal (hidden) structure of a composite control is not fixed and may be changed (see * also our "Compatibility Rules"). Therefore, you should **never** rely on a specific structure or object * being returned by `getParent`. * * **Note: ** There is no API to determine the original API parent. * * * @returns The technical parent managed object or `null` */ getParent(): sap.ui.base.ManagedObject | null; /** * Returns the value for the property with the given `sPropertyName`. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically retrieve the value of a property. * Use the concrete method getXYZ for property 'XYZ' instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the value of the property */ getProperty( /** * the name of the property */ sPropertyName: string ): any; /** * Check if any model is set to the ManagedObject or to one of its parents (including UIArea and Core). * * **Note:** A ManagedObject inherits models from the Core only when it is a descendant of a UIArea. * * * @returns whether a model reference exists or not */ hasModel(): boolean; /** * Searches for the provided ManagedObject in the named aggregation and returns its 0-based index if found, * or -1 otherwise. Returns -2 if the given named aggregation is of cardinality 0..1 and doesn't reference * the given object. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically determine the position of an object * in an aggregation. Use the concrete method indexOfXYZ for aggregation 'XYZ' instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the index of the provided managed object in the aggregation. */ indexOfAggregation( /** * the name of the aggregation */ sAggregationName: string, /** * the ManagedObject whose index is looked for. */ oObject: sap.ui.base.ManagedObject ): int; /** * Inserts managed object `oObject` to the aggregation named `sAggregationName` at position `iIndex`. * * If the given object is not valid with regard to the aggregation (if it is not an instance of the type * specified for that aggregation) or when the method is called for an aggregation of cardinality 0..1, * then an Error is thrown (see {@link #validateAggregation}. * * If the given index is out of range with respect to the current content of the aggregation, it is clipped * to that range (0 for iIndex < 0, n for iIndex > n). * * Please note that this method does not work as expected when an object is added that is already part of * the aggregation. In order to change the index of an object inside an aggregation, first remove it, then * insert it again. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically insert an object into an aggregation. * Use the concrete method insertXYZ for aggregation 'XYZ' instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Returns `this` to allow method chaining */ insertAggregation( /** * the string identifying the aggregation the managed object `oObject` should be inserted into. */ sAggregationName: string, /** * the ManagedObject to add; if empty, nothing is inserted. */ oObject: sap.ui.base.ManagedObject, /** * the `0`-based index the managed object should be inserted at; for a negative value `iIndex`, `oObject` * is inserted at position 0; for a value greater than the current size of the aggregation, `oObject` is * inserted at the last position */ iIndex: int, /** * if true, this ManagedObject as well as the added child are not marked as changed */ bSuppressInvalidate?: boolean ): this; /** * Marks this object and its aggregated children as 'invalid'. * * The term 'invalid' originally was introduced by controls where a change to the object's state made the * rendered DOM invalid. Later, the concept of invalidation was moved up in the inheritance hierarchy * to `ManagedObject`, but the term was kept for compatibility reasons. * * Managed settings (properties, aggregations, associations) invalidate the corresponding object automatically. * Changing the state via the standard mutators, therefore, does not require an explicit call to `invalidate`. * The same applies to changes made via data binding, as it internally uses the standard mutators. * * By default, a `ManagedObject` propagates any invalidation to its parent, unless the invalidation is suppressed * on the parent. Controls or UIAreas handle invalidation on their own by triggering a re-rendering. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ invalidate(): void; /** * Find out whether a property or aggregation is bound * * * @returns whether a binding exists for the given name */ isBound( /** * the name of the property or aggregation */ sName: string ): boolean; /** * Returns whether this object is destroyed or not. A destroyed object cannot be used anymore. * * @since 1.93 * * @returns Whether the object is destroyed */ isDestroyed(): boolean; /** * Checks if an object's destruction has been started. During the descruction of an object its ID is still * registered, and child objects could be still aggregated. Creating another object with the same ID would * lead to duplicate ID issues. To check if the destruction is finished, call `isDestroyed`. * * @since 1.93 * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Whether an object's destruction has been started */ isDestroyStarted(): boolean; /** * Returns whether re-rendering is currently suppressed on this ManagedObject. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Whether re-rendering is suppressed */ isInvalidateSuppressed(): boolean; /** * Returns whether the given property value is initial and has not been explicitly set or bound. Even after * setting the default value or setting null/undefined (which also causes the default value to be set), * the property is no longer initial. A property can be reset to initial state by calling `resetProperty(sPropertyName)`. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns true if the property is initial */ isPropertyInitial( /** * the name of the property */ sPropertyName: string ): boolean; /** * This method is used internally and should only be overridden by a tree managed object which utilizes * the tree binding. In this case and if the aggregation is a tree node the overridden method should then * return true. If true is returned the tree binding will be used instead of the list binding. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns whether tree binding should be used or list binding. Default is false. Override method to change * this behavior. */ isTreeBinding( /** * the aggregation to bind (e.g. nodes for a tree managed object) */ sName: string ): boolean; /** * Generic method which is called, whenever messages for this object exist. * * @since 1.28 * @ui5-protected Do not call from applications (only from related classes in the framework) */ propagateMessages( /** * The property name */ sName: string, /** * The messages */ aMessages: any[] ): void; /** * Generic method which can be called, when an aggregation needs to be refreshed. This method does not make * any change on the aggregation, but just calls the `getContexts` method of the binding to trigger fetching * of new data. * * Subclasses should call this method only in the implementation of a named refresh method and for no other * purposes. The framework might change the conditions under which the method is called and the method implementation * might rely on those conditions. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ refreshAggregation( /** * name of the aggregation to refresh */ sName: string ): void; /** * Removes an object from the aggregation named `sAggregationName` with cardinality 0..n. * * The removed object is not destroyed nor is it marked as changed. * * If the given object is found in the aggregation, it is removed, it's parent relationship is unset and * this ManagedObject is marked as changed. The removed object is returned as result of this method. If * the object could not be found, `null` is returned. * * This method must only be called for aggregations of cardinality 0..n. The only way to remove objects * from a 0..1 aggregation is to set a `null` value for them. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically remove an object from an aggregation. * Use the concrete method removeXYZ for aggregation 'XYZ' instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the removed object or `null` */ removeAggregation( /** * the string identifying the aggregation that the given object should be removed from */ sAggregationName: string, /** * the position or ID of the ManagedObject that should be removed or that ManagedObject itself; if `vObject` * is invalid, a negative value or a value greater or equal than the current size of the aggregation, nothing * is removed. */ vObject: int | string | sap.ui.base.ManagedObject, /** * if true, this ManagedObject is not marked as changed */ bSuppressInvalidate?: boolean ): sap.ui.base.ManagedObject | null; /** * Removes all objects from the 0..n-aggregation named `sAggregationName`. * * The removed objects are not destroyed nor are they marked as changed. * * Additionally, it clears the parent relationship of all removed objects, marks this ManagedObject as changed * and returns an array with the removed objects. * * If the aggregation did not contain any objects, an empty array is returned and this ManagedObject is * not marked as changed. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically remove all objects from an aggregation. * Use the concrete method removeAllXYZ for aggregation 'XYZ' instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns An array of the removed elements (might be empty) */ removeAllAggregation( /** * Name of the aggregation to remove all objects from */ sAggregationName: string, /** * If true, this `ManagedObject` is not marked as changed */ bSuppressInvalidate?: boolean ): sap.ui.base.ManagedObject[]; /** * Removes all the objects in the 0..n-association named `sAssociationName` and returns an array with their * IDs. This ManagedObject is marked as changed, if the association contained any objects. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically remove all object from an association. * Use the concrete method removeAllXYZ for association 'XYZ' instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns an array with the IDs of the removed objects (might be empty) */ removeAllAssociation( /** * the name of the association */ sAssociationName: string, /** * if true, this ManagedObject is not marked as changed */ bSuppressInvalidate?: boolean ): any[]; /** * Removes a `ManagedObject` from the association named `sAssociationName`. * * If an object is removed, the ID of that object is returned and this `ManagedObject` is marked as changed. * Otherwise `null` is returned. * * If the same object was added multiple times to the same association, only a single occurrence of it will * be removed by this method. If the object is not found or if the parameter can't be interpreted neither * as a `ManagedObject` (or ID) nor as an index in the association, nothing will be removed. The same is * true if an index is given and if that index is out of range for the association. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically remove an object from an association. * Use the concrete method removeXYZ for association 'XYZ' instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns ID of the removed `ManagedObject` or `null` */ removeAssociation( /** * the string identifying the association the `ManagedObject` should be removed from. */ sAssociationName: string, /** * the position or ID of the `ManagedObject` to remove or the `ManagedObject` itself; if `vObject` is invalid * input, a negative value or a value greater or equal than the current size of the association, nothing * is removed */ vObject: int | string | sap.ui.base.ManagedObject, /** * if `true`, the managed object is not marked as changed */ bSuppressInvalidate?: boolean ): string | null; /** * Resets the given property to the default value and also restores the "initial" state (like it has never * been set). * * As subclasses might have implemented side effects in the named setter `setXYZ` for property 'xyz', that * setter is called with a value of `null`, which by convention restores the default value of the property. * This is only done to notify subclasses, the internal state is anyhow reset. * * When the property has not been modified so far, nothing will be done. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Returns `this` to allow method chaining */ resetProperty( /** * Name of the property */ sPropertyName: string ): this; /** * Sets a new object in the named 0..1 aggregation of this ManagedObject and marks this ManagedObject as * changed. * * If the given object is not valid with regard to the aggregation (if it is not an instance of the type * specified for that aggregation) or when the method is called for an aggregation of cardinality 0..n, * then an Error is thrown (see {@link #validateAggregation}. * * If the new object is the same as the currently aggregated object, then the internal state is not modified * and this ManagedObject is not marked as changed. * * If the given object is different, the parent of a previously aggregated object is cleared (it must have * been this ManagedObject before), the parent of the given object is set to this ManagedObject and {@link #invalidate } * is called for this object. * * Note that this method does neither return nor destroy the previously aggregated object. This behavior * is inherited by named set methods (see below) in subclasses. To avoid memory leaks, applications therefore * should first get the aggregated object, keep a reference to it or destroy it, depending on their needs, * and only then set a new object. * * Note that ManagedObject only implements a single level of change tracking: if a first call to setAggregation * recognizes a change, 'invalidate' is called. If another call to setAggregation reverts that change, invalidate() * will be called again, the new status is not recognized as being 'clean' again. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically set an object in an aggregation. Use * the concrete method setXYZ for aggregation 'XYZ' or the generic {@link #applySettings} instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Returns `this` to allow method chaining */ setAggregation( /** * name of an 0..1 aggregation */ sAggregationName: string, /** * the managed object that is set as aggregated object */ oObject: sap.ui.base.ManagedObject, /** * if true, this ManagedObject is not marked as changed */ bSuppressInvalidate?: boolean ): this; /** * Sets the associated object for the given managed association of cardinality '0..1' and marks this ManagedObject * as changed. * * The associated object can either be given by itself or by its id. If `null` or `undefined` is given, * the association is cleared. * * **Note:** This method is a low-level API as described in the class documentation. * Applications or frameworks must not use this method to generically set an object in an association. Use * the concrete method setXYZ for association 'XYZ' or the generic {@link #applySettings} instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Returns `this` to allow method chaining */ setAssociation( /** * name of the association */ sAssociationName: string, /** * the ID of the managed object that is set as an association, or the managed object itself or null */ sId: string | sap.ui.base.ManagedObject, /** * if true, the managed objects invalidate method is not called */ bSuppressInvalidate?: boolean ): this; /** * Set the binding context for this ManagedObject for the model with the given name. * * **Note:** to be compatible with future versions of this API, you must not use the following model names: * * - `null` * - empty string `""` * - string literals `"null"` or `"undefined"` Omitting the model name (or using the value `undefined`) * is explicitly allowed and refers to the default model. * * A value of `null` for `oContext` hides the parent context. The parent context will no longer be propagated * to aggregated child controls. A value of `undefined` removes a currently active context or a `null` context * and the parent context gets visible and propagated again. * * **Note:** A ManagedObject inherits binding contexts from the Core only when it is a descendant of a UIArea. * * * @returns reference to the instance itself */ setBindingContext( /** * the new binding context for this object */ oContext: sap.ui.model.Context, /** * the name of the model to set the context for or `undefined` */ sModelName?: string ): this; /** * Sets or unsets a model for the given model name for this ManagedObject. * * The `sName` must either be `undefined` (or omitted) or a non-empty string. When the name is omitted, * the default model is set/unset. To be compatible with future versions of this API, you must not use the * following model names: * - `null` * - empty string `""` * - string literals `"null"` or `"undefined"` * * When `oModel` is `null` or `undefined`, a previously set model with that name is removed from this ManagedObject. * If an ancestor (parent, UIArea or Core) has a model with that name, this ManagedObject will immediately * inherit that model from its ancestor. * * All local bindings that depend on the given model name are updated (created if the model references became * complete now; updated, if any model reference has changed; removed if the model references became incomplete * now). * * Any change (new model, removed model, inherited model) is also applied to all aggregated descendants * as long as a descendant doesn't have its own model set for the given name. * * **Note:** By design, it is not possible to hide an inherited model by setting a `null` or `undefined` * model. Applications can set an empty model to achieve the same. * * **Note:** A ManagedObject inherits models from the Core only when it is a descendant of a UIArea. * * * @returns `this` to allow method chaining */ setModel( /** * Model to be set or `null` or `undefined` */ oModel: sap.ui.model.Model | null | undefined, /** * the name of the model or `undefined` */ sName?: string ): this; /** * Sets the given value for the given property after validating and normalizing it, marks this object as * changed. * * If the value is not valid with regard to the declared data type of the property, an Error is thrown. * In case `null` or `undefined` is passed, the default value for this property is used (see {@link #validateProperty}). * To fully reset the property to initial state, use {@link #resetProperty} instead. If the validated and * normalized `oValue` equals the current value of the property, the internal state of this object is not * changed (apart from the result of {@link #isPropertyInitial}). If the value changes, it is stored internally * and the {@link #invalidate} method is called on this object. In the case of TwoWay databinding, the bound * model is informed about the property change. * * Note that ManagedObject only implements a single level of change tracking: if a first call to setProperty * recognizes a change, 'invalidate' is called. If another call to setProperty reverts that change, invalidate() * will be called again, the new status is not recognized as being 'clean' again. * * **Note:** This method is a low level API as described in the class documentation. * Applications or frameworks must not use this method to generically set a property. Use the concrete method * setXYZ for property 'XYZ' or the generic {@link #applySettings} instead. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Returns `this` to allow method chaining */ setProperty( /** * name of the property to set */ sPropertyName: string, /** * value to set the property to */ oValue: any, /** * if true, the managed object is not marked as changed */ bSuppressInvalidate?: boolean ): this; /** * Returns a simple string representation of this managed object. * * Mainly useful for tracing purposes. * * * @returns a string description of this managed object */ toString(): string; /** * Unbind the aggregation from the model. * * After unbinding, the current content of the aggregation is destroyed by default. When the `bSuppressReset` * parameter is set, it is however retained. * * * @returns Reference to this instance itself */ unbindAggregation( /** * Name of the aggregation */ sName: string, /** * Indicates whether destroying the content of the aggregation is skipped */ bSuppressReset: boolean ): this; /** * Removes the defined binding context of this object, all bindings will now resolve relative to the parent * context again. * * @deprecated As of version 1.11.1. please use {@link #unbindObject} instead. * * @returns reference to the instance itself */ unbindContext( /** * name of the model to remove the context for. */ sModelName?: string ): this; /** * Removes the defined binding context of this object, all bindings will now resolve relative to the parent * context again. * * * @returns Reference to the instance itself */ unbindObject( /** * Name of the model to remove the context for. */ sModelName?: string ): this; /** * Unbind the property from the model * * * @returns reference to the instance itself */ unbindProperty( /** * the name of the property */ sName: string, /** * whether the reset to the default value when unbinding should be suppressed */ bSuppressReset: boolean ): this; /** * Generic method which is called whenever an aggregation binding has changed. * * Depending on the type of the list binding and on additional configuration, this method either destroys * all elements in the aggregation `sName` and recreates them anew or tries to reuse as many existing objects * as possible. It is up to the method which strategy it uses. * * In case a managed object needs special handling for an aggregation binding, it can create a named update * method (e.g. `updateRows` for an aggregation `rows`) which then will be called by the framework * instead of this generic method. THe method will be called with two arguments `sChangeReason` and `oEventInfo`. * * Subclasses should call this method only in the implementation of such a named update method and for no * other purposes. The framework might change the conditions under which the method is called and the method * implementation might rely on those conditions. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ updateAggregation( /** * Name of the aggregation to update */ sName: string, /** * One of the predefined reasons for the change event */ sChangeReason: sap.ui.model.ChangeReason, /** * Additional information about the change event */ oEventInfo: { /** * A non-standardized string that further classifies the change event. Model implementations should document * any value that they might provide as detailed reason, and describe under what circumstances each value * will be used. */ detailedReason?: string; } ): void; /** * Checks whether the given value is of the proper type for the given aggregation name. * * This method is already called by {@link #setAggregation}, {@link #addAggregation} and {@link #insertAggregation}. * In many cases, subclasses of ManagedObject don't need to call it again in their mutator methods. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the passed object */ validateAggregation( /** * the name of the aggregation */ sAggregationName: string, /** * the aggregated object or a primitive value */ oObject: sap.ui.base.ManagedObject | any, /** * whether the caller assumes the aggregation to have cardinality 0..n */ bMultiple: boolean ): sap.ui.base.ManagedObject | any; /** * Checks whether the given value is of the proper type for the given property name. * * In case `null` or `undefined` is passed, the default value for this property is used as value. If no * default value is defined for the property, the default value of the type of the property is used. * * If the property has a data type that is an instance of sap.ui.base.DataType and if a `normalize` function * is defined for that type, that function will be called with the resulting value as only argument. The * result of the function call is then used instead of the raw value. * * This method is called by {@link #setProperty}. In many cases, subclasses of ManagedObject don't need * to call it themselves. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The normalized value for the passed value or for the default value if `null` or `undefined` * was passed */ validateProperty( /** * Name of the property */ sPropertyName: string, /** * Value to be set */ oValue: any ): any; } /** * **Note about Info Objects** * * Several methods in this class return info objects that describe a property, aggregation, association * or event of the class described by this metadata object. The type, structure and behavior of these info * objects is not yet documented and not part of the stable, public API. * * Code using such methods and the returned info objects therefore needs to be aware of the following restrictions: * * * the set of properties exposed by each info object, their type and value might change as well as the * class of the info object itself. * * Properties that represent settings provided during class definition (in the oClassInfo parameter of the * 'extend' call, e.g. 'type', 'multiple' of an aggregation) are more likely to stay the same than additional, * derived properties like '_iKind'. * * * - info objects must not be modified / enriched although they technically could. * * * - the period of validity of info objects is not defined. They should be referenced only for a short * time and not be kept as members of long living objects or closures. * * * * @since 0.8.6 */ class ManagedObjectMetadata extends sap.ui.base.Metadata { /** * Creates a new metadata object that describes a subclass of ManagedObject. * * **Note:** Code outside the `sap.ui.base` namespace must not call this constructor directly. Instances * will be created automatically when a new class is defined with one of the {@link sap.ui.base.ManagedObject.extend SomeClass.extend } * methods. * * **Note**: throughout this class documentation, the described subclass of ManagedObject is referenced * as the described class. */ constructor( /** * fully qualified name of the described class */ sClassName: string, /** * static info to construct the metadata from */ oClassInfo: { /** * The metadata object describing the class */ metadata?: sap.ui.base.ManagedObject.MetadataOptions; } ); /** * Adds information to the given oAggregatedObject about its original API parent (or a subsequent API parent * in case of multiple forwarding). MUST be called before an element is forwarded to another internal aggregation * (in case forwarding is done explicitly/manually without using the declarative mechanism introduced in * UI5 1.56). * * CAUTION: ManagedObjectMetadata.addAPIParentInfoEnd(...) MUST be called AFTER the element has been forwarded * (set to an aggregation of an internal control). These two calls must wrap the forwarding. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ static addAPIParentInfoBegin( /** * Object to which the new API parent info should be added */ oAggregatedObject: sap.ui.base.ManagedObject, /** * Object that is a new API parent */ oParent: sap.ui.base.ManagedObject, /** * the name of the aggregation under which oAggregatedObject is aggregated by the API parent */ sAggregationName: string ): void; /** * Completes the information about the original API parent of the given element. MUST be called after an * element is forwarded to another internal aggregation. For every call to ManagedObjectMetadata.addAPIParentInfoBegin(...) * this method here must be called as well. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ static addAPIParentInfoEnd( /** * Object to which the new API parent info should be added */ oAggregatedObject: sap.ui.base.ManagedObject ): void; /** * Get the prefix used for the generated IDs from configuration * * @since 1.119.0 * * @returns The prefix for the generated IDs */ static getUIDPrefix(): string; /** * Test whether a given ID looks like it was automatically generated. * * Examples: * ```javascript * * True for: * "foo--__bar04--baz" * "foo--__bar04" * "__bar04--baz" * "__bar04" * "__bar04--" * "__bar04--foo" * False for: * "foo__bar04" * "foo__bar04--baz" * ``` * * * See {@link sap.ui.base.ManagedObjectMetadata.prototype.uid} for details on ID generation. * * * @returns whether the ID is likely to be generated */ static isGeneratedId( /** * the ID that should be tested */ sId: string ): boolean; /** * Calculates a new ID based on a prefix. * * To guarantee uniqueness of the generated IDs across all ID prefixes, prefixes must not end with digits. * * * @returns A (hopefully unique) control id */ static uid( /** * prefix for the new ID */ sIdPrefix: string ): string; /** * Returns an info object for the named public aggregation of the described class no matter whether the * aggregation was defined by the class itself or by one of its ancestor classes. * * If neither the class nor its ancestor classes define a public aggregation with the given name, `undefined` * is returned. * * If the name is not given (or has a falsy value), then it is substituted by the name of the default aggregation * of the 'described class' (if any). * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * @since 1.27.0 * * @returns An info object describing the aggregation or `undefined` */ getAggregation( /** * name of the aggregation or empty */ sName?: string ): sap.ui.base.ManagedObject.MetadataOptions.Aggregation | undefined; /** * Returns a map of info objects for the public aggregations of the described class. Aggregations declared * by ancestor classes are not included. * * The returned map keys the aggregation info objects by their name. In case of 0..1 aggregations this is * the singular name, otherwise it is the plural name. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * * @returns Map of aggregation info objects keyed by aggregation names */ getAggregations(): Record< string, sap.ui.base.ManagedObject.MetadataOptions.Aggregation >; /** * Returns a map of info objects for all public aggregations of the described class, including public aggregations * form the ancestor classes. * * The returned map keys the aggregation info objects by their name. In case of 0..1 aggregations this is * the singular name, otherwise it is the plural name. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * * @returns Map of aggregation info objects keyed by aggregation names */ getAllAggregations(): Record< string, sap.ui.base.ManagedObject.MetadataOptions.Aggregation >; /** * Returns a map of info objects for all public associations of the described class, including public associations * form the ancestor classes. * * The returned map keys the association info objects by their name. In case of 0..1 associations this is * the singular name, otherwise it is the plural name. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * * @returns Map of association info objects keyed by association names */ getAllAssociations(): Record< string, sap.ui.base.ManagedObject.MetadataOptions.Association >; /** * Returns a map of info objects for all public events of the described class, including public events form * the ancestor classes. * * The returned map keys the event info objects by their name. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * * @returns Map of event info objects keyed by event names */ getAllEvents(): Record< string, sap.ui.base.ManagedObject.MetadataOptions.Event >; /** * Returns a map of info objects for all private (hidden) aggregations of the described class, including * private aggregations from the ancestor classes. * * The returned map contains aggregation info objects keyed by the aggregation name. In case of 0..1 aggregations * this is the singular name, otherwise it is the plural name. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Map of aggregation info objects keyed by aggregation names */ getAllPrivateAggregations(): Record< string, sap.ui.base.ManagedObject.MetadataOptions.Aggregation >; /** * Returns a map of info objects for all private (hidden) associations of the described class, including * private associations from the ancestor classes. * * The returned map contains association info objects keyed by the association name. In case of 0..1 associations * this is the singular name, otherwise it is the plural name. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Map of association info objects keyed by association names */ getAllPrivateAssociations(): Record< string, sap.ui.base.ManagedObject.MetadataOptions.Association >; /** * Returns a map of info objects for all private (hidden) properties of the described class, including private * properties from the ancestor classes. * * The returned map contains property info objects keyed by the property name. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Map of property info objects keyed by property names */ getAllPrivateProperties(): Record< string, sap.ui.base.ManagedObject.MetadataOptions.Property >; /** * Returns a map of info objects for all public properties of the described class, including public properties * from the ancestor classes. * * The returned map keys the property info objects by their name. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * * @returns Map of property info objects keyed by the property names */ getAllProperties(): Record< string, sap.ui.base.ManagedObject.MetadataOptions.Property >; /** * Returns an info object for the named public association of the described class, no matter whether the * association was defined by the class itself or by one of its ancestor classes. * * If neither the described class nor its ancestor classes define an association with the given name, `undefined` * is returned. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * @since 1.27.0 * * @returns An info object describing the association or `undefined` */ getAssociation( /** * name of the association */ sName: string ): sap.ui.base.ManagedObject.MetadataOptions.Association | undefined; /** * Returns a map of info objects for all public associations of the described class. Associations declared * by ancestor classes are not included. * * The returned map keys the association info objects by their name. In case of 0..1 associations this is * the singular name, otherwise it is the plural name. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * * @returns Map of association info objects keyed by association names */ getAssociations(): Record< string, sap.ui.base.ManagedObject.MetadataOptions.Association >; /** * Returns an info object for the default aggregation of the described class. * * If the class itself does not define a default aggregation, then the info object for the default aggregation * of the parent class is returned. * * @since 1.73 * * @returns An info object for the default aggregation */ getDefaultAggregation(): sap.ui.base.ManagedObject.MetadataOptions.Aggregation; /** * Returns the name of the default aggregation of the described class. * * If the class itself does not define a default aggregation, then the default aggregation of the parent * is returned. If no class in the hierarchy defines a default aggregation, `undefined` is returned. * * @since 1.73 * * @returns Name of the default aggregation */ getDefaultAggregationName(): string; /** * Returns an info object for the named public event of the described class, no matter whether the event * was defined by the class itself or by one of its ancestor classes. * * If neither the described class nor its ancestor classes define an event with the given name, `undefined` * is returned. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * @since 1.27.0 * * @returns An info object describing the event or `undefined` */ getEvent( /** * name of the event */ sName: string ): sap.ui.base.ManagedObject.MetadataOptions.Event | undefined; /** * Returns a map of info objects for the public events of the described class. Events declared by ancestor * classes are not included. * * The returned map keys the event info objects by their name. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * * @returns Map of event info objects keyed by event names */ getEvents(): Record< string, sap.ui.base.ManagedObject.MetadataOptions.Event >; /** * Returns the name of the library that contains the described UIElement. * * * @returns the name of the library */ getLibraryName(): string; /** * Returns the info object for the named public or private aggregation declared by the described class or * by any of its ancestors. * * If the name is not given (or has a falsy value), then it is substituted by the name of the default aggregation * of the described class (if it is defined). * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns aggregation info object or `undefined` */ getManagedAggregation( /** * name of the aggregation to be retrieved or empty */ sAggregationName: string ): sap.ui.base.ManagedObject.MetadataOptions.Aggregation | undefined; /** * Returns the info object for the named public or private association declared by the described class or * by any of its ancestors. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns association info object or `undefined` */ getManagedAssociation( /** * name of the association to be retrieved */ sName: string ): sap.ui.base.ManagedObject.MetadataOptions.Association | undefined; /** * Returns the info object for the named public or private property declared by the described class or by * any of its ancestors. * * If the name is not given (or has a falsy value), then it is substituted by the name of the default property * of the described class (if it is defined). * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns property info object or `undefined` */ getManagedProperty( /** * name of the property to be retrieved or empty */ sName: string ): sap.ui.base.ManagedObject.MetadataOptions.Property | undefined; /** * Returns a map of info objects for the public properties of the described class. Properties declared by * ancestor classes are not included. * * The returned map keys the property info objects by their name. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * * @returns Map of property info objects keyed by the property names */ getProperties(): Record< string, sap.ui.base.ManagedObject.MetadataOptions.Property >; /** * Returns an info object for the named public property of the described class, no matter whether the property * was defined by the class itself or by one of its ancestor classes. * * If neither the described class nor its ancestor classes define a property with the given name, `undefined` * is returned. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * @since 1.27.0 * * @returns An info object describing the property or `undefined` */ getProperty( /** * name of the property */ sName: string ): sap.ui.base.ManagedObject.MetadataOptions.Property | undefined; /** * Returns a map of default values for all properties declared by the described class and its ancestors, * keyed by the property name. * * * @returns Map of default values keyed by property names */ getPropertyDefaults(): Record; /** * Returns an info object for a public setting with the given name that either is a public property or a * public aggregation of cardinality 0..1 and with at least one simple alternative type. The setting can * be defined by the class itself or by one of its ancestor classes. * * If neither the described class nor its ancestor classes define a suitable setting with the given name, * `undefined` is returned. * * **Warning:** Type, structure and behavior of the returned info objects is not documented and therefore * not part of the API. See the {@link #constructor Notes about Info objects} in the constructor documentation * of this class. * * @since 1.27.0 * * @returns An info object describing the property or aggregation or `undefined` */ getPropertyLikeSetting( /** * name of the property like setting */ sName: string ): | sap.ui.base.ManagedObject.MetadataOptions.Property | sap.ui.base.ManagedObject.MetadataOptions.Aggregation | undefined; /** * Checks the existence of the given public aggregation by its name. * * * @returns true, if the aggregation exists */ hasAggregation( /** * name of the aggregation */ sName: string ): boolean; /** * Checks the existence of the given public association by its name * * * @returns true, if the association exists */ hasAssociation( /** * name of the association */ sName: string ): boolean; /** * Checks the existence of the given event by its name * * * @returns true, if the event exists */ hasEvent( /** * name of the event */ sName: string ): boolean; /** * Checks the existence of the given public property by its name * * * @returns true, if the property exists */ hasProperty( /** * name of the property */ sName: string ): boolean; /** * Calculates a new ID for an instance of this class. * * Note that the calculated short name part is usually not unique across all classes, but doesn't have to * be. It might even be empty when the class name consists of invalid characters only. * * * @returns A (hopefully unique) control ID */ uid(): string; } /** * Metadata for a class. * * @since 0.8.6 */ class Metadata { /** * Creates a new metadata object from the given static infos. * * **Note:** Throughout this class documentation, the described subclass of Object is referenced as the * described class. */ constructor( /** * Fully qualified name of the described class */ sClassName: string, /** * Info to construct the class and its metadata from */ oClassInfo: { /** * The metadata object describing the class */ metadata?: sap.ui.base.Object.MetadataOptions; } ); /** * Returns an array with the names of all public methods declared by the described class and all its ancestors * classes. * * @deprecated As of version 1.58. this method should not be used for productive code. The accuracy of the * returned information highly depends on the concrete class and is not actively monitored. There might * be more public methods or some of the returned methods might not really be intended for public use. In * general, pure visibility information should not be exposed in runtime metadata but be part of the documentation. * Subclasses of `sap.ui.base.Object` might decide to provide runtime metadata describing their public API, * but this then should not be backed by this method. See {@link sap.ui.core.mvc.ControllerMetadata#getAllMethods } * for an example. * * @returns array with names of all public methods provided by the described class and its ancestors */ getAllPublicMethods(): string[]; /** * Returns the (constructor of the) described class * * * @returns class described by this metadata */ getClass(): new () => sap.ui.base.Object; /** * Returns the fully qualified name of the described class * * * @returns name of the described class */ getName(): string; /** * Returns the metadata object of the base class of the described class or undefined if the class has no * (documented) base class. * * * @returns metadata of the base class */ getParent(): sap.ui.base.Metadata | undefined; /** * Returns an array with the names of the public methods declared by the described class, methods of ancestors * are not listed. * * @deprecated As of version 1.58. this method should not be used for productive code. The accuracy of the * returned information highly depends on the concrete class and is not actively monitored. There might * be more public methods or some of the returned methods might not really be intended for public use. In * general, pure visibility information should not be exposed in runtime metadata but be part of the documentation. * Subclasses of `sap.ui.base.Object` might decide to provide runtime metadata describing their public API, * but this then should not be backed by this method. See {@link sap.ui.core.mvc.ControllerMetadata#getAllMethods } * for an example. * * @returns array with names of public methods declared by the described class */ getPublicMethods(): string[]; /** * Checks whether the class described by this metadata object is of the named type. * * This check is solely based on the type names as declared in the class metadata. It compares the given * `vTypeName` with the name of this class, with the names of any base class of this class and with the * names of all interfaces implemented by any of the aforementioned classes. * * Instead of a single type name, an array of type names can be given and the method will check if this * class is of any of the listed types (logical or). * * Should the UI5 class system in future implement additional means of associating classes with type names * (e.g. by introducing mixins), then this method might detect matches for those names as well. * * @since 1.56 * * @returns Whether this class is of the given type or of any of the given types */ isA( /** * Type or types to check for */ vTypeName: string | string[] ): boolean; /** * Returns whether the described class is abstract * * * @returns whether the class is abstract */ isAbstract(): boolean; /** * Whether the described class is deprecated and should not be used any more * * @since 1.26.4 * * @returns whether the class is considered deprecated */ isDeprecated(): boolean; /** * Returns whether the described class is final * * * @returns whether the class is final */ isFinal(): boolean; /** * Checks whether the described class or one of its ancestor classes implements the given interface. * * * @returns whether this class implements the interface */ isInstanceOf( /** * name of the interface to test for (in dot notation) */ sInterface: string ): boolean; } /** * Base class for all SAPUI5 Objects. */ abstract class Object { /** * Constructor for an `sap.ui.base.Object`. * * Subclasses of this class should always call the constructor of their base class. */ constructor(); /** * Creates metadata for a given class and attaches it to the constructor and prototype of that class. * * After creation, metadata can be retrieved with getMetadata(). * * The static info can at least contain the following entries: * - baseType: {string} fully qualified name of a base class or empty * - publicMethods: {string} an array of method names that will be visible in the interface proxy returned * by {@link #getInterface} * * @deprecated As of version 1.3.1. Use the static `extend` method of the desired base class (e.g. {@link sap.ui.base.Object.extend}) * * @returns the created metadata object */ static defineClass( /** * name of an (already declared) constructor function */ sClassName: string, /** * static info used to create the metadata object */ oStaticInfo: { /** * qualified name of a base class */ baseType: string; /** * array of names of public methods */ publicMethods: string[]; }, /** * constructor function for the metadata object. If not given, it defaults to sap.ui.base.Metadata. */ FNMetaImpl?: Function ): sap.ui.base.Metadata; /** * Creates a subclass of class sap.ui.base.Object with name `sClassName` and enriches it with the information * contained in `oClassInfo`. * * `oClassInfo` might contain three kinds of information: * - `metadata:` an (optional) object literal with metadata about the class like implemented interfaces, * see {@link sap.ui.base.Object.MetadataOptions MetadataOptions} for details. The information in the object * literal will be wrapped by an instance of {@link sap.ui.base.Metadata Metadata}. Subclasses of sap.ui.base.Object * can enrich the set of supported metadata (e.g. see {@link sap.ui.core.Element.extend}). * * * - `constructor:` a function that serves as a constructor function for the new class. If no constructor * function is given, the framework creates a default implementation that delegates all its arguments to * the constructor function of the base class. * * any-other-name: any other property in the `oClassInfo` is copied into the prototype object * of the newly created class. Callers can thereby add methods or properties to all instances of the class. * But be aware that the given values are shared between all instances of the class. Usually, it doesn't * make sense to use primitive values here other than to declare public constants. * * If such a property has a function as its value, and if the property name does not start with an underscore * or with the prefix "on", the property name will be automatically added to the list of public methods * of the class (see property `publicMethods` in the `metadata` section). If a method's name matches that * pattern, but is not meant to be public, it shouldn't be included in the class info object, but be assigned * to the prototype instead. * * * * The prototype object of the newly created class uses the same prototype as instances of the base class * (prototype chaining). * * A metadata object is always created, even if there is no `metadata` entry in the `oClassInfo` object. * A getter for the metadata is always attached to the prototype and to the class (constructor function) * itself. * * Last but not least, with the third argument `FNMetaImpl` the constructor of a metadata class can be specified. * Instances of that class will be used to represent metadata for the newly created class and for any subclass * created from it. Typically, only frameworks will use this parameter to enrich the metadata for a new * class hierarchy they introduce (e.g. {@link sap.ui.core.Element.extend Element}). * * @since 1.3.1 * * @returns the created class / constructor function */ static extend>( /** * name of the class to be created */ sClassName: string, /** * structured object with information about the class */ oClassInfo?: sap.ClassInfo, /** * constructor function for the metadata object. If not given, it defaults to sap.ui.base.Metadata. */ FNMetaImpl?: Function ): Function; /** * Checks whether the given object is an instance of the named type. This function is a short-hand convenience * for {@link sap.ui.base.Object#isA}. * * Please see the API documentation of {@link sap.ui.base.Object#isA} for more details. * * @since 1.56 * @deprecated As of version 1.120. please use {@link sap.ui.base.Object.isObjectA}. * * @returns Whether the given object is an instance of the given type or of any of the given types */ static isA( /** * Object which will be checked whether it is an instance of the given type */ oObject: any, /** * Type or types to check for */ vTypeName: string | string[] ): oObject is T; /** * Checks whether the given object is an instance of the named type. This function is a short-hand convenience * for {@link sap.ui.base.Object#isA}. * * Please see the API documentation of {@link sap.ui.base.Object#isA} for more details. * * @since 1.120 * * @returns Whether the given object is an instance of the given type or of any of the given types */ static isObjectA( /** * Object which will be checked whether it is an instance of the given type */ oObject: any, /** * Type or types to check for */ vTypeName: string | string[] ): oObject is T; /** * Destructor method for objects. */ destroy(): void; /** * Returns the public facade of this object. * * By default, the public facade is implemented as an instance of {@link sap.ui.base.Interface}, exposing * the `publicMethods` as defined in the metadata of the class of this object. * * See the documentation of the {@link #.extend extend} method for an explanation of `publicMethods`. * * The facade is created on the first call of `getInterface` and reused for all later calls. * * * @returns A facade for this object, with at least the public methods of the class of this. */ getInterface(): sap.ui.base.Object; /** * Returns the metadata for the class that this object belongs to. * * This method is only defined when metadata has been declared by using {@link sap.ui.base.Object.defineClass } * or {@link sap.ui.base.Object.extend}. * * * @returns metadata for the class of the object */ getMetadata(): sap.ui.base.Metadata; /** * Checks whether this object is an instance of the named type. * * This check is solely based on the type names as declared in the class metadata. It compares the given * `vTypeName` with the name of the class of this object, with the names of any base class of that class * and with the names of all interfaces implemented by any of the aforementioned classes. * * Instead of a single type name, an array of type names can be given and the method will check if this * object is an instance of any of the listed types (logical or). * * Should the UI5 class system in future implement additional means of associating classes with type names * (e.g. by introducing mixins), then this method might detect matches for those names as well. * * @since 1.56 * * @returns Whether this object is an instance of the given type or of any of the given types */ isA( /** * Type or types to check for */ vTypeName: string | string[] ): this is T; } /** * Manages a pool of objects for reuse, all of the same type; the type has to be specified at construction * time. * * Each pool maintains a list of free objects of the given type. If {@link sap.ui.base.ObjectPool.prototype.borrowObject } * is called, an existing free object is taken from the pool. When no free object is available, a new instance * is created by calling the constructor without any arguments. In either case, the {@link sap.ui.base.Poolable#init } * method is called on the object to initialize it with the data for the current caller. * * When the object is no longer needed, it has to be returned to the pool by calling {@link #returnObject}. * At that point in time, {@link sap.ui.base.Poolable#reset} is called on the object to remove all data * from it. Then it is is added back to the list of free objects for future reuse. * * See {@link sap.ui.base.Poolable} for a description of the contract for poolable objects. * * Example: * ```javascript * * sap.ui.define([ * "sap/ui/base/Event", * "sap/ui/base/ObjectPool" * ], function(Event, ObjectPool) { * * // create a pool for events * var oEventPool = new ObjectPool(Event); * * ... * * // borrow an instance and initialize it at the same time * var oEvent = oEventPool.borrowObject('myEvent', this, {foo: 'bar'}); * // this internally calls oEvent.init('myEvent', this, {foo: 'bar'}) * * // return the borrowed object * oEventPool.returnObject(oEvent); * // this internally calls oEvent.reset() * * ... * * }}); * ``` */ class ObjectPool extends sap.ui.base.Object { /** * Creates an `ObjectPool` for maintaining instances of the given class `oObjectClass`. * * `oObjectClass` must implement the {@link sap.ui.base.Poolable} interface. */ constructor( /** * Constructor for the class of objects that this pool should manage */ oObjectClass: new () => Object ); /** * Creates a new subclass of class sap.ui.base.ObjectPool with name `sClassName` and enriches it with the * information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.base.ObjectPool. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Borrows a free object from the pool. Any arguments to this method are forwarded to the init method of * the borrowed object. * * * @returns The borrowed object of the same type that has been specified for this pool */ borrowObject( /** * optional initialization parameters for the borrowed object */ ...args: any[] ): Object; /** * Returns an object to the pool. The object must have been borrowed from this pool beforehand. The reset * method is called on the object before it is added to the set of free objects. */ returnObject( /** * The object to return to the pool */ oObject: Object ): void; } /** * Event object of the ManagedObject#formatError event. */ type ManagedObject$FormatErrorEvent = sap.ui.base.Event< ManagedObject$FormatErrorEventParameters, ManagedObject >; /** * Event object of the ManagedObject#modelContextChange event. */ type ManagedObject$ModelContextChangeEvent = sap.ui.base.Event< ManagedObject$ModelContextChangeEventParameters, ManagedObject >; /** * Event object of the ManagedObject#parseError event. */ type ManagedObject$ParseErrorEvent = sap.ui.base.Event< ManagedObject$ParseErrorEventParameters, ManagedObject >; /** * Event object of the ManagedObject#validationError event. */ type ManagedObject$ValidationErrorEvent = sap.ui.base.Event< ManagedObject$ValidationErrorEventParameters, ManagedObject >; /** * Event object of the ManagedObject#validationSuccess event. */ type ManagedObject$ValidationSuccessEvent = sap.ui.base.Event< ManagedObject$ValidationSuccessEventParameters, ManagedObject >; } /** * The SAPUI5 Core Runtime. * * Contains the UI5 Core and all its components, base classes for Controls, Components and the Model View * Controller classes. * * @since 0.8 */ namespace core { /** * Applies the support for custom style classes on the prototype of a `sap.ui.core.Element`. * * All controls (subclasses of `sap.ui.core.Control`) provide the support custom style classes. The control * API provides functions to the application which allow it to add, remove or change style classes for the * control. In general, this option is not available for elements because elements do not necessarily have * a representation in the DOM. * * This function can be used by a control developer to explicitly enrich the API of his/her element implementation * with the API functions for the custom style class support. It must be called on the prototype of the * element. * * **Usage Example:** * ```javascript * * sap.ui.define(['sap/ui/core/Element', 'sap/ui/core/CustomStyleClassSupport'], function(Element, CustomStyleClassSupport) { * "use strict"; * var MyElement = Element.extend("my.MyElement", { * metadata : { * //... * } * //... * }); * * CustomStyleClassSupport.apply(MyElement.prototype); * * return MyElement; * }, true); * ``` * * * The classes are written to the HTML automatically when using the {@link sap.ui.core.RenderManager Semantic Rendering API}. * To ensure that the classes are written to the HTML with the traditional string-based rendering, when * writing the root tag of the element you must call the function `oRenderManager.writeClasses(oElement);` * ({@link sap.ui.core.RenderManager#writeClasses}) within the renderer of the control to which the element * belongs. * * This function adds the following functions to the elements prototype: * - `addStyleClass`: {@link sap.ui.core.Control#addStyleClass} * - `removeStyleClass`: {@link sap.ui.core.Control#removeStyleClass} * - `toggleStyleClass`: {@link sap.ui.core.Control#toggleStyleClass} * - `hasStyleClass`: {@link sap.ui.core.Control#hasStyleClass} In addition the clone function of * the element is extended to ensure that the custom style classes are also available on the cloned element. * * **Note:** This function can only be used within control development. An application cannot add * style class support on existing elements by calling this function. */ function CustomStyleClassSupport(): void; namespace delegate { /** * Parameters of the ItemNavigation#AfterFocus event. */ interface ItemNavigation$AfterFocusEventParameters {} /** * Parameters of the ItemNavigation#BeforeFocus event. */ interface ItemNavigation$BeforeFocusEventParameters {} /** * Parameters of the ItemNavigation#BorderReached event. */ interface ItemNavigation$BorderReachedEventParameters {} /** * Parameters of the ItemNavigation#FocusAgain event. */ interface ItemNavigation$FocusAgainEventParameters {} /** * Parameters of the ItemNavigation#FocusLeave event. */ interface ItemNavigation$FocusLeaveEventParameters {} /** * Delegate for the navigation between DOM nodes with the keyboard. * * The `ItemNavigation` provides keyboard and mouse navigation between DOM nodes representing items. This * means that controls rendering a list of items can attach this delegate to get a common keyboard and mouse * support to navigate between these items. It is possible to navigate between the items via the arrow keys. * If needed, paging using the Page Up and Page Down keys is possible. (To activate call `setPageSize` with * a value > 0.) HOME and END keys are also supported. Focusing an item via mouse also is also supported. * For mouse navigation, the `mousedown` event is used. * * As the `ItemNavigation` works with DOM nodes, the items and the control area must be provided as DOM * references. There is one root DOM reference (set via `setRootDomRef`). All item DOM references (set via * `setItemDomRefs`) must be places somewhere inside of this root DOM reference. Only focusable items are * used for the navigation, meaning disabled items or separator items are just ignored by navigating through * the items. In some cases however, it makes sense to put the non-focusable items in the array of the DOM * references to keep the indexes stable or like in the calling control. **Hint:** To make a DOM reference * focusable a `tabindex` of -1 can be set. * * **Note** After re-rendering of the control or changing the DOM nodes of the control, the DOM references * of the `ItemNavigation` must be updated. Then the same item (corresponding to the index) will get the * focus. * * The `ItemNavigation` adjusts the `tabindex` of all DOM references relating to the current focused item. * So if the control containing the items gets the focus (e.g. via tab navigation), it is always the focused * items which will be focused. * * **Note:** If the `ItemNavigation` is nested in another `ItemNavigation` (e.g. `SegmentedButton` in `Toolbar`), * the `RootDomRef` will always have `tabindex` -1. * * Per default the `ItemNavigation` cycles over the items. It navigates again to the first item if the Arrow * Down or Arrow Right key is pressed while the last item has the focus. It navigates to the last item if * arrow up or arrow left is pressed while the first item has the focus. If you want to stop the navigation * at the first and last item, call the `setCycling` method with a value of `false`. * * It is possible to have multiple columns in the item navigation. If multiple columns are used, the keyboard * navigation changes. The Arrow Right and Arrow Left keys will take the user to the next or previous item, * and the Arrow Up and Arrow Down keys will navigate the same way but in a vertical direction. * * The `ItemNavigation` also allows setting a selected index that is used to identify the selected item. * Initially, if no other focus is set, the selected item will be the focused one. Note that navigating * through the items will not change the selected item, only the focus. (For example a radio group has one * selected item.) */ class ItemNavigation extends sap.ui.base.EventProvider { /** * Creates an `ItemNavigation` delegate that can be attached to controls requiring capabilities for keyboard * navigation between items. */ constructor( /** * The root DOM reference that includes all items */ oDomRef: /* was Element */ global_Element, /** * Array of DOM references representing the items for the navigation */ aItemDomRefs: /* was Element */ global_Element[], /** * Whether the selected element should be in the tab chain or not */ bNotInTabChain?: boolean ); /** * Creates a new subclass of class sap.ui.core.delegate.ItemNavigation with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.EventProvider.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.delegate.ItemNavigation. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Returns disabled modifiers These modifiers will not be handled by the `ItemNavigation` * * * @returns Object that includes event type with disabled keys as an array */ getDisabledModifiers( /** * Object that includes event type with disabled keys as an array */ oDisabledModifiers: object ): object; /** * Returns the array of item DOM references * * * @returns Array of item DOM references */ getItemDomRefs(): /* was Element */ global_Element[]; /** * Returns the root DOM reference surrounding the items * * * @returns Root DOM reference */ getRootDomRef(): /* was Element */ global_Element; /** * Check whether given event has disabled modifier or not * * * @returns Flag if disabled modifiers are set */ hasDisabledModifier( /** * jQuery event */ oEvent: jQuery.Event ): boolean; /** * Sets whether the items are displayed in columns. * * If columns are used, the Arrow Up and Arrow Down keys navigate to the next or previous item of the column. * If the first or last item of the column is reached, the next focused item is then in the next or previous * column. * * * @returns `this` to allow method chaining */ setColumns( /** * Count of columns for the table mode or cycling mode */ iColumns: int, /** * Forbids jumping to an other column with Arrow Up and Arrow Down keys */ bNoColumnChange: boolean ): this; /** * Sets whether the `ItemNavigation` should cycle through the items. * * If cycling is disabled the navigation stops at the first and last item, if the corresponding arrow keys * are used. * * * @returns `this` to allow method chaining */ setCycling( /** * Set to true if cycling should be done, else false */ bCycling: boolean ): this; /** * Sets the disabled modifiers These modifiers will not be handled by the `ItemNavigation` * * * ```javascript * * Example: Disable shift + up handling of the `ItemNavigation` * * oItemNavigation.setDisabledModifiers({ * sapnext : ["shift"] * }); * * Possible keys are : "shift", "alt", "ctrl", "meta" * Possible events are : "sapnext", "sapprevious", "saphome", "sapend" * ``` * * * * @returns `this` to allow method chaining */ setDisabledModifiers( /** * Object that includes event type with disabled keys as an array */ oDisabledModifiers: Object ): this; /** * Sets behavior of HOME and END keys if columns are used. * * * @returns `this` to allow method chaining */ setHomeEndColumnMode( /** * HOME -> go to first item in row; END -> go to last item in row */ bStayInRow: boolean, /** * HOME/END with CTRL -> go to first/last item of all */ bCtrlEnabled: boolean ): this; /** * Sets the item DOM references as an array for the items * * * @returns `this` to allow method chaining */ setItemDomRefs( /** * Array of DOM references or DOM node list object, representing the items */ aItemDomRefs: /* was Element */ global_Element[] ): this; /** * Sets the page size of the item navigation to allow Page Up and Page Down keys. * * * @returns `this` to allow method chaining */ setPageSize( /** * The page size, needs to be at least 1 */ iPageSize: int ): this; /** * Sets the root DOM reference surrounding the items * * * @returns `this` to allow method chaining */ setRootDomRef( /** * Root DOM reference */ oDomRef: /* was Element */ global_Element ): this; /** * Sets the selected index if the used control supports selection. * * * @returns `this` to allow method chaining */ setSelectedIndex( /** * Index of the first selected item */ iIndex: int ): this; /** * Sets whether the `ItemNavigation` should use the table mode to navigate through the items (navigation * in a grid). * * * @returns `this` to allow method chaining */ setTableMode( /** * Set to true if table mode should be used, else false */ bTableMode: boolean, /** * This sets a different behavior for table mode. In this mode we keep using table navigation but there * are some differences. e.g. * - Page-up moves focus to the first row, not to the first cell like in table mode * - Page-down moves focus to the last row, not to the last cell like in table mode */ bTableList?: boolean ): this; } /** * Delegate for touch scrolling on mobile devices. * * This delegate uses native scrolling of mobile and desktop browsers. Third party scrolling libraries are * not supported. * * Controls that implement ScrollEnablement should additionally provide the getScrollDelegate method that * returns the current instance of this delegate object * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ class ScrollEnablement extends sap.ui.base.Object { /** * Creates a ScrollEnablement delegate that can be attached to Controls requiring capabilities for scrolling * of a certain part of their DOM. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor( /** * the Control of which this Scroller is the delegate */ oControl: sap.ui.core.Control, /** * the Id of the element within the DOM of the Control which should be scrollable */ sScrollContentDom: string, /** * the configuration of the scroll delegate */ oConfig: { /** * Whether the element should be scrollable horizontally */ horizontal?: boolean; /** * Whether the element should be scrollable vertically */ vertical?: boolean; /** * Deprecated since 1.42, the parameter has no effect */ zynga?: boolean; /** * Deprecated since 1.42, the parameter has no effect */ iscroll?: boolean; /** * Deprecated since 1.42, the parameter has no effect */ preventDefault?: boolean; /** * If true, the delegate will also be active to allow touch like scrolling with the mouse on non-touch platforms. */ nonTouchScrolling?: boolean; /** * Native scrolling does not need content wrapper. In this case, ID of the container element should be provided. */ scrollContainerId?: string; /** * if true, the delegate event listeners are called before the event listeners of the element; default is * "false". */ callBefore?: boolean; } ); /** * Creates a new subclass of class sap.ui.core.delegate.ScrollEnablement with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo< T, sap.ui.core.delegate.ScrollEnablement >, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.delegate.ScrollEnablement. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Destroys this Scrolling delegate. * * This function must be called by the control which uses this delegate in the `exit` function. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ destroy(): void; /** * Calculates scroll position of a child of a container. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Position object. */ getChildPosition( /** * An element(DOM or jQuery) for which the scroll position will be calculated. */ vElement: HTMLElement | jQuery ): object; /** * Get current setting for horizontal scrolling. * * @since 1.9.1 * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns true if horizontal scrolling is enabled */ getHorizontal(): boolean; /** * Get current setting for vertical scrolling. * * @since 1.9.1 * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns true if vertical scrolling is enabled */ getVertical(): boolean; /** * Refreshes this Scrolling delegate. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ refresh(): void; /** * Scrolls to a specific position in scroll container. */ scrollTo( /** * Horizontal position of the scrollbar */ x: int, /** * Vertical position of the scrollbar */ y: int, /** * The duration of animated scrolling in milliseconds. To scroll immediately without animation, give 0 as * value. */ time: int, /** * Called when the scroll completes or stops without completing */ fnScrollEndCallback: Function ): this; /** * Scrolls to a specific position in scroll container. */ scrollTo( /** * Horizontal position of the scrollbar */ x: int, /** * Vertical position of the scrollbar */ y: int, /** * Called when the scroll completes or stops without completing */ fnScrollEndCallback: Function ): this; /** * Scrolls to an element within a container. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ scrollToElement( /** * A DOM element. */ oElement: HTMLElement, /** * The duration of animated scrolling in milliseconds. To scroll immediately without animation, give 0 as * value. */ iTime?: int, /** * Specifies an additional left and top offset of the target scroll position, relative to the upper left * corner of the DOM element */ aOffset?: int[], /** * The configuration of the parameter for scrolling only if the element is not in the view port - i.e. if * bSkipElementsInScrollport is set to true, there will be no scrolling if the element is already in the * view port */ bSkipElementsInScrollport?: boolean ): this; /** * Setter for property `bounce`. * * @since 1.17 * @deprecated As of version 1.42. without replacement. * @ui5-protected Do not call from applications (only from related classes in the framework) */ setBounce( /** * new value for property `bounce`. */ bBounce: boolean ): void; /** * Sets GrowingList control to scroll container * * @since 1.11.0 * @ui5-protected Do not call from applications (only from related classes in the framework) */ setGrowingList( /** * Scrolling callback */ fnScrollLoadCallback: Function, /** * Scrolling direction */ sScrollLoadDirection: /* was: sap.m.ListGrowingDirection */ any, /** * listener for the `overflowChange` event */ fnOverflowChange: Function ): void; /** * Enable or disable horizontal scrolling. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ setHorizontal( /** * set true to enable horizontal scrolling, false - to disable */ bHorizontal: boolean ): void; /** * Sets IconTabBar control to scroll container * * @since 1.16.1 * @ui5-protected Do not call from applications (only from related classes in the framework) */ setIconTabBar( /** * instance */ oIconTabBar: /* was: sap.m.IconTabBar */ any, /** * callback function for the scroll end event */ fnScrollEndCallback: Function, /** * callback function for the scroll start event */ fnScrollStartCallback: Function ): void; /** * Set overflow control on top of scroll container. * * @since 1.9.2 * @ui5-protected Do not call from applications (only from related classes in the framework) */ setPullDown( /** * Top control that should be normally hidden over the top border of the scroll container (pull-down content). */ oControl: sap.ui.core.Control ): void; /** * Enable or disable vertical scrolling. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ setVertical( /** * set true to enable vertical scrolling, false - to disable */ bVertical: boolean ): void; } /** * Event object of the ItemNavigation#AfterFocus event. */ type ItemNavigation$AfterFocusEvent = sap.ui.base.Event< ItemNavigation$AfterFocusEventParameters, ItemNavigation >; /** * Event object of the ItemNavigation#BeforeFocus event. */ type ItemNavigation$BeforeFocusEvent = sap.ui.base.Event< ItemNavigation$BeforeFocusEventParameters, ItemNavigation >; /** * Event object of the ItemNavigation#BorderReached event. */ type ItemNavigation$BorderReachedEvent = sap.ui.base.Event< ItemNavigation$BorderReachedEventParameters, ItemNavigation >; /** * Event object of the ItemNavigation#FocusAgain event. */ type ItemNavigation$FocusAgainEvent = sap.ui.base.Event< ItemNavigation$FocusAgainEventParameters, ItemNavigation >; /** * Event object of the ItemNavigation#FocusLeave event. */ type ItemNavigation$FocusLeaveEvent = sap.ui.base.Event< ItemNavigation$FocusLeaveEventParameters, ItemNavigation >; } /** * Contains classes and helpers related to drag & drop functionality. * * @since 1.52 */ namespace dnd { /** * When a user requests to drag some controls that can be dragged, a drag session is started. The drag session * can be used to transfer data between applications or between dragged and dropped controls. Please see * provided APIs for more details. * * **Note:** An implementation of this interface is provided by the framework during drag-and-drop operations * and is exposed as `dragSession` parameter of the different drag and drop events. * * **Note:** This interface is not intended to be implemented by controls, applications or test code. Extending * it with additional methods in future versions will be regarded as a compatible change. */ interface DragSession { __implements__sap_ui_core_dnd_DragSession: boolean; /** * Returns the data that has been set via `setComplexData` method. * * * @returns The previously set data or undefined */ getComplexData( /** * The key of the data */ sKey: string ): any | undefined; /** * Returns the data that has been set via `setData` method. * * * @returns Data */ getData( /** * The key of the data */ sKey: string ): string; /** * Returns the dragged control, if available within the same UI5 application frame. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The dragged control */ getDragControl(): sap.ui.core.Element | null; /** * The valid drop target underneath the dragged control. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The drop target */ getDropControl(): sap.ui.core.Element | null; /** * Returns the drop configuration corresponding to the drop control. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The drop configuration */ getDropInfo(): sap.ui.core.dnd.DropInfo | null; /** * Returns the calculated position of the drop action relative to the valid dropped control. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The calculated position */ getDropPosition(): sap.ui.core.dnd.RelativeDropPosition; /** * Returns the drop indicator. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Drop indicator's DOM reference */ getIndicator(): HTMLElement | null; /** * Returns the visual configuration of the drop indicator. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Drop indicator configuration */ getIndicatorConfig(): object; /** * Returns the data that has been set via `setTextData` method. * * * @returns Data */ getTextData(): string; /** * Sets any type of data (even functions, pointers, anything non-serializable) with any MIME type. **Note:** * This works only within a UI5 application within the same window/frame. */ setComplexData( /** * The key of the data */ sKey: string, /** * Data */ vData: any ): void; /** * Sets string data with any MIME type. **Note:** This works if you navigate between different windows. */ setData( /** * The key of the data */ sKey: string, /** * Data */ sData: string ): void; /** * Set the valid target. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ setDropControl( /** * The dropped target */ oControl: sap.ui.core.Element ): void; /** * Defines the visual configuration of the drop indicator for the current `DropInfo`. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ setIndicatorConfig( /** * Custom styles of the drop indicator. */ mConfig: object ): void; /** * Sets string data with plain text MIME type. **Note:** This works if you navigate between different windows. */ setTextData( /** * Data */ sData: string ): void; } /** * Marker interface for drag configuration providing information about the source of the drag operation. * * @since 1.52.0 */ interface IDragInfo { __implements__sap_ui_core_dnd_IDragInfo: boolean; } /** * Marker interface for drop configuration providing information about the target of the drop operation. * * @since 1.52.0 */ interface IDropInfo { __implements__sap_ui_core_dnd_IDropInfo: boolean; } /** * Describes the settings that can be provided to the DragDropBase constructor. */ interface $DragDropBaseSettings extends sap.ui.core.$ElementSettings { /** * Defines the name of the group to which this object belongs. If `groupName` is specified, then this object * will only interacts with other drag-and-drop objects within the same group. */ groupName?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Indicates whether this configuration is active or not. * * @since 1.56 */ enabled?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Indicates limited keyboard handling support for drag-and-drop configurations defined for aggregation * reordering. * * **Note:** If the drag-and-drop configuration is defined for the aggregation reordering of a control (only * if the `dropPosition` property is `Between`), the `Ctrl/Cmd + Left/Right` keys for horizontal move or * the `Ctrl/Cmd + Up/Down` keys for vertical move trigger a series of pseudo drag-and-drop events, such * as `dragstart, dragenter, drop, dragend`, to create an artificial drag-and-drop action. This keyboard * handling might not be suitable for every control where aggregation reordering is defined, and in such * cases, this property must not be set to `true`. * * @since 1.126 */ keyboardHandling?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; } /** * Describes the settings that can be provided to the DragDropInfo constructor. */ interface $DragDropInfoSettings extends sap.ui.core.dnd.$DropInfoSettings { /** * The name of the aggregation from which all children can be dragged. If undefined, the control itself * can be dragged. */ sourceAggregation?: | string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * The target element for this drag and drop action. If undefined, the control with this drag and drop configuration * itself is the target. Leaving this empty, but defining source and target aggregation, allows you to reorder * the children within a control, for example. */ targetElement?: sap.ui.core.Element | string; /** * This event is fired when the user starts dragging an element. */ dragStart?: (oEvent: DragDropInfo$DragStartEvent) => void; /** * This event is fired when a drag operation is being ended. * * @since 1.56 */ dragEnd?: (oEvent: sap.ui.base.Event) => void; } /** * Describes the settings that can be provided to the DragInfo constructor. */ interface $DragInfoSettings extends sap.ui.core.dnd.$DragDropBaseSettings { /** * The name of the aggregation from which all children can be dragged. If undefined, the control itself * can be dragged. */ sourceAggregation?: | string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * This event is fired when the user starts dragging an element. */ dragStart?: (oEvent: DragInfo$DragStartEvent) => void; /** * This event is fired when a drag operation is ended. * * @since 1.56 */ dragEnd?: (oEvent: DragInfo$DragEndEvent) => void; } /** * Describes the settings that can be provided to the DropInfo constructor. */ interface $DropInfoSettings extends sap.ui.core.dnd.$DragDropBaseSettings { /** * The aggregation name in the drop target control which is the target of this drag-and-drop action. If * undefined, the entire control is the target. This can be handy if the target control does not have any * aggregations or if the drop position within the target does not matter. */ targetAggregation?: | string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Defines the visual drop effect. */ dropEffect?: | sap.ui.core.dnd.DropEffect | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Defines the position for the drop action, visualized by a rectangle. */ dropPosition?: | sap.ui.core.dnd.DropPosition | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Defines the layout of the droppable controls if `dropPosition` is set to `Between` or `OnOrBetween`. */ dropLayout?: | sap.ui.core.dnd.DropLayout | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * This event is fired when a dragged element enters a drop target. */ dragEnter?: (oEvent: DropInfo$DragEnterEvent) => void; /** * This event is fired when an element is being dragged over a valid drop target. * * @since 1.56 */ dragOver?: (oEvent: DropInfo$DragOverEvent) => void; /** * This event is fired when an element is dropped on a valid drop target, as specified by the drag-and-drop * info. */ drop?: (oEvent: DropInfo$DropEvent) => void; } /** * Parameters of the DragDropInfo#dragEnd event. */ interface DragDropInfo$DragEndEventParameters {} /** * Parameters of the DragDropInfo#dragStart event. */ interface DragDropInfo$DragStartEventParameters { /** * The target element that will be dragged */ target?: sap.ui.core.Element; /** * The UI5 `dragSession` object that exists only during drag and drop */ dragSession?: sap.ui.core.dnd.DragSession; /** * The underlying browser event */ browserEvent?: DragEvent; } /** * Parameters of the DragInfo#dragEnd event. */ interface DragInfo$DragEndEventParameters { /** * The target element that is being dragged */ target?: sap.ui.core.Element; /** * The UI5 `dragSession` object that exists only during drag and drop */ dragSession?: sap.ui.core.dnd.DragSession; /** * The underlying browser event */ browserEvent?: DragEvent; } /** * Parameters of the DragInfo#dragStart event. */ interface DragInfo$DragStartEventParameters { /** * The target element that will be dragged */ target?: sap.ui.core.Element; /** * The UI5 `dragSession` object that exists only during drag and drop */ dragSession?: sap.ui.core.dnd.DragSession; /** * The underlying browser event */ browserEvent?: DragEvent; } /** * Parameters of the DropInfo#dragEnter event. */ interface DropInfo$DragEnterEventParameters { /** * The target element on which the dragged element will be dropped */ target?: sap.ui.core.Element; /** * The UI5 `dragSession` object that exists only during drag and drop */ dragSession?: sap.ui.core.dnd.DragSession; /** * The calculated position of the drop action relative to the `target` */ dropPosition?: sap.ui.core.dnd.RelativeDropPosition; /** * The underlying browser event */ browserEvent?: DragEvent; } /** * Parameters of the DropInfo#dragOver event. */ interface DropInfo$DragOverEventParameters { /** * The target element on which the dragged element will be dropped */ target?: sap.ui.core.Element; /** * The UI5 `dragSession` object that exists only during drag and drop */ dragSession?: sap.ui.core.dnd.DragSession; /** * The calculated position of the drop action relative to the `target` */ dropPosition?: sap.ui.core.dnd.RelativeDropPosition; /** * The underlying browser event */ browserEvent?: DragEvent; } /** * Parameters of the DropInfo#drop event. */ interface DropInfo$DropEventParameters { /** * The UI5 `dragSession` object that exists only during drag and drop */ dragSession?: sap.ui.core.dnd.DragSession; /** * The element being dragged */ draggedControl?: sap.ui.core.Element; /** * The element being dropped */ droppedControl?: sap.ui.core.Element; /** * The calculated position of the drop action relative to the `droppedControl` */ dropPosition?: sap.ui.core.dnd.RelativeDropPosition; /** * The underlying browser event */ browserEvent?: DragEvent; } /** * Provides the base class for all drag-and-drop configurations. This feature enables a native HTML5 drag-and-drop * API for the controls, therefore it is limited to browser support. Restrictions: * - There is no accessible alternative for drag and drop. Applications which use the drag-and-drop functionality * must provide an accessible alternative UI (for example, action buttons or menus) to perform the same * operations. * - Transparency of the drag ghost element and the cursor during drag-and-drop operations depends on * the browser implementation. * - Constraining a drag position is not possible, therefore there is no snap-to-grid or snap-to-element * feature possible. * - Texts in draggable controls cannot be selected. * - The text of input fields in draggable controls can be selected, but not dragged. * * @since 1.52 */ abstract class DragDropBase extends sap.ui.core.Element { /** * Constructor for a new DragDropBase. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * See: * {@link https://ui5.sap.com/#/topic/3ddb6cde6a8d416598ac8ced3f5d82d5 Drag and Drop} */ constructor( /** * Initial settings for the new control */ mSettings?: sap.ui.core.dnd.$DragDropBaseSettings ); /** * Constructor for a new DragDropBase. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * See: * {@link https://ui5.sap.com/#/topic/3ddb6cde6a8d416598ac8ced3f5d82d5 Drag and Drop} */ constructor( /** * ID for the new control, generated automatically if no ID is given */ sId?: string, /** * Initial settings for the new control */ mSettings?: sap.ui.core.dnd.$DragDropBaseSettings ); /** * Creates a new subclass of class sap.ui.core.dnd.DragDropBase with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.Element.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.dnd.DragDropBase. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Gets current value of property {@link #getEnabled enabled}. * * Indicates whether this configuration is active or not. * * Default value is `true`. * * @since 1.56 * * @returns Value of property `enabled` */ getEnabled(): boolean; /** * Gets current value of property {@link #getGroupName groupName}. * * Defines the name of the group to which this object belongs. If `groupName` is specified, then this object * will only interacts with other drag-and-drop objects within the same group. * * * @returns Value of property `groupName` */ getGroupName(): string; /** * Gets current value of property {@link #getKeyboardHandling keyboardHandling}. * * Indicates limited keyboard handling support for drag-and-drop configurations defined for aggregation * reordering. * * **Note:** If the drag-and-drop configuration is defined for the aggregation reordering of a control (only * if the `dropPosition` property is `Between`), the `Ctrl/Cmd + Left/Right` keys for horizontal move or * the `Ctrl/Cmd + Up/Down` keys for vertical move trigger a series of pseudo drag-and-drop events, such * as `dragstart, dragenter, drop, dragend`, to create an artificial drag-and-drop action. This keyboard * handling might not be suitable for every control where aggregation reordering is defined, and in such * cases, this property must not be set to `true`. * * Default value is `false`. * * @since 1.126 * * @returns Value of property `keyboardHandling` */ getKeyboardHandling(): boolean; /** * Sets a new value for property {@link #getEnabled enabled}. * * Indicates whether this configuration is active or not. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * Default value is `true`. * * @since 1.56 * * @returns Reference to `this` in order to allow method chaining */ setEnabled( /** * New value for property `enabled` */ bEnabled?: boolean ): this; /** * Sets a new value for property {@link #getGroupName groupName}. * * Defines the name of the group to which this object belongs. If `groupName` is specified, then this object * will only interacts with other drag-and-drop objects within the same group. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setGroupName( /** * New value for property `groupName` */ sGroupName?: string ): this; /** * Sets a new value for property {@link #getKeyboardHandling keyboardHandling}. * * Indicates limited keyboard handling support for drag-and-drop configurations defined for aggregation * reordering. * * **Note:** If the drag-and-drop configuration is defined for the aggregation reordering of a control (only * if the `dropPosition` property is `Between`), the `Ctrl/Cmd + Left/Right` keys for horizontal move or * the `Ctrl/Cmd + Up/Down` keys for vertical move trigger a series of pseudo drag-and-drop events, such * as `dragstart, dragenter, drop, dragend`, to create an artificial drag-and-drop action. This keyboard * handling might not be suitable for every control where aggregation reordering is defined, and in such * cases, this property must not be set to `true`. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * Default value is `false`. * * @since 1.126 * * @returns Reference to `this` in order to allow method chaining */ setKeyboardHandling( /** * New value for property `keyboardHandling` */ bKeyboardHandling?: boolean ): this; } /** * Provides the configuration for drag-and-drop operations. * * **Note:** This configuration might be ignored due to control {@link sap.ui.core.Element.extend metadata } * restrictions. * * @since 1.52 */ class DragDropInfo extends sap.ui.core.dnd.DropInfo implements sap.ui.core.dnd.IDragInfo, sap.ui.core.dnd.IDropInfo { __implements__sap_ui_core_dnd_IDragInfo: boolean; __implements__sap_ui_core_dnd_IDropInfo: boolean; /** * Constructor for a new DragDropInfo. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * Initial settings for the DragDropInfo */ mSettings?: sap.ui.core.dnd.$DragDropInfoSettings ); /** * Constructor for a new DragDropInfo. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * ID for the new DragDropInfo, generated automatically if no ID is given */ sId?: string, /** * Initial settings for the DragDropInfo */ mSettings?: sap.ui.core.dnd.$DragDropInfoSettings ); /** * Creates a new subclass of class sap.ui.core.dnd.DragDropInfo with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.dnd.DropInfo.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.dnd.DragDropInfo. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Attaches event handler `fnFunction` to the {@link #event:dragEnd dragEnd} event of this `sap.ui.core.dnd.DragDropInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DragDropInfo` itself. * * This event is fired when a drag operation is being ended. * * @since 1.56 * * @returns Reference to `this` in order to allow method chaining */ attachDragEnd( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DragDropInfo` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:dragEnd dragEnd} event of this `sap.ui.core.dnd.DragDropInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DragDropInfo` itself. * * This event is fired when a drag operation is being ended. * * @since 1.56 * * @returns Reference to `this` in order to allow method chaining */ attachDragEnd( /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DragDropInfo` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:dragStart dragStart} event of this `sap.ui.core.dnd.DragDropInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DragDropInfo` itself. * * This event is fired when the user starts dragging an element. * * * @returns Reference to `this` in order to allow method chaining */ attachDragStart( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: DragDropInfo$DragStartEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DragDropInfo` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:dragStart dragStart} event of this `sap.ui.core.dnd.DragDropInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DragDropInfo` itself. * * This event is fired when the user starts dragging an element. * * * @returns Reference to `this` in order to allow method chaining */ attachDragStart( /** * The function to be called when the event occurs */ fnFunction: (p1: DragDropInfo$DragStartEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DragDropInfo` itself */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:dragEnd dragEnd} event of this `sap.ui.core.dnd.DragDropInfo`. * * The passed function and listener object must match the ones used for event registration. * * @since 1.56 * * @returns Reference to `this` in order to allow method chaining */ detachDragEnd( /** * The function to be called, when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:dragStart dragStart} event of this `sap.ui.core.dnd.DragDropInfo`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachDragStart( /** * The function to be called, when the event occurs */ fnFunction: (p1: DragDropInfo$DragStartEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Fires event {@link #event:dragEnd dragEnd} to attached listeners. * * @since 1.56 * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireDragEnd( /** * Parameters to pass along with the event */ mParameters?: object ): this; /** * Fires event {@link #event:dragStart dragStart} to attached listeners. * * Listeners may prevent the default action of this event by calling the `preventDefault` method on the * event object. The return value of this method indicates whether the default action should be executed. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Whether or not to prevent the default action */ fireDragStart( /** * Parameters to pass along with the event */ mParameters?: sap.ui.core.dnd.DragDropInfo$DragStartEventParameters ): boolean; /** * Gets current value of property {@link #getSourceAggregation sourceAggregation}. * * The name of the aggregation from which all children can be dragged. If undefined, the control itself * can be dragged. * * * @returns Value of property `sourceAggregation` */ getSourceAggregation(): string; /** * ID of the element which is the current target of the association {@link #getTargetElement targetElement}, * or `null`. */ getTargetElement(): sap.ui.core.ID | null; /** * Sets a new value for property {@link #getSourceAggregation sourceAggregation}. * * The name of the aggregation from which all children can be dragged. If undefined, the control itself * can be dragged. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setSourceAggregation( /** * New value for property `sourceAggregation` */ sSourceAggregation?: string ): this; /** * Sets the associated {@link #getTargetElement targetElement}. * * * @returns Reference to `this` in order to allow method chaining */ setTargetElement( /** * ID of an element which becomes the new target of this targetElement association; alternatively, an element * instance may be given */ oTargetElement: sap.ui.core.ID | sap.ui.core.Element ): this; } /** * Provides the configuration for drag operations. * * **Note:** This configuration might be ignored due to control {@link sap.ui.core.Element.extend metadata } * restrictions. * * @since 1.56 */ class DragInfo extends sap.ui.core.dnd.DragDropBase implements sap.ui.core.dnd.IDragInfo { __implements__sap_ui_core_dnd_IDragInfo: boolean; /** * Constructor for a new DragInfo. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * Initial settings for the DragInfo */ mSettings?: sap.ui.core.dnd.$DragInfoSettings ); /** * Constructor for a new DragInfo. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * ID for the new DragInfo, generated automatically if no ID is given */ sId?: string, /** * Initial settings for the DragInfo */ mSettings?: sap.ui.core.dnd.$DragInfoSettings ); /** * Creates a new subclass of class sap.ui.core.dnd.DragInfo with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.dnd.DragDropBase.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.dnd.DragInfo. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Attaches event handler `fnFunction` to the {@link #event:dragEnd dragEnd} event of this `sap.ui.core.dnd.DragInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DragInfo` itself. * * This event is fired when a drag operation is ended. * * @since 1.56 * * @returns Reference to `this` in order to allow method chaining */ attachDragEnd( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: DragInfo$DragEndEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DragInfo` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:dragEnd dragEnd} event of this `sap.ui.core.dnd.DragInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DragInfo` itself. * * This event is fired when a drag operation is ended. * * @since 1.56 * * @returns Reference to `this` in order to allow method chaining */ attachDragEnd( /** * The function to be called when the event occurs */ fnFunction: (p1: DragInfo$DragEndEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DragInfo` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:dragStart dragStart} event of this `sap.ui.core.dnd.DragInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DragInfo` itself. * * This event is fired when the user starts dragging an element. * * * @returns Reference to `this` in order to allow method chaining */ attachDragStart( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: DragInfo$DragStartEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DragInfo` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:dragStart dragStart} event of this `sap.ui.core.dnd.DragInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DragInfo` itself. * * This event is fired when the user starts dragging an element. * * * @returns Reference to `this` in order to allow method chaining */ attachDragStart( /** * The function to be called when the event occurs */ fnFunction: (p1: DragInfo$DragStartEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DragInfo` itself */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:dragEnd dragEnd} event of this `sap.ui.core.dnd.DragInfo`. * * The passed function and listener object must match the ones used for event registration. * * @since 1.56 * * @returns Reference to `this` in order to allow method chaining */ detachDragEnd( /** * The function to be called, when the event occurs */ fnFunction: (p1: DragInfo$DragEndEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:dragStart dragStart} event of this `sap.ui.core.dnd.DragInfo`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachDragStart( /** * The function to be called, when the event occurs */ fnFunction: (p1: DragInfo$DragStartEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Fires event {@link #event:dragEnd dragEnd} to attached listeners. * * @since 1.56 * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireDragEnd( /** * Parameters to pass along with the event */ mParameters?: sap.ui.core.dnd.DragInfo$DragEndEventParameters ): this; /** * Fires event {@link #event:dragStart dragStart} to attached listeners. * * Listeners may prevent the default action of this event by calling the `preventDefault` method on the * event object. The return value of this method indicates whether the default action should be executed. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Whether or not to prevent the default action */ fireDragStart( /** * Parameters to pass along with the event */ mParameters?: sap.ui.core.dnd.DragInfo$DragStartEventParameters ): boolean; /** * Gets current value of property {@link #getSourceAggregation sourceAggregation}. * * The name of the aggregation from which all children can be dragged. If undefined, the control itself * can be dragged. * * * @returns Value of property `sourceAggregation` */ getSourceAggregation(): string; /** * Sets a new value for property {@link #getSourceAggregation sourceAggregation}. * * The name of the aggregation from which all children can be dragged. If undefined, the control itself * can be dragged. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setSourceAggregation( /** * New value for property `sourceAggregation` */ sSourceAggregation?: string ): this; } /** * Provides the configuration for drop operations. **Note:** This configuration might be ignored due to * control {@link sap.ui.core.Element.extend metadata} restrictions. * * @since 1.56 */ class DropInfo extends sap.ui.core.dnd.DragDropBase implements sap.ui.core.dnd.IDropInfo { __implements__sap_ui_core_dnd_IDropInfo: boolean; /** * Constructor for a new DropInfo. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * Initial settings for the DropInfo */ mSettings?: sap.ui.core.dnd.$DropInfoSettings ); /** * Constructor for a new DropInfo. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * ID for the new DropInfo, generated automatically if no ID is given */ sId?: string, /** * Initial settings for the DropInfo */ mSettings?: sap.ui.core.dnd.$DropInfoSettings ); /** * Creates a new subclass of class sap.ui.core.dnd.DropInfo with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.dnd.DragDropBase.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.dnd.DropInfo. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Attaches event handler `fnFunction` to the {@link #event:dragEnter dragEnter} event of this `sap.ui.core.dnd.DropInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DropInfo` itself. * * This event is fired when a dragged element enters a drop target. * * * @returns Reference to `this` in order to allow method chaining */ attachDragEnter( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: DropInfo$DragEnterEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DropInfo` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:dragEnter dragEnter} event of this `sap.ui.core.dnd.DropInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DropInfo` itself. * * This event is fired when a dragged element enters a drop target. * * * @returns Reference to `this` in order to allow method chaining */ attachDragEnter( /** * The function to be called when the event occurs */ fnFunction: (p1: DropInfo$DragEnterEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DropInfo` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:dragOver dragOver} event of this `sap.ui.core.dnd.DropInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DropInfo` itself. * * This event is fired when an element is being dragged over a valid drop target. * * @since 1.56 * * @returns Reference to `this` in order to allow method chaining */ attachDragOver( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: DropInfo$DragOverEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DropInfo` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:dragOver dragOver} event of this `sap.ui.core.dnd.DropInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DropInfo` itself. * * This event is fired when an element is being dragged over a valid drop target. * * @since 1.56 * * @returns Reference to `this` in order to allow method chaining */ attachDragOver( /** * The function to be called when the event occurs */ fnFunction: (p1: DropInfo$DragOverEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DropInfo` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:drop drop} event of this `sap.ui.core.dnd.DropInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DropInfo` itself. * * This event is fired when an element is dropped on a valid drop target, as specified by the drag-and-drop * info. * * * @returns Reference to `this` in order to allow method chaining */ attachDrop( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: DropInfo$DropEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DropInfo` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:drop drop} event of this `sap.ui.core.dnd.DropInfo`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.dnd.DropInfo` itself. * * This event is fired when an element is dropped on a valid drop target, as specified by the drag-and-drop * info. * * * @returns Reference to `this` in order to allow method chaining */ attachDrop( /** * The function to be called when the event occurs */ fnFunction: (p1: DropInfo$DropEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.dnd.DropInfo` itself */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:dragEnter dragEnter} event of this `sap.ui.core.dnd.DropInfo`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachDragEnter( /** * The function to be called, when the event occurs */ fnFunction: (p1: DropInfo$DragEnterEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:dragOver dragOver} event of this `sap.ui.core.dnd.DropInfo`. * * The passed function and listener object must match the ones used for event registration. * * @since 1.56 * * @returns Reference to `this` in order to allow method chaining */ detachDragOver( /** * The function to be called, when the event occurs */ fnFunction: (p1: DropInfo$DragOverEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:drop drop} event of this `sap.ui.core.dnd.DropInfo`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachDrop( /** * The function to be called, when the event occurs */ fnFunction: (p1: DropInfo$DropEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Fires event {@link #event:dragEnter dragEnter} to attached listeners. * * Listeners may prevent the default action of this event by calling the `preventDefault` method on the * event object. The return value of this method indicates whether the default action should be executed. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Whether or not to prevent the default action */ fireDragEnter( /** * Parameters to pass along with the event */ mParameters?: sap.ui.core.dnd.DropInfo$DragEnterEventParameters ): boolean; /** * Fires event {@link #event:dragOver dragOver} to attached listeners. * * Listeners may prevent the default action of this event by calling the `preventDefault` method on the * event object. The return value of this method indicates whether the default action should be executed. * * @since 1.56 * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Whether or not to prevent the default action */ fireDragOver( /** * Parameters to pass along with the event */ mParameters?: sap.ui.core.dnd.DropInfo$DragOverEventParameters ): boolean; /** * Fires event {@link #event:drop drop} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireDrop( /** * Parameters to pass along with the event */ mParameters?: sap.ui.core.dnd.DropInfo$DropEventParameters ): this; /** * Gets current value of property {@link #getDropEffect dropEffect}. * * Defines the visual drop effect. * * Default value is `"Move"`. * * * @returns Value of property `dropEffect` */ getDropEffect(): sap.ui.core.dnd.DropEffect; /** * Gets current value of property {@link #getDropLayout dropLayout}. * * Defines the layout of the droppable controls if `dropPosition` is set to `Between` or `OnOrBetween`. * * Default value is `"Default"`. * * * @returns Value of property `dropLayout` */ getDropLayout(): sap.ui.core.dnd.DropLayout; /** * Gets current value of property {@link #getDropPosition dropPosition}. * * Defines the position for the drop action, visualized by a rectangle. * * Default value is `"On"`. * * * @returns Value of property `dropPosition` */ getDropPosition(): sap.ui.core.dnd.DropPosition; /** * Gets current value of property {@link #getTargetAggregation targetAggregation}. * * The aggregation name in the drop target control which is the target of this drag-and-drop action. If * undefined, the entire control is the target. This can be handy if the target control does not have any * aggregations or if the drop position within the target does not matter. * * * @returns Value of property `targetAggregation` */ getTargetAggregation(): string; /** * Sets a new value for property {@link #getDropEffect dropEffect}. * * Defines the visual drop effect. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * Default value is `"Move"`. * * * @returns Reference to `this` in order to allow method chaining */ setDropEffect( /** * New value for property `dropEffect` */ sDropEffect?: sap.ui.core.dnd.DropEffect ): this; /** * Sets a new value for property {@link #getDropLayout dropLayout}. * * Defines the layout of the droppable controls if `dropPosition` is set to `Between` or `OnOrBetween`. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * Default value is `"Default"`. * * * @returns Reference to `this` in order to allow method chaining */ setDropLayout( /** * New value for property `dropLayout` */ sDropLayout?: sap.ui.core.dnd.DropLayout ): this; /** * Sets a new value for property {@link #getDropPosition dropPosition}. * * Defines the position for the drop action, visualized by a rectangle. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * Default value is `"On"`. * * * @returns Reference to `this` in order to allow method chaining */ setDropPosition( /** * New value for property `dropPosition` */ sDropPosition?: sap.ui.core.dnd.DropPosition ): this; /** * Sets a new value for property {@link #getTargetAggregation targetAggregation}. * * The aggregation name in the drop target control which is the target of this drag-and-drop action. If * undefined, the entire control is the target. This can be handy if the target control does not have any * aggregations or if the drop position within the target does not matter. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setTargetAggregation( /** * New value for property `targetAggregation` */ sTargetAggregation?: string ): this; } /** * Configuration options for visual drop effects that are given during a drag and drop operation. * * This enum is part of the 'sap/ui/core/library' module export and must be accessed by the property 'dnd.DropEffect'. * * @since 1.52.0 */ enum DropEffect { /** * A copy of the source item is made at the new location. */ Copy = "Copy", /** * A link is established to the source at the new location. */ Link = "Link", /** * An item is moved to a new location. */ Move = "Move", /** * The item cannot be dropped. */ None = "None", } /** * Configuration options for the layout of the droppable controls. * * This enum is part of the 'sap/ui/core/library' module export and must be accessed by the property 'dnd.DropLayout'. * * @since 1.52.0 */ enum DropLayout { /** * Default {@link sap.ui.core.Element.extend layout} definition of the aggregations. */ Default = "Default", /** * Droppable controls are arranged horizontally. */ Horizontal = "Horizontal", /** * Droppable controls are arranged vertically. */ Vertical = "Vertical", } /** * Configuration options for drop positions. * * This enum is part of the 'sap/ui/core/library' module export and must be accessed by the property 'dnd.DropPosition'. * * @since 1.52.0 */ enum DropPosition { /** * Drop between the controls. */ Between = "Between", /** * Drop on the control. */ On = "On", /** * Drop on the control or between the controls. */ OnOrBetween = "OnOrBetween", } /** * Drop positions relative to a dropped element. * * This enum is part of the 'sap/ui/core/library' module export and must be accessed by the property 'dnd.RelativeDropPosition'. * * @since 1.100.0 */ enum RelativeDropPosition { /** * Drop after the control. */ After = "After", /** * Drop before the control. */ Before = "Before", /** * Drop on the control. */ On = "On", } /** * Event object of the DragDropInfo#dragEnd event. */ type DragDropInfo$DragEndEvent = sap.ui.base.Event< DragDropInfo$DragEndEventParameters, DragDropInfo >; /** * Event object of the DragDropInfo#dragStart event. */ type DragDropInfo$DragStartEvent = sap.ui.base.Event< DragDropInfo$DragStartEventParameters, DragDropInfo >; /** * Event object of the DragInfo#dragEnd event. */ type DragInfo$DragEndEvent = sap.ui.base.Event< DragInfo$DragEndEventParameters, DragInfo >; /** * Event object of the DragInfo#dragStart event. */ type DragInfo$DragStartEvent = sap.ui.base.Event< DragInfo$DragStartEventParameters, DragInfo >; /** * Event object of the DropInfo#dragEnter event. */ type DropInfo$DragEnterEvent = sap.ui.base.Event< DropInfo$DragEnterEventParameters, DropInfo >; /** * Event object of the DropInfo#dragOver event. */ type DropInfo$DragOverEvent = sap.ui.base.Event< DropInfo$DragOverEventParameters, DropInfo >; /** * Event object of the DropInfo#drop event. */ type DropInfo$DropEvent = sap.ui.base.Event< DropInfo$DropEventParameters, DropInfo >; } /** * Format classes */ namespace format { namespace DateFormat { /** * Interface for a timezone-specific DateFormat, which is able to format and parse a date based on a given * timezone. The timezone is used to convert the given date, and also for timezone-related pattern symbols. * The timezone is an IANA timezone ID, e.g. "America/New_York". * See: * sap.ui.core.format.DateFormat * * @since 1.99 */ interface DateTimeWithTimezone { __implements__sap_ui_core_format_DateFormat_DateTimeWithTimezone: boolean; /** * Format a date object to a string according to the given timezone and format options. * * @since 1.99 * * @returns the formatted output value. If an invalid date or timezone is given, an empty string is returned. */ format( /** * The date to format. If it is `null` or `undefined` only the timezone will be formatted, any other invalid * date is formatted as empty string. */ oJSDate?: Date, /** * The IANA timezone ID in which the date will be calculated and formatted e.g. "America/New_York". If the * parameter is omitted, `null` or an empty string, the timezone will be taken from {@link module:sap/base/i18n/Localization.getTimezone Localization.getTimezone}. * For an invalid IANA time zone ID, an empty string will be returned. */ sTimezone?: string ): string; /** * Parse a string which is formatted according to the given format options to an array containing a date * object and the timezone. * * @since 1.99 * * @returns the parsed values * - An array containing datetime and timezone depending on the showDate, showTime and showTimezone options * * (Default): [Date, string], e.g. [UI5Date.getInstance("2021-11-13T13:22:33Z"), "America/New_York"] * - `showTimezone: false`: [Date, undefined], e.g. [UI5Date.getInstance("2021-11-13T13:22:33Z"), undefined] * * - `showDate: false, showTime: false`: [undefined, string], e.g. [undefined, "America/New_York"] */ parse( /** * the string containing a formatted date/time value */ sValue: string, /** * The IANA timezone ID which should be used to convert the date e.g. "America/New_York". If the parameter * is omitted, `null` or an empty string, the timezone will be taken from {@link module:sap/base/i18n/Localization.getTimezone Localization.getTimezone}. * For an invalid IANA timezone ID, `null` will be returned. */ sTimezone?: string, /** * Whether to be strict with regards to the value ranges of date fields, e.g. for a month pattern of `MM` * and a value range of [1-12] `strict` ensures that the value is within the range; if it is larger than * `12` it cannot be parsed and `null` is returned */ bStrict?: boolean ): | [ Date | import("sap/ui/core/date/UI5Date").default | undefined, string | undefined, ] | null; } } namespace NumberFormat { /** * Specifies a rounding behavior for numerical operations capable of discarding precision. Each rounding * mode in this object indicates how the least significant returned digits of rounded result are to be calculated. * * This enum is part of the 'sap/ui/core/format/NumberFormat' module export and must be accessed by the * property 'RoundingMode'. */ enum RoundingMode { /** * Rounding mode to round away from zero; examples of rounding results to one fractional digit: 0.51 is * rounded to 0.6, and -0.51 is rounded to -0.6. */ AWAY_FROM_ZERO = "AWAY_FROM_ZERO", /** * Rounding mode to round towards positive infinity; examples of rounding results to one fractional digit: * 0.51 is rounded to 0.6, and -0.51 is rounded to -0.5. */ CEILING = "CEILING", /** * Rounding mode to round towards negative infinity; examples of rounding results to one fractional digit: * 0.51 is rounded to 0.5, and -0.51 is rounded to -0.6. */ FLOOR = "FLOOR", /** * Rounding mode to round towards the nearest neighbor unless, both neighbors are equidistant, in which * case round away from zero; examples of rounding results to one fractional digit: 0.54 or 0.46 are rounded * to 0.5, -0.54 or -0.46 are rounded to -0.5, 0.55 is rounded to 0.6, and -0.55 is rounded to -0.6. */ HALF_AWAY_FROM_ZERO = "HALF_AWAY_FROM_ZERO", /** * Rounding mode to round towards the nearest neighbor, unless both neighbors are equidistant, in which * case round towards positive infinity; examples of rounding results to one fractional digit: 0.54 or 0.46 * are rounded to 0.5, -0.54 or -0.46 are rounded to -0.5, 0.55 is rounded to 0.6, and -0.55 is rounded * to -0.5. */ HALF_CEILING = "HALF_CEILING", /** * Rounding mode to round towards the nearest neighbor, unless both neighbors are equidistant, in which * case round towards negative infinity; examples of rounding results to one fractional digit: 0.54 or 0.46 * are rounded to 0.5, -0.54 or -0.46 are rounded to -0.5, 0.55 is rounded to 0.5, and -0.55 is rounded * to -0.6. */ HALF_FLOOR = "HALF_FLOOR", /** * Rounding mode to round towards the nearest neighbor, unless both neighbors are equidistant, in which * case round towards zero; examples of rounding results to one fractional digit: 0.54 or 0.46 are rounded * to 0.5, -0.54 or -0.46 are rounded to -0.5, 0.55 is rounded to 0.5, and -0.55 is rounded to -0.5. */ HALF_TOWARDS_ZERO = "HALF_TOWARDS_ZERO", /** * Rounding mode to round towards zero; examples of rounding results to one fractional digit: 0.59 is rounded * to 0.5, and -0.59 is rounded to -0.5. */ TOWARDS_ZERO = "TOWARDS_ZERO", } /** * The format options for floating-point numbers. */ type FloatFormatOptions = sap.ui.core.format.NumberFormat.FormatOptions & { /** * The target length of places after the decimal separator; if the number has fewer decimal places than * given in this option, it is padded with whitespaces at the end up to the target length. An additional * whitespace character for the decimal separator is added for a number without any decimals. **Note:** * This format option is only allowed if the following conditions apply: * - It has a value greater than 0. * - The `oFormatOptions.style` format option is **not** set to `"short"` or `"long"`. */ decimalPadding?: int; /** * The minimal number of decimal digits. */ minFractionDigits?: int; /** * The maximum number of digits in the formatted representation of a number; if the `precision` is less * than the overall length of the number, its fractional part is truncated through rounding. As the `precision` * only affects the rounding of a number, its integer part can retain more digits than defined by this parameter. * **Example:** With a `precision` of 2, `234.567` is formatted to `235`. **Note:** The formatted output * may differ depending on locale. */ precision?: int; /** * The style of format. Valid values are based on the CLDR `decimalFormat`. When set to `short` or `long`, * numbers are formatted into compact forms. When this option is set, the default value of the `precision` * option is set to `2`. This can be changed by setting either `min/maxFractionDigits`, `decimals`, `shortDecimals`, * or the `precision` option itself. */ style?: "short" | "long" | "standard"; }; /** * The base type for the numeric format options. */ type FormatOptions = { /** * The number of decimal digits. */ decimals?: int; /** * The character used as decimal separator. If none is given, the locale-specific decimal separator is used. * **Note:** `decimalSeparator` must always be different from `groupingSeparator`. */ decimalSeparator?: string; /** * Since 1.130.0. Defines what value an empty string is parsed into and what value is formatted as an empty * string. The {@link #format} and {@link #parse} functions are done in a symmetric way. For example, when * this parameter is set to `NaN`, an empty string is parsed as `NaN`, and `NaN` is formatted as an empty * string. */ emptyString?: null | number | string; /** * The grouping base size in digits if it is different from the grouping size (e.g. Indian grouping). */ groupingBaseSize?: int; /** * Whether grouping is enabled (grouping separators are shown). **Note:** Grouping is disabled if the `groupingSize` * format option is set to a non-positive value. */ groupingEnabled?: boolean; /** * The character used as grouping separator. If none is given, the locale-specific grouping separator is * used. **Note:** `groupingSeparator` must always be different from `decimalSeparator`. */ groupingSeparator?: string; /** * The grouping size in digits. **Note:** Grouping is disabled if this format option is set to a non-positive * value. */ groupingSize?: int; /** * The maximum number of decimal digits. */ maxFractionDigits?: int; /** * The maximum number of non-decimal digits. */ maxIntegerDigits?: int; /** * The minimal number of non-decimal digits. */ minIntegerDigits?: int; /** * The symbol for the minus sign. If none is given, the locale-specific minus sign is used. */ minusSign?: string; /** * Since 1.28.2, whether to parse the number as a string in order to keep the precision for big numbers. * Numbers in scientific notation are parsed back to standard notation. For example, `5e-3` is parsed to * `0.005`. */ parseAsString?: boolean; /** * The CLDR number pattern which is used to format a number. If none is given, the default pattern for the * locale and type is used. */ pattern?: string; /** * The symbol for the plus sign. If none is given, the locale-specific plus sign is used. */ plusSign?: string; /** * Whether {@link #format} preserves decimal digits except trailing zeros if there are more decimals than * the `maxFractionDigits` format option allows. If decimals are not preserved, the formatted number is * rounded to `maxFractionDigits`. */ preserveDecimals?: boolean; /** * Defines how numbers are rounded when the number of fraction digits exceeds the value of `maxFractionDigits`. * The rounding behavior of the formatter can be defined in the following ways: * - Setting this format option to a value from the {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode } * enum * - Setting this format option to a function used for rounding the number. The function must take two * parameters: the number itself, and the number of decimal digits that should be preserved. String-based * numbers are not rounded by this custom function. **Deprecated as of version 1.121.0; apply rounding by * specifying a rounding mode instead.** */ roundingMode?: | sap.ui.core.format.NumberFormat.RoundingMode | Function; /** * The number of decimals in the shortened format string. If this option isn't specified, the `decimals` * option is used instead. */ shortDecimals?: int; /** * A limit above which only short number formatting is used. */ shortLimit?: int; /** * Since 1.40, specifies a number from which the scale factor for the `short` or `long` style format is * generated. The generated scale factor is used for all numbers which are formatted with this format instance. * This option only takes effect when the `style` option is set to `short` or `long`. It is set to `undefined` * by default, which means that the scale factor is selected automatically for each number being formatted. */ shortRefNumber?: int; /** * Since 1.40, specifies whether the scale factor is shown in the formatted number. This option takes effect * only when the `style` option is set to either `short` or `long`. */ showScale?: boolean; /** * Whether the positions of grouping separators are validated. Space characters used as grouping separators * are not validated. */ strictGroupingValidation?: boolean; }; /** * The format options for integer numbers. */ type IntegerFormatOptions = sap.ui.core.format.NumberFormat.FormatOptions & { /** * The minimal number of decimal digits. */ minFractionDigits?: int; /** * **Note:** Only considered if the number format leads to a representation with decimal places, e.g. if * the option `style: "short"` is set. The maximum number of digits in the formatted representation of a * number; if the `precision` is less than the overall length of the number, its fractional part is truncated * through rounding. As the `precision` only affects the rounding of a number, its integer part can retain * more digits than defined by this parameter. **Example:** With a `precision` of 2 and `style: "short"`, * `234567` is formatted to `"235K"`. */ precision?: int; /** * The style of format. Valid values are based on the CLDR `decimalFormat`. When set to `short` or `long`, * numbers are formatted into compact forms. When this option is set, the default value of the `precision` * option is set to `2`. This can be changed by setting either `min/maxFractionDigits`, `decimals`, `shortDecimals`, * or the `precision` option itself. */ style?: "short" | "long" | "standard"; }; } /** * The DateFormat is a static class for formatting and parsing single date and time values or date and time * intervals according to a set of format options. * * Important: Every Date is converted with the timezone taken from {@link module:sap/base/i18n/Localization.getTimezone Localization.getTimezone}. * The timezone falls back to the browser's local timezone. * * Supported format options are pattern based on Unicode LDML Date Format notation. Please note that only * a subset of the LDML date symbols is supported. If no pattern is specified a default pattern according * to the locale settings is used. * * Documentation links: * - {@link https://ui5.sap.com/#/topic/91f2eba36f4d1014b6dd926db0e91070 Date Format} * - {@link http://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table} */ class DateFormat { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Get a date instance of the DateFormat, which can be used for formatting. * * * @returns date instance of the DateFormat */ static getDateInstance( /** * Object which defines the format options */ oFormatOptions?: { /** * since 1.108.0 specifies the calendar week numbering. If specified, this overwrites `oFormatOptions.firstDayOfWeek` * and `oFormatOptions.minimalDaysInFirstWeek`. */ calendarWeekNumbering?: import("sap/base/i18n/date/CalendarWeekNumbering").default; /** * since 1.105.0 specifies the first day of the week starting with `0` (which is Sunday); if not defined, * the value taken from the locale is used */ firstDayOfWeek?: int; /** * since 1.105.0 minimal days at the beginning of the year which define the first calendar week; if not * defined, the value taken from the locale is used */ minimalDaysInFirstWeek?: int; /** * since 1.34.0 contains pattern symbols (e.g. "yMMMd" or "Hms") which will be converted into the pattern * in the used locale, which matches the wanted symbols best. The symbols must be in canonical order, that * is: Era (G), Year (y/Y), Quarter (q/Q), Month (M/L), Week (w), Day-Of-Week (E/e/c), Day (d), Hour (h/H/k/K/j/J), * Minute (m), Second (s), Timezone (z/Z/v/V/O/X/x) See {@link https://unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems Unicode Locale Data Markup Language (LDML): Elements availableFormats, appendItems}. */ format?: string; /** * a data pattern in LDML format. It is not verified whether the pattern represents only a date. */ pattern?: string; /** * can be either 'short, 'medium', 'long' or 'full'. If no pattern is given, a locale dependent default * date pattern of that style is used from the LocaleData class. */ style?: string; /** * if true, by parsing it is checked if the value is a valid date */ strictParsing?: boolean; /** * if true, the date is formatted relatively to todays date if it is within the given day range, e.g. "today", * "1 day ago", "in 5 days" */ relative?: boolean; /** * the day range used for relative formatting. If `oFormatOptions.relativeScale` is set to default value * 'day', the relativeRange is by default [-6, 6], which means only the last 6 days, today and the next * 6 days are formatted relatively. Otherwise when `oFormatOptions.relativeScale` is set to 'auto', all * dates are formatted relatively. */ relativeRange?: int[]; /** * if 'auto' is set, new relative time format is switched on for all Date/Time Instances. The relative scale * is chosen depending on the difference between the given date and now. */ relativeScale?: string; /** * since 1.32.10, 1.34.4 the style of the relative format. The valid values are "wide", "short", "narrow" */ relativeStyle?: string; /** * since 1.48.0 if true, the {@link sap.ui.core.format.DateFormat#format format} method expects an array * with two dates as the first argument and formats them as interval. Further interval "Jan 10, 2008 - Jan * 12, 2008" will be formatted as "Jan 10-12, 2008" if the 'format' option is set with necessary symbols. * Otherwise the two given dates are formatted separately and concatenated with local dependent pattern. */ interval?: boolean; /** * Since 1.113.0, a delimiter for intervals. With a given interval delimiter a specific interval format * is created. **Example:** If `oFormatOptions.intervalDelimiter` is set to "...", an interval would be * given as "Jan 10, 2008...Feb 12, 2008". **Note:** If this format option is set, the locale-specific interval * notation is overruled, for example "Jan 10 – Feb 12, 2008" becomes "Jan 10, 2008...Feb 12, 2008". */ intervalDelimiter?: string; /** * Only relevant if oFormatOptions.interval is set to 'true'. This allows to pass an array with only one * date object to the {@link sap.ui.core.format.DateFormat#format format} method. */ singleIntervalValue?: boolean; /** * if true, the date is formatted and parsed as UTC instead of the local timezone */ UTC?: boolean; /** * The calender type which is used to format and parse the date. This value is by default either set in * configuration or calculated based on current locale. */ calendarType?: import("sap/base/i18n/date/CalendarType").default; }, /** * Locale to ask for locale specific texts/settings */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.DateFormat; /** * Get a date instance of the DateFormat, which can be used for formatting. * * * @returns date instance of the DateFormat */ static getDateInstance( /** * Locale to ask for locale specific texts/settings */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.DateFormat; /** * Get a datetime instance of the DateFormat, which can be used for formatting. * * * @returns datetime instance of the DateFormat */ static getDateTimeInstance( /** * Object which defines the format options */ oFormatOptions?: { /** * since 1.108.0 specifies the calendar week numbering. If specified, this overwrites `oFormatOptions.firstDayOfWeek` * and `oFormatOptions.minimalDaysInFirstWeek`. */ calendarWeekNumbering?: import("sap/base/i18n/date/CalendarWeekNumbering").default; /** * since 1.105.0 specifies the first day of the week starting with `0` (which is Sunday); if not defined, * the value taken from the locale is used */ firstDayOfWeek?: int; /** * since 1.105.0 minimal days at the beginning of the year which define the first calendar week; if not * defined, the value taken from the locale is used */ minimalDaysInFirstWeek?: int; /** * since 1.34.0 contains pattern symbols (e.g. "yMMMd" or "Hms") which will be converted into the pattern * in the used locale, which matches the wanted symbols best. The symbols must be in canonical order, that * is: Era (G), Year (y/Y), Quarter (q/Q), Month (M/L), Week (w), Day-Of-Week (E/e/c), Day (d), Hour (h/H/k/K/j/J), * Minute (m), Second (s), Timezone (z/Z/v/V/O/X/x) See {@link https://unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems Unicode Locale Data Markup Language (LDML): Elements availableFormats, appendItems}. */ format?: string; /** * a datetime pattern in LDML format. It is not verified whether the pattern represents a full datetime. */ pattern?: string; /** * can be either 'short, 'medium', 'long' or 'full'. For datetime you can also define mixed styles, separated * with a slash, where the first part is the date style and the second part is the time style (e.g. "medium/short"). * If no pattern is given, a locale dependent default datetime pattern of that style is used from the LocaleData * class. */ style?: string; /** * if true, by parsing it is checked if the value is a valid datetime */ strictParsing?: boolean; /** * if true, the date is formatted relatively to today's date if it is within the given day range, e.g. "today", * "1 day ago", "in 5 days" */ relative?: boolean; /** * the day range used for relative formatting. If `oFormatOptions.relativeScale` is set to value 'day', * the relativeRange is by default [-6, 6], which means only the last 6 days, today and the next 6 days * are formatted relatively. Otherwise when `oFormatOptions.relativeScale` is set to 'auto', all dates are * formatted relatively. */ relativeRange?: int[]; /** * if 'auto' is set, new relative time format is switched on for all Date/Time Instances. The relative scale * is chosen depending on the difference between the given date and now. */ relativeScale?: string; /** * since 1.32.10, 1.34.4 the style of the relative format. The valid values are "wide", "short", "narrow" */ relativeStyle?: string; /** * since 1.48.0 if true, the {@link sap.ui.core.format.DateFormat#format format} method expects an array * with two dates as the first argument and formats them as interval. Further interval "Jan 10, 2008 - Jan * 12, 2008" will be formatted as "Jan 10-12, 2008" if the 'format' option is set with necessary symbols. * Otherwise the two given dates are formatted separately and concatenated with local dependent pattern. */ interval?: boolean; /** * Since 1.113.0, a delimiter for intervals. With a given interval delimiter a specific interval format * is created. **Example:** If `oFormatOptions.intervalDelimiter` is set to "...", an interval would be * given as "Jan 10, 2008, 9:15:00 AM...Jan 10, 2008, 11:45:00 AM". **Note:** If this format option is set, * the locale-specific interval notation is overruled, for example "Jan 10, 2008, 9:15 – 11:45 AM" becomes * "Jan 10, 2008, 9:15 AM...Jan 10, 2008, 11:45 AM". */ intervalDelimiter?: string; /** * Only relevant if oFormatOptions.interval is set to 'true'. This allows to pass an array with only one * date object to the {@link sap.ui.core.format.DateFormat#format format} method. */ singleIntervalValue?: boolean; /** * if true, the date is formatted and parsed as UTC instead of the local timezone */ UTC?: boolean; /** * The calender type which is used to format and parse the date. This value is by default either set in * configuration or calculated based on current locale. */ calendarType?: import("sap/base/i18n/date/CalendarType").default; }, /** * Locale to ask for locale specific texts/settings */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.DateFormat; /** * Get a datetime instance of the DateFormat, which can be used for formatting. * * * @returns datetime instance of the DateFormat */ static getDateTimeInstance( /** * Locale to ask for locale specific texts/settings */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.DateFormat; /** * Get a datetimeWithTimezone instance of the DateFormat, which can be used for formatting. * * @since 1.99.0 * * @returns dateTimeWithTimezone instance of the DateFormat */ static getDateTimeWithTimezoneInstance( /** * An object which defines the format options */ oFormatOptions?: { /** * since 1.108.0 specifies the calendar week numbering. If specified, this overwrites `oFormatOptions.firstDayOfWeek` * and `oFormatOptions.minimalDaysInFirstWeek`. */ calendarWeekNumbering?: import("sap/base/i18n/date/CalendarWeekNumbering").default; /** * since 1.105.0 specifies the first day of the week starting with `0` (which is Sunday); if not defined, * the value taken from the locale is used */ firstDayOfWeek?: int; /** * since 1.105.0 minimal days at the beginning of the year which define the first calendar week; if not * defined, the value taken from the locale is used */ minimalDaysInFirstWeek?: int; /** * A string containing pattern symbols (e.g. "yMMMd" or "Hms") which will be converted into a pattern for * the used locale that matches the wanted symbols best. The symbols must be in canonical order, that is: * Era (G), Year (y/Y), Quarter (q/Q), Month (M/L), Week (w), Day-Of-Week (E/e/c), Day (d), Hour (h/H/k/K/j/J), * Minute (m), Second (s), Timezone (z/Z/v/V/O/X/x) See {@link https://unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems Unicode Locale Data Markup Language (LDML): Elements availableFormats, appendItems}. */ format?: string; /** * a datetime pattern in LDML format. It is not verified whether the pattern represents a full datetime. */ pattern?: string; /** * Specifies if the date should be displayed. It is ignored for formatting when an options pattern or a * format are supplied. */ showDate?: boolean; /** * Specifies if the time should be displayed. It is ignored for formatting when an options pattern or a * format are supplied. */ showTime?: boolean; /** * Specifies if the timezone should be displayed. It is ignored for formatting when an options pattern or * a format are supplied. */ showTimezone?: boolean; /** * Can be either 'short, 'medium', 'long' or 'full'. For datetime you can also define mixed styles, separated * with a slash, where the first part is the date style and the second part is the time style (e.g. "medium/short"). * If no pattern is given, a locale-dependent default datetime pattern of that style from the LocaleData * class is used. */ style?: string; /** * Whether to check by parsing if the value is a valid datetime */ strictParsing?: boolean; /** * Whether the date is formatted relatively to today's date if it is within the given day range, e.g. "today", * "1 day ago", "in 5 days" */ relative?: boolean; /** * The day range used for relative formatting. If `oFormatOptions.relativeScale` is set to the default value * 'day', the `relativeRange is by default [-6, 6], which means that only the previous 6 and the following * 6 days are formatted relatively. If oFormatOptions.relativeScale` is set to 'auto', all dates are * formatted relatively. */ relativeRange?: int[]; /** * If 'auto' is set, a new relative time format is switched on for all Date/Time instances. The default * value depends on `showDate` and `showTime` options. */ relativeScale?: string; /** * The style of the relative format. The valid values are "wide", "short", "narrow" */ relativeStyle?: string; /** * The calendar type which is used to format and parse the date. This value is by default either set in * the configuration or calculated based on the current locale. */ calendarType?: import("sap/base/i18n/date/CalendarType").default; }, /** * Locale to ask for locale-specific texts/settings */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.DateFormat.DateTimeWithTimezone; /** * Get a datetimeWithTimezone instance of the DateFormat, which can be used for formatting. * * @since 1.99.0 * * @returns dateTimeWithTimezone instance of the DateFormat */ static getDateTimeWithTimezoneInstance( /** * Locale to ask for locale-specific texts/settings */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.DateFormat.DateTimeWithTimezone; /** * Get a time instance of the DateFormat, which can be used for formatting. * * * @returns time instance of the DateFormat */ static getTimeInstance( /** * Object which defines the format options */ oFormatOptions?: { /** * since 1.108.0 specifies the calendar week numbering. If specified, this overwrites `oFormatOptions.firstDayOfWeek` * and `oFormatOptions.minimalDaysInFirstWeek`. */ calendarWeekNumbering?: import("sap/base/i18n/date/CalendarWeekNumbering").default; /** * since 1.105.0 specifies the first day of the week starting with `0` (which is Sunday); if not defined, * the value taken from the locale is used */ firstDayOfWeek?: int; /** * since 1.105.0 minimal days at the beginning of the year which define the first calendar week; if not * defined, the value taken from the locale is used */ minimalDaysInFirstWeek?: int; /** * since 1.34.0 contains pattern symbols (e.g. "yMMMd" or "Hms") which will be converted into the pattern * in the used locale, which matches the wanted symbols best. The symbols must be in canonical order, that * is: Era (G), Year (y/Y), Quarter (q/Q), Month (M/L), Week (w), Day-Of-Week (E/e/c), Day (d), Hour (h/H/k/K/j/J), * Minute (m), Second (s), Timezone (z/Z/v/V/O/X/x) See {@link https://unicode.org/reports/tr35/tr35-dates.html#availableFormats_appendItems Unicode Locale Data Markup Language (LDML): Elements availableFormats, appendItems}. */ format?: string; /** * a time pattern in LDML format. It is not verified whether the pattern only represents a time. */ pattern?: string; /** * can be either 'short, 'medium', 'long' or 'full'. If no pattern is given, a locale dependent default * time pattern of that style is used from the LocaleData class. */ style?: string; /** * if true, by parsing it is checked if the value is a valid time */ strictParsing?: boolean; /** * if true, the date is formatted relatively to todays date if it is within the given day range, e.g. "today", * "1 day ago", "in 5 days" */ relative?: boolean; /** * the day range used for relative formatting. If `oFormatOptions.relativeScale` is set to value 'day', * the relativeRange is by default [-6, 6], which means only the last 6 days, today and the next 6 days * are formatted relatively. Otherwise when `oFormatOptions.relativeScale` is set to 'auto', all dates are * formatted relatively. */ relativeRange?: int[]; /** * if 'auto' is set, new relative time format is switched on for all Date/Time Instances. The relative scale * is chosen depending on the difference between the given date and now. */ relativeScale?: string; /** * since 1.32.10, 1.34.4 the style of the relative format. The valid values are "wide", "short", "narrow" */ relativeStyle?: string; /** * since 1.48.0 if true, the {@link sap.ui.core.format.DateFormat#format format} method expects an array * with two dates as the first argument and formats them as interval. Further interval "Jan 10, 2008 - Jan * 12, 2008" will be formatted as "Jan 10-12, 2008" if the 'format' option is set with necessary symbols. * Otherwise the two given dates are formatted separately and concatenated with local dependent pattern. */ interval?: boolean; /** * Since 1.113.0, a delimiter for intervals. With a given interval delimiter a specific interval format * is created. **Example:** If `oFormatOptions.intervalDelimiter` is set to "...", an interval would be * given as "09:15 AM...11:45 AM". **Note:** If this format option is set, the locale-specific interval * notation is overruled, for example "09:15 – 11:45 AM" becomes "9:15 AM...11:45 AM". */ intervalDelimiter?: string; /** * Only relevant if oFormatOptions.interval is set to 'true'. This allows to pass an array with only one * date object to the {@link sap.ui.core.format.DateFormat#format format} method. */ singleIntervalValue?: boolean; /** * if true, the time is formatted and parsed as UTC instead of the local timezone */ UTC?: boolean; /** * The calender type which is used to format and parse the date. This value is by default either set in * configuration or calculated based on current locale. */ calendarType?: import("sap/base/i18n/date/CalendarType").default; }, /** * Locale to ask for locale specific texts/settings */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.DateFormat; /** * Get a time instance of the DateFormat, which can be used for formatting. * * * @returns time instance of the DateFormat */ static getTimeInstance( /** * Locale to ask for locale specific texts/settings */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.DateFormat; /** * Format a date according to the given format options. * * Uses the timezone from {@link module:sap/base/i18n/Localization.getTimezone Localization.getTimezone}, * which falls back to the browser's local timezone to convert the given date. * * When using instances from getDateTimeWithTimezoneInstance, please see the corresponding documentation: * {@link sap.ui.core.format.DateFormat.DateTimeWithTimezone#format}. * * * @returns the formatted output value. If an invalid date is given, an empty string is returned. */ format( /** * the value to format */ vJSDate: Date | Date[], /** * whether to use UTC */ bUTC?: boolean ): string; /** * Parse a string which is formatted according to the given format options. * * Uses the timezone from {@link module:sap/base/i18n/Localization.getTimezone Localization.getTimezone}, * which falls back to the browser's local timezone to convert the given date. * * When using instances from getDateTimeWithTimezoneInstance, please see the corresponding documentation: * {@link sap.ui.core.format.DateFormat.DateTimeWithTimezone#parse}. * * * @returns the parsed value(s) */ parse( /** * the string containing a formatted date/time value */ sValue: string, /** * whether to use UTC */ bUTC?: boolean, /** * whether to use strict value check */ bStrict?: boolean ): | Date | Date[] | import("sap/ui/core/date/UI5Date").default | Array; } /** * The FileSizeFormat is a static class for formatting and parsing numeric file size values according to * a set of format options. * * Supports the same options as {@link sap.ui.core.format.NumberFormat.getFloatInstance NumberFormat.getFloatInstance } * For format options which are not specified default values according to the type and locale settings are * used. * * Supported format options (additional to NumberFormat): * - binaryFilesize: Whether to use base 2, that means 1 Kibibyte = 1024 Byte, or base 10, that means * 1 Kilobyte = 1000 Byte */ class FileSizeFormat extends sap.ui.base.Object { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Creates a new subclass of class sap.ui.core.format.FileSizeFormat with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Get an instance of the FileSizeFormat, which can be used for formatting. * * * @returns instance of the FileSizeFormat */ static getInstance( /** * Supports the same options as {@link sap.ui.core.format.NumberFormat.getFloatInstance} */ oFormatOptions?: { /** * Whether to use base 2, that means 1 Kibibyte = 1024 Byte, or base 10, that means 1 Kilobyte = 1000 Byte */ binaryFilesize?: boolean; }, /** * The locale to get the formatter for; if no locale is given, a locale for the currently configured language * is used; see {@link module:sap/base/i18n/Formatting.getLanguageTag Formatting.getLanguageTag} */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.FileSizeFormat; /** * Get an instance of the FileSizeFormat, which can be used for formatting. * * * @returns instance of the FileSizeFormat */ static getInstance( /** * The locale to get the formatter for; if no locale is given, a locale for the currently configured language * is used; see {@link module:sap/base/i18n/Formatting.getLanguageTag Formatting.getLanguageTag} */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.FileSizeFormat; /** * Returns a metadata object for class sap.ui.core.format.FileSizeFormat. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Format a filesize (in bytes) according to the given format options. * * * @returns the formatted output value */ format( /** * the number (or hex string) to format */ oValue: number | string ): string; /** * Parse a string which is formatted according to the given format options. * * * @returns the parsed value in bytes */ parse( /** * the string containing a formatted filesize value */ sValue: string ): number; } /** * The ListFormat is a static class for formatting and parsing an array of strings in a locale-sensitive * manner according to a set of format options. */ class ListFormat { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Get an instance of the ListFormat which can be used for formatting. * * * @returns Instance of the ListFormat */ static getInstance( /** * Object which defines the format options */ oFormatOptions?: object, /** * Locale to get the formatter for */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.ListFormat; /** * Get an instance of the ListFormat which can be used for formatting. * * * @returns Instance of the ListFormat */ static getInstance( /** * Locale to get the formatter for */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.ListFormat; /** * Formats a list according to the given format options. * * * @returns The formatted output value. */ format( /** * The value to format */ aList: any[] ): string; /** * Parses a given list string into an array. * * * @returns The parsed output value */ parse( /** * String value to be parsed */ sValue: string ): any[]; } /** * The NumberFormat is a static class for formatting and parsing numeric values according to a set of format * options. */ class NumberFormat extends sap.ui.base.Object { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Creates a new subclass of class sap.ui.core.format.NumberFormat with name `sClassName` and enriches it * with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Get a currency instance of the NumberFormat, which can be used for formatting. * * This instance has HALF_AWAY_FROM_ZERO set as default rounding mode. Please set the roundingMode property * in oFormatOptions to change the default value. * * The currency instance supports locally defined custom currency exclusive to the created instance. The * following example shows how to use custom currencies (e.g. for Bitcoins): * ```javascript * * var oFormat = NumberFormat.getCurrencyInstance({ * "currencyCode": false, * "customCurrencies": { * "BTC": { * "symbol": "\u0243", * "decimals": 3 * } * } * }); * * oFormat.format(123.4567, "BTC"); // "Ƀ 123.457" * ``` * * * As an alternative to using a fixed `symbol` for your custom currencies, you can also provide an ISO-Code. * The provided ISO-Code will be used to look up the currency symbol in the global configuration, either * defined in the CLDR or custom defined on the Format Settings (see {@link module:sap/base/i18n/Formatting.setCustomCurrencies Formatting.setCustomCurrencies}, * {@link module:sap/base/i18n/Formatting.addCustomCurrencies Formatting.addCustomCurrencies}). * * If no symbol is given at all, the custom currency key is used for formatting. * * * ```javascript * * var oFormat = NumberFormat.getCurrencyInstance({ * "currencyCode": false, * "customCurrencies": { * "MyDollar": { * "isoCode": "USD", * "decimals": 3 * }, * "Bitcoin": { * "decimals": 2 * } * } * }); * * // symbol looked up from global configuration * oFormat.format(123.4567, "MyDollar"); // "$123.457" * * // no symbol available, custom currency key is rendered * oFormat.format(777.888, "Bitcoin"); // "Bitcoin 777.89" * ``` * * * * @returns currency instance of the NumberFormat */ static getCurrencyInstance( /** * The option object, which supports the following parameters. If no options are given, default values according * to the type and locale settings are used. */ oFormatOptions?: { /** * defines whether the currency is shown as a code in currency format. The currency symbol is displayed * when this option is set to `false` and a symbol has been defined for the given currency code. */ currencyCode?: boolean; /** * can be set either to 'standard' (the default value) or to 'accounting' for an accounting-specific currency * display */ currencyContext?: string; /** * defines a set of custom currencies exclusive to this NumberFormat instance. Custom currencies must not * only consist of digits. If custom currencies are defined on the instance, no other currencies can be * formatted and parsed by this instance. Globally available custom currencies can be added via the global * configuration. See the above examples. See also {@link module:sap/base/i18n/Formatting.setCustomCurrencies Formatting.setCustomCurrencies } * and {@link module:sap/base/i18n/Formatting.addCustomCurrencies Formatting.addCustomCurrencies}. */ customCurrencies?: Record; /** * The target length of places after the decimal separator; if the number has fewer decimal places than * given in this option, it is padded with whitespaces at the end up to the target length. An additional * whitespace character for the decimal separator is added for a number without any decimals. **Note:** * This format option is only allowed if the following conditions apply: * - It has a value greater than 0. * - The `FormatOptions.showMeasure` format option is set to `false`. * - The `oFormatOptions.style` format option is **not** set to `"short"` or `"long"`. */ decimalPadding?: int; /** * defines the number of decimal digits */ decimals?: int; /** * defines the character used as decimal separator. Note: `decimalSeparator` must always be different from * `groupingSeparator`. */ decimalSeparator?: string; /** * since 1.30.0 defines what an empty string is parsed as, and what is formatted as an empty string. The * allowed values are "" (empty string), NaN, `null`, or 0. The 'format' and 'parse' functions are done * in a symmetric way. For example, when this parameter is set to NaN, an empty string is parsed as [NaN, * undefined], and NaN is formatted as an empty string. */ emptyString?: null | number | string; /** * defines the grouping base size in digits if it is different from the grouping size (e.g. Indian grouping) */ groupingBaseSize?: int; /** * defines whether grouping is enabled (grouping separators are shown). **Note:** Grouping is disabled if * the `groupingSize` format option is set to a non-positive value. */ groupingEnabled?: boolean; /** * defines the character used as grouping separator. Note: `groupingSeparator` must always be different * from `decimalSeparator`. */ groupingSeparator?: string; /** * defines the grouping size in digits; the default is `3`. **Note:** If this format option is set to a * non-positive value, grouping will be disabled entirely. */ groupingSize?: int; /** * defines the maximum number of decimal digits */ maxFractionDigits?: int; /** * defines the maximum number of non-decimal digits. If the number exceeds this maximum, e.g. 1e+120, "?" * characters are shown instead of digits. */ maxIntegerDigits?: int; /** * Deprecated as of 1.130; this format option does not have an effect on currency formats since decimals * can always be determined, either through the given format options, custom currencies or the CLDR */ minFractionDigits?: int; /** * defines the minimal number of non-decimal digits */ minIntegerDigits?: int; /** * defines the used minus symbol */ minusSign?: string; /** * since 1.28.2 defines whether to output the string from the parse function in order to keep the precision * for big numbers. Numbers in scientific notation are parsed back to standard notation. For example, "5e-3" * is parsed to "0.005". */ parseAsString?: boolean; /** * CLDR number pattern which is used to format the number */ pattern?: string; /** * defines the used plus symbol */ plusSign?: string; /** * Whether {@link #format} preserves decimal digits except trailing zeros in case there are more decimals * than the `maxFractionDigits` format option allows. If decimals are not preserved, the formatted number * is rounded to `maxFractionDigits`. */ preserveDecimals?: boolean; /** * Specifies the rounding behavior for discarding the digits after the maximum fraction digits defined by * `maxFractionDigits`. This can be assigned * - by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode}, * - via a function that is used for rounding the number and takes two parameters: the number itself, * and the number of decimal digits that should be reserved. **Using a function is deprecated since 1.121.0**; * string based numbers are not rounded via this custom function. */ roundingMode?: sap.ui.core.format.NumberFormat.RoundingMode; /** * defines the number of decimal in the shortened format string. If this isn't specified, the 'decimals' * options is used */ shortDecimals?: int; /** * only use short number formatting for values above this limit */ shortLimit?: int; /** * since 1.40 specifies a number from which the scale factor for 'short' or 'long' style format is generated. * The generated scale factor is used for all numbers which are formatted with this format instance. This * option has effect only when the option 'style' is set to 'short' or 'long'. This option is by default * set with `undefined` which means the scale factor is selected automatically for each number being formatted. */ shortRefNumber?: int; /** * defines whether the currency code/symbol is shown in the formatted string, e.g. true: "1.00 EUR", false: * "1.00" for locale "en" If both `showMeasure` and `showNumber` are false, an empty string is returned */ showMeasure?: boolean; /** * defines whether the number is shown as part of the result string, e.g. 1 EUR for locale "en" `NumberFormat.getCurrencyInstance({showNumber:true}).format(1, * "EUR"); // "1.00 EUR"` `NumberFormat.getCurrencyInstance({showNumber:false}).format(1, "EUR"); // "EUR"` * If both `showMeasure` and `showNumber` are false, an empty string is returned */ showNumber?: boolean; /** * since 1.40 specifies whether the scale factor is shown in the formatted number. This option takes effect * only when the 'style' options is set to either 'short' or 'long'. */ showScale?: boolean; /** * whether the positions of grouping separators are validated. Space characters used as grouping separators * are not validated. */ strictGroupingValidation?: boolean; /** * defines the style of format. Valid values are 'short, 'long' or 'standard' (based on the CLDR decimalFormat). * When set to 'short' or 'long', numbers are formatted into the 'short' form only. When this option is * set, the default value of the 'precision' option is set to 2. This can be changed by setting either min/maxFractionDigits, * decimals, shortDecimals, or the 'precision' option itself. */ style?: string; /** * overrides the global configuration value {@link module:sap/base/i18n/Formatting.getTrailingCurrencyCode Formatting.getTrailingCurrencyCode}, * which has a default value of `true. This is ignored if oFormatOptions.currencyCode` is set to * `false`, or if `oFormatOptions.pattern` is supplied. */ trailingCurrencyCode?: boolean; }, /** * The locale to get the formatter for; if no locale is given, a locale for the currently configured language * is used; see {@link module:sap/base/i18n/Formatting.getLanguageTag Formatting.getLanguageTag} */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.NumberFormat; /** * Get a float instance of the NumberFormat, which can be used for formatting. * * This instance has HALF_AWAY_FROM_ZERO set as default rounding mode. Please set the roundingMode property * in oFormatOptions to change the default value. * * The following example shows how grouping is done: * ```javascript * * var oFormat = NumberFormat.getFloatInstance({ * "groupingEnabled": true, // grouping is enabled * "groupingSeparator": '.', // grouping separator is '.' * "groupingSize": 3, // the amount of digits to be grouped (here: thousand) * "decimalSeparator": "," // the decimal separator must be different from the grouping separator * }); * * oFormat.format(1234.56); // "1.234,56" * ``` * * * * @returns float instance of the NumberFormat */ static getFloatInstance( /** * The option object, which supports the following parameters. If no options are given, default values according * to the type and locale settings are used. */ oFormatOptions?: sap.ui.core.format.NumberFormat.FloatFormatOptions, /** * The locale to get the formatter for; if no locale is given, a locale for the currently configured language * is used; see {@link module:sap/base/i18n/Formatting.getLanguageTag Formatting.getLanguageTag} */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.NumberFormat; /** * Get an integer instance of the NumberFormat, which can be used for formatting. * * This instance has TOWARDS_ZERO set as default rounding mode. Please set the roundingMode property * in oFormatOptions to change the default value. * * The following example shows how grouping is done: * ```javascript * * var oFormat = NumberFormat.getIntegerInstance({ * "groupingEnabled": true, // grouping is enabled * "groupingSeparator": '.', // grouping separator is '.' * "groupingSize": 3 // the amount of digits to be grouped (here: thousand) * }); * * oFormat.format(1234); // "1.234" * ``` * * * * @returns integer instance of the NumberFormat */ static getIntegerInstance( /** * The option object, which supports the following parameters. If no options are given, default values according * to the type and locale settings are used. */ oFormatOptions?: sap.ui.core.format.NumberFormat.IntegerFormatOptions, /** * The locale to get the formatter for; if no locale is given, a locale for the currently configured language * is used; see {@link module:sap/base/i18n/Formatting.getLanguageTag Formatting.getLanguageTag} */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.NumberFormat; /** * Returns a metadata object for class sap.ui.core.format.NumberFormat. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Get a percent instance of the NumberFormat, which can be used for formatting. * * This instance has HALF_AWAY_FROM_ZERO set as default rounding mode. Please set the roundingMode property * in oFormatOptions to change the default value. * * * @returns percentage instance of the NumberFormat */ static getPercentInstance( /** * The option object, which supports the following parameters. If no options are given, default values according * to the type and locale settings are used. */ oFormatOptions?: { /** * Not supported. */ decimalPadding?: int; /** * defines the number of decimal digits */ decimals?: int; /** * defines the character used as decimal separator. Note: `decimalSeparator` must always be different from * `groupingSeparator`. */ decimalSeparator?: string; /** * since 1.30.0 defines what an empty string is parsed as, and what is formatted as an empty string. The * allowed values are "" (empty string), NaN, `null`, or 0. The 'format' and 'parse' functions are done * in a symmetric way. For example, when this parameter is set to NaN, an empty string is parsed as NaN, * and NaN is formatted as an empty string. */ emptyString?: null | number | string; /** * defines the grouping base size in digits if it is different from the grouping size (e.g. Indian grouping) */ groupingBaseSize?: int; /** * defines whether grouping is enabled (grouping separators are shown). **Note:** Grouping is disabled if * the `groupingSize` format option is set to a non-positive value. */ groupingEnabled?: boolean; /** * defines the character used as grouping separator. Note: `groupingSeparator` must always be different * from `decimalSeparator`. */ groupingSeparator?: string; /** * defines the grouping size in digits; the default is `3`. **Note:** If this format option is set to a * non-positive value, grouping will be disabled entirely. */ groupingSize?: int; /** * defines the maximum number of decimal digits */ maxFractionDigits?: int; /** * defines the maximum number of non-decimal digits. If the number exceeds this maximum, e.g. 1e+120, "?" * characters are shown instead of digits. */ maxIntegerDigits?: int; /** * defines the minimal number of decimal digits */ minFractionDigits?: int; /** * defines the minimal number of non-decimal digits */ minIntegerDigits?: int; /** * defines the used minus symbol */ minusSign?: string; /** * since 1.28.2 defines whether to output the string from the parse function in order to keep the precision * for big numbers. Numbers in scientific notation are parsed back to standard notation. For example, "5e-3" * is parsed to "0.005". */ parseAsString?: boolean; /** * CLDR number pattern which is used to format the number */ pattern?: string; /** * defines the used percent symbol */ percentSign?: string; /** * defines the used plus symbol */ plusSign?: string; /** * The maximum number of digits in the formatted representation of a number; if the `precision` is less * than the overall length of the number, its fractional part is truncated through rounding. As the `precision` * only affects the rounding of a number, its integer part can retain more digits than defined by this parameter. * **Example:** With a `precision` of 2, `234.567` is formatted to `"23,457%"`. **Note:** The formatted * output may differ depending on locale. */ precision?: int; /** * Whether {@link #format} preserves decimal digits except trailing zeros in case there are more decimals * than the `maxFractionDigits` format option allows. If decimals are not preserved, the formatted number * is rounded to `maxFractionDigits`. */ preserveDecimals?: boolean; /** * Specifies the rounding behavior for discarding the digits after the maximum fraction digits defined by * `maxFractionDigits`. This can be assigned * - by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode}, * - via a function that is used for rounding the number and takes two parameters: the number itself, * and the number of decimal digits that should be reserved. **Using a function is deprecated since 1.121.0**; * string based numbers are not rounded via this custom function. */ roundingMode?: sap.ui.core.format.NumberFormat.RoundingMode; /** * defines the number of decimal in the shortened format string. If this isn't specified, the 'decimals' * options is used */ shortDecimals?: int; /** * only use short number formatting for values above this limit */ shortLimit?: int; /** * since 1.40 specifies a number from which the scale factor for 'short' or 'long' style format is generated. * The generated scale factor is used for all numbers which are formatted with this format instance. This * option has effect only when the option 'style' is set to 'short' or 'long'. This option is by default * set with `undefined` which means the scale factor is selected automatically for each number being formatted. */ shortRefNumber?: int; /** * since 1.40 specifies whether the scale factor is shown in the formatted number. This option takes effect * only when the 'style' options is set to either 'short' or 'long'. */ showScale?: boolean; /** * whether the positions of grouping separators are validated. Space characters used as grouping separators * are not validated. */ strictGroupingValidation?: boolean; /** * defines the style of format. Valid values are 'short, 'long' or 'standard' (based on the CLDR decimalFormat). * When set to 'short' or 'long', numbers are formatted into compact forms. When this option is set, the * default value of the 'precision' option is set to 2. This can be changed by setting either min/maxFractionDigits, * decimals, shortDecimals, or the 'precision' option itself. */ style?: string; }, /** * The locale to get the formatter for; if no locale is given, a locale for the currently configured language * is used; see {@link module:sap/base/i18n/Formatting.getLanguageTag Formatting.getLanguageTag} */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.NumberFormat; /** * Get a unit instance of the NumberFormat, which can be used for formatting units. * * This instance has HALF_AWAY_FROM_ZERO set as default rounding mode. Please set the roundingMode property * in oFormatOptions to change the default value. * * * @returns unit instance of the NumberFormat */ static getUnitInstance( /** * The option object, which supports the following parameters. If no options are given, default values according * to the type and locale settings are used. */ oFormatOptions?: { /** * defines the allowed units for formatting and parsing, e.g. ["size-meter", "volume-liter", ...] */ allowedUnits?: any[]; /** * defines a set of custom units, e.g. {"electric-inductance": { "displayName": "henry", "unitPattern-count-one": * "{0} H", "unitPattern-count-other": "{0} H", "perUnitPattern": "{0}/H", "decimals": 2, "precision": 4 * }} */ customUnits?: Record; /** * The target length of places after the decimal separator; if the number has fewer decimal places than * given in this option, it is padded with whitespaces at the end up to the target length. An additional * whitespace character for the decimal separator is added for a number without any decimals. **Note:** * This format option is only allowed if the following conditions apply: * - It has a value greater than 0. * - The `FormatOptions.showMeasure` format option is set to `false`. * - The `oFormatOptions.style` format option is **not** set to `"short"` or `"long"`. */ decimalPadding?: int; /** * defines the number of decimal digits */ decimals?: int; /** * defines the character used as decimal separator. Note: `decimalSeparator` must always be different from * `groupingSeparator`. */ decimalSeparator?: string; /** * since 1.30.0 defines what an empty string is parsed as, and what is formatted as an empty string. The * allowed values are "" (empty string), NaN, `null`, or 0. The 'format' and 'parse' functions are done * in a symmetric way. For example, when this parameter is set to NaN, an empty string is parsed as [NaN, * undefined], and NaN is formatted as an empty string. */ emptyString?: null | number | string; /** * defines the grouping base size in digits if it is different from the grouping size (e.g. Indian grouping) */ groupingBaseSize?: int; /** * defines whether grouping is enabled (grouping separators are shown). **Note:** Grouping is disabled if * the `groupingSize` format option is set to a non-positive value. */ groupingEnabled?: boolean; /** * defines the character used as grouping separator. Note: `groupingSeparator` must always be different * from `decimalSeparator`. */ groupingSeparator?: string; /** * defines the grouping size in digits; the default is `3`. **Note:** If this format option is set to a * non-positive value, grouping will be disabled entirely. */ groupingSize?: int; /** * defines the maximum number of decimal digits */ maxFractionDigits?: int; /** * defines the maximum number of non-decimal digits. If the number exceeds this maximum, e.g. 1e+120, "?" * characters are shown instead of digits. */ maxIntegerDigits?: int; /** * defines the minimal number of decimal digits */ minFractionDigits?: int; /** * defines the minimal number of non-decimal digits */ minIntegerDigits?: int; /** * defines the used minus symbol */ minusSign?: string; /** * since 1.28.2 defines whether to output the string from the parse function in order to keep the precision * for big numbers. Numbers in scientific notation are parsed back to standard notation. For example, "5e-3" * is parsed to "0.005". */ parseAsString?: boolean; /** * CLDR number pattern which is used to format the number */ pattern?: string; /** * defines the used plus symbol */ plusSign?: string; /** * The maximum number of digits in the formatted representation of a number; if the `precision` is less * than the overall length of the number, its fractional part is truncated through rounding. As the `precision` * only affects the rounding of a number, its integer part can retain more digits than defined by this parameter. * **Example:** With a `precision` of 2, the parameters `"234.567", "mass-kilogram"` are formatted to `"235 * kg"`. **Note:** The formatted output may differ depending on locale. */ precision?: int; /** * Whether {@link #format} preserves decimal digits except trailing zeros in case there are more decimals * than the `maxFractionDigits` format option allows. If decimals are not preserved, the formatted number * is rounded to `maxFractionDigits`. */ preserveDecimals?: boolean; /** * Specifies the rounding behavior for discarding the digits after the maximum fraction digits defined by * `maxFractionDigits`. This can be assigned * - by value in {@link sap.ui.core.format.NumberFormat.RoundingMode RoundingMode}, * - via a function that is used for rounding the number and takes two parameters: the number itself, * and the number of decimal digits that should be reserved. **Using a function is deprecated since 1.121.0**; * string based numbers are not rounded via this custom function. */ roundingMode?: sap.ui.core.format.NumberFormat.RoundingMode; /** * defines the number of decimals in the shortened format string. If this option isn't specified, the 'decimals' * option is used instead. */ shortDecimals?: int; /** * defines a limit above which only short number formatting is used */ shortLimit?: int; /** * since 1.40 specifies a number from which the scale factor for the 'short' or 'long' style format is generated. * The generated scale factor is used for all numbers which are formatted with this format instance. This * option only takes effect when the 'style' option is set to 'short' or 'long'. This option is set to `undefined` * by default, which means that the scale factor is selected automatically for each number being formatted. */ shortRefNumber?: int; /** * defines whether the unit of measure is shown in the formatted string, e.g. for input 1 and "duration-day" * true: "1 day", false: "1". If both `showMeasure` and `showNumber` are false, an empty string is returned */ showMeasure?: boolean; /** * defines whether the number is shown as part of the result string, e.g. 1 day for locale "en" `NumberFormat.getUnitInstance({showNumber:true}).format(1, * "duration-day"); // "1 day"` `NumberFormat.getUnitInstance({showNumber:false}).format(1, "duration-day"); * // "day"` e.g. 2 days for locale "en" `NumberFormat.getUnitInstance({showNumber:true}).format(2, "duration-day"); * // "2 days"` `NumberFormat.getUnitInstance({showNumber:false}).format(2, "duration-day"); // "days"` * If both `showMeasure` and `showNumber` are false, an empty string is returned */ showNumber?: boolean; /** * since 1.40 specifies whether the scale factor is shown in the formatted number. This option takes effect * only when the 'style' options is set to either 'short' or 'long'. */ showScale?: boolean; /** * whether the positions of grouping separators are validated. Space characters used as grouping separators * are not validated. */ strictGroupingValidation?: boolean; /** * defines the style of format. Valid values are 'short, 'long' or 'standard' (based on the CLDR decimalFormat). * When set to 'short' or 'long', numbers are formatted into compact forms. When this option is set, the * default value of the 'precision' option is set to 2. This can be changed by setting either min/maxFractionDigits, * decimals, shortDecimals, or the 'precision' option itself. */ style?: string; }, /** * The locale to get the formatter for; if no locale is given, a locale for the currently configured language * is used; see {@link module:sap/base/i18n/Formatting.getLanguageTag Formatting.getLanguageTag} */ oLocale?: sap.ui.core.Locale ): sap.ui.core.format.NumberFormat; /** * Format a number according to the given format options. * * * @returns The formatted value */ format( /** * The number to format as a number or a string, such as `1234.45` or `"-1234.45"`, or an array which contains * both the number to format as a number or a string and the `sMeasure` parameter */ vValue: number | string | any[], /** * An optional unit which has an impact on formatting currencies and units */ sMeasure?: string ): string; /** * Returns the scaling factor which is calculated based on the format options and the current locale being * used. * * This function only returns a meaningful scaling factor when the 'style' formatting option is set to 'short' * or 'long', and the 'shortRefNumber' option for calculating the scale factor is set. * * Consider using this function when the 'showScale' option is set to `false`, which causes the scale factor * not to appear in every formatted number but in a shared place. * * @since 1.100 * * @returns The scale string if it exists based on the given 'shortRefNumber' option. Otherwise it returns * `undefined`. */ getScale(): string | undefined; /** * Parse a string which is formatted according to the given format options. * * * @returns the parsed value as: * - number * - array which contains the parsed value and the currency code (symbol) or unit for currency and unit * instances * - string when option "parseAsString" is `true` * - `NaN` if value cannot be parsed * - `null` if value is invalid */ parse( /** * the string containing a formatted numeric value */ sValue: string ): number | any[] | string | null; } /** * Configuration options for the `showTimezone` format option of `DateFormat#getDateTimeWithTimezoneInstance`. * * @since 1.99.0 * @deprecated As of version 1.101. replaced by `DateFormat#getDateTimeWithTimezoneInstance` with the `showDate`, * `showTime` and `showTimezone` format options. */ enum DateFormatTimezoneDisplay { /** * Do not add the IANA timezone ID to the format output. */ Hide = "Hide", /** * Only output the IANA timezone ID. */ Only = "Only", /** * Add the IANA timezone ID to the format output. */ Show = "Show", } } namespace message { /** * Parameters of the MessageProcessor#messageChange event. */ interface MessageProcessor$MessageChangeEventParameters { /** * Messages already existing before the `messageChange` event was fired. */ oldMessages?: sap.ui.core.message.Message[]; /** * New messages added by the trigger of the `messageChange` event. */ newMessages?: sap.ui.core.message.Message[]; } /** * The ControlMessageProcessor implementation. This MessageProcessor is able to handle Messages with the * following target syntax: 'ControlID/PropertyName'. Creating an instance of this class using the "new" * keyword always results in the same instance (Singleton). */ class ControlMessageProcessor extends sap.ui.core.message .MessageProcessor { /** * Constructor for a new ControlMessageProcessor */ constructor(); /** * Creates a new subclass of class sap.ui.core.message.ControlMessageProcessor with name `sClassName` and * enriches it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.message.MessageProcessor.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo< T, sap.ui.core.message.ControlMessageProcessor >, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.message.ControlMessageProcessor. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Check Messages and update controls with messages * * @ui5-protected Do not call from applications (only from related classes in the framework) */ checkMessages(): void; /** * Set Messages to check * * @ui5-protected Do not call from applications (only from related classes in the framework) */ setMessages( /** * map of messages: {'target': [sap.ui.core.message.Message],...} */ mMessages: Record ): void; } class Message extends sap.ui.base.Object { /** * Constructor for a new Message. */ constructor( /** * a map which contains the following parameter properties: */ mParameters?: { /** * The message id: will be generated if no id is set */ id?: string; /** * The message text */ message?: string; /** * The message description */ description?: string; /** * The message description url to get a more detailed message */ descriptionUrl?: string; /** * The message additionalText */ additionalText?: string; /** * The message type */ type?: import("sap/ui/core/message/MessageType").default; /** * The message code */ code?: string; /** * If the message is set as technical message */ technical?: boolean; /** * An object containing technical details for a message */ technicalDetails?: object; processor?: sap.ui.core.message.MessageProcessor; /** * The single message target or (since 1.79) an array of message targets in case the message has multiple * targets. The syntax is MessageProcessor dependent. Read the documentation of the respective MessageProcessor. */ target?: string | string[]; /** * Sets message persistent: If persistent is set `true` the message lifecycle is controlled by the application */ persistent?: boolean; /** * Sets message date which can be used to remove old messages. Number of milliseconds elapsed since 1 January * 1970 00:00:00 UTC */ date?: int; /** * Defines more detailed information about the message target or (since 1.79) the message targets in case * the message has multiple targets. This property is currently only used by the ODataMessageParser. */ fullTarget?: string | string[]; } ); /** * Creates a new subclass of class sap.ui.core.message.Message with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.message.Message. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Returns the messages additional text. * * * @returns The additionaltext */ getAdditionalText(): string; /** * Returns the message code * * * @returns code */ getCode(): string; /** * Returns the control ID if set. * * NOTE: The control ID is only set for Controls based on `sap.m.InputBase` The Control must be bound to * a Model so the Message could be propagated to this Control. The propagation happens only if the Control * is created and visible on the screen. Is this the case the control ID is set. The ID is not set in all * other cases and cannot be set manually. * * If a Message is propagated to multiple Controls bound to the same target the last Control wins. * * * @returns sControlId */ getControlId(): string; /** * Returns an array of control IDs. * * NOTE: The control ID is only set for Controls based on `sap.m.InputBase`. The Control must be bound to * a Model so the Message could be propagated to this Control. The propagation happens only if the Control * is created and visible on the screen. The ID is not set in all other cases and cannot be set manually. * * * @returns aControlIds */ getControlIds(): any[]; /** * Set the date of the message * * * @returns The message date in number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. As returned * by Date.now(). */ getDate(): int; /** * Returns the message description * * * @returns description */ getDescription(): string; /** * Returns the message description URL which should be used to download the description content * * * @returns The URL pointing to the description long text */ getDescriptionUrl(): string; /** * Returns the Message Id * * * @returns id */ getId(): string; /** * Returns message text * * * @returns message */ getMessage(): string; /** * Returns the message processor * * * @returns processor */ getMessageProcessor(): sap.ui.core.message.MessageProcessor; /** * Returns the if Message is persistent * * * @returns bPersistent */ getPersistent(): boolean; /** * Returns the message target or the first target if the message has multiple targets. * * @deprecated As of version 1.79.0. As a message may have multiple targets, use {@link #getTargets} instead * * @returns The message target */ getTarget(): string; /** * Returns the targets of this message. * * @since 1.79 * * @returns The message targets; empty array if the message has no targets */ getTargets(): string[]; /** * Returns the if Message set as technical message * * * @returns true if message is technical or false if not */ getTechnical(): boolean; /** * Returns the technical details of the message * * * @returns The technical details */ getTechnicalDetails(): object; /** * Returns the message type * * * @returns type */ getType(): import("sap/ui/core/message/MessageType").default; /** * Sets the additionaltext for the message or merge different additionaltext strings */ setAdditionalText( /** * The additionaltext. */ sAdditionalText: string ): void; /** * Set message code */ setCode( /** * The Message code */ sCode: string ): void; /** * Set the date of the message, this will automatically be set on message creation */ setDate( /** * The message date in number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. As returned by * Date.now(). */ iDate: int ): void; /** * Set message description */ setDescription( /** * The Message description */ sDescription: string ): void; /** * Set message description URL which should be used to download the description content */ setDescriptionUrl( /** * The URL pointing to the description long text */ sDescriptionUrl: string ): void; /** * Set message text */ setMessage( /** * The Message as text */ sMessage: string ): void; /** * Set message processor */ setMessageProcessor( /** * The Message processor */ oMessageProcessor: sap.ui.model.Model ): void; /** * Set message persistent */ setPersistent( /** * Set Message persistent: If persisten is set true the message lifecycle controlled by Application */ bPersistent: boolean ): void; /** * Sets the message target; in case the message has multiple targets, sets the first target of the message. * The syntax is MessageProcessor dependent. See the documentation of the respective MessageProcessor. * * @deprecated As of version 1.79.0. As a message may have multiple targets, use {@link #setTargets} instead */ setTarget( /** * The message target */ sTarget: string ): void; /** * Sets the targets of this message. * * @since 1.79 */ setTargets( /** * The new targets of this message; use an empty array if the message shall have no targets */ aNewTargets: string[] ): void; /** * Set message as technical message */ setTechnical( /** * Set Message as technical message lifecycle controlled by Application */ bTechnical: boolean ): void; /** * Set the technical details for the message */ setTechnicalDetails( /** * The technical details of the message */ oTechnicalDetails: object ): void; /** * Set message type */ setType( /** * The Message type */ sType: import("sap/ui/core/message/MessageType").default ): void; } /** * @deprecated As of version 1.118. Please use {@link module:sap/ui/core/Messaging Messaging} instead. */ class MessageManager extends sap.ui.base.Object { /** * Constructor for a new MessageManager. * * Creating own instances of MessageManager is deprecated. Please require {@link module:sap/ui/core/Messaging 'sap/ui/core/Messaging' } * instead and use the module export directly without using 'new'. */ constructor(); /** * Creates a new subclass of class sap.ui.core.message.MessageManager with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.message.MessageManager. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Add messages to Messaging */ addMessages( /** * Array of `Message` or single `Message` */ vMessages: | sap.ui.core.message.Message | sap.ui.core.message.Message[] ): void; /** * Get the MessageModel * * * @returns oMessageModel The Message Model */ getMessageModel(): sap.ui.model.message.MessageModel; /** * Register MessageProcessor */ registerMessageProcessor( /** * The MessageProcessor */ oProcessor: sap.ui.core.message.MessageProcessor ): void; /** * When using the databinding type system, the validation/parsing of a new property value could fail. In * this case, a validationError/parseError event is fired. These events bubble up to the core. For registered * ManagedObjects, the Messaging attaches to these events and creates a `sap.ui.core.message.Message` (bHandleValidation=true) * for each of these errors and cancels the event bubbling. */ registerObject( /** * The sap.ui.base.ManagedObject */ oObject: sap.ui.base.ManagedObject, /** * Handle validationError/parseError events for this object. If set to true, the Messaging creates a Message * for each validation/parse error. The event bubbling is canceled in every case. */ bHandleValidation: boolean ): void; /** * Remove all messages */ removeAllMessages(): void; /** * Remove given Messages */ removeMessages( /** * The message(s) to be removed. */ vMessages: | sap.ui.core.message.Message | sap.ui.core.message.Message[] ): void; /** * Deregister MessageProcessor */ unregisterMessageProcessor( /** * The MessageProcessor */ oProcessor: sap.ui.core.message.MessageProcessor ): void; /** * Unregister ManagedObject */ unregisterObject( /** * The sap.ui.base.ManagedObject */ oObject: sap.ui.base.ManagedObject ): void; /** * Update Messages by providing two arrays of old and new messages. * * The old ones will be removed, the new ones will be added. */ updateMessages( /** * Array of old messages to be removed */ aOldMessages: sap.ui.core.message.Message[], /** * Array of new messages to be added */ aNewMessages: sap.ui.core.message.Message[] ): void; } /** * This is an abstract base class for MessageParser objects. */ abstract class MessageParser extends sap.ui.base.Object { /** * Abstract MessageParser class to be inherited in back-end specific implementations. */ constructor(); /** * Creates a new subclass of class sap.ui.core.message.MessageParser with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.message.MessageParser. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Returns the registered processor on which the events for message handling can be fired * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The currently set MessageProcessor or `null` if none is set */ getProcessor(): sap.ui.core.message.MessageProcessor | null; /** * Abstract parse method must be implemented in the inheriting class. */ parse( /** * The response from the server containing body and headers */ oResponse: object, /** * The original request that lead to this response */ oRequest: object ): void; /** * This method is used by the model to register itself as MessageProcessor for this parser * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Instance reference for method chaining */ setProcessor( /** * The MessageProcessor that can be used to fire events */ oProcessor: sap.ui.core.message.MessageProcessor ): this; } /** * This is an abstract base class for MessageProcessor objects. */ abstract class MessageProcessor extends sap.ui.base.EventProvider { /** * Constructor for a new MessageProcessor */ constructor(); /** * Creates a new subclass of class sap.ui.core.message.MessageProcessor with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.EventProvider.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.message.MessageProcessor. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Attaches event handler `fnFunction` to the {@link #event:messageChange messageChange} event of this `sap.ui.core.message.MessageProcessor`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.message.MessageProcessor` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachMessageChange( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: (evt: MessageProcessor$MessageChangeEvent) => void, /** * Context object to call the event handler with, defaults to this `MessageProcessor` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:messageChange messageChange} event of this `sap.ui.core.message.MessageProcessor`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.message.MessageProcessor` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachMessageChange( /** * The function to be called, when the event occurs */ fnFunction: (evt: MessageProcessor$MessageChangeEvent) => void, /** * Context object to call the event handler with, defaults to this `MessageProcessor` itself */ oListener?: object ): this; /** * Implement in inheriting classes */ checkMessages(): void; /** * Detaches event handler `fnFunction` from the {@link #event:messageChange messageChange} event of this * `sap.ui.core.message.MessageProcessor`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachMessageChange( /** * The function to be called, when the event occurs */ fnFunction: (evt: MessageProcessor$MessageChangeEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Fires event {@link #event:messageChange messageChange} to attached listeners. * * @deprecated As of version 1.115. Use {@link module:sap/ui/core/Messaging.updateMessages} instead * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireMessageChange( /** * Parameters to pass along with the event */ mParameters: sap.ui.core.message.MessageProcessor$MessageChangeEventParameters ): this; /** * Returns the ID of the MessageProcessor instance * * * @returns sId The MessageProcessor ID */ getId(): string; /** * Implement in inheriting classes */ setMessages( /** * map of messages: {'target': [sap.ui.core.message.Message],...} */ mMessages: Record ): void; } /** * Event object of the MessageProcessor#messageChange event. */ type MessageProcessor$MessageChangeEvent = sap.ui.base.Event< MessageProcessor$MessageChangeEventParameters, MessageProcessor >; } namespace mvc { namespace View { namespace Preprocessor { /** * Information about the view that is processed by the preprocessor */ type ViewInfo = { /** * the ID of the view */ id: string; /** * the name of the view */ name: string; /** * the ID of the owning Component of the view */ componentId: string; /** * identifies the caller of this preprocessor; basis for log or exception messages */ caller: string; }; } /** * Interface for Preprocessor implementations that can be hooked in the view life cycle. * * There are two possibilities to use the preprocessor. It can be either passed to the view via the mSettings.preprocessors * object where it is the executed only for this instance, or by the registerPreprocessor method of the * view type. Currently this is available only for XMLViews (as of version 1.30). * See: * sap.ui.core.mvc.View.registerPreprocessor (the method is available specialized for view types, so use * the following) * sap.ui.core.mvc.XMLView.registerPreprocessor * * @since 1.30 */ interface Preprocessor { __implements__sap_ui_core_mvc_View_Preprocessor: boolean; /** * Cache key provider method that can be implemented by a preprocessor. * * This method should be used to invalidate a cache on the currently preprocessed view. Therefore, a Promise * needs to be passed which resolves with the according cache key increment. * * **Note:** Caching is only available for XMLViews! Some parts of the feature are still experimental, For * further information see {@link sap.ui.core.mvc.XMLView.create XMLView.create} * * @since 1.40 * * @returns String or Promise resolving with a string */ getCacheKey( /** * identification information about the calling instance */ oViewInfo: { /** * ID */ id: string; /** * Name */ name: string; /** * ID of the owning Component */ componentId: string; } ): string | Promise; /** * Processing method that must be implemented by a Preprocessor. * * * @returns the processed resource or a promise which resolves with the processed resource */ process( /** * the source to be processed */ vSource: Object, /** * identification information about the calling instance */ oViewInfo: sap.ui.core.mvc.View.Preprocessor.ViewInfo, /** * settings object containing the settings provided with the preprocessor */ mSettings?: object ): Object | Promise; } } namespace XMLView { /** * Specifies the available preprocessor types for XMLViews * * This enum is part of the 'sap/ui/core/mvc/XMLView' module export and must be accessed by the property * 'PreprocessorType'. * See: * sap.ui.core.mvc.XMLView * sap.ui.core.mvc.View.Preprocessor * * @since 1.34 */ enum PreprocessorType { /** * This preprocessor receives the control tree produced through the view source */ CONTROLS = "controls", /** * This preprocessor receives a valid xml source for View creation without any template tags but with control * declarations. These include their full IDs by which they can also be queried during runtime. */ VIEWXML = "viewxml", /** * This preprocessor receives the plain xml source of the view and should also return a valid xml ready * for view creation */ XML = "xml", } } namespace ControllerExtension { /** * The type of the `overrides` property */ type Overrides = { [key: string]: any } & Partial< Pick< (typeof Controller)["prototype"], "onAfterRendering" | "onBeforeRendering" | "onExit" | "onInit" > >; } /** * Marker interface for a ControllerExtension. * * @since 1.56.0 */ interface IControllerExtension { __implements__sap_ui_core_mvc_IControllerExtension: boolean; } /** * Describes the settings that can be provided to the HTMLView constructor. * * @deprecated As of version 1.108. as there are no more known usages of `HTMLViews`, and as the use of * HTML as syntax does not bring any advantages over XML. The HTML necessary for the `HTMLView` is not re-used * for the HTML of the controls, but is fully replaced. * * Consider using {@link sap.ui.core.mvc.XMLView XMLViews} or "typed views" (view classes written in JavaScript) * instead. For more information, see the documentation on {@link topic:91f27e3e6f4d1014b6dd926db0e91070 View types}. */ interface $HTMLViewSettings extends sap.ui.core.mvc.$ViewSettings {} /** * Describes the settings that can be provided to the JSONView constructor. * * @deprecated As of version 1.120. please consider using {@link sap.ui.core.mvc.XMLView XMLViews} or "typed * views" (view classes written in JavaScript) instead. For more information, see the documentation on {@link topic:91f27e3e6f4d1014b6dd926db0e91070 View types}. */ interface $JSONViewSettings extends sap.ui.core.mvc.$ViewSettings {} /** * Describes the settings that can be provided to the JSView constructor. * * @deprecated As of version 1.90. Instead use {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed Views } * by defining the view class with {@link sap.ui.core.mvc.View.extend View.extend} and creating the view * instances with {@link sap.ui.core.mvc.View.create View.create}. */ interface $JSViewSettings extends sap.ui.core.mvc.$ViewSettings {} /** * Describes the settings that can be provided to the TemplateView constructor. * * @deprecated As of version 1.56.0. use {@link sap.ui.core.mvc.XMLView} in combination with {@link topic:5ee619fc1370463ea674ee04b65ed83b XML Templating } * instead. */ interface $TemplateViewSettings extends sap.ui.core.mvc.$ViewSettings {} /** * Describes the settings that can be provided to the View constructor. */ interface $ViewSettings extends sap.ui.core.$ControlSettings { /** * The width */ width?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * The height */ height?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Name of the View */ viewName?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Whether the CSS display should be set to "block". Set this to "true" if the default display "inline-block" * causes a vertical scrollbar with Views that are set to 100% height. Do not set this to "true" if you * want to display other content in the same HTML parent on either side of the View (setting to "true" may * push that other content to the next/previous line). */ displayBlock?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Controller instance to use for this view. */ controller?: sap.ui.core.mvc.Controller; /** * Name of the controller class to use for this view. If given, it overrides the same information in the * view definition (XML, HTML). */ controllerName?: string; /** * Preprocessors that the view can use before constructing the view. */ preprocessors?: Object; /** * (module) Name of a resource bundle that should be loaded for this view */ resourceBundleName?: string; /** * URL of a resource bundle that should be loaded for this view */ resourceBundleUrl?: sap.ui.core.URI; /** * Locale that should be used to load a resource bundle for this view */ resourceBundleLocale?: string; /** * Model name under which the resource bundle should be stored. */ resourceBundleAlias?: string; /** * Type of the view */ type?: string; /** * A view definition */ definition?: any; /** * Deprecated as of 1.56: Use `definition` instead. */ viewContent?: any; /** * Additional configuration data that should be given to the view at construction time and which will be * available early, even before model data or other constructor settings are applied. */ viewData?: any; /** * Determines initialization mode of the view * * @since 1.30 */ async?: boolean; /** * Child Controls of the view */ content?: | sap.ui.core.Control[] | sap.ui.core.Control | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; /** * Fired when the View has parsed the UI description and instantiated the contained controls (/control tree). */ afterInit?: (oEvent: sap.ui.base.Event) => void; /** * Fired when the view has received the request to destroy itself, but before it has destroyed anything. */ beforeExit?: (oEvent: sap.ui.base.Event) => void; /** * Fired when the View has been (re-)rendered and its HTML is present in the DOM. */ afterRendering?: (oEvent: sap.ui.base.Event) => void; /** * Fired before this View is re-rendered. Use to unbind event handlers from HTML elements etc. */ beforeRendering?: (oEvent: sap.ui.base.Event) => void; } /** * Describes the settings that can be provided to the XMLView constructor. */ interface $XMLViewSettings extends sap.ui.core.mvc.$ViewSettings { /** * Configuration for the XMLView caching. */ cache?: Object; } /** * Parameters of the View#afterInit event. */ interface View$AfterInitEventParameters {} /** * Parameters of the View#afterRendering event. */ interface View$AfterRenderingEventParameters {} /** * Parameters of the View#beforeExit event. */ interface View$BeforeExitEventParameters {} /** * Parameters of the View#beforeRendering event. */ interface View$BeforeRenderingEventParameters {} /** * A generic controller implementation for the UI5 Model-View-Controller concept. * * Can be used as a base class for typed controllers. * * **Typed Controller Scenario**: * - use {@link sap.ui.core.mvc.Controller.extend Controller.extend} to define the controller class * - use {@link sap.ui.core.mvc.Controller.create Controller.create} to create an instance */ class Controller extends sap.ui.base.EventProvider { /** * Instantiates a (MVC-style) controller. */ constructor( /** * The name of the controller to instantiate. */ sName: string ); /** * Creates an instance of controller class. * * @since 1.56.0 * * @returns the Promise resolves with a new instance of the controller */ static create( /** * A map containing the controller configuration options. */ mOptions: { /** * The controller name that corresponds to a JS module that can be loaded via the module system (mOptions.name * + suffix ".controller.js"). It can be specified either in dot notation (`my.sample.Controller`) or in * module name syntax (`module:my/sample/Controller`). */ name: string; } ): Promise; /** * Creates a new subclass of class sap.ui.core.mvc.Controller with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.EventProvider.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.mvc.Controller. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * See {@link sap.ui.core.mvc.ControllerExtensionProvider.registerExtensionProvider}. * * @since 1.34.0 * @deprecated As of version 1.136.0. without replacement, the extension provider concept is intended for * framework internal use only. */ static registerExtensionProvider( /** * the module name of the extension provider */ sExtensionProvider: string ): void; /** * Returns an Element of the connected view with the given local ID. * * Views automatically prepend their own ID as a prefix to created Elements to make the IDs unique even * in the case of multiple view instances. This method helps to find an element by its local ID only. * * If no view is connected or if the view doesn't contain an element with the given local ID, `undefined` * is returned. * * * @returns Element by its (view local) ID */ byId( /** * View-local ID */ sId: string ): sap.ui.core.Element | undefined; /** * Converts a view local ID to a globally unique one by prepending the view ID. * * If no view is connected, `undefined` is returned. * * * @returns Prefixed ID */ createId( /** * View-local ID */ sId: string ): string | undefined; /** * Gets the component of the controller's view * * If there is no Component connected to the view or the view is not connected to the controller, `undefined` * is returned. * * @since 1.23.0 * * @returns Component instance */ getOwnerComponent(): sap.ui.core.Component | undefined; /** * Returns the view associated with this controller or `undefined`. * * * @returns View connected to this controller. */ getView(): sap.ui.core.mvc.View | undefined; /** * Loads a Fragment by {@link sap.ui.core.Fragment.load}. * * The fragment content will be added to the `dependents` aggregation of the view by default. This behavior * can be suppressed by setting `mOptions.addToDependents` to false. * * The controller is passed to the Fragment by default, so the (event handler) methods referenced in the * Fragment will be called on this Controller. * * If the controller has an owner component, it is passed to the fragment content. By default the fragment * content will be prefixed with the view ID to avoid duplicate ID issues. The prefixing can be switched * off with the `autoPrefixId` option. * * When `autoPrefixId` is enabled, the fragment content can be accessed by calling {@link sap.ui.core.mvc.Controller.byId}. * * **Destroy behavior**: Different scenarios concerning the destruction of the fragment's content exist, * of which some must be addressed by the caller, while others are handled automatically. * - The controller instance is destroyed before the fragment content creation has finished: In this case, * the controller instance takes care of asynchronously destroying the fragment content * - The fragment content is aggregated within a control (e.g. `dependents` aggregation by default): In * this case, the content will be destroyed during the regular destroy lifecycle. * - The fragment content is not aggregated within a control: In this case, ***it must be destroyed manually*** * in the exit hook of the controller. * * @since 1.93 * * @returns A Promise that resolves with the fragment content */ loadFragment( /** * Options regarding fragment loading */ mOptions: { /** * The fragment name, which must correspond to a fragment which can be loaded via the module system (mOptions.name * + suffix ".fragment.[typeextension]") and must contain the fragment definition. It can be specified either * in dot notation (`my.sample.myFragment`) or, for JS fragments, in module name syntax (`module:my/sample/myFragment`). */ name: string; /** * Whether the fragment content should be added to the `dependents` aggregation of the view */ addToDependents?: boolean; /** * Whether the IDs of the fragment content will be prefixed by the view ID */ autoPrefixId?: boolean; /** * the ID of the fragment */ id?: string; /** * the fragment type, e.g. "XML", "JS", or "HTML" (see above). Default is "XML". If the fragment name is * given in module name syntax (e.g., `module:my/sample/myFragment`) the type must be omitted. */ type?: string; } ): Promise; /** * This method is called every time the View is rendered, after the HTML is placed in the DOM-Tree. It can * be used to apply additional changes to the DOM after the Renderer has finished. (Even though this method * is declared as "abstract", it does not need to be defined in controllers, if the method does not exist, * it will simply not be called.) * See: * sap.ui.core.Control.prototype.onAfterRendering * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns This lifecycle hook must not have a return value. Return value `void` is deprecated since 1.120, * as it does not force functions to **not** return something. This implies that, for instance, no async * function returning a Promise should be used. * * **Note:** While the return type is currently `void|undefined`, any implementation of this hook must not * return anything but undefined. Any other return value will cause an error log in this version of UI5 * and will fail in future major versions of UI5. */ onAfterRendering(): void | undefined; /** * This method is called every time the View is rendered, before the Renderer is called and the HTML is * placed in the DOM-Tree. It can be used to perform clean-up-tasks before re-rendering. (Even though this * method is declared as "abstract", it does not need to be defined in controllers, if the method does not * exist, it will simply not be called.) * See: * sap.ui.core.Control.prototype.onBeforeRendering * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns This lifecycle hook must not have a return value. Return value `void` is deprecated since 1.120, * as it does not force functions to **not** return something. This implies that, for instance, no async * function returning a Promise should be used. * * **Note:** While the return type is currently `void|undefined`, any implementation of this hook must not * return anything but undefined. Any other return value will cause an error log in this version of UI5 * and will fail in future major versions of UI5. */ onBeforeRendering(): void | undefined; /** * This method is called upon desctuction of the View. The controller should perform its internal destruction * in this hook. It is only called once per View instance, unlike the onBeforeRendering and onAfterRendering * hooks. (Even though this method is declared as "abstract", it does not need to be defined in controllers, * if the method does not exist, it will simply not be called.) * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns This lifecycle hook must not have a return value. Return value `void` is deprecated since 1.120, * as it does not force functions to **not** return something. This implies that, for instance, no async * function returning a Promise should be used. * * **Note:** While the return type is currently `void|undefined`, any implementation of this hook must not * return anything but undefined. Any other return value will cause an error log in this version of UI5 * and will fail in future major versions of UI5. */ onExit(): void | undefined; /** * This method is called upon initialization of the View. The controller can perform its internal setup * in this hook. It is only called once per View instance, unlike the onBeforeRendering and onAfterRendering * hooks. (Even though this method is declared as "abstract", it does not need to be defined in controllers, * if the method does not exist, it will simply not be called.) * * **Note:** In component-based apps `this.getOwnerComponent().getModel()` should be used inside `onInit()` * to get a model assigned to the component instead of using `this.getView().getModel()`. The latter call * might return `undefined` because the view might not have been attached to a parent yet (i.e. the component), * and thus the view can't inherit a model from that parent. You could also attach to the `modelContextChange` * event. The event is fired when either the context or the model changes for the control. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns This lifecycle hook must not have a return value. Return value `void` is deprecated since 1.120, * as it does not force functions to **not** return something. This implies that, for instance, no async * function returning a Promise should be used. * * **Note:** While the return type is currently `void|undefined`, any implementation of this hook must not * return anything but undefined. Any other return value will cause an error log in this version of UI5 * and will fail in future major versions of UI5. */ onInit(): void | undefined; } /** * Base class for controller extensions. * * All controller extensions must {@link #.extend extend} from this base class. It provides access to the * {@link #getView view} of the extended controller as well as to the view's {@link #byId controls}. * * For a more detailed description how to develop controller extensions, see section {@link https://ui5.sap.com/#/topic/21515f09c0324218bb705b27407f5d61 Using Controller Extension } * in the documentation. */ class ControllerExtension extends sap.ui.base.Object { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * The `overrides` definition object, which is used to specify methods of the base class to override. The * names of this object's properties are method names like `onInit` and the values are the respective implementation. */ static readonly overrides?: sap.ui.core.mvc.ControllerExtension.Overrides; /** * Creates a new subclass of class sap.ui.core.mvc.ControllerExtension with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.mvc.ControllerExtension. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Override the ControllerExtension class with the given custom extension definition. * * Only public methods that are not final could be overridden. The lifecycle methods `onInit`, `onExit`, * `onBeforeRendering` and `onAfterRendering` are added before or after the lifecycle functions of the original * extension. * * Example for `oExtension`: * ```javascript * * { * onInit: function() { * ... * }, * ... * } * ``` * * * **Note:** This static method is automatically propagated to subclasses of `ControllerExtension`. * * * @returns The adapted controller extension class */ static override< TheExtension extends new () => ControllerExtension, AddtlProps extends object, >( this: TheExtension, /** * The custom extension definition */ customExtension: AddtlProps ): new () => InstanceType & AddtlProps; /** * A marker method for applying controller extensions to controller class members in TypeScript code. * This method is only used to make TypeScript usage compatible to the UI5 runtime behavior, where an extension * *class* is assigned when the controller is defined, but each controller instance gets an *instance* of * this extension. This method call is removed in the class transformer when the ES class is transformed * to the traditional UI5 class definition syntax. * * To allow for proper removal, it may only be called directly on the base class `ControllerExtension`, * at the place where a controller extension is assigned to a member property of the new controller class. * The class transformation then removes this call. If it is not removed because it is used in any other * way, then it throws an error at runtime. * * Usage example: * ```javascript * import Routing from "sap/fe/core/controllerextensions/Routing"; * import ControllerExtension from "sap/ui/core/mvc/ControllerExtension"; * ... * export default class App extends Controller { * routing = ControllerExtension.use(Routing); * ``` * * Usage example with overriding extension callbacks: * ```javascript * import Routing from "sap/fe/core/controllerextensions/Routing"; * import ControllerExtension from "sap/ui/core/mvc/ControllerExtension"; * ... * export default class App extends Controller { * routing = ControllerExtension.use(Routing.override({ * ... * })); * ``` * * * * @returns An instance of the given `ControllerExtension`. **NOTE:** this is only a dummy return type for * proper usage in TypeScript. This method does not actually return an instance of `ControllerExtension`, * but only throws an error at runtime. The sole purpose of this method is to mimic the actual runtime behavior * where a *class* is given when a controller is defined, but an *instance* is present in each controller * instance. */ static use( /** * The ControllerExtension to use */ extensionClass: new () => TheExtension ): TheExtension; /** * Returns an Element of the connected view with the given local ID. * * Views automatically prepend their own ID as a prefix to created Elements to make the IDs unique even * in the case of multiple view instances. For a controller extension, the namespace of the control ID gets * also prefixed with the namespace of the extension. This method helps to find an element by its local * ID only. * * If no view is connected or if the view doesn't contain an element with the given local ID, `undefined` * is returned. * * * @returns Element by its (view local) ID */ byId( /** * View-local ID */ sId: string ): sap.ui.core.Element; /** * Returns the View from the corresponding controller. * * * @returns oView The corresponding view instance */ getView(): sap.ui.core.mvc.View; } /** * A view defined/constructed by declarative HTML. * * @since 1.9.2 * @deprecated As of version 1.108. as there are no more known usages of `HTMLViews`, and as the use of * HTML as syntax does not bring any advantages over XML. The HTML necessary for the `HTMLView` is not re-used * for the HTML of the controls, but is fully replaced. * * Consider using {@link sap.ui.core.mvc.XMLView XMLViews} or "typed views" (view classes written in JavaScript) * instead. For more information, see the documentation on {@link topic:91f27e3e6f4d1014b6dd926db0e91070 View types}. */ class HTMLView extends sap.ui.core.mvc.View { /** * Constructor for a new `HTMLView`. * * **Note:** Application code shouldn't call the constructor directly, but rather use the factory {@link sap.ui.core.mvc.HTMLView.create HTMLView.create } * or {@link sap.ui.core.mvc.View.create View.create} with type {@link sap.ui.core.mvc.ViewType.HTML HTML}. * The factory simplifies asynchronous loading of a view and future features might be added to the factory * only. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.mvc.View#constructor sap.ui.core.mvc.View } * can be used. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.mvc.$HTMLViewSettings ); /** * Constructor for a new `HTMLView`. * * **Note:** Application code shouldn't call the constructor directly, but rather use the factory {@link sap.ui.core.mvc.HTMLView.create HTMLView.create } * or {@link sap.ui.core.mvc.View.create View.create} with type {@link sap.ui.core.mvc.ViewType.HTML HTML}. * The factory simplifies asynchronous loading of a view and future features might be added to the factory * only. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.mvc.View#constructor sap.ui.core.mvc.View } * can be used. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.mvc.$HTMLViewSettings ); /** * Flag for feature detection of asynchronous loading/rendering * * @since 1.30 */ static asyncSupport: boolean; /** * Creates an instance of a declarative HTML view. * * @since 1.56.0 * * @returns A promise which resolves with the created `HTMLView` instance */ static create( /** * An object containing the view configuration options. */ oOptions: { /** * Specifies an ID for the view instance. If no ID is given, an ID will be generated. */ id?: string; /** * Name of the view resource in module name notation (without suffix) */ viewName?: string; /** * The view definition. */ definition?: string; /** * Controller instance to be used for this view. The given controller instance overrides the controller * defined in the view definition. Sharing a controller instance between multiple views is not supported. */ controller?: sap.ui.core.mvc.Controller; } ): Promise; /** * Creates a new subclass of class sap.ui.core.mvc.HTMLView with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.mvc.View.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.mvc.HTMLView. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; } /** * A View defined using JSON. * * @deprecated As of version 1.120. please consider using {@link sap.ui.core.mvc.XMLView XMLViews} or "typed * views" (view classes written in JavaScript) instead. For more information, see the documentation on {@link topic:91f27e3e6f4d1014b6dd926db0e91070 View types}. */ class JSONView extends sap.ui.core.mvc.View { /** * Constructor for a new mvc/JSONView. * * **Note:** Application code shouldn't call the constructor directly, but rather use the factory {@link sap.ui.core.mvc.JSONView.create JSONView.create } * or {@link sap.ui.core.mvc.View.create View.create} with type {@link sap.ui.core.mvc.ViewType.JSON JSON}. * The factory simplifies asynchronous loading of a view and future features might be added to the factory * only. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.mvc.View#constructor sap.ui.core.mvc.View } * can be used. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.mvc.$JSONViewSettings ); /** * Constructor for a new mvc/JSONView. * * **Note:** Application code shouldn't call the constructor directly, but rather use the factory {@link sap.ui.core.mvc.JSONView.create JSONView.create } * or {@link sap.ui.core.mvc.View.create View.create} with type {@link sap.ui.core.mvc.ViewType.JSON JSON}. * The factory simplifies asynchronous loading of a view and future features might be added to the factory * only. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.mvc.View#constructor sap.ui.core.mvc.View } * can be used. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.mvc.$JSONViewSettings ); /** * Flag for feature detection of asynchronous loading/rendering. * * @since 1.30 */ static asyncSupport: boolean; /** * Creates a JSON view of the given configuration. * * @since 1.56.0 * * @returns A promise which resolves with the created `JSONView` instance. */ static create( /** * An object containing the view configuration options. */ oOptions: { /** * Specifies an ID for the view instance. If no ID is given, an ID will be generated. */ id?: string; /** * The view name (in dot-notation) that corresponds to a JSON resource that can be loaded via the module * system (viewName + suffix ".view.json"). */ viewName?: string; /** * view definition as a JSON string or an object literal */ definition?: string | object; /** * Controller instance to be used for this view. The given controller instance overrides the controller * defined in the view definition. Sharing a controller instance between multiple views is not supported. */ controller?: sap.ui.core.mvc.Controller; } ): Promise; /** * Creates a new subclass of class sap.ui.core.mvc.JSONView with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.mvc.View.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.mvc.JSONView. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; } /** * A View defined/constructed by JavaScript code. * * @deprecated As of version 1.90. Instead use {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed Views } * by defining the view class with {@link sap.ui.core.mvc.View.extend View.extend} and creating the view * instances with {@link sap.ui.core.mvc.View.create View.create}. */ class JSView extends sap.ui.core.mvc.View { /** * Constructor for a new `JSView`. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.mvc.View#constructor sap.ui.core.mvc.View } * can be used. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.mvc.$JSViewSettings ); /** * Constructor for a new `JSView`. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.mvc.View#constructor sap.ui.core.mvc.View } * can be used. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.mvc.$JSViewSettings ); /** * Flag for feature detection of asynchronous loading/rendering. * * @since 1.30 */ static asyncSupport: boolean; /** * Creates an instance of the view with the given name (and id). * * @since 1.56.0 * @deprecated As of version 1.90. Use {@link sap.ui.core.mvc.View.create View.create} to create view instances * * @returns A promise that resolves with the view instance */ static create( /** * An object containing the view configuration options. */ oOptions: { /** * Specifies an ID for the view instance. If no ID is given, an ID will be generated. */ id?: string; /** * Name of the view definition. The view must still be defined using {@link sap.ui.jsview}. */ viewName?: string; /** * Controller instance to be used for this view. The given controller instance overrides the controller * defined in the view definition. Sharing a controller instance between multiple views is not supported. */ controller?: sap.ui.core.mvc.Controller; } ): Promise; /** * Creates a new subclass of class sap.ui.core.mvc.JSView with name `sClassName` and enriches it with the * information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.mvc.View.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.mvc.JSView. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * A method to be implemented by `JSView`s, returning the view UI. * * While for declarative view types like `XMLView` or `JSONView` the user interface definition is declared * in a separate file, `JSView`s programmatically constructs the UI. This happens in the `createContent` * method which every `JSView` needs to implement. The view implementation can construct the complete UI * in this method, or only return the root control and create the remainder of the UI lazily later on. * * * @returns A control or array of controls representing the view user interface */ createContent(): sap.ui.core.Control | sap.ui.core.Control[]; } /** * A view defined in a template. * * @deprecated As of version 1.56.0. use {@link sap.ui.core.mvc.XMLView} in combination with {@link topic:5ee619fc1370463ea674ee04b65ed83b XML Templating } * instead. */ class TemplateView extends sap.ui.core.mvc.View { /** * Constructor for a new mvc/TemplateView. * * **Note:** Application code shouldn't call the constructor directly, but rather use the factory {@link sap.ui.templateview } * or {@link sap.ui.core.mvc.View.create View.create} with type {@link sap.ui.core.mvc.ViewType.Template Template}. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.mvc.View#constructor sap.ui.core.mvc.View } * can be used. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.mvc.$TemplateViewSettings ); /** * Constructor for a new mvc/TemplateView. * * **Note:** Application code shouldn't call the constructor directly, but rather use the factory {@link sap.ui.templateview } * or {@link sap.ui.core.mvc.View.create View.create} with type {@link sap.ui.core.mvc.ViewType.Template Template}. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.mvc.View#constructor sap.ui.core.mvc.View } * can be used. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.mvc.$TemplateViewSettings ); /** * Creates a new subclass of class sap.ui.core.mvc.TemplateView with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.mvc.View.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.mvc.TemplateView. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; } /** * A base class for Views. * * Introduces the relationship to a Controller, some basic visual appearance settings like width and height, * and provides lifecycle events. * * Views form an ID scope for the elements and controls in their content. They can prefix the IDs of elements * either automatically (e.g. XMLView) or programmatically (using {@link #createId}). With method {@link #byId}, * elements or controls can be found with their view-local ID. Also see {@link https://ui5.sap.com/#/topic/91f28be26f4d1014b6dd926db0e91070 "Support for Unique IDs" } * in the documentation. * * View Definition: A view can be defined by {@link sap.ui.core.mvc.View.extend extending} this class and * implementing the {@link #createContent} method. The method must return one or many root controls that * will be rendered as content of the view. * * Views that are defined that way are referred to as **typed views**, as each view definition is represented * by its own class (type). See {@link https://ui5.sap.com/#/topic/e6bb33d076dc4f23be50c082c271b9f0 Typed Views } * for further information. * * **Example:** Defining a typed view (module 'myapp/views/MainView.js') * ```javascript * * // view definition * sap.ui.define([ * "sap/ui/core/mvc/View", * "sap/m/Panel" * ], function(View, Panel) { * * return View.extend("myapp.views.MainView", { * * // define, which controller to use * getControllerName: function() { * return "myapp.controller.Main"; * }, * * // whether the ID of content controls should be prefixed automatically with the view's ID * getAutoPrefixId: function() { * return true; // default is false * } * * // create view content and return the root control(s) * // or a Promise resolving with the control(s). * createContent: function() { * return new Promise(function(res, rej) { * res(new Panel({...})); * }).catch(function(err) { * rej(err); * }); * } * }); * }); * ``` * * * View Instantiation: The preferred way of instantiating a typed view is via the generic factory {@link sap.ui.core.mvc.View.create View.create}. * * When the `viewName` starts with prefix `"module:"`, the remainder of the name is assumed to be the name * of a module that exports a typed view (a subclass of `View`). The module name must use the same syntax * as for `sap.ui.define/sap.ui.require` (slash-separated name without '.js' suffix). * * **Example:** Instantiating a typed view with `View.create` * ```javascript * * View.create({ * viewName: "module:myapp/views/MainView" * }).then(oView) { * oView.placeAt("content"); * }); * ``` * * * A typed view can also be instantiated by calling its constructor without any arguments: * ```javascript * * sap.ui.require(["myapp/views/MainView"], function(MainView) { * new MainView().placeAt("content"); * }); * ``` * * * Other Methods: Besides `createContent`, there are other methods that a view can implement: * - Method {@link #getControllerName getControllerName} defines the name of the controller that should * be instantiated and used for the view. The name must be in class name notation (dot notation), without * the `".controller"` suffix. The suffix will be added by the framework when loading the module containing * the controller. * - Method {@link #getControllerModuleName getControllerModuleName} defines the module name of the controller * that should be loaded for the view. Unlike `getControllerName`, the name must be in `sap.ui.define/sap.ui.require` * syntax (slash-separated name without '.js' suffix). * - {@link #getAutoPrefixId getAutoPrefixId} defines whether the IDs of controls created during the execution * of `createContent` will be prefixed with the ID of the view automatically. The default implementation * of this method returns `false`. */ abstract class View extends sap.ui.core.Control { /** * Constructor for a new `View`. * * As `View` is an abstract base class for views, applications should not call the constructor, but rather * use one of the view factories instead, e.g. {@link #.create View.create}, to create an instance of a * concrete subclass (e.g. `XMLView`). * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * Initial settings for the new control */ mSettings?: sap.ui.core.mvc.$ViewSettings ); /** * Constructor for a new `View`. * * As `View` is an abstract base class for views, applications should not call the constructor, but rather * use one of the view factories instead, e.g. {@link #.create View.create}, to create an instance of a * concrete subclass (e.g. `XMLView`). * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * ID for the new control, generated automatically if no ID is given */ sId?: string, /** * Initial settings for the new control */ mSettings?: sap.ui.core.mvc.$ViewSettings ); /** * Creates a view of the given type, name and with the given ID. * * If the option `viewName` is given, the corresponding view module is loaded if needed. * * When the `viewName` starts with prefix `"module:"`, the remainder of the name is assumed to be the name * of a module that exports a typed view (subclass of `View`). The module name must use the same syntax * as for `sap.ui.define/sap.ui.require` (slash-separated name). * * @since 1.56.0 * * @returns A Promise which resolves with the created View instance */ static create( /** * Options for the view instantiation. Can contain any settings that are documented for the {@link sap.ui.core.mvc.View}; * specialized view types could bring in additional settings. */ oOptions: { /** * Specifies an ID for the View instance. If no ID is given, one will be generated */ id?: string; /** * Name of the view resource in module name notation (dot-separated, without suffix); either `viewName` * or `definition` must be given. A `viewName` can be given in the form `module:my/views/Main` to load a * typed view. */ viewName?: string; /** * The view definition. Only supported for XML and HTML views. See also {@link sap.ui.core.mvc.XMLView.create } * and {@link sap.ui.core.mvc.HTMLView.create} (deprecated) for more information. */ definition?: any; /** * Specifies what kind of view will be instantiated. All valid view types are listed in the enumeration * {@link sap.ui.core.mvc.ViewType}. */ type?: sap.ui.core.mvc.ViewType; /** * A general purpose data bag, which is under full control of the caller. It can be retrieved with the {@link sap.ui.core.mvc.View#getViewData } * method during the whole lifecycle of the view and controller. In contrast to data propagated from the * parent control (e.g. models, binding contexts), `viewData` can already be accessed at construction time, * e.g. in the `onInit` hook of the controller. Propagated data can only be accessed after the view has * been added to the control hierarchy. */ viewData?: any; /** * Can hold a map from the specified preprocessor type (e.g. "xml") to an array of preprocessor configurations; * each configuration consists of a `preprocessor` property (optional when registered as on-demand preprocessor) * and may contain further preprocessor-specific settings. The preprocessor can be either a module name * as string implementation of {@link sap.ui.core.mvc.View.Preprocessor} or a function according to {@link sap.ui.core.mvc.View.Preprocessor.process}. * Do not set properties starting with underscore like `_sProperty` property, these are reserved for internal * purposes. When several preprocessors are provided for one hook, it has to be made sure that they do not * conflict when being processed serially. * * **Note**: These preprocessors are only available to this instance. For global or on-demand availability * use {@link sap.ui.core.mvc.XMLView.registerPreprocessor}. **Note**: Please note that preprocessors in * general are currently only available to XMLViews */ preprocessors?: object; /** * Controller instance to be used for this view. The given controller instance overrides the controller * defined in the view definition. Sharing a controller instance between multiple views is not supported. */ controller?: sap.ui.core.mvc.Controller; } ): Promise; /** * Creates a new subclass of class sap.ui.core.mvc.View with name `sClassName` and enriches it with the * information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.Control.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.mvc.View. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Register a preprocessor for all views of a specific type. * * The preprocessor can be registered for several stages of view initialization, which are dependent on * the view type, e.g. "raw", "xml" or already initialized "controls". If there is a preprocessor passed * to or activated at the view instance already, that one is used. When several preprocessors are registered * for one hook, it has to be made sure that they do not conflict when being processed serially. * * It can be either a module name as string of an implementation of {@link sap.ui.core.mvc.View.Preprocessor } * or a function with a signature according to {@link sap.ui.core.mvc.View.Preprocessor.process}. * * **Note**: Preprocessors only work in async views and will be ignored when the view is instantiated in * sync mode by default, as this could have unexpected side effects. You may override this behaviour by * setting the `bSyncSupport` flag to `true`. * * @since 1.30 * @ui5-protected Do not call from applications (only from related classes in the framework) */ static registerPreprocessor( /** * the type of content to be processed */ sType: string, /** * module path of the preprocessor implementation or a preprocessor function */ vPreprocessor: | string | (( p1: Object, p2: sap.ui.core.mvc.View.Preprocessor.ViewInfo, p3: object ) => void), /** * type of the calling view, e.g. `XML` */ sViewType: string, /** * Deprecated as of version 1.145, because this parameter is only applicable to sync views and is no longer * used. Declares if the vPreprocessor ensures safe sync processing. This means the preprocessor will be * executed also for sync views. Please be aware that any kind of async processing (like Promises, XHR, * etc) may break the view initialization and lead to unexpected results. */ bSyncSupport: boolean, /** * on-demand preprocessor which enables developers to quickly activate the preprocessor for a view, by setting * `preprocessors : { xml }`, for example. There can only be one on-demand preprocessor per content type. */ bOnDemand?: boolean, /** * optional configuration for preprocessor */ mSettings?: object ): void; /** * Adds some content to the aggregation {@link #getContent content}. * * * @returns Reference to `this` in order to allow method chaining */ addContent( /** * The content to add; if empty, nothing is inserted */ oContent: sap.ui.core.Control ): this; /** * Attaches event handler `fnFunction` to the {@link #event:afterInit afterInit} event of this `sap.ui.core.mvc.View`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.mvc.View` itself. * * Fired when the View has parsed the UI description and instantiated the contained controls (/control tree). * * * @returns Reference to `this` in order to allow method chaining */ attachAfterInit( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.mvc.View` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:afterInit afterInit} event of this `sap.ui.core.mvc.View`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.mvc.View` itself. * * Fired when the View has parsed the UI description and instantiated the contained controls (/control tree). * * * @returns Reference to `this` in order to allow method chaining */ attachAfterInit( /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.mvc.View` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:afterRendering afterRendering} event of this * `sap.ui.core.mvc.View`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.mvc.View` itself. * * Fired when the View has been (re-)rendered and its HTML is present in the DOM. * * * @returns Reference to `this` in order to allow method chaining */ attachAfterRendering( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.mvc.View` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:afterRendering afterRendering} event of this * `sap.ui.core.mvc.View`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.mvc.View` itself. * * Fired when the View has been (re-)rendered and its HTML is present in the DOM. * * * @returns Reference to `this` in order to allow method chaining */ attachAfterRendering( /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.mvc.View` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:beforeExit beforeExit} event of this `sap.ui.core.mvc.View`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.mvc.View` itself. * * Fired when the view has received the request to destroy itself, but before it has destroyed anything. * * * @returns Reference to `this` in order to allow method chaining */ attachBeforeExit( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.mvc.View` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:beforeExit beforeExit} event of this `sap.ui.core.mvc.View`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.mvc.View` itself. * * Fired when the view has received the request to destroy itself, but before it has destroyed anything. * * * @returns Reference to `this` in order to allow method chaining */ attachBeforeExit( /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.mvc.View` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:beforeRendering beforeRendering} event of this * `sap.ui.core.mvc.View`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.mvc.View` itself. * * Fired before this View is re-rendered. Use to unbind event handlers from HTML elements etc. * * * @returns Reference to `this` in order to allow method chaining */ attachBeforeRendering( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.mvc.View` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:beforeRendering beforeRendering} event of this * `sap.ui.core.mvc.View`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.mvc.View` itself. * * Fired before this View is re-rendered. Use to unbind event handlers from HTML elements etc. * * * @returns Reference to `this` in order to allow method chaining */ attachBeforeRendering( /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.mvc.View` itself */ oListener?: object ): this; /** * Returns an element by its ID in the context of this view. * * This method expects a view-local ID of an element (the same as e.g. defined in the *.view.xml of an XMLView). * For a search with a global ID (the value returned by `oElement.getId()`) you should rather use {@link sap.ui.core.Element#getElementById Element.getElementById}. * * * @returns Element by its ID or `undefined` */ byId( /** * View local ID of the element */ sId: string ): sap.ui.core.Element | undefined; /** * Creates a clone of this view. * * Overrides the clone method to avoid conflicts between generic cloning of the content aggregation and * content creation as defined by the UI5 Model View Controller lifecycle. * * For more details see the {@link https://ui5.sap.com/#/topic/a575619e25c2487f904bae71764e2350 View Cloning } * section in the documentation. * * @deprecated As of version 1.120. please call the corresponding View factory instead, e.g. {@link sap.ui.core.mvc.XMLView.create} * * @returns Reference to the newly created clone */ clone( /** * Suffix to be appended to the cloned element IDs */ sIdSuffix?: string, /** * Array of local IDs within the cloned hierarchy (internally used) */ aLocalIds?: string[] ): this; /** * A method to be implemented by typed `View`s, returning the view UI. * * While for declarative view types like `XMLView` or `JSONView` (deprecated) the user interface definition * is declared in a separate file, `View`s programmatically constructs the UI. This happens in the `createContent` * method, which every `View` needs to implement. The view implementation can construct the complete UI * in this method, or only return the root control and create the remainder of the UI lazily later on. * * * @returns A control or array of controls representing the view user interface or a Promise resolving with * a control or an array of controls. */ createContent( /** * The controller of the view */ oController: sap.ui.core.mvc.Controller ): | sap.ui.core.Control | sap.ui.core.Control[] | Promise; /** * Convert the given view local element ID to a globally unique ID by prefixing it with the view ID. * * * @returns prefixed id */ createId( /** * View local ID of the element */ sId: string ): string; /** * Destroys all the content in the aggregation {@link #getContent content}. * * * @returns Reference to `this` in order to allow method chaining */ destroyContent(): this; /** * Detaches event handler `fnFunction` from the {@link #event:afterInit afterInit} event of this `sap.ui.core.mvc.View`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachAfterInit( /** * The function to be called, when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:afterRendering afterRendering} event of this * `sap.ui.core.mvc.View`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachAfterRendering( /** * The function to be called, when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:beforeExit beforeExit} event of this `sap.ui.core.mvc.View`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachBeforeExit( /** * The function to be called, when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:beforeRendering beforeRendering} event of * this `sap.ui.core.mvc.View`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachBeforeRendering( /** * The function to be called, when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Fires event {@link #event:afterInit afterInit} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireAfterInit( /** * Parameters to pass along with the event */ mParameters?: object ): this; /** * Fires event {@link #event:afterRendering afterRendering} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireAfterRendering( /** * Parameters to pass along with the event */ mParameters?: object ): this; /** * Fires event {@link #event:beforeExit beforeExit} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireBeforeExit( /** * Parameters to pass along with the event */ mParameters?: object ): this; /** * Fires event {@link #event:beforeRendering beforeRendering} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireBeforeRendering( /** * Parameters to pass along with the event */ mParameters?: object ): this; /** * A method to be implemented by typed views, returning the flag whether to prefix the IDs of controls automatically * or not, if the controls are created inside the {@link sap.ui.core.mvc.View#createContent} function. By * default this feature is not activated. * * You can overwrite this function and return `true` to activate the automatic prefixing. * * **Note**: Auto-prefixing is only available for synchronous content creation. For asynchronous content * creation use {@link #createId} instead, to prefix the IDs programmatically. * * @since 1.88 * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Whether the control IDs should be prefixed automatically */ getAutoPrefixId(): boolean; /** * Gets content of aggregation {@link #getContent content}. * * Child Controls of the view */ getContent(): sap.ui.core.Control[]; /** * Returns the view's Controller instance or null for a controller-less View. * * * @returns Controller of this view. */ getController(): sap.ui.core.mvc.Controller; /** * An optional method that views can implement to return the controller's module name in `sap.ui.define/sap.ui.require` * syntax (slash-separated name without '.js' suffix). If no controller instance is provided at the time * of View instantiation AND this method exists, the View attempts to load and instantiate the controller * and to connect it to itself. * * * @returns Name of the module name from which to load the view definition. */ getControllerModuleName(): string; /** * An (optional) method to be implemented by Views. When no controller instance is given at View instantiation * time AND this method exists and returns the (package and class) name of a controller, the View tries * to load and instantiate the controller and to connect it to itself. * * * @returns the name of the controller */ getControllerName(): string; /** * Gets current value of property {@link #getDisplayBlock displayBlock}. * * Whether the CSS display should be set to "block". Set this to "true" if the default display "inline-block" * causes a vertical scrollbar with Views that are set to 100% height. Do not set this to "true" if you * want to display other content in the same HTML parent on either side of the View (setting to "true" may * push that other content to the next/previous line). * * Default value is `false`. * * * @returns Value of property `displayBlock` */ getDisplayBlock(): boolean; /** * Gets current value of property {@link #getHeight height}. * * The height * * * @returns Value of property `height` */ getHeight(): sap.ui.core.CSSSize; /** * Returns the local ID of an element by removing the view ID prefix or `null` if the ID does not contain * a prefix. * * @since 1.39.0 * * @returns ID without prefix or `null` */ getLocalId( /** * Prefixed ID */ sId: string ): string | null; /** * Returns the info object which is also passed to the preprocessors * See: * sap.ui.core.mvc.View.Preprocessor.process * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Info object for the view */ getPreprocessorInfo( /** * Describes the view execution, true if sync */ bSync: boolean ): { name: string; componentId: string; id: string; caller: string; sync: boolean; }; /** * Returns user specific data object. * * * @returns viewData */ getViewData(): object; /** * Gets current value of property {@link #getViewName viewName}. * * Name of the View * * * @returns Value of property `viewName` */ getViewName(): string; /** * Gets current value of property {@link #getWidth width}. * * The width * * Default value is `'100%'`. * * * @returns Value of property `width` */ getWidth(): sap.ui.core.CSSSize; /** * Checks if any preprocessors are active for the specified type * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns `true` if a preprocessor is active */ hasPreprocessor( /** * Type of the preprocessor, e.g. "raw", "xml" or "controls" */ sType: string ): boolean; /** * Checks for the provided `sap.ui.core.Control` in the aggregation {@link #getContent content}. and returns * its index if found or -1 otherwise. * * * @returns The index of the provided control in the aggregation if found, or -1 otherwise */ indexOfContent( /** * The content whose index is looked for */ oContent: sap.ui.core.Control ): int; /** * Inserts a content into the aggregation {@link #getContent content}. * * * @returns Reference to `this` in order to allow method chaining */ insertContent( /** * The content to insert; if empty, nothing is inserted */ oContent: sap.ui.core.Control, /** * The `0`-based index the content should be inserted at; for a negative value of `iIndex`, the content * is inserted at position 0; for a value greater than the current size of the aggregation, the content * is inserted at the last position */ iIndex: int ): this; /** * Returns a Promise representing the state of the view initialization. * * For views that are loading asynchronously (by setting async=true) this Promise is created by view initialization. * Synchronously loading views get wrapped in an immediately resolving Promise. * * @since 1.30 * * @returns resolves with the complete view instance, rejects with any thrown error */ loaded(): Promise; /** * Removes all the controls from the aggregation {@link #getContent content}. * * Additionally, it unregisters them from the hosting UIArea. * * * @returns An array of the removed elements (might be empty) */ removeAllContent(): sap.ui.core.Control[]; /** * Removes a content from the aggregation {@link #getContent content}. * * * @returns The removed content or `null` */ removeContent( /** * The content to remove or its index or id */ vContent: int | string | sap.ui.core.Control ): sap.ui.core.Control | null; /** * Executes preprocessors for a type of source * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns a promise resolving with the processed source or an error | the source when bSync=true */ runPreprocessor( /** * the type of preprocessor, e.g. "raw", "xml" or "controls" */ sType: string, /** * the view source as a JSON object, a raw text, an XML document element or a Promise resolving with those */ vSource: object | string | /* was Element */ global_Element, /** * describes the view execution, true if sync */ bSync?: boolean ): Promise | object | string | /* was Element */ global_Element; /** * Sets a new value for property {@link #getDisplayBlock displayBlock}. * * Whether the CSS display should be set to "block". Set this to "true" if the default display "inline-block" * causes a vertical scrollbar with Views that are set to 100% height. Do not set this to "true" if you * want to display other content in the same HTML parent on either side of the View (setting to "true" may * push that other content to the next/previous line). * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * Default value is `false`. * * * @returns Reference to `this` in order to allow method chaining */ setDisplayBlock( /** * New value for property `displayBlock` */ bDisplayBlock?: boolean ): this; /** * Sets a new value for property {@link #getHeight height}. * * The height * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setHeight( /** * New value for property `height` */ sHeight?: sap.ui.core.CSSSize ): this; /** * Sets a new value for property {@link #getViewName viewName}. * * Name of the View * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setViewName( /** * New value for property `viewName` */ sViewName?: string ): this; /** * Sets a new value for property {@link #getWidth width}. * * The width * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * Default value is `'100%'`. * * * @returns Reference to `this` in order to allow method chaining */ setWidth( /** * New value for property `width` */ sWidth?: sap.ui.core.CSSSize ): this; } /** * A View defined using XML and, optionally, pure HTML markup. * * **Note:** * Be aware that modifications of the content aggregation of this control are not supported due to technical * reasons. This includes calls to all content modifying methods like `addContent>` etc., but also the implicit * removal of controls contained by the content aggregation. For example the destruction of a Control via * the ` destroy` method. All functions can be called but may not work properly or lead to unexpected side * effects. * * **Note:** * The XML view offers special handling for context binding and style classes. You can specify them via * the `binding` and `class` attributes on a control's XML node. Please be aware that these attributes are * not properties of the respective controls and thus are not supported by a control's constructor. For * more information, see {@link https://ui5.sap.com/#/topic/91f05e8b6f4d1014b6dd926db0e91070 Context Binding (Element Binding) } * and {@link https://ui5.sap.com/#/topic/b564935324f449209354c7e2f9903f22 Using CSS Style Sheets in XML Views}. * * **Note:** * When the content aggregation of this control is bound, no HTML markup is allowed in the binding template * of the bound content aggregation. An error will be thrown when the above combination is detected. */ class XMLView extends sap.ui.core.mvc.View { /** * Constructor for a new `XMLView`. * * **Note:** Application code shouldn't call the constructor directly, but rather use the factory {@link sap.ui.core.mvc.XMLView.create XMLView.create } * or {@link sap.ui.core.mvc.View.create View.create} with type {@link sap.ui.core.mvc.ViewType.XML XML}. * The factory provides more features than the constructor (e.g. caching and preprocessing) and simplifies * asynchronous loading of a view. Future features might only be available when using the factory. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.mvc.View#constructor sap.ui.core.mvc.View } * can be used. */ constructor( /** * Initial settings for the new view */ mSettings?: sap.ui.core.mvc.$XMLViewSettings ); /** * Constructor for a new `XMLView`. * * **Note:** Application code shouldn't call the constructor directly, but rather use the factory {@link sap.ui.core.mvc.XMLView.create XMLView.create } * or {@link sap.ui.core.mvc.View.create View.create} with type {@link sap.ui.core.mvc.ViewType.XML XML}. * The factory provides more features than the constructor (e.g. caching and preprocessing) and simplifies * asynchronous loading of a view. Future features might only be available when using the factory. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.mvc.View#constructor sap.ui.core.mvc.View } * can be used. */ constructor( /** * ID for the new view, generated automatically if no ID is given */ sId?: string, /** * Initial settings for the new view */ mSettings?: sap.ui.core.mvc.$XMLViewSettings ); /** * Flag for feature detection of asynchronous loading/rendering * * @since 1.30 */ static asyncSupport: boolean; /** * Instantiates an XMLView from the given configuration options. * * If a `viewName` is given, it must be a dot-separated name of an XML view resource (without the mandatory * suffix ".view.xml"). The resource will be loaded asynchronously via the module system (preload caches * might apply) and will be parsed as XML. Alternatively, an already loaded view `definition` can be provided, * either as XML string or as an already parsed XML document. Exactly one of `viewName` or `definition` * must be given, if none or both are given, an error will be reported. * * The `controller` property is optional and can hold a controller instance. When given, it overrides the * controller class defined in the view definition. * * **Note**: On root level, you can only define content for the default aggregation, e.g. without adding * the `` tag. If you want to specify content for another aggregation of a view like `dependents`, * place it in a child control's `dependents` aggregation or add it by using {@link sap.ui.core.mvc.XMLView#addDependent}. * * **Note**: If you enable caching, you need to take care of the invalidation via keys. Automatic invalidation * takes only place if the UI5 version or the component descriptor (manifest.json) change. This is still * an experimental feature and may experience slight changes of the invalidation parameters or the cache * key format. * * @since 1.56.0 * * @returns A Promise that resolves with the view instance or rejects with any thrown error. */ static create( /** * An object containing the view configuration options. */ oOptions: { /** * Specifies an ID for the View instance. If no ID is given, an ID will be generated. */ id?: string; /** * Corresponds to an XML module that can be loaded via the module system (oOptions.viewName + suffix ".view.xml") */ viewName?: string; /** * XML string or XML document that defines the view. Exactly one of `viewName` or `definition` must be given. */ definition?: string | Document; /** * Controller instance to be used for this view. The given controller instance overrides the controller * defined in the view definition. Sharing one controller instance between multiple views is not possible. */ controller?: sap.ui.core.mvc.Controller; /** * Cache configuration; caching gets active when this object is provided with vView.cache.keys array; keys * are used to store data in the cache and for invalidation of the cache. */ cache?: { /** * Array with strings or Promises resolving with strings */ keys?: Array>; }; /** * Preprocessors configuration, see {@link sap.ui.core.mvc.View} **Note**: These preprocessors are only * available to this instance. For global or on-demand availability use {@link sap.ui.core.mvc.XMLView.registerPreprocessor}. */ preprocessors?: object; } ): Promise; /** * Creates a new subclass of class sap.ui.core.mvc.XMLView with name `sClassName` and enriches it with the * information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.mvc.View.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.mvc.XMLView. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Register a preprocessor for all views of a specific type. * * The preprocessor can be registered for several stages of view initialization, for xml views these are * either the plain "xml" or the already initialized "controls" , see {@link sap.ui.core.mvc.XMLView.PreprocessorType}. * For each type one preprocessor is executed. If there is a preprocessor passed to or activated at the * view instance already, that one is used. When several preprocessors are registered for one hook, it has * to be made sure, that they do not conflict when being processed serially. * * It can be either a module name as string of an implementation of {@link sap.ui.core.mvc.View.Preprocessor } * or a function with a signature according to {@link sap.ui.core.mvc.View.Preprocessor.process}. * * **Note**: Preprocessors work only in async views and will be ignored when the view is instantiated in * sync mode by default, as this could have unexpected side effects. You may override this behaviour by * setting the bSyncSupport flag to true. * * @since 1.30 */ static registerPreprocessor( /** * the type of content to be processed */ sType: string | sap.ui.core.mvc.XMLView.PreprocessorType, /** * module path of the preprocessor implementation or a preprocessor function */ vPreprocessor: | string | (( p1: Object, p2: sap.ui.core.mvc.View.Preprocessor.ViewInfo, p3: object ) => void), /** * Since 1.89, added for signature compatibility with {@link sap.ui.core.mvc.View#registerPreprocessor View#registerPreprocessor}. * Only supported value is "XML". */ sViewType: string, /** * Deprecated as of version 1.145, because this parameter is only applicable to sync views and is no longer * used. Declares if the vPreprocessor ensures safe sync processing. This means the preprocessor will be * executed also for sync views. Please be aware that any kind of async processing (like Promises, XHR, * etc) may break the view initialization and lead to unexpected results. */ bSyncSupport: boolean, /** * ondemand preprocessor which enables developers to quickly activate the preprocessor for a view, by setting * `preprocessors : { xml }`, for example. */ bOnDemand?: boolean, /** * optional configuration for preprocessor */ mSettings?: object ): void; /** * Register a preprocessor for all views of a specific type. * * The preprocessor can be registered for several stages of view initialization, for xml views these are * either the plain "xml" or the already initialized "controls" , see {@link sap.ui.core.mvc.XMLView.PreprocessorType}. * For each type one preprocessor is executed. If there is a preprocessor passed to or activated at the * view instance already, that one is used. When several preprocessors are registered for one hook, it has * to be made sure, that they do not conflict when being processed serially. * * It can be either a module name as string of an implementation of {@link sap.ui.core.mvc.View.Preprocessor } * or a function with a signature according to {@link sap.ui.core.mvc.View.Preprocessor.process}. * * **Note**: Preprocessors work only in async views and will be ignored when the view is instantiated in * sync mode by default, as this could have unexpected side effects. You may override this behaviour by * setting the bSyncSupport flag to true. * * @since 1.30 */ static registerPreprocessor( /** * the type of content to be processed */ sType: string | sap.ui.core.mvc.XMLView.PreprocessorType, /** * module path of the preprocessor implementation or a preprocessor function */ vPreprocessor: | string | (( p1: Object, p2: sap.ui.core.mvc.View.Preprocessor.ViewInfo, p3: object ) => void), /** * Deprecated as of version 1.145, because this parameter is only applicable to sync views and is no longer * used. Declares if the vPreprocessor ensures safe sync processing. This means the preprocessor will be * executed also for sync views. Please be aware that any kind of async processing (like Promises, XHR, * etc) may break the view initialization and lead to unexpected results. */ bSyncSupport: boolean, /** * ondemand preprocessor which enables developers to quickly activate the preprocessor for a view, by setting * `preprocessors : { xml }`, for example. */ bOnDemand?: boolean, /** * optional configuration for preprocessor */ mSettings?: object ): void; } /** * Execution option for overrides defined by a `ControllerExtension`. * See: * sap.ui.core.mvc.ControllerExtension */ enum OverrideExecution { /** * The override function gets executed after the original function */ After = "After", /** * The override function gets executed before the original function */ Before = "Before", /** * The override function is called instead of the original function * * This is the default option for ControllerExtension overrides */ Instead = "Instead", } /** * Specifies possible view types. * * **Note:** Typed views do not rely on a `ViewType`, it must be omitted in the view settings. * * See the {@link https://ui5.sap.com/#/topic/91f27e3e6f4d1014b6dd926db0e91070 documentation} for more information * on the different view types. */ enum ViewType { /** * HTML view * * @deprecated As of version 1.108. Consider using {@link sap.ui.core.mvx.XMLView XMLViews} or "typed views" * (view classes written in JavaScript) instead. */ HTML = "HTML", /** * JS View * * @deprecated As of version 1.90. Consider using {@link sap.ui.core.mvx.XMLView XMLViews} or "typed views" * (view classes written in JavaScript) instead. */ JS = "JS", /** * JSON View * * @deprecated As of version 1.120. please consider using {@link sap.ui.core.mvc.XMLView XMLViews} or "typed * views" (view classes written in JavaScript) instead. */ JSON = "JSON", /** * Template View * * @deprecated As of version 1.56. Consider using {@link sap.ui.core.mvx.XMLView XMLViews} or "typed views" * (view classes written in JavaScript) instead. */ Template = "Template", /** * XML view */ XML = "XML", } /** * Event object of the View#afterInit event. */ type View$AfterInitEvent = sap.ui.base.Event< View$AfterInitEventParameters, View >; /** * Event object of the View#afterRendering event. */ type View$AfterRenderingEvent = sap.ui.base.Event< View$AfterRenderingEventParameters, View >; /** * Event object of the View#beforeExit event. */ type View$BeforeExitEvent = sap.ui.base.Event< View$BeforeExitEventParameters, View >; /** * Event object of the View#beforeRendering event. */ type View$BeforeRenderingEvent = sap.ui.base.Event< View$BeforeRenderingEventParameters, View >; } namespace aria { /** * Types of popups to set as aria-haspopup attribute. Most of the values (except "None") of the enumeration * are taken from the ARIA specification: https://www.w3.org/TR/wai-aria/#aria-haspopup * * This enum is part of the 'sap/ui/core/library' module export and must be accessed by the property 'aria.HasPopup'. * * @since 1.84 */ enum HasPopup { /** * Dialog popup type. */ Dialog = "Dialog", /** * Grid popup type. */ Grid = "Grid", /** * ListBox popup type. */ ListBox = "ListBox", /** * Menu popup type. */ Menu = "Menu", /** * None - the aria-haspopup attribute will not be rendered. */ None = "None", /** * Tree popup type. */ Tree = "Tree", } } namespace Component { /** * Registry of all `Component`s that currently exist. * * @since 1.67 * @deprecated As of version 1.120. Use {@link module:sap/ui/core/ComponentRegistry} instead. */ interface registry { /** * Number of existing components. */ size: int; /** * Return an object with all instances of `sap.ui.core.Component`, keyed by their ID. * * Each call creates a new snapshot object. Depending on the size of the UI, this operation therefore might * be expensive. Consider to use the `forEach` or `filter` method instead of executing similar operations * on the returned object. * * **Note**: The returned object is created by a call to `Object.create(null)`, and therefore lacks all * methods of `Object.prototype`, e.g. `toString` etc. * * * @returns Object with all components, keyed by their ID */ all(): Record; /** * Returns an array with components for which the given `callback` returns a value that coerces to `true`. * * The expected signature of the callback is * ```javascript * * function callback(oComponent, sID) * ``` * where `oComponent` is the currently visited component instance and `sID` is the ID of that instance. * * If components are created or destroyed within the `callback`, then the behavior is not specified. Newly * added objects might or might not be visited. When a component is destroyed during the filtering and was * not visited yet, it might or might not be visited. As the behavior for such concurrent modifications * is not specified, it may change in newer releases. * * If a `thisArg` is given, it will be provided as `this` context when calling `callback`. The `this` value * that the implementation of `callback` sees, depends on the usual resolution mechanism. E.g. when `callback` * was bound to some context object, that object wins over the given `thisArg`. * * This function returns an array with all components matching the given predicate. The order of the components * in the array is not specified and might change between calls (over time and across different versions * of UI5). * * * @returns Array of components matching the predicate; order is undefined and might change in newer versions * of UI5 */ filter( /** * predicate against which each Component is tested */ callback: ( p1: sap.ui.core.Component, p2: sap.ui.core.ID ) => boolean, /** * context object to provide as `this` in each call of `callback` */ thisArg?: Object ): sap.ui.core.Component[]; /** * Calls the given `callback` for each existing component. * * The expected signature of the callback is * ```javascript * * function callback(oComponent, sID) * ``` * where `oComponent` is the currently visited component instance and `sID` is the ID of that instance. * * The order in which the callback is called for components is not specified and might change between calls * (over time and across different versions of UI5). * * If components are created or destroyed within the `callback`, then the behavior is not specified. Newly * added objects might or might not be visited. When a component is destroyed during the filtering and was * not visited yet, it might or might not be visited. As the behavior for such concurrent modifications * is not specified, it may change in newer releases. * * If a `thisArg` is given, it will be provided as `this` context when calling `callback`. The `this` value * that the implementation of `callback` sees, depends on the usual resolution mechanism. E.g. when `callback` * was bound to some context object, that object wins over the given `thisArg`. */ forEach( /** * Function to call for each Component */ callback: (p1: sap.ui.core.Component, p2: sap.ui.core.ID) => void, /** * Context object to provide as `this` in each call of `callback` */ thisArg?: Object ): void; /** * Retrieves a Component by its ID. * * When the ID is `null` or `undefined` or when there's no Component with the given ID, then `undefined` * is returned. * * * @returns Component with the given ID or `undefined` */ get( /** * ID of the Component to retrieve */ id: sap.ui.core.ID ): sap.ui.core.Component | undefined; } /** * The structure of the "metadata" object which is passed when inheriting from sap.ui.core.Component using * its static "extend" method. See {@link sap.ui.core.Component.extend} and {@link sap.ui.core.Component.create } * for additional details on its usage. */ type MetadataOptions = sap.ui.base.ManagedObject.MetadataOptions & { /** * The manifest option determines how a component manifest should be evaluated. Default is `undefined`. * * When set to `false` or `undefined`, no manifest.json is present for this Component, however the Component * can still be started with a manifest given as an argument of the factory function, see {@link sap.ui.core.Component.create}. * When set to an object, this object will be interpreted as a manifest and must adhere to the {@link https://ui5.sap.com/#/topic/be0cf40f61184b358b5faedaec98b2da descriptor schema for components}. * When set to the string literal `"json"`, this property indicates that the component configuration should * be read from a manifest.json file which is assumed to exist next to the Component.js file. */ manifest?: undefined | false | object | "json"; }; } namespace Configuration { /** * Encapsulates configuration settings that are related to data formatting/parsing. * * **Note:** When format configuration settings are modified through this class, UI5 only ensures that formatter * objects created after that point in time will honor the modifications. To be on the safe side, applications * should do any modifications early in their lifecycle or recreate any model/UI that is locale dependent. * * @deprecated As of version 1.120. Please use {@link module:sap/base/i18n/Formatting Formatting} instead. */ class FormatSettings extends sap.ui.base.Object { constructor(); /** * Creates a new subclass of class sap.ui.core.Configuration.FormatSettings with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo< T, sap.ui.core.Configuration.FormatSettings >, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.Configuration.FormatSettings. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Adds custom currencies. There is a special currency code named "DEFAULT" that is optional. In case it * is set it is used for all currencies not contained in the list, otherwise currency digits as defined * by the CLDR are used as a fallback. * * **Note:** Adding custom currencies affects all applications running with the current UI5 core instance. * * @since 1.120 */ addCustomCurrencies( /** * A map with the currency code as key and a custom currency definition as value; already existing custom * currencies are replaced, new ones are added; the custom currency code must contain at least one non-digit * character, so that the currency part can be distinguished from the amount part; see {@link #.getCustomCurrencies Formatting.getCustomCurrencies } * for an example */ mCurrencies?: Record< string, import("sap/base/i18n/Formatting").CustomCurrency > ): void; /** * Adds custom units. * * **Note:** Adding custom units affects all applications running with the current UI5 core instance. * * @since 1.123 */ addCustomUnits( /** * A map with the unit code as key and a custom unit definition as value; already existing custom units * are replaced, new ones are added; see {@link #.getCustomUnits Formatting.getCustomUnits} for an example */ mUnits: Record< string, import("sap/base/i18n/Formatting").CustomUnit > ): void; /** * Gets the custom currencies that have been set via {@link #.addCustomCurrencies Formatting.addCustomCurrencies } * or {@link #.setCustomCurrencies Formatting.setCustomCurrencies}. There is a special currency code named * "DEFAULT" that is optional. If it is set it is used for all currencies not contained in the list, otherwise * currency digits as defined by the CLDR are used as a fallback. * * @since 1.120 * * @returns A map with the currency code as key and a custom currency definition containing the number of * decimals as value; or `undefined` if there are no custom currencies */ getCustomCurrencies(): | Record | undefined; /** * Gets the custom units that have been set via {@link #.addCustomUnits Formatting.addCustomUnits} or {@link #.setCustomUnits Formatting.setCustomUnits}. * * @since 1.123 * * @returns A map with the unit code as key and a custom unit definition containing a display name and different * unit patterns as value; or `undefined` if there are no custom units */ getCustomUnits(): | Record | undefined; /** * Returns the currently set date pattern or undefined if no pattern has been defined. * * @since 1.120 * * @returns The resulting date pattern */ getDatePattern( /** * The date style (short, medium, long or full) */ sStyle: "short" | "medium" | "long" | "full" ): string; /** * Returns the locale to be used for formatting. * * If no such locale has been defined, this method falls back to the language, see {@link sap.ui.core.Configuration.getLanguage Configuration.getLanguage()}. * * If any user preferences for date, time or number formatting have been set, and if no format locale has * been specified, then a special private use subtag is added to the locale, indicating to the framework * that these user preferences should be applied. * * @deprecated As of version 1.120. Please use {@link module:sap/base/i18n/Formatting.getLanguageTag Formatting.getLanguageTag } * instead. * * @returns the format locale */ getFormatLocale(): sap.ui.core.Locale; /** * Returns the currently set customizing data for Islamic calendar support. * * See: {@link module:sap/base/i18n/Formatting.CustomIslamicCalendarData} * * @since 1.120 * * @returns Returns an array that contains the customizing data. Each element in the array has properties: * dateFormat, islamicMonthStart, gregDate. For details, please see {@link #.setCustomIslamicCalendarData} */ getLegacyDateCalendarCustomizing(): | Array< import("sap/base/i18n/Formatting").CustomIslamicCalendarData > | undefined; /** * Returns the currently set number symbol of the given type or undefined if no symbol has been defined. * * @since 1.120 * * @returns A non-numerical symbol used as part of a number for the given type, e.g. for locale de_DE: * * - "group": "." (grouping separator) * - "decimal": "," (decimal separator) * - "plusSign": "+" (plus sign) * - "minusSign": "-" (minus sign) */ getNumberSymbol( /** * the type of symbol */ sType: "group" | "decimal" | "plusSign" | "minusSign" ): string; /** * Returns the currently set time pattern or undefined if no pattern has been defined. * * @since 1.120 * * @returns The resulting time pattern */ getTimePattern( /** * The time style (short, medium, long or full) */ sStyle: "short" | "medium" | "long" | "full" ): string; /** * Returns current trailingCurrencyCode configuration for new NumberFormatter instances * * @since 1.120 * * @returns Whether currency codes shall always be placed after the numeric value */ getTrailingCurrencyCode(): boolean; /** * Replaces existing custom currencies by the given custom currencies. There is a special currency code * named "DEFAULT" that is optional. In case it is set, it is used for all currencies not contained in the * list, otherwise currency digits as defined by the CLDR are used as a fallback. * * **Note:** Setting custom units affects all applications running with the current UI5 core instance. * See: * {@link module:sap/base/i18n/Formatting.addCustomCurrencies Formatting.addCustomCurrencies} * * @since 1.120 */ setCustomCurrencies( /** * A map with the currency code as key and a custom currency definition as value; the custom currency code * must contain at least one non-digit character, so that the currency part can be distinguished from the * amount part; `mCurrencies` replaces the current custom currencies; if not given, all custom currencies * are deleted; see {@link #.getCustomCurrencies Formatting.getCustomCurrencies} for an example */ mCurrencies?: Record< string, import("sap/base/i18n/Formatting").CustomCurrency > ): void; /** * Replaces existing custom units by the given custom units. * * **Note:** Setting custom units affects all applications running with the current UI5 core instance. * See: * {@link module:sap/base/i18n/Formatting.addCustomUnits Formatting.addCustomUnits} * * @since 1.123 */ setCustomUnits( /** * A map with the unit code as key and a custom unit definition as value; `mUnits` replaces the current * custom units; if not given, all custom units are deleted; see {@link #.getCustomUnits Formatting.getCustomUnits } * for an example */ mUnits?: Record< string, import("sap/base/i18n/Formatting").CustomUnit > ): void; /** * Defines the preferred format pattern for the given date format style. * * Calling this method with a null or undefined pattern removes a previously set pattern. * * If a pattern is defined, it will be preferred over patterns derived from the current locale. * * See class {@link sap.ui.core.format.DateFormat DateFormat} for details about the pattern syntax. * * After changing the date pattern, the framework tries to update localization specific parts of the UI. * See the documentation of {@link sap.ui.core.Configuration.setLanguage Configuration.setLanguage} for * details and restrictions. * * * @returns Returns `this` to allow method chaining */ setDatePattern( /** * must be one of short, medium, long or full. */ sStyle: string, /** * the format pattern to be used in LDML syntax. */ sPattern: string ): this; /** * Defines the day used as the first day of the week. * * The day is set as an integer value between 0 (Sunday) and 6 (Saturday). Calling this method with a null * or undefined symbol removes a previously set value. * * If a value is defined, it will be preferred over values derived from the current locale. * * Usually in the US the week starts on Sunday while in most European countries on Monday. There are special * cases where you want to have the first day of week set independent of the user locale. * * After changing the first day of week, the framework tries to update localization specific parts of the * UI. See the documentation of {@link sap.ui.core.Configuration.setLanguage Configuration.setLanguage } * for details and restrictions. * * @deprecated As of version 1.113. Use {@link sap.ui.core.Configuration.FormatSettings#setCalendarWeekNumbering FormatSettings#setCalendarWeekNumbering } * instead. * * @returns Returns `this` to allow method chaining */ setFirstDayOfWeek( /** * must be an integer value between 0 and 6 */ iValue: int ): this; /** * Allows to specify the customizing data for Islamic calendar support * * See: {@link module:sap/base/i18n/Formatting.CustomIslamicCalendarData} * * @since 1.120 */ setLegacyDateCalendarCustomizing( /** * Contains the customizing data for the support of Islamic calendar. One JSON object in the array represents * one row of data from Table TISLCAL */ aCustomCalendarData: Array< import("sap/base/i18n/Formatting").CustomIslamicCalendarData > ): void; /** * Allows to specify one of the legacy ABAP date formats. * * This method modifies the date patterns for 'short' and 'medium' style with the corresponding ABAP format. * When called with a null or undefined format id, any previously applied format will be removed. * * After changing the legacy date format, the framework tries to update localization specific parts of the * UI. See the documentation of {@link sap.ui.core.Configuration.setLanguage Configuration.setLanguage } * for details and restrictions. * * * @returns Returns `this` to allow method chaining */ setLegacyDateFormat( /** * ID of the ABAP date format, `""` will reset the date patterns for 'short' and 'medium' style to the locale-specific * ones. */ sFormatId?: | "" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "A" | "B" | "C" ): this; /** * Allows to specify one of the legacy ABAP number format. * * This method will modify the 'group' and 'decimal' symbols. When called with a null or undefined format * id, any previously applied format will be removed. * * After changing the legacy number format, the framework tries to update localization specific parts of * the UI. See the documentation of {@link sap.ui.core.Configuration.setLanguage Configuration.setLanguage } * for details and restrictions. * * * @returns Returns `this` to allow method chaining */ setLegacyNumberFormat( /** * ID of the ABAP number format set, `""` will reset the 'group' and 'decimal' symbols to the locale-specific * ones. */ sFormatId?: "" | " " | "X" | "Y" ): this; /** * Allows to specify one of the legacy ABAP time formats. * * This method sets the time patterns for 'short' and 'medium' style to the corresponding ABAP formats and * sets the day period texts to "AM"/"PM" or "am"/"pm" respectively. When called with a null or undefined * format id, any previously applied format will be removed. * * After changing the legacy time format, the framework tries to update localization specific parts of the * UI. See the documentation of {@link sap.ui.core.Configuration.setLanguage Configuration.setLanguage } * for details and restrictions. * * * @returns Returns `this` to allow method chaining */ setLegacyTimeFormat( /** * ID of the ABAP time format, `""` will reset the time patterns for 'short' and 'medium' style and the * day period texts to the locale-specific ones. */ sFormatId?: "" | "0" | "1" | "2" | "3" | "4" ): this; /** * Defines the string to be used for the given number symbol. * * Calling this method with a null or undefined symbol removes a previously set symbol string. Note that * an empty string is explicitly allowed. * * If a symbol is defined, it will be preferred over symbols derived from the current locale. * * See class {@link sap.ui.core.format.NumberFormat NumberFormat} for details about the symbols. * * After changing the number symbol, the framework tries to update localization specific parts of the UI. * See the documentation of {@link sap.ui.core.Configuration.setLanguage Configuration.setLanguage} for * details and restrictions. * * * @returns Returns `this` to allow method chaining */ setNumberSymbol( /** * the type of symbol */ sType: "group" | "decimal" | "plusSign" | "minusSign", /** * will be used to represent the given symbol type */ sSymbol: string ): this; /** * Defines the preferred format pattern for the given time format style. * * Calling this method with a null or undefined pattern removes a previously set pattern. * * If a pattern is defined, it will be preferred over patterns derived from the current locale. * * See class {@link sap.ui.core.format.DateFormat DateFormat} for details about the pattern syntax. * * After changing the time pattern, the framework tries to update localization specific parts of the UI. * See the documentation of {@link sap.ui.core.Configuration.setLanguage Configuration.setLanguage} for * details and restrictions. * * * @returns Returns `this` to allow method chaining */ setTimePattern( /** * must be one of short, medium, long or full. */ sStyle: string, /** * the format pattern to be used in LDML syntax. */ sPattern: string ): this; /** * Define whether the NumberFormatter shall always place the currency code after the numeric value, with * the only exception of right-to-left locales, where the currency code shall be placed before the numeric * value. Default configuration setting is `true`. * * When set to `false` the placement of the currency code is done dynamically, depending on the configured * locale using data provided by the Unicode Common Locale Data Repository (CLDR). * * Each currency instance ({@link sap.ui.core.format.NumberFormat.getCurrencyInstance NumberFormat.getCurrencyInstance}) * will be created with this setting unless overwritten on instance level. * * @since 1.120 */ setTrailingCurrencyCode( /** * Whether currency codes shall always be placed after the numeric value */ bTrailingCurrencyCode: boolean ): void; } /** * Enumerable list with available animation modes. * * This enumerable is used to validate the animation mode. Animation modes allow to specify different animation * scenarios or levels. The implementation of the Control (JavaScript or CSS) has to be done differently * for each animation mode. * * This enum is part of the 'sap/ui/core/Configuration' module export and must be accessed by the property * 'AnimationMode'. * * @since 1.50.0 * @deprecated As of version 1.120. Please use module {@link module:sap/ui/core/AnimationMode AnimationMode } * instead. */ enum AnimationMode { /** * `basic` can be used for a reduced, more light-weight set of animations. */ basic = "undefined", /** * `full` represents a mode with unrestricted animation capabilities. */ full = "undefined", /** * `minimal` includes animations of fundamental functionality. */ minimal = "undefined", /** * `none` deactivates the animation completely. */ none = "undefined", } } namespace date { /** * The `CalendarWeekNumbering` enum defines how to calculate calendar weeks. Each value defines: * - The first day of the week, * - the first week of the year. * * @since 1.108.0 * @deprecated As of version 1.120. Please use {@link module:sap/base/i18n/date/CalendarWeekNumbering} instead. */ enum CalendarWeekNumbering { /** * The default calendar week numbering: * * The framework determines the week numbering scheme; currently it is derived from the active format locale. * Future versions of UI5 might select a different week numbering scheme. */ Default = "Default", /** * Official calendar week numbering in most of Europe (ISO 8601 standard): * Monday is first day of the week, the week containing January 4th is first week of the year. */ ISO_8601 = "ISO_8601", /** * Official calendar week numbering in much of the Middle East (Middle Eastern calendar): * Saturday is first day of the week, the week containing January 1st is first week of the year. */ MiddleEastern = "MiddleEastern", /** * Official calendar week numbering in the United States, Canada, Brazil, Israel, Japan, and other countries * (Western traditional calendar): * Sunday is first day of the week, the week containing January 1st is first week of the year. */ WesternTraditional = "WesternTraditional", } } namespace Element { namespace MetadataOptions { /** * An object literal configuring the drag&drop capabilities of a class derived from sap.ui.core.Element. * See {@link sap.ui.core.Element.MetadataOptions MetadataOptions} for details on its usage. */ type DnD = { /** * Defines whether the element is draggable or not. The default value is `false`. */ draggable?: boolean; /** * Defines whether the element is droppable (it allows being dropped on by a draggable element) or not. * The default value is `false`. */ droppable?: boolean; }; } /** * Registry of all `sap.ui.core.Element`s that currently exist. * * @since 1.67 * @deprecated As of version 1.120. Use {@link module:sap/ui/core/ElementRegistry} instead. */ interface registry { /** * Number of existing elements. */ size: int; /** * Return an object with all instances of `sap.ui.core.Element`, keyed by their ID. * * Each call creates a new snapshot object. Depending on the size of the UI, this operation therefore might * be expensive. Consider to use the `forEach` or `filter` method instead of executing similar operations * on the returned object. * * **Note**: The returned object is created by a call to `Object.create(null)`, and therefore lacks all * methods of `Object.prototype`, e.g. `toString` etc. * * * @returns Object with all elements, keyed by their ID */ all(): Record; /** * Returns an array with elements for which the given `callback` returns a value that coerces to `true`. * * The expected signature of the callback is * ```javascript * * function callback(oElement, sID) * ``` * where `oElement` is the currently visited element instance and `sID` is the ID of that instance. * * If elements are created or destroyed within the `callback`, then the behavior is not specified. Newly * added objects might or might not be visited. When an element is destroyed during the filtering and was * not visited yet, it might or might not be visited. As the behavior for such concurrent modifications * is not specified, it may change in newer releases. * * If a `thisArg` is given, it will be provided as `this` context when calling `callback`. The `this` value * that the implementation of `callback` sees, depends on the usual resolution mechanism. E.g. when `callback` * was bound to some context object, that object wins over the given `thisArg`. * * This function returns an array with all elements matching the given predicate. The order of the elements * in the array is not specified and might change between calls (over time and across different versions * of UI5). * * * @returns Array of elements matching the predicate; order is undefined and might change in newer versions * of UI5 */ filter( /** * predicate against which each element is tested */ callback: (p1: sap.ui.core.Element, p2: sap.ui.core.ID) => boolean, /** * context object to provide as `this` in each call of `callback` */ thisArg?: Object ): sap.ui.core.Element[]; /** * Calls the given `callback` for each element. * * The expected signature of the callback is * ```javascript * * function callback(oElement, sID) * ``` * where `oElement` is the currently visited element instance and `sID` is the ID of that instance. * * The order in which the callback is called for elements is not specified and might change between calls * (over time and across different versions of UI5). * * If elements are created or destroyed within the `callback`, then the behavior is not specified. Newly * added objects might or might not be visited. When an element is destroyed during the filtering and was * not visited yet, it might or might not be visited. As the behavior for such concurrent modifications * is not specified, it may change in newer releases. * * If a `thisArg` is given, it will be provided as `this` context when calling `callback`. The `this` value * that the implementation of `callback` sees, depends on the usual resolution mechanism. E.g. when `callback` * was bound to some context object, that object wins over the given `thisArg`. */ forEach( /** * Function to call for each element */ callback: (p1: sap.ui.core.Element, p2: sap.ui.core.ID) => void, /** * Context object to provide as `this` in each call of `callback` */ thisArg?: Object ): void; /** * Retrieves an Element by its ID. * * When the ID is `null` or `undefined` or when there's no element with the given ID, then `undefined` is * returned. * * * @returns Element with the given ID or `undefined` */ get( /** * ID of the element to retrieve */ id: sap.ui.core.ID ): sap.ui.core.Element | undefined; } /** * The structure of the "metadata" object which is passed when inheriting from sap.ui.core.Element using * its static "extend" method. See {@link sap.ui.core.Element.extend} for details on its usage. */ type MetadataOptions = sap.ui.base.ManagedObject.MetadataOptions & { /** * Defines draggable and droppable configuration of the element. The following boolean properties can be * provided in the given object literal to configure drag-and-drop behavior of the element (see {@link sap.ui.core.Element.MetadataOptions.DnD DnD } * for details): draggable, droppable If the `dnd` property is of type Boolean, then the `draggable` and * `droppable` configuration are both set to this Boolean value. */ dnd?: boolean | sap.ui.core.Element.MetadataOptions.DnD; }; } namespace hyphenation { /** * Describes the settings that can be provided to the Hyphenation constructor. */ interface $HyphenationSettings extends sap.ui.base.$ManagedObjectSettings {} /** * Parameters of the Hyphenation#error event. */ interface Hyphenation$ErrorEventParameters { /** * The message of the error. */ sErrorMessage?: string; } /** * This class provides methods for evaluating the possibility of using browser-native hyphenation or initializing * and using a third-party hyphenation module. * * Overview: By using this API, a developer can check if browser-native hyphenation is supported for a particular * language. * * When browser-native hyphenation is not supported or if otherwise required, the API can be used to hyphenate * texts. A third-party library "Hyphenopoly" is used in that case. * * It is used internally by controls that support the `wrappingType:{@link sap.m.WrappingType WrappingType.Hyphenated}` * property. * * As the class is singleton, an instance should be acquired from {@link sap.ui.core.hyphenation.Hyphenation.getInstance Hyphenation.getInstance}. * * Usage: When to use:: * - To check if browser-native hyphenation is available for particular language. * - To hyphenate texts if browser-native hyphenation is not available. When not to use:: * - If the use case is covered by controls that support the property `wrappingType:{@link sap.m.WrappingType WrappingType.Hyphenated}`. * This functionality is supported by {@link sap.m.Title sap.m.Title}, {@link sap.m.Label sap.m.Label} and * {@link sap.m.Text sap.m.Text}. * - If browser-native hyphenation is available * * Example: * ```javascript * * if (!Hyphenation.getInstance().canUseNativeHyphenation("en")) { * Hyphenation.getInstance().initialize("en").then(function() { * console.log(Hyphenation.getInstance().hyphenate("An example text to hyphenate.", "en")); * }); * } * ``` * * * For more information, see {@link https://ui5.sap.com/#/topic/6322164936f047de941ec522b95d7b70 Hyphenation for Text Controls}. * * `Caution:` Note that as the hyphenation feature uses third-party and browser-native tools, we are not * responsible for any grammatical incorrectness or inconsistencies of the hyphenation. Also, the variety * of supported languages is outside the scope of our control and may be subject to future changes. * * @since 1.60 */ class Hyphenation extends sap.ui.base.ManagedObject { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Creates a new subclass of class sap.ui.core.hyphenation.Hyphenation with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.ManagedObject.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns the singleton instance of the Hyphenation API. * See: * sap.ui.core.hyphenation.Hyphenation * * * @returns The singleton instance of the Hyphenation API */ static getInstance(): sap.ui.core.hyphenation.Hyphenation; /** * Returns a metadata object for class sap.ui.core.hyphenation.Hyphenation. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.ManagedObjectMetadata; /** * Checks if native hyphenation works in the current browser for the given language. This check is performed * against the value of the "lang" HTML attribute of the page. * * * @returns True if native hyphenation works for the given language. False if native hyphenation will not * work. Null if the language is not known to the Hyphenation API */ canUseNativeHyphenation( /** * For what language to check. The global application language is the default one */ sLang?: string ): boolean | null; /** * Checks if third-party hyphenation works for the given language. * * * @returns True if third-party hyphenation works for the given language. False if third-party hyphenation * doesn't work. Null if the language is not known to the `Hyphenation` API. */ canUseThirdPartyHyphenation( /** * For what language to check. The global application language is the default one. */ sLang?: string ): boolean | null; /** * What languages were initialized with {@link sap.ui.core.hyphenation.Hyphenation#initialize Hyphenation#initialize} * * * @returns List of languages which were initialized */ getInitializedLanguages(): any[]; /** * Hyphenates the given text with the third-party library. * * Adds the soft hyphen symbol at the places where words can break. * * * @returns The text with the hyphens symbol added */ hyphenate( /** * The text to hyphenate */ sText: string, /** * The language of the text. The global application language is the default one */ sLang?: string ): string; /** * Initializes the third-party library for the given language. * * Loads required third-party resources and language-specific resources. * * * @returns A promise which resolves when all language resources are loaded. Rejects if the language is * not supported */ initialize( /** * The language for which the third-party library should be initialized. The global application language * is the default one */ sLang?: string ): Promise; /** * Checks if the given language was initialized with {@link sap.ui.core.hyphenation.Hyphenation#initialize Hyphenation#initialize} * * * @returns True if the language was initialized */ isLanguageInitialized( /** * The language to check for */ sLang?: string ): boolean; /** * Checks if `Hyphenation` API knows about the given language. * * If it is a known language, the API can be used to check browser-native and third-party support. * * * @returns True if the language is known to the `Hyphenation` API */ isLanguageSupported( /** * For what language to check. The global application language is the default one. */ sLang?: string ): boolean; } /** * Event object of the Hyphenation#error event. */ type Hyphenation$ErrorEvent = sap.ui.base.Event< Hyphenation$ErrorEventParameters, Hyphenation >; } namespace IconPool { type IconInfo = { /** * the name of the icon */ name: string; /** * the collection name of the icon. For the default icon font with name 'SAP-icons', this property is set * with `undefined` */ collection: string; /** * The URI representing the icon following pattern `sap-icon://collection-name/icon-name` */ uri: sap.ui.core.URI; /** * the name of the font when importing the font using @font-face in CSS */ fontFamily: string; /** * the hexadecimal code in string format without the prefix, for example "e000" */ content: string; /** * the translated text for the icon under the current used locale */ text: string; /** * indicates whether this icon should NOT be mirrored in RTL (right to left) mode */ suppressMirroring: boolean; }; } namespace LocaleData { /** * Type which describes the difference in the date field groups of the two dates of an date time interval. * The keys are the names of the date field symbol groups. If one of them is set, the value should be set * to `true`. */ type DateFieldGroupsDifference = { /** * The era date field symbol group */ Era?: boolean; /** * The year date field symbol group */ Year?: boolean; /** * The quarter date field symbol group */ Quarter?: boolean; /** * The month date field symbol group */ Month?: boolean; /** * The week date field symbol group */ Week?: boolean; /** * The day date field symbol group */ Day?: boolean; /** * The day period date field symbol group */ DayPeriod?: boolean; /** * The hour date field symbol group */ Hour?: boolean; /** * The minute date field symbol group */ Minute?: boolean; /** * The second date field symbol group */ Second?: boolean; }; /** * A relative time pattern. */ type RelativeTimePattern = { /** * The string with the locale-specific representation of the relative time pattern */ pattern: string; /** * The scale of the pattern */ scale: | "day" | "hour" | "minute" | "month" | "second" | "week" | "year"; /** * `-1`, if the pattern is for the past; `1` otherwise */ sign: number; }; } namespace Popup { /** * Enumeration providing options for docking of some element to another. * * "Right" and "Left" will stay the same in RTL mode, but "Begin" and "End" will flip to the other side * ("Begin" is "Right" in RTL). * * This enum is part of the 'sap/ui/core/Popup' module export and must be accessed by the property 'Dock'. */ enum Dock { /** * Docks the popup at the begin of the reference element, at the bottom. */ BeginBottom = "BeginBottom", /** * Docks the popup at the begin of the reference element, vertically centered. */ BeginCenter = "BeginCenter", /** * Docks the popup at the begin of the reference element, at the top. */ BeginTop = "BeginTop", /** * Docks the popup horizontally centered to the reference element, at the bottom. */ CenterBottom = "CenterBottom", /** * Docks the popup horizontally and vertically centered to the reference element. */ CenterCenter = "CenterCenter", /** * Docks the popup horizontally centered to the reference element, at the top. */ CenterTop = "CenterTop", /** * Docks the popup at the end of the reference element, at the bottom. */ EndBottom = "EndBottom", /** * Docks the popup at the end of the reference element, vertically centered. */ EndCenter = "EndCenter", /** * Docks the popup at the end of the reference element, at the top. */ EndTop = "EndTop", /** * Docks the popup at the left side of the reference element, at the bottom. */ LeftBottom = "LeftBottom", /** * Docks the popup at the left side of the reference element, vertically centered. */ LeftCenter = "LeftCenter", /** * Docks the popup at the left side of the reference element, at the top. */ LeftTop = "LeftTop", /** * Docks the popup at the right side of the reference element, at the bottom. */ RightBottom = "RightBottom", /** * Docks the popup at the right side of the reference element, vertically centered. */ RightCenter = "RightCenter", /** * Docks the popup at the right side of the reference element, at the top. */ RightTop = "RightTop", } type PositionInfo = { /** * The last position value */ lastPosition: object; /** * The DOMRect of the previous "of" element */ lastOfRect: DOMRect; /** * The DOMRect of the current "of" element */ currentOfRect: DOMRect; }; } namespace routing { /** * Parameters of the HashChanger#hashSet event. */ interface HashChanger$HashSetEventParameters { /** * The relevant hash segment */ hash?: string; } /** * Parameters of the HashChangerBase#hashChanged event. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ interface HashChangerBase$HashChangedEventParameters { /** * The hash segment before it's changed */ oldHash?: string; /** * The new hash segment */ newHash?: object; /** * The full format of the hash if the newHash only contains part of the relevant hash */ fullHash?: string; } /** * Parameters of the HashChangerBase#hashReplaced event. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ interface HashChangerBase$HashReplacedEventParameters { /** * The relevant hash segment */ hash?: string; } /** * Parameters of the Route#beforeMatched event. */ interface Route$BeforeMatchedEventParameters { /** * The name of the route */ name?: string; /** * A key-value pair object which contains the arguments defined in the route resolved with the corresponding * information from the current URL hash */ arguments?: object; /** * The configuration object of the route */ config?: object; /** * The nested route instance of this route. The event is fired on this route because the pattern in the * nested route is matched with the current URL hash. This parameter can be used to decide whether the current * route is matched because of its nested child route. For more information about nested child route please * refer to the documentation of oConfig.parent in {@link sap.ui.core.routing.Route#constructor} */ nestedRoute?: sap.ui.core.routing.Route; } /** * Parameters of the Route#matched event. */ interface Route$MatchedEventParameters { /** * The name of the route */ name?: string; /** * A key-value pair object which contains the arguments defined in the route resolved with the corresponding * information from the current URL hash */ arguments?: object; /** * The configuration object of the route */ config?: object; /** * The nested route instance of this route. The event is fired on this route because the pattern in the * nested route is matched with the current URL hash. This parameter can be used to decide whether the current * route is matched because of its nested child route. For more information about nested child route please * refer to the documentation of oConfig.parent in {@link sap.ui.core.routing.Route#constructor} */ nestedRoute?: sap.ui.core.routing.Route; /** * The first View or ComponentContainer instance which is created out of the first target. If multiple targets * are displayed, use oEvent.getParameters.views to get all instances */ view?: sap.ui.core.mvc.View | sap.ui.core.ComponentContainer; /** * All View or ComponentContainer instances which are created out of the targets. */ views?: Array; /** * The container control to which the first View or ComponentContainer is added. If multiple targets are * displayed, use oEvent.getParameters.targetControls to get all container controls */ targetControl?: sap.ui.core.Control; /** * The container controls to which the View or ComponentContainer instances are added. */ targetControls?: sap.ui.core.Control[]; } /** * Parameters of the Route#patternMatched event. */ interface Route$PatternMatchedEventParameters { /** * The name of the route */ name?: string; /** * A key-value pair object which contains the arguments defined in the route resolved with the corresponding * information from the current URL hash */ arguments?: object; /** * The configuration object of the route */ config?: object; /** * The first View or ComponentContainer instance which is created out of the first target. If multiple targets * are displayed, use oEvent.getParameters.views to get all instances */ view?: sap.ui.core.mvc.View | sap.ui.core.ComponentContainer; /** * All View or ComponentContainer instances which are created out of the targets. */ views?: Array; /** * The container control to which the first View or ComponentContainer is added. If multiple targets are * displayed, use oEvent.getParameters.targetControls to get all container controls */ targetControl?: sap.ui.core.Control; /** * The container controls to which the View or ComponentContainer instances are added. */ targetControls?: sap.ui.core.Control[]; } /** * Parameters of the Route#switched event. */ interface Route$SwitchedEventParameters { /** * The name of the route */ name?: string; /** * A key-value pair object which contains the arguments defined in the route resolved with the corresponding * information from the current URL hash */ arguments?: object; /** * The configuration object of the route */ config?: object; } /** * Parameters of the Router#beforeRouteMatched event. */ interface Router$BeforeRouteMatchedEventParameters { /** * The name of the route */ name?: string; /** * A key-value pair object which contains the arguments defined in the route resolved with the corresponding * information from the current URL hash */ arguments?: object; /** * The configuration object of the route */ config?: object; /** * The nested route instance of this route. The event is fired on this route because the pattern in the * nested route is matched with the current URL hash. This parameter can be used to decide whether the current * route is matched because of its nested child route. For more information about nested child route please * refer to the documentation of oConfig.parent in {@link sap.ui.core.routing.Route#constructor} */ nestedRoute?: sap.ui.core.routing.Route; } /** * Parameters of the Router#bypassed event. */ interface Router$BypassedEventParameters { /** * the current URL hash which did not match any route */ hash?: string; } /** * Parameters of the Router#routeMatched event. */ interface Router$RouteMatchedEventParameters { /** * The name of the route */ name?: string; /** * A key-value pair object which contains the arguments defined in the route resolved with the corresponding * information from the current URL hash */ arguments?: object; /** * The configuration object of the route */ config?: object; /** * The nested route instance of this route. The event is fired on this route because the pattern in the * nested route is matched with the current URL hash. This parameter can be used to decide whether the current * route is matched because of its nested child route. For more information about nested child route please * refer to the documentation of oConfig.parent in {@link sap.ui.core.routing.Route#constructor} */ nestedRoute?: sap.ui.core.routing.Route; /** * The first View or ComponentContainer instance which is created out of the first target. If multiple targets * are displayed, use oEvent.getParameters.views to get all instances */ view?: sap.ui.core.mvc.View | sap.ui.core.ComponentContainer; /** * All View or ComponentContainer instances which are created out of the targets. */ views?: Array; /** * The container control to which the first View or ComponentContainer is added. If multiple targets are * displayed, use oEvent.getParameters.targetControls to get all container controls */ targetControl?: sap.ui.core.Control; /** * The container controls to which the View or ComponentContainer instances are added. */ targetControls?: sap.ui.core.Control[]; } /** * Parameters of the Router#routePatternMatched event. */ interface Router$RoutePatternMatchedEventParameters { /** * The name of the route */ name?: string; /** * A key-value pair object which contains the arguments defined in the route resolved with the corresponding * information from the current URL hash */ arguments?: object; /** * The configuration object of the route */ config?: object; /** * The first View or ComponentContainer instance which is created out of the first target. If multiple targets * are displayed, use oEvent.getParameters.views to get all instances */ view?: sap.ui.core.mvc.View | sap.ui.core.ComponentContainer; /** * All View or ComponentContainer instances which are created out of the targets. */ views?: Array; /** * The container control to which the first View or ComponentContainer is added. If multiple targets are * displayed, use oEvent.getParameters.targetControls to get all container controls */ targetControl?: sap.ui.core.Control; /** * The container controls to which the View or ComponentContainer instances are added. */ targetControls?: sap.ui.core.Control[]; } /** * Parameters of the Router#titleChanged event. */ interface Router$TitleChangedEventParameters { /** * The current displayed title */ title?: string; /** * An array which contains the history of previous titles */ history?: any[]; /** * An array which contains the title history information of the current router and of the router of the * nested components, so the application doesn't need to merge the `nestedHistory` with the `history` parameter * together. If a hierarchical control is used to show the title information (like the sap.m.Breadcrumbs * control), the application can simply use the `nestedHistory` to build up the control and doesn't need * the `history` anymore. */ nestedHistory?: any[]; /** * Whether the titleChanged event is triggered by a nested component */ propagated?: boolean; } /** * Parameters of the Target#display event. */ interface Target$DisplayEventParameters { /** * The view that got displayed. */ view?: object; /** * The control that now contains the view in the controlAggregation */ control?: object; /** * The options object passed to the constructor {@link sap.ui.core.routing.Target#constructor} */ config?: object; /** * The data passed into the {@link sap.ui.core.routing.Target#display} function */ data?: object; /** * Whether the target is relevant to the matched route or not */ routeRelevant?: object; } /** * Parameters of the Targets#display event. */ interface Targets$DisplayEventParameters { /** * The view that got displayed. */ view?: object; /** * The control that now contains the view in the controlAggregation */ control?: object; /** * The options object passed to the constructor {@link sap.ui.core.routing.Targets#constructor} */ config?: object; /** * The name of the target firing the event */ name?: object; /** * The data passed into the {@link sap.ui.core.routing.Targets#display} function */ data?: object; /** * Whether the target is relevant to the matched route or not */ routeRelevant?: object; } /** * Parameters of the Targets#titleChanged event. */ interface Targets$TitleChangedEventParameters { /** * The current displayed title */ title?: string; /** * The name of the displayed target */ name?: string; } /** * Parameters of the Views#created event. */ interface Views$CreatedEventParameters { /** * the instance of the created view. */ view?: sap.ui.core.mvc.View; /** * The view options passed to {@link sap.ui.view} */ viewOptions?: object; } /** * Class for manipulating and receiving changes of the browser hash with `hasher` framework. * * **IMPORTANT:** To set or replace the current browser hash, use {@link #setHash} or {@link #replaceHash } * and do NOT interact with the `hasher` framework directly in order to have the navigation direction calculated * as accurate as possible. * * Fires a `hashChanged` event if the browser hash changes. */ class HashChanger extends sap.ui.core.routing.HashChangerBase { constructor(); /** * Creates a new subclass of class sap.ui.core.routing.HashChanger with name `sClassName` and enriches it * with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.routing.HashChangerBase.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Gets a global singleton of the HashChanger. The singleton will get created when this function is invoked * for the first time. * * * @returns The global HashChanger */ static getInstance(): sap.ui.core.routing.HashChanger; /** * Returns a metadata object for class sap.ui.core.routing.HashChanger. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Sets the hashChanger to a new instance, destroys the old one and copies all its event listeners to the * new one * * @ui5-protected Do not call from applications (only from related classes in the framework) */ static replaceHashChanger( /** * the new instance for the global singleton */ oHashChanger: sap.ui.core.routing.HashChanger ): void; /** * Cleans the event registration * See: * sap.ui.base.Object.prototype.destroy * * @ui5-protected Do not call from applications (only from related classes in the framework) */ destroy(): void; /** * Fires the `hashChanged` event, may be extended to modify the hash before firing the event * * @ui5-protected Do not call from applications (only from related classes in the framework) */ fireHashChanged( /** * the new hash of the browser */ sNewHash: string, /** * the previous hash */ sOldHash: string ): void; /** * Gets the current hash * * * @returns the current hash */ getHash(): string; /** * Defines the events and its parameters which should be used for tracking the hash changes * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The array containing the events info */ getRelevantEventsInfo(): sap.ui.core.routing.HashChangerEventInfo[]; /** * Will start listening to hash changes. This will also fire a `hashChanged` event with the initial hash. * * * @returns false if it was initialized before, true if it was initialized the first time */ init(): boolean; /** * Replaces the hash with a certain value. When using the replace function, no browser history entry is * written. If you want to have an entry in the browser history, please use the {@link #setHash} function. * * The `sDirection` parameter can be used to provide direction information on the navigation which leads * to this hash replacement. This is typically used when synchronizing the hashes between multiple frames * to provide information to the frame where the hash is replaced with the navigation direction in the other * frame where the navigation occurs. */ replaceHash( /** * New hash */ sHash: string, /** * The direction information for this hash replacement */ sDirection: sap.ui.core.routing.HistoryDirection ): void; /** * Sets the hash to a certain value. When using this function, a browser history entry is written. If you * do not want to have an entry in the browser history, please use the {@link #replaceHash} function. */ setHash( /** * New hash */ sHash: string ): void; } /** * Base Class for manipulating and receiving changes of hash segment. * * Fires a `hashChanged` event if the relevant hash changes. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ class HashChangerBase extends sap.ui.base.EventProvider { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Creates a new subclass of class sap.ui.core.routing.HashChangerBase with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.EventProvider.extend}. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.routing.HashChangerBase. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Replaces the hash with a certain value. When using the replace function, no browser history entry is * written. If you want to have an entry in the browser history, please use the {@link #setHash} function. * * The `sDirection` parameter can be used to provide direction information on the navigation which leads * to this hash replacement. This is typically used when synchronizing the hashes between multiple frames * to provide information to the frame where the hash is replaced with the navigation direction in the other * frame where the navigation occurs. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ replaceHash( /** * New hash */ sHash: string, /** * The direction information for this hash replacement */ sDirection: sap.ui.core.routing.HistoryDirection ): void; /** * Sets the hash to a certain value. When using this function, a browser history entry is written. If you * do not want to have an entry in the browser history, please use the {@link #replaceHash} function. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ setHash( /** * New hash */ sHash: string ): void; } class History { /** * Used to determine the {@link sap.ui.core.routing.HistoryDirection} of the current or a future navigation, * done with a {@link sap.ui.core.routing.Router} or {@link sap.ui.core.routing.HashChanger}. * * **ATTENTION:** this class will not be accurate if someone does hash-replacement without the named classes * above. If you are manipulating the hash directly, this class is not supported anymore. */ constructor( /** * required, without a HashChanger this class cannot work. The class needs to be aware of the hash-changes. */ oHashChanger: sap.ui.core.routing.HashChanger ); /** * * @returns a global singleton that gets created as soon as the sap.ui.core.routing.History is required */ static getInstance(): sap.ui.core.routing.History; /** * Determines what the navigation direction for a newly given hash would be. * * Returns the direction as {@link sap.ui.core.routing.HistoryDirection} (for example: Forwards, Backwards, * NewEntry). If no navigation has occurred yet, returns `undefined`. In cases where the direction cannot * be determined (if the same hash appears in multiple places), returns {@link sap.ui.core.routing.HistoryDirection.Unknown}. * For hash replacements, the history stack is updated at the current position. * * Example: It will say "Unknown" if there is a history "foo" - "bar" (current history) - "foo". If you * now ask for the direction of the hash "foo" you get "Unknown" because it might be backwards or forwards. * * * @returns Direction for the given hash or `undefined`, if no navigation has taken place yet. */ getDirection( /** * optional, if this parameter is not passed the last hashChange is taken. */ sNewHash?: string ): sap.ui.core.routing.HistoryDirection | undefined; /** * Returns the length difference between the history state stored in browser's pushState and the state maintained * in this class. * * The function returns `undefined` when * - The current state in browser's history pushState isn't initialized, for example, between a new hash * is set or replaced and the "hashChange" event is processed by this class * - History pushState is already used before UI5 History is initialized, and UI5 can't maintain the hash * history by using the browser pushState * * Once the "hashChange" event is processed by this class, this method always returns 0. However, before * a "hashChange" event reaches this class, it returns the offset between the new hash and the previous * one within the history state. * * @since 1.70 * * @returns The length difference or returns `undefined` when browser pushState can't be used at the moment * when this function is called */ getHistoryStateOffset(): int | undefined; /** * Gets the previous hash in the history. * * If the last direction was Unknown or there was no navigation yet, `undefined` will be returned. * * * @returns Previous hash in the history or `undefined` */ getPreviousHash(): string | undefined; } class Route extends sap.ui.base.EventProvider { /** * Instantiates a route */ constructor( /** * Router instance to which the route will be added */ oRouter: sap.ui.core.routing.Router, /** * Configuration object for the route */ oConfig: sap.ui.core.routing.$RouteSettings, /** * The parent route - if a parent route is given, the routeMatched event of this route will also trigger * the route matched of the parent and it will also create the view of the parent(if provided). */ oParent?: sap.ui.core.routing.Route ); /** * Creates a new subclass of class sap.ui.core.routing.Route with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.EventProvider.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.routing.Route. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Attaches event handler `fnFunction` to the {@link #event:beforeMatched beforeMatched} event of this `sap.ui.core.routing.Route`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Route` itself. * * @since 1.46.1 * * @returns Reference to `this` in order to allow method chaining */ attachBeforeMatched( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: (evt: Route$BeforeMatchedEvent) => void, /** * Context object to call the event handler with. Defaults to this `Route` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:beforeMatched beforeMatched} event of this `sap.ui.core.routing.Route`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Route` itself. * * @since 1.46.1 * * @returns Reference to `this` in order to allow method chaining */ attachBeforeMatched( /** * The function to be called, when the event occurs */ fnFunction: (evt: Route$BeforeMatchedEvent) => void, /** * Context object to call the event handler with. Defaults to this `Route` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:matched matched} event of this `sap.ui.core.routing.Route`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Route` itself. * * @since 1.25.1 * * @returns Reference to `this` in order to allow method chaining */ attachMatched( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: (evt: Route$MatchedEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.routing.Route` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:matched matched} event of this `sap.ui.core.routing.Route`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Route` itself. * * @since 1.25.1 * * @returns Reference to `this` in order to allow method chaining */ attachMatched( /** * The function to be called, when the event occurs */ fnFunction: (evt: Route$MatchedEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.routing.Route` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:patternMatched patternMatched} event of this * `sap.ui.core.routing.Route`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Route` itself. * * @since 1.25.1 * * @returns Reference to `this` in order to allow method chaining */ attachPatternMatched( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: (evt: Route$PatternMatchedEvent) => void, /** * Context object to call the event handler with. Defaults to this `Route` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:patternMatched patternMatched} event of this * `sap.ui.core.routing.Route`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Route` itself. * * @since 1.25.1 * * @returns Reference to `this` in order to allow method chaining */ attachPatternMatched( /** * The function to be called, when the event occurs */ fnFunction: (evt: Route$PatternMatchedEvent) => void, /** * Context object to call the event handler with. Defaults to this `Route` itself */ oListener?: object ): this; /** * Destroys a route * * * @returns this for chaining. */ destroy(): sap.ui.core.routing.Route; /** * Detaches event handler `fnFunction` from the {@link #event:beforeMatched beforeMatched} event of this * `sap.ui.core.routing.Route`. * * The passed function and listener object must match the ones used for event registration. * * @since 1.46.1 * * @returns Reference to `this` in order to allow method chaining */ detachBeforeMatched( /** * The function to be called, when the event occurs */ fnFunction: (evt: Route$BeforeMatchedEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:matched matched} event of this `sap.ui.core.routing.Route`. * * The passed function and listener object must match the ones used for event registration. * * @since 1.25.1 * * @returns Reference to `this` in order to allow method chaining */ detachMatched( /** * The function to be called, when the event occurs */ fnFunction: (evt: Route$MatchedEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:patternMatched patternMatched} event of this * `sap.ui.core.routing.Route`. * * The passed function and listener object must match the ones used for event registration. * * @since 1.25.1 * * @returns Reference to `this` in order to allow method chaining */ detachPatternMatched( /** * The function to be called, when the event occurs */ fnFunction: (evt: Route$PatternMatchedEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Fires event {@link #event:beforeMatched beforeMatched} to attached listeners. * * @since 1.46.1 * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireBeforeMatched( /** * Parameters to pass along with the event */ oParameters?: sap.ui.core.routing.Route$BeforeMatchedEventParameters ): sap.ui.core.routing.Router; /** * Returns the pattern of the route. If there are multiple patterns, the first pattern is returned * * * @returns the routes pattern */ getPattern(): string; /** * Returns the URL for the route and replaces the placeholders with the values in oParameters * * * @returns the unencoded pattern with interpolated arguments */ getURL( /** * Parameters for the route */ oParameters: object ): string; /** * Returns whether the given hash can be matched by the Route * * @since 1.58.0 * * @returns whether the hash can be matched */ match( /** * which will be tested by the Route */ sHash: string ): boolean; } class Router extends sap.ui.base.EventProvider { /** * A Router is responsible for managing navigation within an application by interpreting and responding * to changes in the URL hash. It enables applications to define routes, map them to Views/Components, and * control their placement and transitions — all in a structured and declarative way. * * A router: * - Listens to hash changes and matches them to configured route patterns * - Instantiates Views/Components dynamically when a route is matched and caches them for better performance * * - Places Views/Components into UI containers based on the defined targets and aggregations * - Maintains the browser history and consistent back/forward navigation behavior * - Fires events such as `routeMatched` and `routePatternMatched`, allowing developers to run logic when * routes change * - Handles unmatched routes through a special bypassed configuration for displaying "Not Found" View(s) * or fallbacks * * It can be used directly or via a {@link sap.ui.core.UIComponent UIComponent}'s metadata (manifest.json) * to create scalable, maintainable, and testable navigation structures across complex applications. */ constructor( /** * may contain many Route configurations as {@link sap.ui.core.routing.Route#constructor}. * * * Each of the routes contained in the array/object will be added to the router. * * * One way of defining routes is an array: * ```javascript * * [ * //Will create a route called 'firstRouter' you can later use this name in navTo to navigate to this route * { * name: "firstRoute" * pattern : "usefulPattern" * }, * //Will create a route called 'anotherRoute' for displaying the target 'targetView' which is defined in 'oTargets' * { * name: "anotherRoute" * pattern : "anotherPattern", * target: "targetView" * }, * //Will create a route for displaying a nested component which is defined in 'oTargets' with the prefix 'componentPrefix' * { * pattern: "componentPattern", * name: "componentRoute", * target: [ * { * name: "subComponent", * prefix: "componentPrefix" * } * ] * } * ] * ``` * * * The alternative way of defining routes is an Object. * If you choose this way, the name attribute is the name of the property. * ```javascript * * { * //Will create a route called 'firstRouter' you can later use this name in navTo to navigate to this route * firstRoute : { * pattern : "usefulPattern" * }, * //Will create a route called 'anotherRoute' for displaying the target 'targetView' which is defined in 'oTargets' * anotherRoute : { * pattern : "anotherPattern", * target: "targetView" * }, * //Will create a route for displaying a nested component which is defined in 'oTargets' with the prefix 'componentPrefix' * componentRoute{ * pattern: "componentPattern", * target: [ * { * name: "subComponent", * prefix: "componentPrefix" * } * ] * } * } * ``` * The values that may be provided are the same as in {@link sap.ui.core.routing.Route#constructor} */ oRoutes?: | Record | sap.ui.core.routing.$RouteSettings[], /** * Default values for route configuration - also takes the same parameters as {@link sap.ui.core.routing.Target#constructor}. * This config will be used for routes and for targets, used in the router * Eg: if the config object specifies: * ```javascript * * { * viewType: "XML" * } * ``` * The targets look like this: * ```javascript * * { * xmlTarget : { * ... * }, * jsTarget : { * viewType : "JS" * ... * } * } * ``` * Then the effective config will look like this: * ```javascript * * { * xmlTarget : { * viewType : "XML" * ... * }, * jsTarget : { * viewType : "JS" * ... * } * } * ``` * * * Since the xmlTarget does not specify its viewType, XML is taken from the config object. The jsTarget * is specifying it, so the viewType will be JS. */ oConfig?: { /** * Since 1.28. Settings which are used when no route of the router is matched after a hash change. */ bypassed?: { /** * Since 1.28. One or multiple names of targets that will be displayed, if no route of the router is matched. * A typical use case is a not found page. * The current hash will be passed to the display event of the target. * **Example:** * ```javascript * * new Router( * // Routes * [ * // Any route here * ], * { * bypassed: { * // you will find this name in the target config * target: "notFound" * } * }, * // You should only use this constructor when you are not using a router with a component. Please use the metadata of a component to define your routes and targets. The documentation can be found here: {@link sap.ui.core.UIComponent.extend}. * null, * // Target config * { * //same name as in the config.bypassed.target * notFound: { * type: "View" * name: "notFound", * ... * // more properties to place the view in the correct container * } * }); * ``` */ target?: string | string[]; }; /** * Since 1.34. Whether views are loaded asynchronously within this router instance. As of 1.90 synchronous * routing is deprecated. Therefore, you should explicitly set `oConfig.async` to `true`. */ async?: boolean; }, /** * the Component of all the views that will be created by this Router, * will get forwarded to the {@link sap.ui.core.routing.Views#constructor}. * If you are using the componentMetadata to define your routes you should skip this parameter. */ oOwner?: sap.ui.core.UIComponent, /** * Since 1.28 the target configuration, see {@link sap.ui.core.routing.Targets#constructor} documentation * (the options object). * You should use Targets to create and display views. Since 1.28 the route should only contain routing * relevant properties. * **Example:** * ```javascript * * new Router( * // Routes * [ * { * // no view creation related properties are in the route * name: "startRoute", * //no hash * pattern: "", * // you can find this target in the targetConfig * target: "welcome" * } * ], * // Default values shared by routes and Targets * { * path: "my.application.namespace", * viewType: "XML" * }, * // You should only use this constructor when you are using a router without a component. * // Please use the metadata of a component to define your routes and targets. * // The documentation can be found here: {@link sap.ui.core.UIComponent.extend}. * null, * // Target config * { * //same name as in the route called 'startRoute' * welcome: { * // All properties for creating and placing a view go here or in the config * type: "View", * name: "Welcome", * controlId: "app", * controlAggregation: "pages" * } * }) * ``` */ oTargetsConfig?: Record ); /** * Creates a new subclass of class sap.ui.core.routing.Router with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.EventProvider.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.routing.Router. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Get a registered router. * * * @returns The router with the specified name, else `undefined` */ static getRouter( /** * Name of the router */ sName: string ): sap.ui.core.routing.Router | undefined; /** * Adds a route to the router. */ addRoute( /** * Configuration object for the route, see {@link sap.ui.core.routing.Route#constructor} */ oConfig: sap.ui.core.routing.$RouteSettings, /** * The parent route - if a parent route is given, the `routeMatched` event of this route will also trigger * the `routeMatched` of the parent and it will also create the view of the parent (if provided). */ oParent?: sap.ui.core.routing.Route ): void; /** * Attaches event handler `fnFunction` to the {@link #event:beforeRouteMatched beforeRouteMatched} event * of this `sap.ui.core.routing.Router`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachBeforeRouteMatched( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (evt: Router$BeforeRouteMatchedEvent) => void, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:beforeRouteMatched beforeRouteMatched} event * of this `sap.ui.core.routing.Router`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachBeforeRouteMatched( /** * The function to be called when the event occurs */ fnFunction: (evt: Router$BeforeRouteMatchedEvent) => void, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:bypassed bypassed} event of this `sap.ui.core.routing.Router`. * * The event will get fired, if none of the routes of the router is matching. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachBypassed( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (evt: Router$BypassedEvent) => void, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:bypassed bypassed} event of this `sap.ui.core.routing.Router`. * * The event will get fired, if none of the routes of the router is matching. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachBypassed( /** * The function to be called when the event occurs */ fnFunction: (evt: Router$BypassedEvent) => void, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:routeMatched routeMatched} event of this `sap.ui.core.routing.Router`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachRouteMatched( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (evt: Router$RouteMatchedEvent) => void, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:routeMatched routeMatched} event of this `sap.ui.core.routing.Router`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachRouteMatched( /** * The function to be called when the event occurs */ fnFunction: (evt: Router$RouteMatchedEvent) => void, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:routePatternMatched routePatternMatched} event * of this `sap.ui.core.routing.Router`. * * This event is similar to `routeMatched`. But it will only fire for the route that has a matching pattern, * not for its parent routes. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachRoutePatternMatched( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (evt: Router$RoutePatternMatchedEvent) => void, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:routePatternMatched routePatternMatched} event * of this `sap.ui.core.routing.Router`. * * This event is similar to `routeMatched`. But it will only fire for the route that has a matching pattern, * not for its parent routes. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachRoutePatternMatched( /** * The function to be called when the event occurs */ fnFunction: (evt: Router$RoutePatternMatchedEvent) => void, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:titleChanged titleChanged} event of this `sap.ui.core.routing.Router`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachTitleChanged( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (evt: Router$TitleChangedEvent) => void, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:titleChanged titleChanged} event of this `sap.ui.core.routing.Router`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachTitleChanged( /** * The function to be called when the event occurs */ fnFunction: (evt: Router$TitleChangedEvent) => void, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:viewCreated viewCreated} event of this `sap.ui.core.routing.Router`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * @deprecated As of version 1.28. use {@link #getViews} instead. * * @returns Reference to `this` in order to allow method chaining */ attachViewCreated( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:viewCreated viewCreated} event of this `sap.ui.core.routing.Router`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Router` itself. * * @deprecated As of version 1.28. use {@link #getViews} instead. * * @returns Reference to `this` in order to allow method chaining */ attachViewCreated( /** * The function to be called when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with, defaults to this `sap.ui.core.routing.Router` itself */ oListener?: object ): this; /** * Removes the router from the hash changer. * * See {@link sap.ui.core.routing.HashChanger}. * * * @returns this for chaining. */ destroy(): sap.ui.core.routing.Router; /** * Detaches event handler `fnFunction` from the {@link #event:beforeRouteMatched beforeRouteMatched} event * of this `sap.ui.core.routing.Router`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachBeforeRouteMatched( /** * The function to be called when the event occurs */ fnFunction: (evt: Router$BeforeRouteMatchedEvent) => void, /** * Context object on which the given function had to be called */ oListener: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:bypassed bypassed} event of this `sap.ui.core.routing.Router`. * * The passed function and listener object must match the ones used for event registration. * * The event will get fired, if none of the routes of the router is matching. * * * @returns Reference to `this` in order to allow method chaining */ detachBypassed( /** * The function to be called when the event occurs */ fnFunction: (evt: Router$BypassedEvent) => void, /** * Context object on which the given function had to be called */ oListener: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:routeMatched routeMatched} event of this `sap.ui.core.routing.Router`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachRouteMatched( /** * The function to be called when the event occurs */ fnFunction: (evt: Router$RouteMatchedEvent) => void, /** * Context object on which the given function had to be called */ oListener: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:routePatternMatched routePatternMatched} event * of this `sap.ui.core.routing.Router`. * * The passed function and listener object must match the ones used for event registration. * * This event is similar to `routeMatched`. But it will only fire for the route that has a matching pattern, * not for its parent routes. * * * @returns Reference to `this` in order to allow method chaining */ detachRoutePatternMatched( /** * The function to be called when the event occurs */ fnFunction: (evt: Router$RoutePatternMatchedEvent) => void, /** * Context object on which the given function had to be called */ oListener: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:titleChanged titleChanged} event of this `sap.ui.core.routing.Router`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachTitleChanged( /** * The function to be called when the event occurs */ fnFunction: (evt: Router$TitleChangedEvent) => void, /** * Context object on which the given function had to be called */ oListener: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:viewCreated viewCreated} event of this `sap.ui.core.routing.Router`. * * The passed function and listener object must match the ones used for event registration. * * @deprecated As of version 1.28. use {@link #getViews} instead. * * @returns Reference to `this` in order to allow method chaining */ detachViewCreated( /** * The function to be called when the event occurs */ fnFunction: Function, /** * Context object on which the given function had to be called */ oListener: object ): this; /** * Fires event {@link #event:beforeRouteMatched beforeRouteMatched} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireBeforeRouteMatched( /** * Parameters to pass along with the event */ oParameters?: sap.ui.core.routing.Router$BeforeRouteMatchedEventParameters ): this; /** * Fires event {@link #event:bypassed bypassed} to attached listeners. * * The event will get fired, if none of the routes of the router is matching. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireBypassed( /** * Parameters to pass along with the event */ oParameters?: sap.ui.core.routing.Router$BypassedEventParameters ): this; /** * Fires event {@link #event:routeMatched routeMatched} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireRouteMatched( /** * Parameters to pass along with the event */ oParameters?: sap.ui.core.routing.Router$RouteMatchedEventParameters ): this; /** * Fires event {@link #event:routePatternMatched routePatternMatched} to attached listeners. * * This event is similar to `routeMatched`. But it will only fire for the route that has a matching pattern, * not for its parent routes. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireRoutePatternMatched( /** * Parameters to pass along with the event */ oParameters?: sap.ui.core.routing.Router$RoutePatternMatchedEventParameters ): this; /** * Fires event {@link #event:viewCreated viewCreated} to attached listeners. * * @deprecated As of version 1.28. use {@link #getViews} instead. * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireViewCreated( /** * Parameters to pass along with the event */ oParameters?: object ): this; /** * Returns the hash changer instance which is used in the router. * * This hash changer behaves differently than the hash changer that is returned by {@link sap.ui.core.routing.HashChanger.getInstance}, * especially when the router is created in a component which is nested within another component. When this * hash changer is used, the other hash parts which belong to the parent components are kept in the browser * hash, while the complete browser hash is changed when it's changed by using the {@link sap.ui.core.routing.HashChanger.getInstance}. * * @since 1.75 * * @returns The hash changer */ getHashChanger(): sap.ui.core.routing.RouterHashChanger; /** * Returns the route with the given name or `undefined` if no route is found. * * @since 1.25.1 * * @returns Route with the provided name or `undefined`. */ getRoute( /** * Name of the route */ sName: string ): sap.ui.core.routing.Route | undefined; /** * Returns a route info object containing the name and arguments of the route which matches the given hash * or `undefined`. * * @since 1.75 * * @returns An object containing the route `name` and the `arguments` or `undefined` */ getRouteInfoByHash( /** * The hash to be matched */ sHash: string ): sap.ui.core.routing.RouteInfo | undefined; /** * Returns a target by its name. * * If you pass `myTarget: { view: "myView" })` in the config, `myTarget` is the name. See {@link sap.ui.core.routing.Targets#getTarget}. * * * @returns Target with the corresponding name or `undefined`. If an array of names was passed, this will * return an array with all found targets. Non existing targets will not be returned but will log an error. */ getTarget( /** * Name of a single target or an array of names of multiple targets */ vName: string | string[] ): | sap.ui.core.routing.Target | undefined | sap.ui.core.routing.Target[]; /** * Returns the instance of `sap.ui.core.routing.Targets`, if you passed a `targets` configuration to the * router. * * * @returns Instance of `Targets` which the router uses to place views or `undefined` if you did not specify * the `targets` parameter in the router's constructor. */ getTargets(): sap.ui.core.routing.Targets | undefined; /** * Returns the title history. * * History entry example: * ```javascript * * { * title: "TITLE", // The displayed title * hash: "HASH" // The url hash * isHome: "true/false" // The app home indicator * } * ``` * * * * @returns An array which contains the history entries. */ getTitleHistory(): any[]; /** * Returns the URL for the route and replaces the placeholders with the values in `oParameters`. * * * @returns The unencoded pattern with interpolated arguments or `undefined` if no matching route can be * determined */ getURL( /** * Name of the route */ sName: string, /** * Parameters for the route */ oParameters?: object ): string | undefined; /** * Returns a cached view for a given name or creates it if it does not exist yet. * * @deprecated As of version 1.28.1. use {@link #getViews} instead. * * @returns The view instance */ getView( /** * Name of the view */ sViewName: string, /** * Type of the view */ sViewType: string, /** * Optional view id */ sViewId: string ): sap.ui.core.mvc.View; /** * Returns the `sap.ui.core.routing.Views` instance created by the router. * * @since 1.28 * * @returns the Views instance */ getViews(): sap.ui.core.routing.Views; /** * Attaches the router to the hash changer. * * See {@link sap.ui.core.routing.HashChanger}. * * * @returns this for chaining. */ initialize( /** * Since 1.48.0. Whether the current URL hash shouldn't be parsed after the router is initialized */ bIgnoreInitialHash?: boolean ): this; /** * Returns whether the router is initialized by calling {@link sap.ui.core.routing.Router#initialize} function. * * @since 1.62 * * @returns Whether the router is initialized */ isInitialized(): boolean; /** * Returns whether the router is stopped by calling {@link sap.ui.core.routing.Router#stop} function. * * @since 1.62 * * @returns Whether the router is stopped */ isStopped(): boolean; /** * Returns whether the given hash can be matched by any of the routes in the router. * * @since 1.58.0 * * @returns Whether the hash can be matched */ match( /** * which will be tested by the Router */ sHash: string ): boolean; /** * Navigates to a specific route defining a set of parameters. * * The parameters will be URI encoded - the characters ; , / ? : @ & = + $ are reserved and will not be * encoded. If you want to use special characters in your `oParameters`, you have to encode them (encodeURIComponent). * * If the given route name can't be found, an error message is logged to the console and the hash will be * changed to the empty string. * * This method excecutes following steps: 1. Interpolates the pattern with the given parameters 2. Sets * the interpolated pattern to the browser's hash 3. Reacts to the browser's `hashchange` event to find * out the route which matches the hash * * If there are multiple routes that have the same pattern, the call of navTo with a specific route won't * necessarily trigger the matching process of this route. In the end, the first route in the router configuration * list that matches the browser hash will be chosen. * * If the browser hash is already set with the interpolated pattern from the navTo call, nothing will happen * because the browser won't fire `hashchange` event in this case. * * * @returns this for chaining. */ navTo( /** * The name of the route */ sName: string, /** * The parameters for the route. As of Version 1.75 the recommendation is naming the query parameter with * a leading "?" character, which is identical to the definition in the route's pattern. The old syntax * without a leading "?" character is deprecated. e.g. **Route:** `{parameterName1}/:parameterName2:/{?queryParameterName}` * **Parameter:** * ```javascript * * { * parameterName1: "parameterValue1", * parameterName2: "parameterValue2", * "?queryParameterName": { * queryParameterName1: "queryParameterValue1" * } * } * ``` */ oParameters?: object, /** * Defines routing information for nested component targets. For each nested component target, you can specify * the route name and its parameters of the nested router. This allows matching a non-empty route pattern * in the nested component directly during this `navTo` call. The same structure can be used recursively * for deeper levels of nested component targets. */ oComponentTargetInfo?: Record< string, sap.ui.core.routing.ComponentTargetParameters >, /** * If set to `true`, the hash is replaced, and there will be no entry in the browser history. If set to * `false`, the hash is set and the entry is stored in the browser history. */ bReplace?: boolean ): this; /** * Navigates to a specific route defining a set of parameters. * * The parameters will be URI encoded - the characters ; , / ? : @ & = + $ are reserved and will not be * encoded. If you want to use special characters in your `oParameters`, you have to encode them (encodeURIComponent). * * If the given route name can't be found, an error message is logged to the console and the hash will be * changed to the empty string. * * This method excecutes following steps: 1. Interpolates the pattern with the given parameters 2. Sets * the interpolated pattern to the browser's hash 3. Reacts to the browser's `hashchange` event to find * out the route which matches the hash * * If there are multiple routes that have the same pattern, the call of navTo with a specific route won't * necessarily trigger the matching process of this route. In the end, the first route in the router configuration * list that matches the browser hash will be chosen. * * If the browser hash is already set with the interpolated pattern from the navTo call, nothing will happen * because the browser won't fire `hashchange` event in this case. * * * @returns this for chaining. */ navTo( /** * The name of the route */ sName: string, /** * The parameters for the route. As of Version 1.75 the recommendation is naming the query parameter with * a leading "?" character, which is identical to the definition in the route's pattern. The old syntax * without a leading "?" character is deprecated. e.g. **Route:** `{parameterName1}/:parameterName2:/{?queryParameterName}` * **Parameter:** * ```javascript * * { * parameterName1: "parameterValue1", * parameterName2: "parameterValue2", * "?queryParameterName": { * queryParameterName1: "queryParameterValue1" * } * } * ``` */ oParameters?: object, /** * If set to `true`, the hash is replaced, and there will be no entry in the browser history. If set to * `false`, the hash is set and the entry is stored in the browser history. */ bReplace?: boolean ): this; /** * Will trigger routing events + place targets for routes matching the string. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ parse( /** * A new hash */ sNewHash: string ): void; /** * Centrally register this router instance under a given name to be able to access it from another context, * just by knowing the name. * * Use {@link sap.ui.core.routing.Router.getRouter Router.getRouter()} to retrieve the instance. * * * @returns The router instance */ register( /** * Name of the router instance */ sName: string ): this; /** * Adds or overwrites a view in the view cache of the router which will be cached under the given `sViewName` * and the "undefined" key. * * @since 1.22 * @deprecated As of version 1.28. use {@link #getViews} instead. * * @returns Since 1.28, the `this` pointer for chaining */ setView( /** * Name of the view */ sViewName: string, /** * The view instance */ oView: sap.ui.core.mvc.View ): this; /** * Stops to listen to the `hashchange` of the browser. * * If you want the router to start again, call {@link #initialize} again. * * * @returns this for chaining. */ stop(): sap.ui.core.routing.Router; } /** * Class for manipulating and receiving changes of the relevant hash segment which belongs to a router. * This Class doesn't change the browser hash directly, but informs its parent RouterHashChanger and finally * changes the browser hash through the {@link sap.ui.core.routing.HashChanger} * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ class RouterHashChanger extends sap.ui.core.routing.HashChangerBase { /** * @ui5-protected Do not call from applications (only from related classes in the framework) */ protected constructor(); /** * Creates a new subclass of class sap.ui.core.routing.RouterHashChanger with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.routing.HashChangerBase.extend}. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo< T, sap.ui.core.routing.RouterHashChanger >, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.routing.RouterHashChanger. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Returns a managed instance of {@link sap.ui.core.routing.RouterHashChanger} associated with the current * instance. * * This sub-instance handles a specific part of the URL hash. When the sub-instance modifies the hash, it * notifies the parent instance, which then updates the browser’s hash accordingly. Likewise, when the relevant * part of the hash changes externally, the parent instance notifies the sub-instance. * * The provided `sKey` is used as an identifier for caching the sub-instance. If this method is called again * with the same key, the previously created instance is returned. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The corresponding sub RouterHashChanger instance. */ createSubHashChanger( /** * A unique key used as the prefix for the sub RouterHashChanger. */ sKey: string ): sap.ui.core.routing.RouterHashChanger; /** * Save the given hash and potentially fires a "hashChanged" event; may be extended to modify the hash before * firing the event. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ fireHashChanged( /** * the new hash of the browser */ sHash: string, /** * the prefixes and hashes for the child RouterHashChangers */ oSubHashMap: object, /** * if this parameter is set to true, the given sHash is saved in the instance but no "hashChanged" event * is fired. */ bUpdateHashOnly: boolean ): void; /** * Gets the current hash * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the current hash */ getHash(): string; /** * Replaces the hash with a certain value. When using the replace function, no browser history entry is * written. If you want to have an entry in the browser history, please use the {@link #setHash} function. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns When `pNestedHashChange` is given as a Promise, this function also returns a Promise which resolves * after the given promise resolves. Otherwise it returns `undefined`. */ replaceHash( /** * New hash */ sHash: string, /** * The direction information for the hash replacement */ sDirection: sap.ui.core.routing.HistoryDirection, /** * When this parameter is given, this RouterHashChanger switchs to collect mode and all hash changes from * its children will be collected. When this promise resolves, this RouterHashChanger fires a "hashReplaced" * event with its own hash and the hashes which are collected from the child RouterHashChanger(s). */ pNestedHashChange?: Promise, /** * Whether this RouterHashChanger shouldn't collect the prefixes from its active child RouterHashChanger(s) * and forward them as delete prefixes within the next "hashReplaced" event */ bSuppressActiveHashCollect?: boolean ): Promise | undefined; /** * Reset the hash if the given router is the active router that is saved in this RouterHashChanger * * This is needed for allowing to fire the hashChanged event with the previous hash again after displaying * a Target without involving a Router. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns The current RouterHashChanger for chaining the method */ resetHash( /** * the router from which the resetHash is started */ oRouter: sap.ui.core.routing.Router ): this; /** * Sets the hash to a certain value. When using this function, a browser history entry is written. If you * do not want to have an entry in the browser history, please use the {@link #replaceHash} function. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns When `pNestedHashChange` is given as a Promise, this function also returns a Promise which resolves * after the given promise resolves. Otherwise it returns `undefined`. */ setHash( /** * New hash */ sHash: string, /** * When this parameter is given, this RouterHashChanger switchs to collect mode and all hash changes from * its children will be collected. When this promise resolves, this RouterHashChanger fires a "hashSet" * event with its own hash and the hashes which are collected from the child RouterHashChanger(s). */ pNestedHashChange?: Promise, /** * Whether this RouterHashChanger shouldn't collect the prefixes from its active child RouterHashChanger(s) * and forward them as delete prefixes within the next "hashSet" event */ bSuppressActiveHashCollect?: boolean ): Promise | undefined; } /** * Provides a convenient way for placing views into the correct containers of your application. * * The main benefit of Targets is lazy loading: you do not have to create the views until you really need * them. * * @since 1.28.1 */ class Target extends sap.ui.base.EventProvider { /** * **Don't call this constructor directly**, use {@link sap.ui.core.routing.Targets} instead, it will create * instances of a Target. * If you are using the mobile library, please use the {@link sap.m.routing.Targets} constructor, please * read the documentation there. */ constructor( /** * all of the parameters defined in {@link sap.m.routing.Targets#constructor} are accepted here, except * for children you need to specify the parent. */ oOptions: object, /** * All views required by this target will get created by the views instance using {@link sap.ui.core.routing.Views#getView} */ oCache: /* was: sap.ui.core.routing.TargetCache */ any, /** * the parent of this target. Will also get displayed, if you display this target. In the config you have * the fill the children property {@link sap.m.routing.Targets#constructor} */ oParent?: sap.ui.core.routing.Target ); /** * Creates a new subclass of class sap.ui.core.routing.Target with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.EventProvider.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.routing.Target. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Attaches event handler `fnFunction` to the {@link #event:display display} event of this `sap.ui.core.routing.Target`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Target` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachDisplay( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: (evt: Target$DisplayEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.routing.Target` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:display display} event of this `sap.ui.core.routing.Target`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Target` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachDisplay( /** * The function to be called, when the event occurs */ fnFunction: (evt: Target$DisplayEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.routing.Target` itself */ oListener?: object ): this; /** * This function is called between the target view is loaded and the view is added to the container. * * This function can be used for applying modification on the view or the container to make the rerendering * occur together with the later aggregation change. * * **Note:** This function was previously named `_beforePlacingViewIntoContainer` (with a leading underscore) * and has been renamed to be protected instead of private. * * @since 1.46.1 * @ui5-protected Do not call from applications (only from related classes in the framework) */ beforePlacingViewIntoContainer( /** * the object containing the arguments */ mArguments: { /** * the container where the view will be added */ container: sap.ui.core.Control; /** * the view which will be added to the container */ view: sap.ui.core.Control; /** * the data passed from {@link sap.ui.core.routing.Target#display} method */ data?: object; } ): void; /** * Destroys the target, will be called by {@link sap.m.routing.Targets} don't call this directly. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns this for chaining. */ destroy(): sap.ui.core.routing.Target; /** * Detaches event handler `fnFunction` from the {@link #event:display display} event of this `sap.ui.core.routing.Target`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachDisplay( /** * The function to be called, when the event occurs */ fnFunction: (evt: Target$DisplayEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Creates a view and puts it in an aggregation of a control that has been defined in the {@link #constructor}. * * This method can be used to display a target without changing the browser hash. If the browser hash should * be changed, the {@link sap.ui.core.routing.Router#navTo} method should be used instead * * * @returns resolves with {name: *, view: *, control: *} if the target can be successfully displayed otherwise * it resolves with {name: *, error: *} */ display( /** * an object that will be passed to the display event in the data property. If the target has parents, the * data will also be passed to them. */ vData?: object ): Promise<{ name: string; view: sap.ui.core.mvc.View; control: sap.ui.core.Control; }>; /** * Fires event {@link #event:created created} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireDisplay( /** * Parameters to pass along with the event */ oParameters?: sap.ui.core.routing.Target$DisplayEventParameters ): this; /** * Suspends the object which is loaded by the target. * * Currently this function stops the router of the component when the object which is loaded by this target * is an instance of UIComponent. This is done only when the target is already loaded. When the target is * not loaded yet or still being loaded, the router of the component isn't stopped. * * * @returns The 'this' to chain the call */ suspend(): sap.ui.core.routing.Target; } /** * Provides a convenient way for placing views into the correct containers of your application. * * The main benefit of `Targets` is lazy loading: you do not have to create the views until you really need * them. If you are using the mobile library, please use {@link sap.m.routing.Targets} instead of this class. * * @since 1.28.1 */ class Targets extends sap.ui.base.EventProvider { /** * Constructor for a new Targets class. */ constructor(oOptions: { /** * the views instance will create the instances of all the targets defined, so if 2 targets have the same * `type` and `name` set, the same instance of the target will be displayed. */ views: sap.ui.core.routing.Views; /** * this config allows all the values oOptions.targets.anyName allows, these will be the default values for * properties used in the target. * For example if you are only using xmlViews in your app you can specify viewType="XML" so you don't have * to repeat this in every target. * If a target specifies viewType="JS", the JS will be stronger than the XML here is an example. * * * ```javascript * * * { * config: { * viewType : "XML" * } * targets : { * xmlTarget : { * ... * }, * jsTarget : { * viewType : "JS" * ... * } * } * } * * ``` * Then the effective config that will be used looks like this: * ```javascript * * * { * xmlTarget : { * // coming from the defaults * viewType : "XML" * ... * }, * jsTarget : { * // XML is overwritten by the "JS" of the targets property * viewType : "JS" * ... * } * } * * ``` */ config?: { /** * The id of the rootView - This should be the id of the view that contains the control with the controlId * since the control will be retrieved by calling the {@link sap.ui.core.mvc.View#byId} function of the * rootView. If you are using a component and add the routing.targets **do not set this parameter**, since * the component will set the rootView to the view created by the {@link sap.ui.core.UIComponent#createContent } * function. If you specify the "parent" property of a target, the control will not be searched in the root * view but in the view Created by the parent (see parent documentation). */ rootView?: string; /** * @since 1.34 Whether the views which are created through this Targets are loaded asynchronously. This * option can be set only when the Targets is used standalone without the involvement of a Router. Otherwise * the async option is inherited from the Router. */ async?: boolean; }; /** * One or multiple targets in a map. */ targets: Record; }); /** * Creates a new subclass of class sap.ui.core.routing.Targets with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.EventProvider.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.routing.Targets. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Creates a target by using the given name and options. * * If there's already a target with the same name, the existing target is not overwritten and an error log * will be written to the console. * * * @returns Reference to `this` in order to allow method chaining */ addTarget( /** * Name of a target */ sName: string, /** * Options of a target. The option names are the same as the ones in "oOptions.targets.anyName" of {@link #constructor}. */ oTargetOptions: sap.ui.core.routing.$TargetSettings ): this; /** * Attaches event handler `fnFunction` to the {@link #event:display display} event of this `sap.ui.core.routing.Targets`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Targets` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachDisplay( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: (evt: Targets$DisplayEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.routing.Targets` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:display display} event of this `sap.ui.core.routing.Targets`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Targets` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachDisplay( /** * The function to be called, when the event occurs */ fnFunction: (evt: Targets$DisplayEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.routing.Targets` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:titleChanged titleChanged} event of this `sap.ui.core.routing.Targets`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Targets` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachTitleChanged( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: (evt: Targets$TitleChangedEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.routing.Targets` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:titleChanged titleChanged} event of this `sap.ui.core.routing.Targets`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.routing.Targets` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachTitleChanged( /** * The function to be called, when the event occurs */ fnFunction: (evt: Targets$TitleChangedEvent) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.routing.Targets` itself */ oListener?: object ): this; /** * Destroys the targets instance and all created targets. Does not destroy the views instance passed to * the constructor. It has to be destroyed separately. * * * @returns this for method chaining. */ destroy(): this; /** * Detaches event handler `fnFunction` from the {@link #event:display display} event of this `sap.ui.core.routing.Targets`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachDisplay( /** * The function to be called, when the event occurs */ fnFunction: (evt: Targets$DisplayEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:titleChanged titleChanged} event of this `sap.ui.core.routing.Targets`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachTitleChanged( /** * The function to be called, when the event occurs */ fnFunction: (evt: Targets$TitleChangedEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Creates a view and puts it in an aggregation of the specified control. * * * @returns resolving with {{name: *, view: *, control: *}|undefined} for every vTargets, object for single, * array for multiple */ display( /** * the key of the target as specified in the {@link #constructor}. To display multiple targets you may also * pass an array of keys. If the target(s) represents a sap.ui.core.UIComponent, a prefix for its Router * is needed. You can set this parameter with an object which has the 'name' property set with the key of * the target and the 'prefix' property set with the prefix for the UIComponent's router. To display multiple * component targets, you man also pass an array of objects. */ vTargets: string | string[] | object | object[], /** * an object that will be passed to the display event in the data property. If the target has parents, the * data will also be passed to them. */ vData?: object, /** * the name of the target from which the title option is taken for firing the {@link sap.ui.core.routing.Targets#event:titleChanged titleChanged } * event */ sTitleTarget?: string ): Promise; /** * Fires event {@link #event:created created} to attached listeners. * * * @returns Reference to `this` in order to allow method chaining */ fireDisplay( /** * Parameters to pass along with the event */ oParameters?: sap.ui.core.routing.Targets$DisplayEventParameters ): this; /** * Returns a target by its name (if you pass myTarget: { view: "myView" }) in the config myTarget is the * name. * * * @returns The target with the coresponding name or undefined. If an array was passed as name, this will * return an array with all found targets. Non existing targets will not be returned and an error is logged * when `bSuppressNotFoundError` param isn't set to `true`. */ getTarget( /** * the name of a single target or the name of multiple targets */ vName: string | string[], /** * In case no target is found for the given name, the not found error is supressed when this is set with * true */ bSuppressNotFoundError?: boolean ): | sap.ui.core.routing.Target | undefined | sap.ui.core.routing.Target[]; /** * Returns the views instance passed to the constructor * * * @returns the views instance */ getViews(): sap.ui.core.routing.Views; } /** * @since 1.28.1 */ class Views extends sap.ui.base.EventProvider { /** * Instantiates a view repository that creates and caches views. If it is destroyed, all the Views it created * are destroyed. Usually you do not have to create instances of this class, it is used by the {@link sap.ui.core.routing.Router}. * If you are using {@link sap.ui.core.routing.Targets} without using a {@link sap.ui.core.UIComponent } * you have to create an instance of this class. They will create an instance on their own, or if they are * used with a {@link sap.ui.core.UIComponent} they will share the same instance of Views. */ constructor(oOptions?: { /** * the owner of all the views that will be created by this Instance. */ component?: sap.ui.core.UIComponent; /** * @since 1.34 Whether the views which are created through this Views are loaded asyncly. This option can * be set only when the Views is used standalone without the involvement of a Router. Otherwise the async * option is inherited from the Router. */ async?: boolean; }); /** * Creates a new subclass of class sap.ui.core.routing.Views with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.EventProvider.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.routing.Views. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Fires event {@link #event:created created} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireCreated( /** * Parameters to pass along with the event */ oParameters?: sap.ui.core.routing.Views$CreatedEventParameters ): this; /** * Returns a cached view, for a given name. If it does not exist yet, it will create the view with the provided * options. If you provide a viewId, it will be prefixed with the viewId of the component. * * * @returns A promise that is resolved when the view is loaded {@link sap.ui.core.mvc.View#loaded}. The * view instance will be passed to the promise. */ getView( /** * see {@link sap.ui.view} for the documentation. The viewId you pass into the options will be prefixed * with the id of the component you pass into the constructor. So you can retrieve the view later by calling * the {@link sap.ui.core.UIComponent#byId} function of the UIComponent. */ oOptions: { /** * If you do not use setView please see {@link sap.ui.view} for the documentation. This is used as a key * in the cache of the Views instance. If you want to retrieve a view that has been given an alternative * name in {@link #setView} you need to provide the same name here and you can skip all the other viewOptions. */ viewName: string; } ): Promise; /** * Adds or overwrites a view in the cache of the Views instance. The viewName serves as a key for caching. * * If the second parameter is set to null or undefined, the previous cache view under the same name isn't * managed by the Views instance. The lifecycle (for example the destroy of the view) of the view instance * should be maintained by additional code. * * * @returns this for chaining. */ setView( /** * Name of the view, may differ from the actual viewName of the oView parameter provided, since you can * retrieve this view per {@link #.getView}. */ sViewName: string, /** * the view instance */ oView: sap.ui.core.mvc.View | null | undefined ): this; } /** * Enumeration for different HistoryDirections. * * This enum is part of the 'sap/ui/core/library' module export and must be accessed by the property 'routing.HistoryDirection'. */ enum HistoryDirection { /** * The page has already been navigated to and it was the predecessor of the previous page. */ Backwards = "Backwards", /** * The page has already been navigated to and it was the successor of the previous page. */ Forwards = "Forwards", /** * A new entry is added to the history. */ NewEntry = "NewEntry", /** * A navigation took place, but it could be any of the other three states. */ Unknown = "Unknown", } /** * Configuration object for a route */ type $RouteSettings = { /** * Name of the route, it will be used to retrieve the route from the router, it needs to be unique per router * instance */ name: string; /** * URL pattern where it needs to match again. A pattern may consist of the following: * - hardcoded parts: "pattern" : "product/settings" - this pattern will only match if the hash of the * browser is product/settings and no arguments will be passed to the events of the route. * * - mandatory parameters: "pattern" : "product/{id}" - {id} is a mandatory parameter, e. g. the following * hashes would match: product/5, product/3. The patternMatched event will get 5 or 3 passed as id in its * arguments. The hash product/ will not match. * * - optional parameters: "pattern" : "product/{id}/detail/:detailId:" - :detailId: is an optional parameter, * e. g. the following hashes would match: product/5/detail, product/3/detail/2 * * - query parameters: "pattern" : "product{?query}" // {?query} allows you to pass queries with any * parameters, e. g. the following hashes would match: product?first=firstValue, product?first=firstValue&second=secondValue * rest as string parameters: "pattern" : ":all*:" - this pattern will define an optional variable * that will pass the whole hash as string to the routing events. It may be used to define a catchall route, * e. g. the following hashes would match: foo, product/5/3, product/5/detail/3/foo. You can also combine * it with the other variables but make sure a variable with a * is the last one. */ pattern?: string; /** * Since 1.27. By default only the first route matching the hash, will fire events. If greedy is turned * on for a route, its events will be fired even if another route has already matched. */ greedy?: boolean; /** * Since 1.32. This property contains the information about the route which nests this route in the form: * "[componentName:]routeName". The nesting routes pattern will be prefixed to this routes pattern and hence * the nesting route also matches if this one matches. */ parent?: string; /** * One or multiple name of targets {@link sap.ui.core.routing.Targets}. As soon as the route matches, the * target(s) will be displayed. All the deprecated parameters are ignored, if a target is used. */ target?: string | string[]; /** * **Deprecated since 1.28, use `target.viewName` instead.** * The name of a view that will be created, the first time this route will be matched. To place the view * into a Control use the targetAggregation and targetControl. Views will only be created once per Router */ view?: string; /** * **Deprecated since 1.28, use `target.viewType` instead.** * The type of the view that is going to be created. eg: "XML", "JS" */ viewType?: string; /** * **Deprecated since 1.28, use `target.viewPath` instead.** * A prefix that will be prepended in front of the view eg: view is set to "myView" and viewPath is set * to "myApp" - the created view will be "myApp.myView" */ viewPath?: string; /** * **Deprecated since 1.28, use `config.rootView` (only available in the router config) instead.** * The ID of the parent of the targetControl - This should be the ID of the view where your targetControl * is located in. By default, this will be the view created by a component, or if the Route is a subroute * the view of the parent route is taken. You only need to specify this, if you are not using a router created * by a component on your top level routes */ targetParent?: string; /** * **Deprecated since 1.28, use `target.controlId` instead.** * Views will be put into a container Control, this might be an {@link sap.ui.ux3.Shell} control or an * {@link sap.m.NavContainer} if working with mobile, or any other container. The ID of this control has * to be put in here */ targetControl?: string; /** * **Deprecated since 1.28, use `target.controlAggregation` instead.** * The name of an aggregation of the targetControl, that contains views. Eg: an {@link sap.m.NavContainer } * has an aggregation "pages", another Example is the {@link sap.ui.ux3.Shell} it has "content". */ targetAggregation?: string; /** * **Deprecated since 1.28, use `target.clearControlAggregation` instead.** * Defines a boolean that can be passed to specify if the aggregation should be cleared before adding the * View to it. When using an {@link sap.ui.ux3.Shell} this should be true. For an {@link sap.m.NavContainer } * it should be false */ clearTarget?: boolean; /** * **Deprecated since 1.28, use `targets.parent` instead.** one or multiple route configs taking all of * these parameters again. If a subroute is hit, it will fire the routeMatched event for all its parents. * The routePatternMatched event will only be fired for the subroute not the parents. The routing will also * display all the targets of the subroutes and its parents. */ subroutes?: object; }; /** * Configuration object for a routing Target */ type $TargetSettings = { /** * Defines whether the target creates an instance of 'View' or 'Component'. */ type: string; /** * Defines the name of the View or Component that will be created. For type 'Component', use option 'usage' * instead if an owner component exists. To place the view or component into a Control, use the options * `controlAggregation` and `controlId`. Instance of View or Component will only be created once per `name` * or `usage` combined with `id`. * ```javascript * * * { * targets: { * // If display("masterWelcome") is called, the master view will be placed in the 'MasterPages' of a control with the id splitContainter * masterWelcome: { * type: "View", * name: "Welcome", * controlId: "splitContainer", * controlAggregation: "masterPages" * }, * // If display("detailWelcome") is called after the masterWelcome, the view will be removed from the master pages and added to the detail pages, since the same instance is used. Also the controls inside of the view will have the same state. * detailWelcome: { * // same view here, that's why the same instance is used * type: "View", * name: "Welcome", * controlId: "splitContainer", * controlAggregation: "detailPages" * } * } * } * * ``` * * * If you want to have a second instance of the 'welcome' view you can set different 'id' to the targets: * * * ```javascript * * * { * targets: { * // If display("masterWelcome") is called, the view with name "Welcome" will be placed in the 'MasterPages' of a control with the ID splitContainter * masterWelcome: { * type: "View", * name: "Welcome", * id: "masterWelcome", * controlId: "splitContainer", * controlAggregation: "masterPages" * }, * // If display("detailWelcome") is called after the "masterWelcome" target, a second instance of the same view with its own controller instance will be added in the detail pages. * detailWelcome: { * type: "View", * name: "Welcome", * // another instance will be created because a different ID is used * id: "detailWelcome", * controlId: "splitContainer", * controlAggregation: "detailPages" * } * } * } * * ``` */ name?: string; /** * Defines the 'usage' name for 'Component' target which refers to the '/sap.ui5/componentUsages' entry * in the owner component's manifest. */ usage?: string; /** * The type of the view that is going to be created. These are the supported types: {@link sap.ui.core.mvc.ViewType}. * You always have to provide a viewType except it's defined in the shared `config` or when using {@link sap.ui.core.routing.Views#setView}. */ viewType?: string; /** * A prefix that will be prepended in front of the `name`. * **Example:** `name` is set to "myView" and `path` is set to "myApp" - the created view's name will be * "myApp.myView". */ path?: string; /** * The ID of the created instance. This is will be prefixed with the ID of the component set to the views * instance provided in oOptions.views. For details see {@link sap.ui.core.routing.Views#getView}. */ id?: string; /** * The ID of the parent of the controlId - This should be the ID of the view that contains your controlId, * since the target control will be retrieved by calling the {@link sap.ui.core.mvc.View#byId} function * of the targetParent. By default, this will be the view created by a component, so you do not have to * provide this parameter. If you are using children, the view created by the parent of the child is taken. * You only need to specify this, if you are not using a Targets instance created by a component and you * should give the ID of root view of your application to this property. */ targetParent?: string; /** * The ID of the control where you want to place the instance created by this target. You also need to set * "controlAggregation" property to specify to which aggregation of the control should the created instance * be added. An example for containers are {@link sap.ui.ux3.Shell} with the aggregation 'content' or a * {@link sap.m.NavContainer} with the aggregation 'pages'. */ controlId?: string; /** * The name of an aggregation of the controlId, where the created instance from the target will be added. * Eg: a {@link sap.m.NavContainer} has an aggregation 'pages', another Example is the {@link sap.ui.ux3.Shell } * it has 'content'. */ controlAggregation?: string; /** * Defines a boolean that can be passed to specify if the aggregation should be cleared - all items will * be removed - before adding the View to it. When using a {@link sap.ui.ux3.Shell} this should be true. * For a {@link sap.m.NavContainer} it should be false. When you use the {@link sap.m.routing.Router} the * default will be false. */ clearControlAggregation?: boolean; /** * A reference to another target, using the name of the target. If you display a target that has a parent, * the parent will also be displayed. Also the control you specify with the controlId parameter, will be * searched inside of the created instance of the parent not in the rootView, provided in the config. The * control will be searched using the byId function of a view. When it is not found, the global ID is checked. * * The main use case for the parent property is placing a view or component inside a smaller container * of an instance, which is also created by targets. This is useful for lazy loading views or components, * only if the user really navigates to this part of your application. * **Example:** Our aim is to lazy load a tab of an IconTabBar (a control that displays a view initially * and when a user clicks on it the view changes). It's a perfect candidate to lazy load something inside * of it. * **Example app structure:** * We have a rootView that is returned by the createContent function of our UIComponent. This view contains * an sap.m.App control with the ID 'myApp' * ```javascript * * * * * * * ``` * an xml view called 'Detail' * ```javascript * * * * * * * * * * * * * * * * ``` * and a view called 'SecondTabContent', this one contains our content we want to have lazy loaded. Now * we need to define the routing config within "sap.ui5/routing" section in manifest.json of a Component: * * ```javascript * * * { * "config": { * // all of our views have that type * "viewType": "XML", * // a reference to the app control in the rootView created by our UIComponent * "controlId": "myApp", * // An app has a pages aggregation where the views need to be put into * "controlAggregation": "pages" * }, * "targets": { * "detail": { * "type": "View", * "name": "Detail" * }, * "secondTabContent": { * // A reference to the detail target defined above * "parent": "detail", * // A reference to the second Tab container in the Detail view. Here the target does not look in the rootView, it looks in the Parent view (Detail). * "controlId": "mySecondTab", * // An IconTabFilter has an aggregation called content so we need to overwrite the pages set in the config as default. * "controlAggregation": "content", * // A view containing the content * "type": "View", * "name": "SecondTabContent" * } * } * } * * ``` * * * Now if the target with name "secondTabContent" is displayed, 2 views will be created: Detail and SecondTabContent. * The 'Detail' view will be put into the pages aggregation of the App. And afterwards the 'SecondTabContent' * view will be put into the content Aggregation of the second IconTabFilter. So a parent will always be * created before the target referencing it. */ parent?: string; }; type ComponentTargetParameters = { /** * The name of the route which should be matched after this navTo call. */ route: string; /** * The parameters for the route */ parameters?: Record>; /** * Information for deeper nested component targets */ componentTargetInfo?: Record< string, sap.ui.core.routing.ComponentTargetParameters >; }; /** * The object containing the event info for the events that are forwarded to {@link sap.ui.core.routing.RouterHashChanger}. * * @since 1.82.0 * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ type HashChangerEventInfo = { /** * The name of the event that is fired by the HashChanger and should be forwarded to the RouterHashChanger * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ name: string; /** * The optional defined parameter name mapping that is used for forwarding the event to the {@link sap.ui.core.routing.RouterHashChanger}. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ paramMapping?: sap.ui.core.routing.HashChangerEventParameterMapping; /** * Indicates whether the event is ignored by every RouterHashChanger instance and is only relevant for the * other routing classes, for example {@link sap.ui.core.routing.History}. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ updateHashOnly: boolean; }; /** * The object containing the parameter mapping for forwarding the event to the {@link sap.ui.core.routing.RouterHashChanger}. * * @since 1.82.0 * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ type HashChangerEventParameterMapping = { /** * The name of the parameter whose value is used as the `newHash` parameter in the event that is forwarded * to the {@link sap.ui.core.routing.RouterHashChanger}. If this isn't set, the value is taken from the * property `newHash`. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ newHash?: string; /** * The name of the parameter whose value is used as the `oldHash` parameter in the event that is forwarded * to the {@link sap.ui.core.routing.RouterHashChanger}. If this isn't set, the value is taken from the * property `oldHash`. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ oldHash?: string; /** * The name of the parameter whose value is used as the `fullHash` parameter in the event that is forwarded * to the {@link sap.ui.core.routing.RouterHashChanger}. If this isn't set, the value is taken from the * property `fullHash`. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ fullHash?: string; }; type RouteInfo = { /** * The route name */ name: string; /** * The route data */ arguments: Record>; }; /** * Object containing the target info for displaying targets * * @since 1.84.0 * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ type TargetInfo = { /** * Defines the name of the target that is going to be displayed * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ name: string; /** * A prefix that is used for reserving a dedicated section in the browser hash for the router of this target. * This needs to be set only for target that has type "Component" * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ prefix?: string; /** * Whether the titleChanged event from this target should be propagated to the parent or not * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ propagateTitle?: boolean; /** * Whether the target is relevant to the current matched route or not. If 'true', then the dynamic target * is linked to the route's life cycle. When switching to a different route, then the dynamic target will * be suspended. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ routeRelevant?: boolean; /** * Since 1.90. Whether the router of the "Component" target ignores the browser hash when it's re-initialized. * This parameter only has effect when the target is of type "Component" and its router is currently stopped. * It has no effect on the first call of {@link sap.ui.core.routing.Router#initialize}, because this is * done by the application and not by the UI5 routing. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ ignoreInitialHash?: boolean; }; /** * Event object of the HashChanger#hashSet event. */ type HashChanger$HashSetEvent = sap.ui.base.Event< HashChanger$HashSetEventParameters, HashChanger >; /** * Event object of the HashChangerBase#hashChanged event. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ type HashChangerBase$HashChangedEvent = sap.ui.base.Event< HashChangerBase$HashChangedEventParameters, HashChangerBase >; /** * Event object of the HashChangerBase#hashReplaced event. * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ type HashChangerBase$HashReplacedEvent = sap.ui.base.Event< HashChangerBase$HashReplacedEventParameters, HashChangerBase >; /** * Event object of the Route#beforeMatched event. */ type Route$BeforeMatchedEvent = sap.ui.base.Event< Route$BeforeMatchedEventParameters, Route >; /** * Event object of the Route#matched event. */ type Route$MatchedEvent = sap.ui.base.Event< Route$MatchedEventParameters, Route >; /** * Event object of the Route#patternMatched event. */ type Route$PatternMatchedEvent = sap.ui.base.Event< Route$PatternMatchedEventParameters, Route >; /** * Event object of the Route#switched event. */ type Route$SwitchedEvent = sap.ui.base.Event< Route$SwitchedEventParameters, Route >; /** * Event object of the Router#beforeRouteMatched event. */ type Router$BeforeRouteMatchedEvent = sap.ui.base.Event< Router$BeforeRouteMatchedEventParameters, Router >; /** * Event object of the Router#bypassed event. */ type Router$BypassedEvent = sap.ui.base.Event< Router$BypassedEventParameters, Router >; /** * Event object of the Router#routeMatched event. */ type Router$RouteMatchedEvent = sap.ui.base.Event< Router$RouteMatchedEventParameters, Router >; /** * Event object of the Router#routePatternMatched event. */ type Router$RoutePatternMatchedEvent = sap.ui.base.Event< Router$RoutePatternMatchedEventParameters, Router >; /** * Event object of the Router#titleChanged event. */ type Router$TitleChangedEvent = sap.ui.base.Event< Router$TitleChangedEventParameters, Router >; /** * Event object of the Target#display event. */ type Target$DisplayEvent = sap.ui.base.Event< Target$DisplayEventParameters, Target >; /** * Event object of the Targets#display event. */ type Targets$DisplayEvent = sap.ui.base.Event< Targets$DisplayEventParameters, Targets >; /** * Event object of the Targets#titleChanged event. */ type Targets$TitleChangedEvent = sap.ui.base.Event< Targets$TitleChangedEventParameters, Targets >; /** * Event object of the Views#created event. */ type Views$CreatedEvent = sap.ui.base.Event< Views$CreatedEventParameters, Views >; } namespace search { /** * Describes the settings that can be provided to the OpenSearchProvider constructor. * * @deprecated As of version 1.120. There is no API replacement. */ interface $OpenSearchProviderSettings extends sap.ui.core.search.$SearchProviderSettings { /** * The URL for suggestions of the search provider. As placeholder for the concrete search queries '{searchTerms}' * must be used. For cross domain requests maybe a proxy must be used. */ suggestUrl?: | sap.ui.core.URI | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * The type of data which is provided by the given suggestUrl: either 'json' or 'xml'. */ suggestType?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; } /** * Describes the settings that can be provided to the SearchProvider constructor. * * @deprecated As of version 1.120. There is no API replacement. */ interface $SearchProviderSettings extends sap.ui.core.$ElementSettings { /** * Icon of the Search Provider */ icon?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; } /** * A SearchProvider which uses the OpenSearch protocol (either JSON or XML). * * @deprecated As of version 1.120. There is no API replacement. */ class OpenSearchProvider extends sap.ui.core.search.SearchProvider { /** * Constructor for a new search/OpenSearchProvider. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.search.$OpenSearchProviderSettings ); /** * Constructor for a new search/OpenSearchProvider. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.search.$OpenSearchProviderSettings ); /** * Creates a new subclass of class sap.ui.core.search.OpenSearchProvider with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.search.SearchProvider.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo< T, sap.ui.core.search.OpenSearchProvider >, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.search.OpenSearchProvider. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Gets current value of property {@link #getSuggestType suggestType}. * * The type of data which is provided by the given suggestUrl: either 'json' or 'xml'. * * Default value is `'json'`. * * * @returns Value of property `suggestType` */ getSuggestType(): string; /** * Gets current value of property {@link #getSuggestUrl suggestUrl}. * * The URL for suggestions of the search provider. As placeholder for the concrete search queries '{searchTerms}' * must be used. For cross domain requests maybe a proxy must be used. * * * @returns Value of property `suggestUrl` */ getSuggestUrl(): sap.ui.core.URI; /** * Sets a new value for property {@link #getSuggestType suggestType}. * * The type of data which is provided by the given suggestUrl: either 'json' or 'xml'. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * Default value is `'json'`. * * * @returns Reference to `this` in order to allow method chaining */ setSuggestType( /** * New value for property `suggestType` */ sSuggestType?: string ): this; /** * Sets a new value for property {@link #getSuggestUrl suggestUrl}. * * The URL for suggestions of the search provider. As placeholder for the concrete search queries '{searchTerms}' * must be used. For cross domain requests maybe a proxy must be used. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setSuggestUrl( /** * New value for property `suggestUrl` */ sSuggestUrl?: sap.ui.core.URI ): this; /** * Call this function to get suggest values from the search provider. The given callback function is called * with the suggest value (type 'string', 1st parameter) and an array of the suggestions (type '[string]', * 2nd parameter). */ suggest( /** * The value for which suggestions are requested. */ sValue: string, /** * The callback function which is called when the suggestions are available. */ fCallback: (p1: string, p2: string[]) => void ): void; } /** * Abstract base class for all SearchProviders which can be e.g. attached to a SearchField. * * Do not create instances of this class, but use a concrete subclass instead. * * @deprecated As of version 1.120. There is no API replacement. */ abstract class SearchProvider extends sap.ui.core.Element { /** * Constructor for a new search/SearchProvider. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.search.$SearchProviderSettings ); /** * Constructor for a new search/SearchProvider. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.search.$SearchProviderSettings ); /** * Creates a new subclass of class sap.ui.core.search.SearchProvider with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.Element.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.search.SearchProvider. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Gets current value of property {@link #getIcon icon}. * * Icon of the Search Provider * * * @returns Value of property `icon` */ getIcon(): string; /** * Sets a new value for property {@link #getIcon icon}. * * Icon of the Search Provider * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setIcon( /** * New value for property `icon` */ sIcon?: string ): this; /** * Call this function to get suggest values from the search provider. The given callback function is called * with the suggest value (type 'string', 1st parameter) and an array of the suggestions (type '[string]', * 2nd parameter). */ suggest( /** * The value for which suggestions are requested. */ sValue: string, /** * The callback function which is called when the suggestions are available. */ fnCallback: (p1: string, p2: string[]) => void ): void; } } namespace service { namespace Service { type Context = { /** * Object that is in scope (e.g. component instance) */ scopeObject: sap.ui.core.Component; /** * Type of object that is in scope */ scopeType: "component"; }; } } namespace support { /** * RuleEngineOpaAssertions represents a set of methods with which OPA test assertions can be enhanced. To * use this functionality, {@link sap.ui.core.support.RuleEngineOpaExtension RuleEngineOpaExtension} should * be provided in the OPA extensions list. */ interface RuleEngineOpaAssertions { __implements__sap_ui_core_support_RuleEngineOpaAssertions: boolean; /** * If there are issues found the assertion result will be false and a report with all the issues will be * generated in the message of the test. If no issues were found the assertion result will be true and no * report will be generated. * * If "sap-skip-rules-issues=true" is set as an URI parameter, assertion result will be always positive. * * * @returns Promise. */ getFinalReport(): Promise<{ result: boolean; message: string; actual: string; expected: object[]; }>; /** * Stores analysis history (if such) as last element in window._$files array. Accessing this array gives * an opportunity to store this history in a file. * * * @returns Promise. */ getReportAsFileInFormat( /** * The options used to configure reporting. */ options?: { /** * The format into which the history object will be converted. */ historyFormat?: /* was: sap.ui.support.HistoryFormats */ any; /** * The name of the file. It should have extension .support-assistant.json". Example: myfile.support-assistant.json * **Note:** Extension ".support-assistant.json" will be appended automatically, if it is not already given. * If only ".json" extension is given, it will be turned to ".support-assistant.json" */ fileName?: string; } ): Promise<{ result: boolean; message: string; actual: boolean; expected: boolean; }>; /** * Run the Support Assistant and analyze against a specific state of the application. Depending on the options * passed the assertion might either fail or not if any issues were found. * * If "sap-skip-rules-issues=true" is set as an URI parameter, assertion result will be always positive. * * * @returns Promise. */ noRuleFailures( /** * The options used to configure an analysis. */ options?: { /** * Should the test fail or not if there are issues of any severity. */ failOnAnyIssues?: boolean; /** * Should the test fail or not if there are issues of high severity. This parameter will override failOnAnyIssues * if set. */ failOnHighIssues?: boolean; /** * The rules to check. */ rules?: Array<{ libName: string; ruleId: string; }>; /** * This parameter allows for selection of subset of rules for the analysis */ preset?: object; /** * The execution scope of the analysis. */ executionScope?: { /** * The type of the execution scope, one of 'global', 'subtree' or 'components'. */ type?: string; /** * The IDs of the components or the subtree. */ selectors?: string | string[]; }; /** * The metadata that will be passed to the analysis. */ metadata?: object; } ): Promise<{ result: boolean; message: string; actual: string; expected: string; }>; } /** * This class represents an extension for OPA tests which allows running Support Assistant checks. * * It enriches the OPA assertions with the methods described in {@link sap.ui.core.support.RuleEngineOpaAssertions}. * * For more information, see {@link https://ui5.sap.com/#/topic/cfabbd4dfc054936997d9d00916e1668 Integrating the Support Assistant in OPA Tests}. * * @since 1.48 */ class RuleEngineOpaExtension extends sap.ui.base.Object { constructor(); /** * Creates a new subclass of class sap.ui.core.support.RuleEngineOpaExtension with name `sClassName` and * enriches it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo< T, sap.ui.core.support.RuleEngineOpaExtension >, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.support.RuleEngineOpaExtension. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * * @returns Object with the methods which will enhance the OPA assertions. */ getAssertions(): sap.ui.core.support.RuleEngineOpaAssertions; } } namespace theming { namespace Parameters { /** * Theming Parameter Value */ type Value = string | Record | undefined; } /** * A helper used for (read-only) access to CSS parameters at runtime. */ interface Parameters { /** * Returns the current value for one or more theming parameters, depending on the given arguments. The * synchronous usage of this API has been deprecated and only the asynchronous usage should still be used * (see the 4th bullet point and the code examples below). * * The theming parameters are immutable and cannot be changed at runtime. Multiple `Parameters.get()` * API calls for the same parameter name will always result in the same parameter value. * * The following API variants are available (see also the below examples): * - **(deprecated since 1.92)** If no parameter is given a key-value map containing all parameters is * returned * - **(deprecated since 1.94)** If a `string` is given as first parameter the value is returned as a * `string` * - **(deprecated since 1.94)** If an `array` is given as first parameter a key-value map containing * all parameters from the `array` is returned * - If an `object` is given as first parameter the result is returned immediately in case all parameters * are loaded and available or within the callback in case not all CSS files are already loaded. This is * the **only asynchronous** API variant. This variant is the preferred way to retrieve theming parameters. * The structure of the return value is the same as listed above depending on the type of the name property * within the `object`. * * The returned key-value maps are a copy so changing values in the map does not have any effect * * Please see the examples below for a detailed guide on how to use the **asynchronous variant** of * the API. * * * @returns the CSS parameter value(s) or `undefined` if the parameters could not be retrieved. */ get( /** * the (array with) CSS parameter name(s) or an object containing the (array with) CSS parameter name(s), * and a callback for async retrieval of parameters. */ vName: | string | string[] | { /** * the (array with) CSS parameter name(s) */ name: string | string[]; /** * If given, the callback is only executed in case there are still parameters pending and one or more of * the requested parameters is missing. */ callback?: (p1: sap.ui.core.theming.Parameters.Value) => void; } ): sap.ui.core.theming.Parameters.Value; /** * Resets the CSS parameters which finally will reload the parameters the next time they are queried via * the method `get`. * * @deprecated As of version 1.92. without a replacement. Application code should not be able to interfere * with the automated determination of theme parameters. Resetting the parameters unnecessarily could impact * performance. Please use the (potentially async) API to get parameter values and rely on the framework * to update parameter values when the theme changes. */ reset(): void; } } namespace tmpl { /** * Describes the settings that can be provided to the DOMAttribute constructor. * * @deprecated As of version 1.56. Use an {@link sap.ui.core.mvc.XMLView XMLView} or a {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed View } * instead. */ interface $DOMAttributeSettings extends sap.ui.core.$ElementSettings { /** * Name of the DOM attribute */ name?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Value of the DOM attribute */ value?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; } /** * Describes the settings that can be provided to the DOMElement constructor. * * @deprecated As of version 1.56. Use an {@link sap.ui.core.mvc.XMLView XMLView} or a {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed View } * instead. */ interface $DOMElementSettings extends sap.ui.core.$ControlSettings { /** * The text content of the DOM element */ text?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * The HTML-tag of the DOM element which contains the text */ tag?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * DOM attributes which are rendered as part of the DOM element and bindable */ attributes?: | sap.ui.core.tmpl.DOMAttribute[] | sap.ui.core.tmpl.DOMAttribute | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; /** * Nested DOM elements to support nested bindable structures */ elements?: | sap.ui.core.tmpl.DOMElement[] | sap.ui.core.tmpl.DOMElement | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; } /** * Describes the settings that can be provided to the HandlebarsTemplate constructor. * * @deprecated As of version 1.56. Use an {@link sap.ui.core.mvc.XMLView XMLView} or a {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed View } * instead. */ interface $HandlebarsTemplateSettings extends sap.ui.core.tmpl.$TemplateSettings {} /** * Describes the settings that can be provided to the Template constructor. * * @deprecated As of version 1.56. use an {@link sap.ui.core.mvc.XMLView XMLView} or a {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed View } * instead. */ interface $TemplateSettings extends sap.ui.base.$ManagedObjectSettings { /** * The Template definition as a String. */ content?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; } /** * Describes the settings that can be provided to the TemplateControl constructor. * * @deprecated As of version 1.56. Use an {@link sap.ui.core.mvc.XMLView XMLView} or a {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed View } * instead. */ interface $TemplateControlSettings extends sap.ui.core.$ControlSettings { /** * The context is a data object. It can be used for default template expressions. A change of the context * object leads to a re-rendering whereas a change of a nested property of the context object doesn't. By * default the context is an empty object. */ context?: | object | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * The template on which the template control is based on. */ template?: sap.ui.core.tmpl.Template | string; /** * Fired when the Template Control has been (re-)rendered and its HTML is present in the DOM. */ afterRendering?: (oEvent: sap.ui.base.Event) => void; /** * Fired before this Template Control is re-rendered. Use to unbind event handlers from HTML elements etc. */ beforeRendering?: (oEvent: sap.ui.base.Event) => void; } /** * Parameters of the TemplateControl#afterRendering event. */ interface TemplateControl$AfterRenderingEventParameters {} /** * Parameters of the TemplateControl#beforeRendering event. */ interface TemplateControl$BeforeRenderingEventParameters {} /** * Represents a DOM attribute of a DOM element. * * @since 1.15 * @deprecated As of version 1.56. Use an {@link sap.ui.core.mvc.XMLView XMLView} or a {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed View } * instead. */ class DOMAttribute extends sap.ui.core.Element { /** * Constructor for a new tmpl/DOMAttribute. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.tmpl.$DOMAttributeSettings ); /** * Constructor for a new tmpl/DOMAttribute. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.tmpl.$DOMAttributeSettings ); /** * Creates a new subclass of class sap.ui.core.tmpl.DOMAttribute with name `sClassName` and enriches it * with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.Element.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.tmpl.DOMAttribute. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Gets current value of property {@link #getName name}. * * Name of the DOM attribute * * * @returns Value of property `name` */ getName(): string; /** * Gets current value of property {@link #getValue value}. * * Value of the DOM attribute * * * @returns Value of property `value` */ getValue(): string; /** * Sets a new value for property {@link #getName name}. * * Name of the DOM attribute * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setName( /** * New value for property `name` */ sName?: string ): this; /** * Sets a new value for property {@link #getValue value}. * * Value of the DOM attribute * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setValue( /** * New value for property `value` */ sValue?: string ): this; } /** * Represents a DOM element. It allows to use databinding for the properties and nested DOM attributes. * * @since 1.15 * @deprecated As of version 1.56. Use an {@link sap.ui.core.mvc.XMLView XMLView} or a {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed View } * instead. */ class DOMElement extends sap.ui.core.Control { /** * Constructor for a new tmpl/DOMElement. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.tmpl.$DOMElementSettings ); /** * Constructor for a new tmpl/DOMElement. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.tmpl.$DOMElementSettings ); /** * Creates a new subclass of class sap.ui.core.tmpl.DOMElement with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.Control.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.tmpl.DOMElement. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Adds some attribute to the aggregation {@link #getAttributes attributes}. * * * @returns Reference to `this` in order to allow method chaining */ addAttribute( /** * The attribute to add; if empty, nothing is inserted */ oAttribute: sap.ui.core.tmpl.DOMAttribute ): this; /** * Adds some element to the aggregation {@link #getElements elements}. * * * @returns Reference to `this` in order to allow method chaining */ addElement( /** * The element to add; if empty, nothing is inserted */ oElement: sap.ui.core.tmpl.DOMElement ): this; /** * Returns the value of a DOM attribute if available or undefined if the DOM attribute is not available * when using this method with the parameter name only. When using the method with the parameter name and * value the method acts as a setter and sets the value of a DOM attribute. In this case the return value * is the reference to this DOM element to support method chaining. If you pass null as value of the attribute * the attribute will be removed. * * * @returns value of attribute or `this` when called as a setter */ attr( /** * The name of the DOM attribute. */ sName: string, /** * The value of the DOM attribute. If the value is undefined the DOM attribute will be removed. */ sValue: string ): any; /** * Destroys all the attributes in the aggregation {@link #getAttributes attributes}. * * * @returns Reference to `this` in order to allow method chaining */ destroyAttributes(): this; /** * Destroys all the elements in the aggregation {@link #getElements elements}. * * * @returns Reference to `this` in order to allow method chaining */ destroyElements(): this; /** * Gets content of aggregation {@link #getAttributes attributes}. * * DOM attributes which are rendered as part of the DOM element and bindable */ getAttributes(): sap.ui.core.tmpl.DOMAttribute[]; /** * Gets content of aggregation {@link #getElements elements}. * * Nested DOM elements to support nested bindable structures */ getElements(): sap.ui.core.tmpl.DOMElement[]; /** * Gets current value of property {@link #getTag tag}. * * The HTML-tag of the DOM element which contains the text * * Default value is `'span'`. * * * @returns Value of property `tag` */ getTag(): string; /** * Gets current value of property {@link #getText text}. * * The text content of the DOM element * * * @returns Value of property `text` */ getText(): string; /** * Checks for the provided `sap.ui.core.tmpl.DOMAttribute` in the aggregation {@link #getAttributes attributes}. * and returns its index if found or -1 otherwise. * * * @returns The index of the provided control in the aggregation if found, or -1 otherwise */ indexOfAttribute( /** * The attribute whose index is looked for */ oAttribute: sap.ui.core.tmpl.DOMAttribute ): int; /** * Checks for the provided `sap.ui.core.tmpl.DOMElement` in the aggregation {@link #getElements elements}. * and returns its index if found or -1 otherwise. * * * @returns The index of the provided control in the aggregation if found, or -1 otherwise */ indexOfElement( /** * The element whose index is looked for */ oElement: sap.ui.core.tmpl.DOMElement ): int; /** * Inserts a attribute into the aggregation {@link #getAttributes attributes}. * * * @returns Reference to `this` in order to allow method chaining */ insertAttribute( /** * The attribute to insert; if empty, nothing is inserted */ oAttribute: sap.ui.core.tmpl.DOMAttribute, /** * The `0`-based index the attribute should be inserted at; for a negative value of `iIndex`, the attribute * is inserted at position 0; for a value greater than the current size of the aggregation, the attribute * is inserted at the last position */ iIndex: int ): this; /** * Inserts a element into the aggregation {@link #getElements elements}. * * * @returns Reference to `this` in order to allow method chaining */ insertElement( /** * The element to insert; if empty, nothing is inserted */ oElement: sap.ui.core.tmpl.DOMElement, /** * The `0`-based index the element should be inserted at; for a negative value of `iIndex`, the element * is inserted at position 0; for a value greater than the current size of the aggregation, the element * is inserted at the last position */ iIndex: int ): this; /** * Removes all the controls from the aggregation {@link #getAttributes attributes}. * * Additionally, it unregisters them from the hosting UIArea. * * * @returns An array of the removed elements (might be empty) */ removeAllAttributes(): sap.ui.core.tmpl.DOMAttribute[]; /** * Removes all the controls from the aggregation {@link #getElements elements}. * * Additionally, it unregisters them from the hosting UIArea. * * * @returns An array of the removed elements (might be empty) */ removeAllElements(): sap.ui.core.tmpl.DOMElement[]; /** * Removes the DOM attribute for the given name and returns the reference to this DOM element to support * method chaining. */ removeAttr( /** * The name of the DOM attribute. */ sName: string ): this; /** * Removes a attribute from the aggregation {@link #getAttributes attributes}. * * * @returns The removed attribute or `null` */ removeAttribute( /** * The attribute to remove or its index or id */ vAttribute: int | string | sap.ui.core.tmpl.DOMAttribute ): sap.ui.core.tmpl.DOMAttribute | null; /** * Removes a element from the aggregation {@link #getElements elements}. * * * @returns The removed element or `null` */ removeElement( /** * The element to remove or its index or id */ vElement: int | string | sap.ui.core.tmpl.DOMElement ): sap.ui.core.tmpl.DOMElement | null; /** * Sets a new value for property {@link #getTag tag}. * * The HTML-tag of the DOM element which contains the text * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * Default value is `'span'`. * * * @returns Reference to `this` in order to allow method chaining */ setTag( /** * New value for property `tag` */ sTag?: string ): this; /** * Sets a new value for property {@link #getText text}. * * The text content of the DOM element * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setText( /** * New value for property `text` */ sText?: string ): this; } /** * The class for Handlebars Templates. * * @since 1.15 * @deprecated As of version 1.56. Use an {@link sap.ui.core.mvc.XMLView XMLView} or a {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed View } * instead. */ abstract class HandlebarsTemplate extends sap.ui.core.tmpl.Template { /** * Creates and initializes a new handlebars template with the given `sId` and settings. * * The set of allowed entries in the `mSettings` object depends on the concrete subclass and is described * there. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.tmpl.Template#constructor sap.ui.core.tmpl.Template } * can be used. */ constructor( /** * optional map/JSON-object with initial settings for the new component instance */ mSettings?: sap.ui.core.tmpl.$HandlebarsTemplateSettings ); /** * Creates and initializes a new handlebars template with the given `sId` and settings. * * The set of allowed entries in the `mSettings` object depends on the concrete subclass and is described * there. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. * * This class does not have its own settings, but all settings applicable to the base type {@link sap.ui.core.tmpl.Template#constructor sap.ui.core.tmpl.Template } * can be used. */ constructor( /** * optional id for the new template; generated automatically if no non-empty id is given Note: this can * be omitted, no matter whether `mSettings` will be given or not! */ sId?: string, /** * optional map/JSON-object with initial settings for the new component instance */ mSettings?: sap.ui.core.tmpl.$HandlebarsTemplateSettings ); /** * Creates a new subclass of class sap.ui.core.tmpl.HandlebarsTemplate with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.tmpl.Template.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.tmpl.HandlebarsTemplate. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.ManagedObjectMetadata; } /** * Base Class for Template. * * @since 1.15 * @deprecated As of version 1.56. use an {@link sap.ui.core.mvc.XMLView XMLView} or a {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed View } * instead. */ abstract class Template extends sap.ui.base.ManagedObject { /** * Creates and initializes a new template with the given `sId` and settings. * * The set of allowed entries in the `mSettings` object depends on the concrete subclass and is described * there. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * optional map/JSON-object with initial settings for the new component instance */ mSettings?: sap.ui.core.tmpl.$TemplateSettings ); /** * Creates and initializes a new template with the given `sId` and settings. * * The set of allowed entries in the `mSettings` object depends on the concrete subclass and is described * there. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * optional id for the new template; generated automatically if no non-empty id is given Note: this can * be omitted, no matter whether `mSettings` will be given or not! */ sId?: string, /** * optional map/JSON-object with initial settings for the new component instance */ mSettings?: sap.ui.core.tmpl.$TemplateSettings ); /** * parses the given path and extracts the model and path * * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ static parsePath: undefined; /** * Returns the registered template for the given ID, if any. * * * @returns the template for the given ID */ static byId(sId: string): sap.ui.core.tmpl.Template; /** * Creates a new subclass of class sap.ui.core.tmpl.Template with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.ManagedObject.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.tmpl.Template. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.ManagedObjectMetadata; /** * Creates an anonymous TemplateControl for the Template. * * * @returns the created control instance */ createControl( /** * the control ID */ sId: string, /** * the context for the renderer/templating */ oContext: object, oView: sap.ui.core.mvc.View ): sap.ui.core.tmpl.TemplateControl; /** * Creates an anonymous TemplateControl for the Template. * * * @returns the created control instance */ createControl( /** * the control ID */ sId: string, oView: sap.ui.core.mvc.View ): sap.ui.core.tmpl.TemplateControl; /** * Declares a new control based on this template and returns the created class / constructor function. The * class is based on the information coming from the abstract functions `createMetadata` and `createRenderer`. * * * @returns the created class / constructor function */ declareControl( /** * the fully qualified name of the control */ sControl: string ): Function; /** * Gets current value of property {@link #getContent content}. * * The Template definition as a String. * * * @returns Value of property `content` */ getContent(): string; /** * Templates don't have a facade and therefore return themselves as their interface. * See: * sap.ui.base.Object#getInterface * * * @returns `this` as there's no facade for templates */ getInterface(): this; /** * Creates an anonymous TemplateControl for the Template and places the control into the specified DOM element. * * * @returns the created control instance */ placeAt( /** * the id or the DOM reference where to render the template */ oRef: | string | /* was Element */ global_Element | sap.ui.core.Control, /** * The context to use to evaluate the Template. It will be applied as value for the context property of * the created control. */ oContext: object, /** * Describes the position where the control should be put into the container */ vPosition: string | int, bInline: boolean ): sap.ui.core.tmpl.TemplateControl; /** * Creates an anonymous TemplateControl for the Template and places the control into the specified DOM element. * * * @returns the created control instance */ placeAt( /** * the id or the DOM reference where to render the template */ oRef: | string | /* was Element */ global_Element | sap.ui.core.Control, /** * The context to use to evaluate the Template. It will be applied as value for the context property of * the created control. */ oContext: object, bInline: boolean ): sap.ui.core.tmpl.TemplateControl; /** * Creates an anonymous TemplateControl for the Template and places the control into the specified DOM element. * * * @returns the created control instance */ placeAt( /** * the id or the DOM reference where to render the template */ oRef: | string | /* was Element */ global_Element | sap.ui.core.Control, /** * Describes the position where the control should be put into the container */ vPosition: string | int, bInline: boolean ): sap.ui.core.tmpl.TemplateControl; /** * Creates an anonymous TemplateControl for the Template and places the control into the specified DOM element. * * * @returns the created control instance */ placeAt( /** * the id or the DOM reference where to render the template */ oRef: | string | /* was Element */ global_Element | sap.ui.core.Control, bInline: boolean ): sap.ui.core.tmpl.TemplateControl; /** * Sets a new value for property {@link #getContent content}. * * The Template definition as a String. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setContent( /** * New value for property `content` */ sContent?: string ): this; } /** * This is the base class for all template controls. Template controls are declared based on templates. * * @since 1.15 * @deprecated As of version 1.56. Use an {@link sap.ui.core.mvc.XMLView XMLView} or a {@link topic:e6bb33d076dc4f23be50c082c271b9f0 Typed View } * instead. */ class TemplateControl extends sap.ui.core.Control { /** * Constructor for a new tmpl/TemplateControl. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.tmpl.$TemplateControlSettings ); /** * Constructor for a new tmpl/TemplateControl. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.tmpl.$TemplateControlSettings ); /** * Creates a new subclass of class sap.ui.core.tmpl.TemplateControl with name `sClassName` and enriches * it with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.Control.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.tmpl.TemplateControl. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Attaches event handler `fnFunction` to the {@link #event:afterRendering afterRendering} event of this * `sap.ui.core.tmpl.TemplateControl`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.tmpl.TemplateControl` itself. * * Fired when the Template Control has been (re-)rendered and its HTML is present in the DOM. * * * @returns Reference to `this` in order to allow method chaining */ attachAfterRendering( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.tmpl.TemplateControl` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:afterRendering afterRendering} event of this * `sap.ui.core.tmpl.TemplateControl`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.tmpl.TemplateControl` itself. * * Fired when the Template Control has been (re-)rendered and its HTML is present in the DOM. * * * @returns Reference to `this` in order to allow method chaining */ attachAfterRendering( /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.tmpl.TemplateControl` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:beforeRendering beforeRendering} event of this * `sap.ui.core.tmpl.TemplateControl`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.tmpl.TemplateControl` itself. * * Fired before this Template Control is re-rendered. Use to unbind event handlers from HTML elements etc. * * * @returns Reference to `this` in order to allow method chaining */ attachBeforeRendering( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.tmpl.TemplateControl` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:beforeRendering beforeRendering} event of this * `sap.ui.core.tmpl.TemplateControl`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.tmpl.TemplateControl` itself. * * Fired before this Template Control is re-rendered. Use to unbind event handlers from HTML elements etc. * * * @returns Reference to `this` in order to allow method chaining */ attachBeforeRendering( /** * The function to be called when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object to call the event handler with. Defaults to this `sap.ui.core.tmpl.TemplateControl` itself */ oListener?: object ): this; /** * Creates a pseudo binding for an aggregation to get notified once the property changes to invalidate the * control and trigger a re-rendering. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the value of the path */ bindList( /** * the binding path */ sPath: string ): any; /** * Creates a pseudo binding for a property to get notified once the property changes to invalidate the control * and trigger a re-rendering. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the value of the path */ bindProp( /** * the binding path */ sPath: string ): any; /** * compiles (creates and registers) a new control * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns new control instance */ createControl( /** * the settings for the new control */ mSettings: object, /** * the parent path for the control */ sParentPath: string, /** * if true, then the control will not be added to the _controls aggregation */ bDoNotAdd: boolean, oView: sap.ui.core.mvc.View ): sap.ui.core.Control; /** * compiles (creates and registers) a new control * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns new control instance */ createControl( /** * the settings for the new control */ mSettings: object, /** * the parent path for the control */ sParentPath: string, oView: sap.ui.core.mvc.View ): sap.ui.core.Control; /** * compiles (creates and registers) a new control * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns new control instance */ createControl( /** * the settings for the new control */ mSettings: object, /** * if true, then the control will not be added to the _controls aggregation */ bDoNotAdd: boolean, oView: sap.ui.core.mvc.View ): sap.ui.core.Control; /** * compiles (creates and registers) a new control * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns new control instance */ createControl( /** * the settings for the new control */ mSettings: object, oView: sap.ui.core.mvc.View ): sap.ui.core.Control; /** * compiles (creates and registers) a new DOM element * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns new DOM element instance */ createDOMElement( /** * the settings for the new DOM element */ mSettings: object, /** * the parent path for the DOM element */ sParentPath?: string, /** * if true, then the control will not be added to the _controls aggregation */ bDoNotAdd?: boolean ): sap.ui.core.Control; /** * Detaches event handler `fnFunction` from the {@link #event:afterRendering afterRendering} event of this * `sap.ui.core.tmpl.TemplateControl`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachAfterRendering( /** * The function to be called, when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:beforeRendering beforeRendering} event of * this `sap.ui.core.tmpl.TemplateControl`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachBeforeRendering( /** * The function to be called, when the event occurs */ fnFunction: (p1: sap.ui.base.Event) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Fires event {@link #event:afterRendering afterRendering} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireAfterRendering( /** * Parameters to pass along with the event */ mParameters?: object ): this; /** * Fires event {@link #event:beforeRendering beforeRendering} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireBeforeRendering( /** * Parameters to pass along with the event */ mParameters?: object ): this; /** * Gets current value of property {@link #getContext context}. * * The context is a data object. It can be used for default template expressions. A change of the context * object leads to a re-rendering whereas a change of a nested property of the context object doesn't. By * default the context is an empty object. * * * @returns Value of property `context` */ getContext(): object; /** * ID of the element which is the current target of the association {@link #getTemplate template}, or `null`. */ getTemplate(): sap.ui.core.ID | null; /** * Returns the instance specific renderer for an anonymous template control. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the instance specific renderer function */ getTemplateRenderer(): Function; /** * checks whether the control is inline or not * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns flag, whether to control is inline or not */ isInline(): boolean; /** * Sets a new value for property {@link #getContext context}. * * The context is a data object. It can be used for default template expressions. A change of the context * object leads to a re-rendering whereas a change of a nested property of the context object doesn't. By * default the context is an empty object. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setContext( /** * New value for property `context` */ oContext?: object ): this; /** * Sets the associated {@link #getTemplate template}. * * * @returns Reference to `this` in order to allow method chaining */ setTemplate( /** * ID of an element which becomes the new target of this template association; alternatively, an element * instance may be given */ oTemplate: sap.ui.core.ID | sap.ui.core.tmpl.Template ): this; /** * Sets the instance specific renderer for an anonymous template control. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns `this` to allow method chaining */ setTemplateRenderer( /** * the instance specific renderer function */ fnRenderer: Function ): this; } /** * Event object of the TemplateControl#afterRendering event. */ type TemplateControl$AfterRenderingEvent = sap.ui.base.Event< TemplateControl$AfterRenderingEventParameters, TemplateControl >; /** * Event object of the TemplateControl#beforeRendering event. */ type TemplateControl$BeforeRenderingEvent = sap.ui.base.Event< TemplateControl$BeforeRenderingEventParameters, TemplateControl >; } namespace UIArea { /** * Registry of all `sap.ui.core.UIArea`s that currently exist. * * @since 1.107 * @deprecated As of version 1.120. without a replacement. Applications should not be interested in the * set of `UIArea`s. They should only assign controls to them, by using {@link sap.ui.core.Control.prototype.placeAt Control.prototype.placeAt } * or use the API of a `UIArea` as reachable via {@link sap.ui.core.Control.prototype.getUIArea Control.prototype.getUIArea}. */ interface registry { /** * Number of existing UIAreas. * * @deprecated As of version 1.120. without a replacement. Applications should not be interested in the * set of `UIArea`s. They should only assign controls to them, by using {@link sap.ui.core.Control.prototype.placeAt Control.prototype.placeAt } * or use the API of a `UIArea` as reachable via {@link sap.ui.core.Control.prototype.getUIArea Control.prototype.getUIArea}. */ size: int; /** * Return an object with all instances of `sap.ui.core.UIArea`, keyed by their ID. * * Each call creates a new snapshot object. Depending on the size of the UI, this operation therefore might * be expensive. Consider to use the `forEach` or `filter` method instead of executing similar operations * on the returned object. * * **Note**: The returned object is created by a call to `Object.create(null)`, and therefore lacks all * methods of `Object.prototype`, e.g. `toString` etc. * * @deprecated As of version 1.120. without a replacement. Applications should not be interested in the * set of all `UIArea`s. They should only assign controls to them, by using {@link sap.ui.core.Control.prototype.placeAt Control.prototype.placeAt } * or use the API of a `UIArea` as reachable via {@link sap.ui.core.Control.prototype.getUIArea Control.prototype.getUIArea}. * * @returns Object with all UIAreas, keyed by their ID */ all(): Record; /** * Returns an array with UIAreas for which the given `callback` returns a value that coerces to `true`. * * The expected signature of the callback is * ```javascript * * function callback(oUIArea, sID) * ``` * where `oUIArea` is the currently visited UIArea instance and `sID` is the ID of that instance. * * If UIAreas are created or destroyed within the `callback`, then the behavior is not specified. Newly * added objects might or might not be visited. When an UIArea is destroyed or the root node is changed * during the filtering and was not visited yet, it might or might not be visited. As the behavior for such * concurrent modifications is not specified, it may change in newer releases. * * If a `thisArg` is given, it will be provided as `this` context when calling `callback`. The `this` value * that the implementation of `callback` sees, depends on the usual resolution mechanism. E.g. when `callback` * was bound to some context object, that object wins over the given `thisArg`. * * This function returns an array with all UIAreas matching the given predicate. The order of the UIAreas * in the array is not specified and might change between calls (over time and across different versions * of UI5). * * @deprecated As of version 1.120. without a replacement. Applications should not be interested in the * set of all `UIArea`s. They should only assign controls to them, by using {@link sap.ui.core.Control.prototype.placeAt Control.prototype.placeAt } * or use the API of a `UIArea` as reachable via {@link sap.ui.core.Control.prototype.getUIArea Control.prototype.getUIArea}. * * @returns Array of UIAreas matching the predicate; order is undefined and might change in newer versions * of UI5 */ filter( /** * predicate against which each UIArea is tested */ callback: (p1: sap.ui.core.UIArea, p2: sap.ui.core.ID) => boolean, /** * context object to provide as `this` in each call of `callback` */ thisArg?: Object ): sap.ui.core.UIArea[]; /** * Calls the given `callback` for each UIArea. * * The expected signature of the callback is * ```javascript * * function callback(oUIArea, sID) * ``` * where `oUIArea` is the currently visited UIArea instance and `sID` is the ID of that instance. * * The order in which the callback is called for UIAreas is not specified and might change between calls * (over time and across different versions of UI5). * * If UIAreas are created or destroyed within the `callback`, then the behavior is not specified. Newly * added objects might or might not be visited. When an UIArea is destroyed or the root node is changed * during the filtering and was not visited yet, it might or might not be visited. As the behavior for such * concurrent modifications is not specified, it may change in newer releases. * * If a `thisArg` is given, it will be provided as `this` context when calling `callback`. The `this` value * that the implementation of `callback` sees, depends on the usual resolution mechanism. E.g. when `callback` * was bound to some context object, that object wins over the given `thisArg`. * * @deprecated As of version 1.120. without a replacement. Applications should not be interested in the * set of all `UIArea`s. They should only assign controls to them, by using {@link sap.ui.core.Control.prototype.placeAt Control.prototype.placeAt } * or use the API of a `UIArea` as reachable via {@link sap.ui.core.Control.prototype.getUIArea Control.prototype.getUIArea}. */ forEach( /** * Function to call for each UIArea */ callback: (p1: sap.ui.core.UIArea, p2: sap.ui.core.ID) => void, /** * Context object to provide as `this` in each call of `callback` */ thisArg?: Object ): void; /** * Retrieves an UIArea by its ID. * * When the ID is `null` or `undefined` or when there's no UIArea with the given ID, then `undefined` is * returned. * * @deprecated As of version 1.120. without a replacement. Applications should not be interested in a certain * `UIArea`. They should only assign controls to them, by using {@link sap.ui.core.Control.prototype.placeAt Control.prototype.placeAt } * or use the API of a `UIArea` as reachable via {@link sap.ui.core.Control.prototype.getUIArea Control.prototype.getUIArea}. * * @returns UIArea with the given ID or `undefined` */ get( /** * ID of the UIArea to retrieve */ id: sap.ui.core.ID ): sap.ui.core.UIArea | undefined; } } namespace UIComponent { /** * An object containing the routing-relevant configurations, routes, targets, config. * * Example for a config:: * * * ```javascript * * routing: { * "routes": [ * { * "name": "welcome", * // If the URL has no hash e.g.: index.html or index.html# , this route will be matched. * "pattern": "", * // Displays the target called "welcome" specified in metadata.routing.targets.welcome. * "target": "welcome" * }, * { * "name": "product", * "pattern": "Product/{id}", * "target": "product" * } * ], * // Default values for targets * "config": { * // For a detailed documentation of these parameters have a look at the sap.ui.core.routing.Targets documentation * "viewType": "XML", * "controlId": "App", * "controlAggregation": "pages", * "viewNamespace": "myApplication.namespace", * // If you are using the mobile library, you have to use an sap.m.routing.Router, to get support for * // the controls sap.m.App, sap.m.SplitApp, sap.m.NavContainer and sap.m.SplitContainer. * "routerClass": "sap.m.routing.Router", * // What happens if no route matches the hash? * "bypassed": { * // the not found target gets displayed * "target": "notFound" * } * }, * "targets": { * "welcome": { * // Referenced by the route "welcome" * "viewName": "Welcome", * "viewLevel": 0 * }, * "product": { * // Referenced by the route "Product" * "viewName": "Product", * "viewLevel": 1 * }, * "notFound": { * // Referenced by the bypassed section of the config * "viewName": "NotFound" * } * } * } * * ``` */ type RoutingMetadata = { /** * An array containing the routes that should be added to the router. See {@link sap.ui.core.routing.Route } * for the allowed properties. */ routes?: | sap.ui.core.routing.$RouteSettings[] | Record; /** * Since 1.16. An object containing default values used for routes and targets. See {@link sap.ui.core.routing.Router#constructor } * and {@link sap.ui.core.routing.Targets} for more documentation. */ config?: { /** * Since 1.20. The qualified name (in dot notation) or the constructor of the router class that should be * used for the component's router. If you are using an own router extension, it has to be required before * the constructor of the component is invoked. If you use `sap.m.routing.Router`, the component will automatically * create an {@link sap.m.routing.Targets} instance. If you pass a function, it has to be the constructor * of a class that extends a router. */ routerClass?: string | Function; /** * Since 1.28.1. The qualified name (in dot notation) or the constructor of the `Targets` class that should * be used by the component's router. If you are using an own `Targets` extension, it has to be required * before the constructor of the component is invoked. If you define routes in your routing section, this * parameter will be ignored and the `Targets` instance of the router will be taken, see {@link sap.ui.core.routing.Router#getTargets}. */ targetsClass?: string | Function; /** * By default, the root view will be set to the ID of the view returned by the {@link sap.ui.core.UIComponent#getRootView } * function. You should not set this parameter if you create a view with the UIComponent. */ rootView?: string; }; }; } namespace util { namespace MockServer { /** * Methods that can be used to respond to a request. */ interface Response { __implements__sap_ui_core_util_MockServer_Response: boolean; /** * Responds to the incoming request with the given `iStatusCode`, `mHeaders` and `sBody`. */ respond( /** * HTTP status code to send with the response */ StatusCode?: int, /** * HTTP headers to send with the response */ mHeaders?: Record, /** * A string that will be sent as response body */ sBody?: string ): void; /** * Convenience variant of {@link #respond} which allows to send the content of an external resource as response. * * This method first synchronously fetches the given `sFileUrl`. Depending on the extension and path of * the `sFileUrl`, it propagates the received response body to {@link #respondJSON}, {@link #respondXML } * or {@link #respond}, using the given `iStatus` and `mHeaders`. * * The status code and headers of the received response are ignored. In particular, the `Content-Type` header * is not used for the mock server's response. */ respondFile( /** * HTTP status code to send with the response */ iStatusCode: int, /** * HTTP Headers to send with the response */ mHeaders: Record, /** * URL to get the response body from */ sFileUrl: string ): void; /** * Convenience variant of {@link #respond} which allows to send the content of an external resource as response. * * This method first synchronously fetches the given `sFileUrl`. Depending on the extension and path of * the `sFileUrl`, it propagates the received response body to {@link #respondJSON}, {@link #respondXML } * or {@link #respond}, using the given `iStatus` and `mHeaders`. * * The status code and headers of the received response are ignored. In particular, the `Content-Type` header * is not used for the mock server's response. */ respondFile( /** * HTTP status code to send with the response */ iStatusCode: int, /** * URL to get the response body from */ sFileUrl: string ): void; /** * Convenience variant of {@link #respond} which allows to send the content of an external resource as response. * * This method first synchronously fetches the given `sFileUrl`. Depending on the extension and path of * the `sFileUrl`, it propagates the received response body to {@link #respondJSON}, {@link #respondXML } * or {@link #respond}, using the given `iStatus` and `mHeaders`. * * The status code and headers of the received response are ignored. In particular, the `Content-Type` header * is not used for the mock server's response. */ respondFile( /** * HTTP Headers to send with the response */ mHeaders: Record, /** * URL to get the response body from */ sFileUrl: string ): void; /** * Convenience variant of {@link #respond} which allows to send the content of an external resource as response. * * This method first synchronously fetches the given `sFileUrl`. Depending on the extension and path of * the `sFileUrl`, it propagates the received response body to {@link #respondJSON}, {@link #respondXML } * or {@link #respond}, using the given `iStatus` and `mHeaders`. * * The status code and headers of the received response are ignored. In particular, the `Content-Type` header * is not used for the mock server's response. */ respondFile( /** * URL to get the response body from */ sFileUrl: string ): void; /** * Convenience variant of {@link #respond} which simplifies sending a JSON response. * * The response content `vBody` can either be given as a string, which is then assumed to be in JSON format. * Or it can be any JSON-stringifiable value which then will be converted to a string using `JSON.stringify`. * If no `vBody` is given, an empty response will be sent. * * If no `Content-Type` header is given, it will be set to `application/json`. */ respondJSON( /** * HTTP status code to send with the response */ iStatusCode?: int, /** * HTTP Headers to send with the response */ mHeaders?: Record, /** * A valid JSON-string or a JSON-stringifiable object that should be sent as response body */ vBody?: object | string | any[] | number | boolean ): void; /** * Convenience variant of {@link #respond} which simplifies sending an XML response. * * If no `Content-Type` header is given, it will be set to `application/xml`. */ respondXML( /** * HTTP status code to send with the response */ iStatusCode?: int, /** * HTTP Headers to send with the response */ mHeaders?: Record, /** * XML string to send as response body */ sXmlString?: string ): void; } /** * Enum for the method. * * This enum is part of the 'sap/ui/core/util/MockServer' module export and must be accessed by the property * 'HTTPMETHOD'. */ enum HTTPMETHOD { /** * HTTP DELETE method. */ DELETE = "DELETE", /** * HTTP GET method. */ GET = "GET", /** * HTTP MERGE method. */ MERGE = "MERGE", /** * HTTP PATCH method. */ PATCH = "PATCH", /** * HTTP POST method. */ POST = "POST", /** * HTTP PUT method. */ PUT = "PUT", } type RequestHandler = { /** * Any HTTP verb */ method: sap.ui.core.util.MockServer.HTTPMETHOD; /** * A string path is converted to a regular expression, so it can contain normal regular expression syntax. * * All regular expression groups are forwarded as arguments to the `response` function. In addition to this, * parameters can be written in this notation: `:param`. These placeholders will be replaced by regular * expression groups. */ path: string | RegExp; /** * A response handler function that will be called when an incoming request matches `method` and `path`. * The first parameter of the handler will be a `Response` object which can be used to respond on the request. * A truthy return value indicates that the request handler has processed the request, meaning that no further * request handlers are called. A falsy return value means that further request handlers with a matching * path are called. */ response: ( p1: sap.ui.core.util.MockServer.Response, p2: any ) => boolean; }; } namespace XMLPreprocessor { /** * Context interface provided by XML template processing as an additional first argument to any formatter * function which opts in to this mechanism. Candidates for such formatter functions are all those used * in binding expressions which are evaluated during XML template processing, including those used inside * template instructions like ``. The formatter function needs to be marked with a property * `requiresIContext = true` to express that it requires this extended signature (compared to ordinary formatter * functions). The usual arguments are provided after the first one (currently: the raw value from the model). * * This interface provides callback functions to access the model and path which are needed to process OData * V4 annotations. It initially offers a subset of methods from {@link sap.ui.model.Context} so that formatters * might also be called with a context object for convenience, e.g. outside of XML template processing (see * below for an exception to this rule). * * **Example:** Suppose you have a formatter function called "foo" like below and it is used within an XML * template like ``. In this case `foo` is called * with arguments `oInterface, vRawValue` such that `oInterface.getModel().getObject(oInterface.getPath()) * === vRawValue` holds. * ```javascript * * window.foo = function (oInterface, vRawValue) { * //TODO ... * }; * window.foo.requiresIContext = true; * ``` * * * **Composite Binding Examples:** Suppose you have the same formatter function and it is used in a composite * binding like ``. * In this case `oInterface.getPath()` refers to ".../Label" in the 1st call and ".../Value" in the 2nd * call. This means each formatter call knows which part of the composite binding it belongs to and behaves * just as if it was an ordinary binding. * * Suppose your formatter is not used within a part of the composite binding, but at the root of the composite * binding in order to aggregate all parts like ` `. In this case `oInterface.getPath(0)` refers to ".../Label" and `oInterface.getPath(1)` * refers to ".../Value". This means, the root formatter can access the ith part of the composite binding * at will (since 1.31.0); see also {@link #.getInterface getInterface}. The function `foo` is called with * arguments such that ` oInterface.getModel(i).getObject(oInterface.getPath(i)) === arguments[i + 1]` holds. * * To distinguish those two use cases, just check whether `oInterface.getModel() === undefined`, in which * case the formatter is called on root level of a composite binding. To find out the number of parts, probe * for the smallest non-negative integer where `oInterface.getModel(i) === undefined`. This additional functionality * is, of course, not available from {@link sap.ui.model.Context}, i.e. such formatters MUST be called with * an instance of this context interface. * * @since 1.27.1 */ interface IContext { __implements__sap_ui_core_util_XMLPreprocessor_IContext: boolean; /** * Returns a context interface for the indicated part in case of the root formatter of a composite binding. * The new interface provides access to the original settings, but only to the model and path of the indicated * part: * ```javascript * * this.getInterface(i).getSetting(sName) === this.getSetting(sName); * this.getInterface(i).getModel() === this.getModel(i); * this.getInterface(i).getPath() === this.getPath(i); * ``` * * * If a path is given, the new interface points to the resolved path as follows: * ```javascript * * this.getInterface(i, "foo/bar").getPath() === this.getPath(i) + "/foo/bar"; * this.getInterface(i, "/absolute/path").getPath() === "/absolute/path"; * ``` * A formatter which is not at the root level of a composite binding can also provide a path, but must * not provide an index: * ```javascript * * this.getInterface("foo/bar").getPath() === this.getPath() + "/foo/bar"; * this.getInterface("/absolute/path").getPath() === "/absolute/path"; * ``` * Note that at least one argument must be present. * * @since 1.31.0 * * @returns the context interface related to the indicated part */ getInterface( /** * index of part in case of the root formatter of a composite binding */ iPart?: number, /** * a path, interpreted relative to `this.getPath(iPart)` */ sPath?: string ): sap.ui.core.util.XMLPreprocessor.IContext; /** * Returns a context interface for the indicated part in case of the root formatter of a composite binding. * The new interface provides access to the original settings, but only to the model and path of the indicated * part: * ```javascript * * this.getInterface(i).getSetting(sName) === this.getSetting(sName); * this.getInterface(i).getModel() === this.getModel(i); * this.getInterface(i).getPath() === this.getPath(i); * ``` * * * If a path is given, the new interface points to the resolved path as follows: * ```javascript * * this.getInterface(i, "foo/bar").getPath() === this.getPath(i) + "/foo/bar"; * this.getInterface(i, "/absolute/path").getPath() === "/absolute/path"; * ``` * A formatter which is not at the root level of a composite binding can also provide a path, but must * not provide an index: * ```javascript * * this.getInterface("foo/bar").getPath() === this.getPath() + "/foo/bar"; * this.getInterface("/absolute/path").getPath() === "/absolute/path"; * ``` * Note that at least one argument must be present. * * @since 1.31.0 * * @returns the context interface related to the indicated part */ getInterface( /** * a path, interpreted relative to `this.getPath(iPart)` */ sPath?: string ): sap.ui.core.util.XMLPreprocessor.IContext; /** * Returns the model related to the current formatter call. * * * @returns the model related to the current formatter call, or (since 1.31.0) `undefined` in case of a * root formatter if no `iPart` is given or if `iPart` is out of range */ getModel( /** * index of part in case of the root formatter of a composite binding (since 1.31.0) */ iPart?: number ): sap.ui.model.Model | undefined; /** * Returns the absolute path related to the current formatter call. * * * @returns the absolute path related to the current formatter call, or (since 1.31.0) `undefined` in case * of a root formatter if no `iPart` is given or if `iPart` is out of range */ getPath( /** * index of part in case of the root formatter of a composite binding (since 1.31.0) */ iPart?: number ): string | undefined; /** * Returns the value of the setting with the given name which was provided to the XML template processing. * * * @returns the value of the setting */ getSetting( /** * the name of the setting */ sName: string ): any; } } /** * Describes the settings that can be provided to the Export constructor. * * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ interface $ExportSettings extends sap.ui.core.$ControlSettings { /** * Type that generates the content. */ exportType?: sap.ui.core.util.ExportType; /** * Columns for the Export. */ columns?: | sap.ui.core.util.ExportColumn[] | sap.ui.core.util.ExportColumn | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; /** * Rows of the Export. */ rows?: | sap.ui.core.util.ExportRow[] | sap.ui.core.util.ExportRow | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; } /** * Describes the settings that can be provided to the ExportCell constructor. * * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ interface $ExportCellSettings extends sap.ui.core.$ElementSettings { /** * Cell content. */ content?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; } /** * Describes the settings that can be provided to the ExportColumn constructor. * * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ interface $ExportColumnSettings extends sap.ui.base.$ManagedObjectSettings { /** * Column name. */ name?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Cell template for column. */ template?: sap.ui.core.util.ExportCell; } /** * Describes the settings that can be provided to the ExportRow constructor. * * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ interface $ExportRowSettings extends sap.ui.base.$ManagedObjectSettings { /** * Cells for the Export. */ cells?: | sap.ui.core.util.ExportCell[] | sap.ui.core.util.ExportCell | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; } /** * Describes the settings that can be provided to the ExportType constructor. * * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ interface $ExportTypeSettings extends sap.ui.base.$ManagedObjectSettings { /** * File extension. */ fileExtension?: | string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * MIME type. */ mimeType?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Charset. */ charset?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Whether to prepend an unicode byte order mark when saving as a file (only applies for utf-8 charset). */ byteOrderMark?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; } /** * Describes the settings that can be provided to the ExportTypeCSV constructor. * * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ interface $ExportTypeCSVSettings extends sap.ui.core.util.$ExportTypeSettings { /** * Separator char. * * Value needs to be exactly one character or empty for default. */ separatorChar?: | string | sap.ui.base.ManagedObject.PropertyBindingInfo; } /** * Describes the settings that can be provided to the MockServer constructor. */ interface $MockServerSettings extends sap.ui.base.$ManagedObjectSettings { /** * Getter for property `rootUri`. Has to be relative and requires a trailing '/'. It also needs to match * the URI set in OData/JSON models or simple XHR calls in order for the mock server to intercept them. * * Default value is empty/`undefined`. Must end with a a trailing slash ("/"). */ rootUri?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Whether or not the requests performed should be recorded (stored). This could be memory intense if each * request is recorded. For unit testing purposes it should be set to `true` to compare requests performed * otherwise this flag should be set to `false` e.g. for demonstration/app purposes. */ recordRequests?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Getter for property `requests`. * * Default value is `[]` */ requests?: | object[] | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; } /** * Utility class to handle files. * * @since 1.22.0 */ interface File { /** * Triggers a download / save action of the given file. */ save( /** * file content */ sData: string, /** * file name */ sFileName: string, /** * file extension */ sFileExtension: string, /** * file mime-type */ sMimeType: string, /** * file charset */ sCharset: string, /** * Whether to prepend a unicode byte order mark (only applies for utf-8 charset). Default is `false` except * when `sFileExtension` === 'csv' and `sCharset` === 'utf-8' it is `true` (compatibility reasons). */ bByteOrderMark?: boolean ): void; } /** * The XML pre-processor for template instructions in XML views. * * @since 1.27.1 */ interface XMLPreprocessor {} /** * Export provides the possibility to generate a list of data in a specific format / type, e.g. CSV to use * it in other programs / applications. * * @since 1.22.0 * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ class Export extends sap.ui.core.Control { /** * Constructor for a new Export. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportSettings ); /** * Constructor for a new Export. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportSettings ); /** * Creates a new subclass of class sap.ui.core.util.Export with name `sClassName` and enriches it with the * information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.Control.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.util.Export. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Adds some column to the aggregation {@link #getColumns columns}. * * * @returns Reference to `this` in order to allow method chaining */ addColumn( /** * The column to add; if empty, nothing is inserted */ oColumn: sap.ui.core.util.ExportColumn ): this; /** * Adds some row to the aggregation {@link #getRows rows}. * * * @returns Reference to `this` in order to allow method chaining */ addRow( /** * The row to add; if empty, nothing is inserted */ oRow: sap.ui.core.util.ExportRow ): this; /** * Binds aggregation {@link #getColumns columns} to model data. * * See {@link sap.ui.base.ManagedObject#bindAggregation ManagedObject.bindAggregation} for a detailed description * of the possible properties of `oBindingInfo`. * * * @returns Reference to `this` in order to allow method chaining */ bindColumns( /** * The binding information */ oBindingInfo: sap.ui.base.ManagedObject.AggregationBindingInfo ): this; /** * Binds aggregation {@link #getRows rows} to model data. * * See {@link sap.ui.base.ManagedObject#bindAggregation ManagedObject.bindAggregation} for a detailed description * of the possible properties of `oBindingInfo`. * * * @returns Reference to `this` in order to allow method chaining */ bindRows( /** * The binding information */ oBindingInfo: sap.ui.base.ManagedObject.AggregationBindingInfo ): this; /** * Destroys all the columns in the aggregation {@link #getColumns columns}. * * * @returns Reference to `this` in order to allow method chaining */ destroyColumns(): this; /** * Destroys the exportType in the aggregation {@link #getExportType exportType}. * * * @returns Reference to `this` in order to allow method chaining */ destroyExportType(): this; /** * Destroys all the rows in the aggregation {@link #getRows rows}. * * * @returns Reference to `this` in order to allow method chaining */ destroyRows(): this; /** * Generates the file content and returns a Promise with the instance as context (this). * The promise will be resolved with the generated content as a string. * * **Please note: The return value was changed from jQuery Promises to standard ES6 Promises. jQuery * specific Promise methods ('done', 'fail', 'always', 'pipe' and 'state') are still available but should * not be used. Please use only the standard methods 'then' and 'catch'!** * * * @returns Promise object */ generate(): Promise; /** * Gets content of aggregation {@link #getColumns columns}. * * Columns for the Export. */ getColumns(): sap.ui.core.util.ExportColumn[]; /** * Gets content of aggregation {@link #getExportType exportType}. * * Type that generates the content. */ getExportType(): sap.ui.core.util.ExportType; /** * Gets content of aggregation {@link #getRows rows}. * * Rows of the Export. */ getRows(): sap.ui.core.util.ExportRow[]; /** * Checks for the provided `sap.ui.core.util.ExportColumn` in the aggregation {@link #getColumns columns}. * and returns its index if found or -1 otherwise. * * * @returns The index of the provided control in the aggregation if found, or -1 otherwise */ indexOfColumn( /** * The column whose index is looked for */ oColumn: sap.ui.core.util.ExportColumn ): int; /** * Checks for the provided `sap.ui.core.util.ExportRow` in the aggregation {@link #getRows rows}. and returns * its index if found or -1 otherwise. * * * @returns The index of the provided control in the aggregation if found, or -1 otherwise */ indexOfRow( /** * The row whose index is looked for */ oRow: sap.ui.core.util.ExportRow ): int; /** * Inserts a column into the aggregation {@link #getColumns columns}. * * * @returns Reference to `this` in order to allow method chaining */ insertColumn( /** * The column to insert; if empty, nothing is inserted */ oColumn: sap.ui.core.util.ExportColumn, /** * The `0`-based index the column should be inserted at; for a negative value of `iIndex`, the column is * inserted at position 0; for a value greater than the current size of the aggregation, the column is inserted * at the last position */ iIndex: int ): this; /** * Inserts a row into the aggregation {@link #getRows rows}. * * * @returns Reference to `this` in order to allow method chaining */ insertRow( /** * The row to insert; if empty, nothing is inserted */ oRow: sap.ui.core.util.ExportRow, /** * The `0`-based index the row should be inserted at; for a negative value of `iIndex`, the row is inserted * at position 0; for a value greater than the current size of the aggregation, the row is inserted at the * last position */ iIndex: int ): this; /** * Removes all the controls from the aggregation {@link #getColumns columns}. * * Additionally, it unregisters them from the hosting UIArea. * * * @returns An array of the removed elements (might be empty) */ removeAllColumns(): sap.ui.core.util.ExportColumn[]; /** * Removes all the controls from the aggregation {@link #getRows rows}. * * Additionally, it unregisters them from the hosting UIArea. * * * @returns An array of the removed elements (might be empty) */ removeAllRows(): sap.ui.core.util.ExportRow[]; /** * Removes a column from the aggregation {@link #getColumns columns}. * * * @returns The removed column or `null` */ removeColumn( /** * The column to remove or its index or id */ vColumn: int | string | sap.ui.core.util.ExportColumn ): sap.ui.core.util.ExportColumn | null; /** * Removes a row from the aggregation {@link #getRows rows}. * * * @returns The removed row or `null` */ removeRow( /** * The row to remove or its index or id */ vRow: int | string | sap.ui.core.util.ExportRow ): sap.ui.core.util.ExportRow | null; /** * Generates the file content, triggers a download / save action and returns a Promise with the instance * as context (this). * The promise will be resolved with the generated content as a string. **For information about browser * support, see `sap.ui.core.util.File.save`** * * **Please note: The return value was changed from jQuery Promises to standard ES6 Promises. jQuery * specific Promise methods ('done', 'fail', 'always', 'pipe' and 'state') are still available but should * not be used. Please use only the standard methods 'then' and 'catch'!** * * * @returns Promise object */ saveFile( /** * The file name */ sFileName?: string ): Promise; /** * Sets the aggregated {@link #getExportType exportType}. * * * @returns Reference to `this` in order to allow method chaining */ setExportType( /** * The exportType to set */ oExportType: sap.ui.core.util.ExportType ): this; /** * Unbinds aggregation {@link #getColumns columns} from model data. * * * @returns Reference to `this` in order to allow method chaining */ unbindColumns(): this; /** * Unbinds aggregation {@link #getRows rows} from model data. * * * @returns Reference to `this` in order to allow method chaining */ unbindRows(): this; } /** * Contains content that can be used to export data. Used in {@link sap.ui.core.util.ExportColumn ExportColumn } * / {@link sap.ui.core.util.Export Export}. * * @since 1.22.0 * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ class ExportCell extends sap.ui.core.Element { /** * Constructor for a new ExportCell. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportCellSettings ); /** * Constructor for a new ExportCell. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportCellSettings ); /** * Creates a new subclass of class sap.ui.core.util.ExportCell with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.Element.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.util.ExportCell. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.ElementMetadata; /** * Gets current value of property {@link #getContent content}. * * Cell content. * * * @returns Value of property `content` */ getContent(): string; /** * Sets a new value for property {@link #getContent content}. * * Cell content. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setContent( /** * New value for property `content` */ sContent: string ): this; } /** * Can have a name and a cell template. * * @since 1.22.0 * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ class ExportColumn extends sap.ui.base.ManagedObject { /** * Constructor for a new ExportColumn. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportColumnSettings ); /** * Constructor for a new ExportColumn. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportColumnSettings ); /** * Creates a new subclass of class sap.ui.core.util.ExportColumn with name `sClassName` and enriches it * with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.ManagedObject.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.util.ExportColumn. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.ManagedObjectMetadata; /** * Destroys the template in the aggregation {@link #getTemplate template}. * * * @returns Reference to `this` in order to allow method chaining */ destroyTemplate(): this; /** * Gets current value of property {@link #getName name}. * * Column name. * * * @returns Value of property `name` */ getName(): string; /** * Gets content of aggregation {@link #getTemplate template}. * * Cell template for column. */ getTemplate(): sap.ui.core.util.ExportCell; /** * Sets a new value for property {@link #getName name}. * * Column name. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setName( /** * New value for property `name` */ sName: string ): this; /** * Sets the aggregated {@link #getTemplate template}. * * * @returns Reference to `this` in order to allow method chaining */ setTemplate( /** * The template to set */ oTemplate: sap.ui.core.util.ExportCell ): this; } /** * Internally used in {@link sap.ui.core.util.Export Export}. * * @since 1.22.0 * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ class ExportRow extends sap.ui.base.ManagedObject { /** * Constructor for a new ExportRow. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportRowSettings ); /** * Constructor for a new ExportRow. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportRowSettings ); /** * Creates a new subclass of class sap.ui.core.util.ExportRow with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.ManagedObject.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.util.ExportRow. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.ManagedObjectMetadata; /** * Adds some cell to the aggregation {@link #getCells cells}. * * * @returns Reference to `this` in order to allow method chaining */ addCell( /** * The cell to add; if empty, nothing is inserted */ oCell: sap.ui.core.util.ExportCell ): this; /** * Destroys all the cells in the aggregation {@link #getCells cells}. * * * @returns Reference to `this` in order to allow method chaining */ destroyCells(): this; /** * Gets content of aggregation {@link #getCells cells}. * * Cells for the Export. */ getCells(): sap.ui.core.util.ExportCell[]; /** * Checks for the provided `sap.ui.core.util.ExportCell` in the aggregation {@link #getCells cells}. and * returns its index if found or -1 otherwise. * * * @returns The index of the provided control in the aggregation if found, or -1 otherwise */ indexOfCell( /** * The cell whose index is looked for */ oCell: sap.ui.core.util.ExportCell ): int; /** * Inserts a cell into the aggregation {@link #getCells cells}. * * * @returns Reference to `this` in order to allow method chaining */ insertCell( /** * The cell to insert; if empty, nothing is inserted */ oCell: sap.ui.core.util.ExportCell, /** * The `0`-based index the cell should be inserted at; for a negative value of `iIndex`, the cell is inserted * at position 0; for a value greater than the current size of the aggregation, the cell is inserted at * the last position */ iIndex: int ): this; /** * Removes all the controls from the aggregation {@link #getCells cells}. * * Additionally, it unregisters them from the hosting UIArea. * * * @returns An array of the removed elements (might be empty) */ removeAllCells(): sap.ui.core.util.ExportCell[]; /** * Removes a cell from the aggregation {@link #getCells cells}. * * * @returns The removed cell or `null` */ removeCell( /** * The cell to remove or its index or id */ vCell: int | string | sap.ui.core.util.ExportCell ): sap.ui.core.util.ExportCell | null; } /** * Base export type. Subclasses can be used for {@link sap.ui.core.util.Export Export}. * * @since 1.22.0 * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ class ExportType extends sap.ui.base.ManagedObject { /** * Constructor for a new ExportType. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportTypeSettings ); /** * Constructor for a new ExportType. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportTypeSettings ); /** * Creates a new subclass of class sap.ui.core.util.ExportType with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.ManagedObject.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.util.ExportType. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.ManagedObjectMetadata; /** * Handles the generation process of the file. * * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns content */ _generate( /** * export instance */ oExport: sap.ui.core.util.Export ): string; /** * Creates a cell "generator" (inspired by ES6 Generators) * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns generator */ cellGenerator(): Generator; /** * Creates a column "generator" (inspired by ES6 Generators) * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns generator */ columnGenerator(): Generator; /** * Generates the file content. * Should be implemented by the individual types! * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns content */ generate(): string; /** * Gets current value of property {@link #getByteOrderMark byteOrderMark}. * * Whether to prepend an unicode byte order mark when saving as a file (only applies for utf-8 charset). * * Default value is `undefined`. * * * @returns Value of property `byteOrderMark` */ getByteOrderMark(): boolean; /** * Gets current value of property {@link #getCharset charset}. * * Charset. * * * @returns Value of property `charset` */ getCharset(): string; /** * Returns the number of columns. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns count */ getColumnCount(): int; /** * Gets current value of property {@link #getFileExtension fileExtension}. * * File extension. * * * @returns Value of property `fileExtension` */ getFileExtension(): string; /** * Gets current value of property {@link #getMimeType mimeType}. * * MIME type. * * * @returns Value of property `mimeType` */ getMimeType(): string; /** * Returns the number of rows. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns count */ getRowCount(): int; /** * Creates a row "generator" (inspired by ES6 Generators) * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns generator */ rowGenerator(): Generator; /** * Sets a new value for property {@link #getByteOrderMark byteOrderMark}. * * Whether to prepend an unicode byte order mark when saving as a file (only applies for utf-8 charset). * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * Default value is `undefined`. * * * @returns Reference to `this` in order to allow method chaining */ setByteOrderMark( /** * New value for property `byteOrderMark` */ bByteOrderMark?: boolean ): this; /** * Sets a new value for property {@link #getCharset charset}. * * Charset. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setCharset( /** * New value for property `charset` */ sCharset: string ): this; /** * Sets a new value for property {@link #getFileExtension fileExtension}. * * File extension. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setFileExtension( /** * New value for property `fileExtension` */ sFileExtension: string ): this; /** * Sets a new value for property {@link #getMimeType mimeType}. * * MIME type. * * When called with a value of `null` or `undefined`, the default value of the property will be restored. * * * @returns Reference to `this` in order to allow method chaining */ setMimeType( /** * New value for property `mimeType` */ sMimeType: string ): this; } /** * CSV export type. Can be used for {@link sap.ui.core.util.Export Export}. * * Please note that there could be an issue with the separator char depending on the user's system language * in some programs such as Microsoft Excel. To prevent those issues use the data-import functionality which * enables the possibility to explicitly set the separator char that should be used. This way the content * will be displayed correctly. * * Potential formulas (cell data starts with one of = + - @) will be escaped by prepending a single quote. * As the export functionality is intended to be used with actual (user) data there is no reason to allow * formulas. * * The maximum cell length is limited to 32,760 characters. In case any string exceeds this limit, it will * be cut off. * * @since 1.22.0 * @deprecated As of version 1.73. replaced by the export functionality of the `sap.ui.export` library. */ class ExportTypeCSV extends sap.ui.core.util.ExportType { /** * Constructor for a new ExportTypeCSV. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportTypeCSVSettings ); /** * Constructor for a new ExportTypeCSV. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new control, generated automatically if no id is given */ sId?: string, /** * initial settings for the new control */ mSettings?: sap.ui.core.util.$ExportTypeCSVSettings ); /** * Creates a new subclass of class sap.ui.core.util.ExportTypeCSV with name `sClassName` and enriches it * with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.util.ExportType.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.util.ExportTypeCSV. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.ManagedObjectMetadata; /** * Generates the file content. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns content */ generate(): string; /** * Gets current value of property {@link #getSeparatorChar separatorChar}. * * Separator char. * * Value needs to be exactly one character or empty for default. * * Default value is `','`. * * * @returns Value of property `separatorChar` */ getSeparatorChar(): string; /** * Setter for property `separatorChar`. * * Value needs to be exactly one character or empty for default. Default value is ','. * * * @returns `this` to allow method chaining */ setSeparatorChar( /** * new value for property `separatorChar` */ sSeparatorChar: string ): this; } /** * Class to mock http requests made to a remote server supporting the OData V2 REST protocol. */ class MockServer extends sap.ui.base.ManagedObject { /** * Creates a mocked server. This helps to mock some back-end calls, e.g. for OData V2/JSON Models or simple * XHR calls, without changing the application code. This class can also be used for qunit tests. * * **Note:** Not all features of mock and all properties are supported. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * optional map/JSON-object with initial property values, aggregated objects etc. for the new object */ mSettings?: sap.ui.core.util.$MockServerSettings ); /** * Creates a mocked server. This helps to mock some back-end calls, e.g. for OData V2/JSON Models or simple * XHR calls, without changing the application code. This class can also be used for qunit tests. * * **Note:** Not all features of mock and all properties are supported. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * id for the new server object; generated automatically if no non-empty id is given Note: this can be omitted, * no matter whether `mSettings` will be given or not! */ sId?: string, /** * optional map/JSON-object with initial property values, aggregated objects etc. for the new object */ mSettings?: sap.ui.core.util.$MockServerSettings ); /** * Global configuration of all mock servers. */ static config( /** * the configuration object. */ mConfig: { /** * If set true, all mock servers will respond automatically. If set false you have to call {@link sap.ui.core.util.MockServer.respond } * method for response. */ autoRespond?: boolean; /** * the time in ms after all mock servers should send their response. */ autoRespondAfter?: int; /** * If set to true, all mock server will find `_method` parameter in the POST body and use this to override * the actual method. */ fakeHTTPMethods?: boolean; } ): void; /** * Stops and calls destroy on all registered servers. Use this method for cleaning up. */ static destroyAll(): void; /** * Creates a new subclass of class sap.ui.core.util.MockServer with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.ManagedObject.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.util.MockServer. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.ManagedObjectMetadata; /** * Respond to a request, when the servers are configured not to automatically respond. */ static respond(): void; /** * Starts all registered servers. */ static startAll(): void; /** * Stops all registered servers. */ static stopAll(): void; /** * Attaches an event handler to be called after the built-in request processing of the mock server */ attachAfter( /** * event type according to HTTP Method */ sHttpMethod: string, /** * the name of the function that will be called at this exit The callback function exposes an event with * parameters, depending on the type of the request. oEvent.getParameters() lists the parameters as per * the request. Examples are: oXhr : the request object; oFilteredData : the mock data entries that are * about to be returned in the response; oEntry : the mock data entry that is about to be returned in the * response; */ fnCallback: Function, /** * (optional) the name of the entity set */ sEntitySet: string ): void; /** * Attaches an event handler to be called before the built-in request processing of the mock server */ attachBefore( /** * event type according to HTTP Method */ sHttpMethod: string, /** * the name of the function that will be called at this exit. The callback function exposes an event with * parameters, depending on the type of the request. oEvent.getParameters() lists the parameters as per * the request. Examples are: oXhr : the request object; sUrlParams : the URL parameters of the request; * sKeys : key properties of the requested entry; sNavProp/sNavName : name of navigation */ fnCallback: Function, /** * (optional) the name of the entity set */ sEntitySet: string ): void; /** * Cleans up the resources associated with this object and all its aggregated children. * * After an object has been destroyed, it can no longer be used! * * Applications should call this method if they don't need the object any longer. * See: * sap.ui.base.ManagedObject#destroy */ destroy( /** * if true, this ManagedObject is not marked as changed */ bSuppressInvalidate?: boolean ): void; /** * Removes a previously attached event handler */ detachAfter( /** * event type according to HTTP Method */ sHttpMethod: string, /** * the name of the function that will be called at this exit */ fnCallback: Function, /** * (optional) the name of the entity set */ sEntitySet: string ): void; /** * Removes a previously attached event handler */ detachBefore( /** * event type according to HTTP Method */ sHttpMethod: string, /** * the name of the function that will be called at this exit */ fnCallback: Function, /** * (optional) the name of the entity set */ sEntitySet: string ): void; /** * Returns the data model of the given EntitySet name. * * * @returns data model of the given EntitySet */ getEntitySetData( /** * EntitySet name */ sEntitySetName: string ): any[]; /** * Getter for property `recordRequests`. Returns whether or not the requests performed should be recorded * (stored). * * Default value is `true` * * * @returns the value of property `recordRequests` */ getRecordRequests(): boolean; /** * Getter for property `requests`. * * Default value is `[]` * * * @returns the value of property `requests` */ getRequests(): sap.ui.core.util.MockServer.RequestHandler[]; /** * Getter for property `rootUri`. Has to be relative and requires a trailing '/'. It also needs to match * the URI set in OData/JSON models or simple XHR calls in order for the mock server to intercept them. * * Default value is empty/`undefined`. Must end with a a trailing slash ("/"). * * * @returns the value of property `rootUri` */ getRootUri(): string; /** * Returns whether the server is started or not. * * * @returns whether the server is started or not. */ isStarted(): boolean; /** * Sets the data of the given EntitySet name with the given array. */ setEntitySetData( /** * EntitySet name */ sEntitySetName: string, aData: any[] ): void; /** * Setter for property `recordRequests`. Defines whether or not the requests performed should be recorded * (stored). * * Default value is `true` */ setRecordRequests( /** * new value for property `recordRequests` */ recordRequests: boolean ): void; /** * Setter for property `requests`. * * Default value is `[]` * * * @returns Returns `this` to allow method chaining */ setRequests( /** * new value for the `requests` property */ requests: sap.ui.core.util.MockServer.RequestHandler[] ): this; /** * Setter for property `rootUri`. All request path URI are prefixed with this root URI if set. * * Default value is empty/`undefined` */ setRootUri( /** * new value for property `rootUri` */ rootUri: string ): void; /** * Simulates an existing OData service by sepcifying the metadata URL and the base URL for the mockdata. * The server configures the request handlers depending on the service metadata. The mockdata needs to be * stored individually for each entity type in a separate JSON file. The name of the JSON file needs to * match the name of the entity type. If no base url for the mockdata is specified then the mockdata are * generated from the metadata * * @since 1.13.2 */ simulate( /** * Either the URL to the service metadata document or the metadata document as xml string itself (starting * with "xml") */ sMetadataString: string, /** * (optional) base url which contains the path to the mockdata, or an object which contains the following * properties: sMockdataBaseUrl, bGenerateMissingMockData, aEntitySetsNames. See below for descriptions * of these parameters. Ommit this parameter to produce random mock data based on the service metadata. */ vMockdataSettings?: | string | { /** * base url which contains the mockdata as single .json files or the .json file containing the complete * mock data */ sMockdataBaseUrl?: string; /** * if the MockServer should generate mock data for missing .json files that are not found in sMockdataBaseUrl */ bGenerateMissingMockData?: boolean; /** * list of entity set names to fetch. If the list is empty or `undefined`, all entity sets will be retrieved. * This parameter should be used to improve performance in case there are a lot of entity sets but only * a few are needed to be fetched. */ aEntitySetsNames?: any[]; } ): void; /** * Starts the server. */ start(): void; /** * Stops the server. */ stop(): void; } } namespace webc { namespace WebComponent { namespace MetadataOptions { namespace Association { /** * An object literal describing the mapping of an association as property of a class derived from `sap.ui.core.webc.WebComponent`. */ type Mapping = { /** * Defines the mapping of the association which defaults to "property". Associations are forwarded to the * corresponding mutator of the Web Component. */ type?: "property"; /** * Defines the target of the mapping of the association to which property it will be mapped to. */ to?: string; /** * Defines the name of the formatter function at the WebComponent instance to format the value before its * being mapped. */ formatter?: string; }; } namespace Event { /** * An object literal describing the mapping of an event of a class derived from `sap.ui.core.webc.WebComponent`. */ type Mapping = { /** * Defines the target of the mapping of the event to which name it will be mapped to. */ to?: string; }; } namespace Property { /** * An object literal describing the mapping of a property of a class derived from `sap.ui.core.webc.WebComponent`. */ type Mapping = { /** * Defines the mapping of the property to be either "property", "style", "textContent", "slot", or "none". * The default mapping of a property is "property" which either renders the value of the property into an * attribute of the custom tag or forwards object properties to the mutator in the onAfterRendering phase. */ type?: "property" | "style" | "textContent" | "slot" | "none"; /** * Defines the target of the mapping of the property (e.g. the name of the attribute/property). */ to?: string; /** * Defines the name of the formatter function at the WebComponent instance to format the value before its * being mapped. */ formatter?: string; }; } /** * An object literal describing a property of a class derived from `sap.ui.core.webc.WebComponent`. See * {@link sap.ui.core.webc.WebComponent.MetadataOptions MetadataOptions} for details on its usage. */ type Aggregation = sap.ui.base.ManagedObject.MetadataOptions.Aggregation & { /** * Flag that marks the property as deprecated (defaults to false). May lead to an additional warning log * message at runtime when the property is still used. For the documentation, also add a `@deprecated` tag * in the JSDoc, describing since when it is deprecated and what any alternatives are. */ slot?: string; }; /** * An object literal describing an association of a class derived from `sap.ui.core.webc.WebComponent`. * See {@link sap.ui.core.webc.WebComponent.MetadataOptions MetadataOptions} for details on its usage. */ type Association = sap.ui.base.ManagedObject.MetadataOptions.Association & { /** * Defines the mapping of the association which defaults to "property". Associations are forwarded to the * corresponding mutator of the Web Component. */ mapping?: | "property" | sap.ui.core.webc.WebComponent.MetadataOptionsAssociationMapping; }; /** * An object literal describing an event of a class derived from `sap.ui.core.webc.WebComponent`. See {@link sap.ui.core.webc.WebComponent.MetadataOptions MetadataOptions } * for details on its usage. */ type Event = sap.ui.base.ManagedObject.MetadataOptions.Event & { /** * Defines the mapping of the event. */ mapping?: sap.ui.core.webc.WebComponent.MetadataOptionsEventMapping; }; /** * An object literal describing a property of a class derived from `sap.ui.core.webc.WebComponent`. See * {@link sap.ui.core.webc.WebComponent.MetadataOptions MetadataOptions} for details on its usage. */ type Property = sap.ui.base.ManagedObject.MetadataOptions.Property & { /** * Defines the mapping of the property to be either "property", "style", "textContent", "slot", or "none". * The default mapping of a property is "property" which either renders the value of the property into an * attribute of the custom tag or forwards object properties to the mutator in the onAfterRendering phase. */ mapping?: | "property" | "style" | "textContent" | "slot" | "none" | sap.ui.core.webc.WebComponent.MetadataOptionsPropertyMapping; }; } /** * The structure of the "metadata" object which is passed when inheriting from sap.ui.core.Element using * its static "extend" method. See {@link sap.ui.core.Element.extend} for details on its usage. */ type MetadataOptions = sap.ui.core.Element.MetadataOptions & { /** * Tag name of the Web Component to be used in the renderer to render the HTML. */ tag: string; /** * An object literal whose properties each define a new managed property in the WebComponent subclass. See * {@link sap.ui.base.ManagedObject.MetadataOptions.Property Property} for more details. */ properties?: Record< string, string | sap.ui.core.webc.WebComponent.MetadataOptions.Property >; /** * An object literal whose properties each define a new aggregation in the ManagedObject subclass. See {@link sap.ui.base.ManagedObject.MetadataOptions.Aggregation Aggregation } * for more details. */ aggregations?: Record< string, string | sap.ui.core.webc.WebComponent.MetadataOptions.Aggregation >; /** * An object literal whose properties each define a new association in the ManagedObject subclass. See {@link sap.ui.base.ManagedObject.MetadataOptions.Association Association } * for more details. */ associations?: Record< string, string | sap.ui.core.webc.WebComponent.MetadataOptions.Association >; /** * An object literal whose properties each define a new event of the ManagedObject subclass. See {@link sap.ui.base.ManagedObject.MetadataOptions.Event Event } * for more details. */ events?: Record< string, string | sap.ui.core.webc.WebComponent.MetadataOptions.Event >; /** * Proxied public getters of the Web Component which are directly accessible on the wrapper Control. */ getters?: string[]; /** * Proxied public methods of the Web Component which are directly accessible on the wrapper Control. */ methods?: string[]; }; type MetadataOptionsAssociationMapping = sap.ui.core.webc.WebComponent.MetadataOptions.Association.Mapping; type MetadataOptionsEventMapping = sap.ui.core.webc.WebComponent.MetadataOptions.Event.Mapping; type MetadataOptionsPropertyMapping = sap.ui.core.webc.WebComponent.MetadataOptions.Property.Mapping; } /** * Describes the settings that can be provided to the WebComponent constructor. */ interface $WebComponentSettings extends sap.ui.core.$ControlSettings {} /** * Base Class for Web Components. Web Components are agnostic UI elements which can be integrated into the * UI5 programming model by using this wrapper control. This wrapper control takes care to propagate the * properties, the aggregations and the events. It also ensures to render the control and put the aggregated * controls in the dedicated slots of the Web Component. * * @since 1.138.0 */ class WebComponent extends sap.ui.core.Control { /** * Constructs and initializes a Web Component Wrapper with the given `sId` and settings. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * Object with initial settings for the new control */ mSettings?: sap.ui.core.webc.$WebComponentSettings ); /** * Constructs and initializes a Web Component Wrapper with the given `sId` and settings. * * Accepts an object literal `mSettings` that defines initial property values, aggregated and associated * objects as well as event handlers. See {@link sap.ui.base.ManagedObject#constructor} for a general description * of the syntax of the settings object. */ constructor( /** * Optional ID for the new control; generated automatically if no non-empty ID is given Note: this can be * omitted, no matter whether `mSettings` will be given or not! */ sId?: string, /** * Object with initial settings for the new control */ mSettings?: sap.ui.core.webc.$WebComponentSettings ); /** * Defines a new subclass of WebComponent with the name `sClassName` and enriches it with the information * contained in `oClassInfo`. * * `oClassInfo` can contain the same information that {@link sap.ui.base.ManagedObject.extend} already accepts, * plus the `dnd` property in the metadata object literal to configure drag-and-drop behavior (see {@link sap.ui.core.webc.WebComponent.MetadataOptions MetadataOptions } * for details). Objects describing aggregations can also have a `dnd` property when used for a class extending * `WebComponent` (see {@link sap.ui.base.ManagedObject.MetadataOptions.AggregationDnD AggregationDnD}). * * Example: * ```javascript * * WebComponent.extend('sap.mylib.MyElement', { * metadata : { * library : 'sap.mylib', * tag : 'my-webcomponent', * properties : { * value : 'string', * width : { * type: 'sap.ui.core.CSSSize', * mapping: 'style' * } * }, * defaultAggregation: "content", * aggregations : { * content : { * type: 'sap.ui.core.Control', * multiple : true * }, * header : { * type : 'sap.ui.core.Control', * multiple : false, * slot: 'header' * } * } * } * }); * ``` * * * * @returns Created class / constructor function */ static extend>( /** * Name of the class to be created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object. If not given, it defaults to `sap.ui.core.ElementMetadata`. */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.webc.WebComponent. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.core.webc.WebComponentMetadata; /** * Sets the Web Components busy state * * * @returns `this` to allow method chaining */ setBusy( /** * The new busy state to be set */ bBusy: boolean ): this; } /** * @since 1.138.0 */ class WebComponentMetadata extends sap.ui.core.ElementMetadata { /** * Creates a new metadata object for a WebComponent Wrapper subclass. */ constructor( /** * fully qualified name of the class that is described by this metadata object */ sClassName: string, /** * static info to construct the metadata from */ oClassInfo: object ); /** * Returns the list of public getters, proxied by the Component Wrapper to the component itself */ getGetters(): any[]; /** * Returns the list of public methods, proxied by the Component Wrapper to the component itself */ getMethods(): any[]; /** * Retrieves the renderer for the described web component class. Note: this is always the default renderer * and Web Component wrappers should not define their own renderers. */ getRenderer(): void; /** * Returns the tag, used to render the Component Wrapper */ getTag(): string; } } namespace ws { namespace SapPcpWebSocket { /** * Protocol versions. * * One (or more) of these have to be selected to create an SapPcpWebSocket connection (or no protocol at * all). * * This enum is part of the 'sap/ui/core/ws/SapPcpWebSocket' module export and must be accessed by the property * 'SUPPORTED_PROTOCOLS'. */ enum SUPPORTED_PROTOCOLS { /** * Protocol v10.pcp.sap.com */ v10 = "v10.pcp.sap.com", } } /** * Parameters of the SapPcpWebSocket#message event. */ interface SapPcpWebSocket$MessageEventParameters extends sap.ui.core.ws.WebSocket$MessageEventParameters { /** * Received pcpFields as a key-value map. */ pcpFields?: Record; } /** * Parameters of the WebSocket#close event. */ interface WebSocket$CloseEventParameters { /** * Close code provided by the server. */ code?: string; /** * Reason from server for closing the connection. */ reason?: string; /** * Indicates whether the connection was cleanly closed or not. */ wasClean?: string; } /** * Parameters of the WebSocket#error event. */ interface WebSocket$ErrorEventParameters {} /** * Parameters of the WebSocket#message event. */ interface WebSocket$MessageEventParameters { /** * Received data from the server. */ data?: string; } /** * Parameters of the WebSocket#open event. */ interface WebSocket$OpenEventParameters {} /** * WebSocket class implementing the pcp-protocol. */ class SapPcpWebSocket extends sap.ui.core.ws.WebSocket { /** * Creates a new WebSocket connection and uses the pcp-protocol for communication. */ constructor( /** * relative or absolute URL for WebSocket connection. */ sUrl: string, /** * array of protocols as strings, a single protocol as a string. Protocol(s) should be selected from {@link sap.ui.core.ws.SapPcpWebSocket.SUPPORTED_PROTOCOLS}. */ vProtocols?: string | string[] ); /** * Creates a new subclass of class sap.ui.core.ws.SapPcpWebSocket with name `sClassName` and enriches it * with the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.core.ws.WebSocket.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.ws.SapPcpWebSocket. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Fires event {@link #event:message message} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns `this` to allow method chaining */ fireMessage( /** * Parameters to pass along with the event */ oParameters?: sap.ui.core.ws.SapPcpWebSocket$MessageEventParameters ): this; /** * Sends a message and optional pcp-header-fields using the pcp-protocol. * * If the connection is not yet opened, the message will be queued and sent when the connection is established. * * * @returns Reference to `this` to allow method chaining */ send( /** * message to send */ message: string | Blob | ArrayBuffer, /** * additional pcp-fields as key-value map */ oPcpFields?: Record ): this; } /** * Basic WebSocket class. */ class WebSocket extends sap.ui.base.EventProvider { /** * Creates a new WebSocket connection. */ constructor( /** * relative or absolute URL for WebSocket connection. */ sUrl: string, /** * array of protocols as strings, a single protocol as a string */ vProtocols?: string | string[] ); /** * Creates a new subclass of class sap.ui.core.ws.WebSocket with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.EventProvider.extend}. * * * @returns Created class / constructor function */ static extend>( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: sap.ClassInfo, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns a metadata object for class sap.ui.core.ws.WebSocket. * * * @returns Metadata object describing this class */ static getMetadata(): sap.ui.base.Metadata; /** * Attaches event handler `fnFunction` to the {@link #event:close close} event of this `sap.ui.core.ws.WebSocket`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.ws.WebSocket` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachClose( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: (evt: WebSocket$CloseEvent) => void, /** * Context object to call the event handler with. Defaults to this `WebSocket` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:close close} event of this `sap.ui.core.ws.WebSocket`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.ws.WebSocket` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachClose( /** * The function to be called, when the event occurs */ fnFunction: (evt: WebSocket$CloseEvent) => void, /** * Context object to call the event handler with. Defaults to this `WebSocket` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:error error} event of this `sap.ui.core.ws.WebSocket`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.ws.WebSocket` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachError( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to this `WebSocket` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:error error} event of this `sap.ui.core.ws.WebSocket`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.ws.WebSocket` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachError( /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to this `WebSocket` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:message message} event of this `sap.ui.core.ws.WebSocket`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.ws.WebSocket` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachMessage( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: (evt: WebSocket$MessageEvent) => void, /** * Context object to call the event handler with. Defaults to this `WebSocket` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:message message} event of this `sap.ui.core.ws.WebSocket`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.ws.WebSocket` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachMessage( /** * The function to be called, when the event occurs */ fnFunction: (evt: WebSocket$MessageEvent) => void, /** * Context object to call the event handler with. Defaults to this `WebSocket` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:open open} event of this `sap.ui.core.ws.WebSocket`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.ws.WebSocket` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachOpen( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to this `WebSocket` itself */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:open open} event of this `sap.ui.core.ws.WebSocket`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to this `sap.ui.core.ws.WebSocket` itself. * * * @returns Reference to `this` in order to allow method chaining */ attachOpen( /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to this `WebSocket` itself */ oListener?: object ): this; /** * Closes the connection. * * * @returns Reference to `this` in order to allow method chaining */ close( /** * Status code that explains why the connection is closed. Must either be 1000, or between 3000 and 4999 */ iCode?: int, /** * Closing reason as a string */ sReason?: string ): this; /** * Closes the connection. * * * @returns Reference to `this` in order to allow method chaining */ close( /** * Closing reason as a string */ sReason?: string ): this; /** * Detaches event handler `fnFunction` from the {@link #event:close close} event of this `sap.ui.core.ws.WebSocket`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachClose( /** * The function to call, when the event occurs */ fnFunction: (evt: WebSocket$CloseEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:error error} event of this `sap.ui.core.ws.WebSocket`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachError( /** * The function to call, when the event occurs */ fnFunction: Function, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:message message} event of this `sap.ui.core.ws.WebSocket`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachMessage( /** * The function to call, when the event occurs */ fnFunction: (evt: WebSocket$MessageEvent) => void, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:open open} event of this `sap.ui.core.ws.WebSocket`. * * The passed function and listener object must match the ones used for event registration. * * * @returns Reference to `this` in order to allow method chaining */ detachOpen( /** * The function to call, when the event occurs */ fnFunction: Function, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Fires event {@link #event:close close} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireClose( /** * Parameters to pass along with the event */ oParameters?: sap.ui.core.ws.WebSocket$CloseEventParameters ): this; /** * Fires event {@link #event:error error} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireError( /** * Parameters to pass along with the event */ oParameters?: object ): this; /** * Fires event {@link #event:message message} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireMessage( /** * Parameters to pass along with the event */ oParameters?: sap.ui.core.ws.WebSocket$MessageEventParameters ): this; /** * Fires event {@link #event:open open} to attached listeners. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireOpen( /** * Parameters to pass along with the event */ oParameters?: object ): this; /** * `WebSockets` don't have a facade and therefore return themselves as their interface. * See: * sap.ui.base.Object#getInterface * * * @returns `this` as there's no facade for a `Websocket` instance */ getInterface(): sap.ui.core.Element; /** * Getter for the protocol selected by the server once the connection is open. * * * @returns protocol */ getProtocol(): string; /** * Getter for WebSocket readyState. * * * @returns readyState */ getReadyState(): sap.ui.core.ws.ReadyState; /** * Sends a message. * * If the connection is not yet opened, the message will be queued and sent when the connection is established. * * * @returns Reference to `this` in order to allow method chaining */ send( /** * Message to send */ sMessage: string ): this; } /** * Defines the different ready states for a WebSocket connection. */ enum ReadyState { /** * The connection has been closed or could not be opened. */ CLOSED = "3", /** * The connection is going through the closing handshake. */ CLOSING = "2", /** * The connection has not yet been established. */ CONNECTING = "0", /** * The WebSocket connection is established and communication is possible. */ OPEN = "1", } /** * Event object of the SapPcpWebSocket#message event. */ type SapPcpWebSocket$MessageEvent = sap.ui.base.Event< SapPcpWebSocket$MessageEventParameters, SapPcpWebSocket >; /** * Event object of the WebSocket#close event. */ type WebSocket$CloseEvent = sap.ui.base.Event< WebSocket$CloseEventParameters, WebSocket >; /** * Event object of the WebSocket#error event. */ type WebSocket$ErrorEvent = sap.ui.base.Event< WebSocket$ErrorEventParameters, WebSocket >; /** * Event object of the WebSocket#message event. */ type WebSocket$MessageEvent = sap.ui.base.Event< WebSocket$MessageEventParameters, WebSocket >; /** * Event object of the WebSocket#open event. */ type WebSocket$OpenEvent = sap.ui.base.Event< WebSocket$OpenEventParameters, WebSocket >; } /** * Implementing this interface allows a control to be accessible via access keys. * * @experimental As of version 1.104. */ interface IAccessKeySupport { __implements__sap_ui_core_IAccessKeySupport: boolean; /** * Returns a refence to DOM element to be focused during Access key navigation. If not implemented getFocusDomRef() * method is used. * * @experimental As of version 1.104. */ getAccessKeysFocusTarget?(): void; /** * If implemented called when access keys feature is enabled and highlighting is over * * @experimental As of version 1.104. */ onAccKeysHighlightEnd?(): void; /** * If implemented called when access keys feature is enabled and highlighting is ongoing * * @experimental As of version 1.104. */ onAccKeysHighlightStart?(): void; } /** * Marker interface for subclasses of `sap.ui.core.UIComponent`. * * Implementing this interface allows a {@link sap.ui.core.UIComponent} to be created fully asynchronously. * This interface will implicitly set the component's rootView and router configuration to async. Nested * views will also be handled asynchronously. Additionally the error handling during the processing of views * is stricter and will fail if a view definition contains errors, e.g. broken binding strings. * * **Note:** Nested components (via {@link sap.ui.core.ComponentContainer}) are not handled asynchronously * by default. * * When implementing this interface the {@link sap.ui.core.Component.create Component.create} factory's * result Promise will resolve once the defined `rootView` is fully processed. * * An asynchronous component can also return a Promise in its {@link sap.ui.core.UIComponent#createContent createContent } * function. This Promise will also be chained into the {@link sap.ui.core.Component.create Component.create } * factory's result Promise. * * See {@link sap.ui.core.UIComponent#createContent} for more details and usage samples. * * @since 1.89.0 */ interface IAsyncContentCreation { __implements__sap_ui_core_IAsyncContentCreation: boolean; } /** * Marker interface for controls that can serve as a menu for a table column header. * * Implementation of this interface should include the `openBy`, `close`, `isOpen` and `getAriaHasPopupType` * methods and fire the `beforeOpen` and `afterClose` events. * * Refer to the base class {@link sap.m.table.columnmenu.MenuBase} for a detailed API description. * * @since 1.98 */ interface IColumnHeaderMenu { __implements__sap_ui_core_IColumnHeaderMenu: boolean; /** * Closes the menu. * * @since 1.126 */ close(): void; /** * Returns the `sap.ui.core.aria.HasPopup` type of the menu. * * @since 1.98.0 * * @returns `sap.ui.core.aria.HasPopup` type of the menu */ getAriaHasPopupType(): sap.ui.core.aria.HasPopup; /** * Determines whether the menu is open. * * @since 1.126 * * @returns `true` if the menu is open, `false` otherwise */ isOpen( /** * The element for which the menu is opened. If it is an `HTMLElement`, the closest control is passed for * this event (if it exists). */ openBy: sap.ui.core.Element ): boolean; /** * Opens the menu using the column header. * * @since 1.98 */ openBy( /** * Specifies the element where the menu is placed. */ oAnchor: sap.ui.core.Control | HTMLElement ): void; } /** * Marker interface for controls that can serve as a context menu. * * Implementation of this interface should implement the `openAsContextMenu` method. */ interface IContextMenu { __implements__sap_ui_core_IContextMenu: boolean; /** * Opens the control by given opener ref. */ openAsContextMenu( /** * An `oncontextmenu` event object or an object with properties left, top, offsetX, offsetY */ oEvent: | jQuery.Event | { left: float; top: float; offsetX: float; offsetY: float; }, /** * The element which will get the focus back again after the menu was closed */ oOpenerRef: sap.ui.core.Element | HTMLElement ): void; } /** * Marker interface for controls that can be used as content of {@link sap.ui.layout.form.Form} or {@link sap.ui.layout.form.SimpleForm}. * * If the control's width must not be adjusted by the {@link sap.ui.layout.form.Form Form} control to meet * the cell's width, the control must implement the {@link sap.ui.core.IFormContent.getFormDoNotAdjustWidth getFormDoNotAdjustWidth } * function and return `true`. * * @since 1.48.0 */ interface IFormContent { __implements__sap_ui_core_IFormContent: boolean; /** * Whether a control wants to keep its original width even when used in a {@link sap.ui.layout.form.Form Form}. * * In the {@link sap.ui.layout.form.Form Form} control, all content controls are positioned on a grid cell * base. By default, the controls use the full width of the used grid cell. But for some controls (like * image controls), this is not the desired behavior. In this case the control must keep its original width. * * This is an optional method. When not defined, the width of the control might be adjusted. * * @since 1.48.0 * * @returns `true` if the {@link sap.ui.layout.form.Form Form} is not allowed to adjust the width of the * control to use the cell's width */ getFormDoNotAdjustWidth?(): boolean; } /** * Defines a control, which can specify if it can be bound to a label * * @since 1.121.0 */ interface ILabelable { __implements__sap_ui_core_ILabelable: boolean; /** * Returns if the control can be bound to a label * * @since 1.121.0 * * @returns `true` if the control can be bound to a label */ hasLabelableHTMLElement(): boolean; } /** * Marker interface for container controls. * * Implementing this interface allows a container control to display a {@link sap.ui.core.Placeholder}. * This requires the container control to implement the `showPlaceholder` and `hidePlaceholder` methods. * * Optionally, the `needPlaceholder` method can be implemented to defined, whether a placeholder is needed * or not. If implemented, this method must return a `boolean`. Depending on the return value, `showPlaceholder` * will be called or not. * * @since 1.92.0 */ interface IPlaceholderSupport { __implements__sap_ui_core_IPlaceholderSupport: boolean; } /** * Marker interface for controls that can be used as content of {@link sap.ui.layout.form.SemanticFormElement SemanticFormElement}. * * If the value-holding property of the control is not `value` or `text`, the name of the value-holding * property must be returned in the {@link sap.ui.core.ISemanticFormContent.getFormValueProperty getFormValueProperty } * function. * * If the value of the control needs some special output formatting (to show a description instead of a * key), this formatted text needs to be returned in the {@link sap.ui.core.ISemanticFormContent.getFormFormattedValue getFormFormattedValue } * function. * * @since 1.86.0 */ interface ISemanticFormContent { __implements__sap_ui_core_ISemanticFormContent: boolean; /** * Returns the formatted value of a control used in a {@link sap.ui.layout.form.SemanticFormElement SemanticFormElement}. * * In the {@link sap.ui.layout.form.SemanticFormElement SemanticFormElement} element, the assigned fields * are rendered in edit mode. In display mode, a text is rendered that concatenates the values of all assigned * fields. In some cases the displayed text does not match the value of the field and needs some formatting. * In other cases the control does not have a `value` property, so the {@link sap.ui.layout.form.SemanticFormElement SemanticFormElement } * element cannot determine the value. * * This is an optional method. If not defined, the `value` property or the `text` property is used to determine * the value. * * @since 1.86.0 * * @returns Formatted value or a `Promise` returning the formatted value if resolved */ getFormFormattedValue?(): string | Promise; /** * Returns the names of the properties of a control that might update the rendering in a {@link sap.ui.layout.form.SemanticFormElement SemanticFormElement}. * * In the {@link sap.ui.layout.form.SemanticFormElement SemanticFormElement} element, the assigned fields * are rendered in edit mode. In display mode, depending on {@link sap.ui.core.ISemanticFormContent.getFormRenderAsControl getFormRenderAsControl}, * either a text is rendered, which concatenates the values of all assigned fields, or the control is rendered. * So if a property of the control changes that might lead to a different rendering (some controls have * a special rendering in display mode), the {@link sap.ui.layout.form.SemanticFormElement SemanticFormElement } * needs to check the rendering. * * This is an optional method. If not defined, no check for updates (only for property defined in {@link sap.ui.core.ISemanticFormContent.getFormValueProperty getFormValueProperty}) * is done once the control has been assigned. * * @since 1.117.0 * * @returns Name of the properties */ getFormObservingProperties?(): string[]; /** * If set to `true`, the {@link sap.ui.layout.form.SemanticFormElement SemanticFormElement} also renders * the control in display mode, if the used {@link sap.ui.layout.form.FormLayout FormLayout} supports this. * * This is an optional method. If not defined, just the text is rendered. * * @since 1.117.0 * * @returns Name of the value-holding property */ getFormRenderAsControl?(): string; /** * Returns the name of the value-holding property of a control used in a {@link sap.ui.layout.form.SemanticFormElement SemanticFormElement}. * * In the {@link sap.ui.layout.form.SemanticFormElement SemanticFormElement} element, the assigned fields * are rendered in edit mode. In display mode, a text is rendered that concatenates the values of all assigned * fields. So the concatenated text needs to be updated if the value of a control changes. If a control * does not have a `value` property, the {@link sap.ui.layout.form.SemanticFormElement SemanticFormElement } * element needs to know the property it has to listen to for changes. * * This is an optional method. If not defined, the `value` property or the `text` property is used to determine * the value. * * @since 1.86.0 * * @returns Name of the value-holding property */ getFormValueProperty?(): string; } /** * Interface for the controls which are suitable to shrink. * * This means the control should still look fine when it gets smaller than its normal size, e.g. Text controls * which can show ellipsis in case of shrink. * * Note: This marker interface can be implemented by controls to give a hint to the container. The control * itself does not need to implement anything. A parent control that respects this interface will apply * the "flex-shrink" as a CSS property which determines how much the item will shrink relative to the rest * of the items in the container when negative free space is distributed. * * @since 1.26 */ interface IShrinkable { __implements__sap_ui_core_IShrinkable: boolean; } /** * Interface for controls that represent a title. * * This marker interface can be implemented by controls that are semantically suitable to act as a title * or heading inside a toolbar. * * @since 1.144 */ interface ITitle { __implements__sap_ui_core_ITitle: boolean; } /** * Marker interface for controls that can be used in `content` aggregation of the `sap.m.Title` control. * * @since 1.87 */ interface ITitleContent { __implements__sap_ui_core_ITitleContent: boolean; } /** * Marker interface for controls which are suitable for use as label. */ interface Label { __implements__sap_ui_core_Label: boolean; } /** * Marker interface for controls that are not rendered "embedded" into other controls but need to be opened/closed. * * Such controls are handled differently during rendering. * * @since 1.19.0 */ interface PopupInterface { __implements__sap_ui_core_PopupInterface: boolean; } /** * Marker interface for toolbar controls. * * @since 1.21.0 */ interface Toolbar { __implements__sap_ui_core_Toolbar: boolean; } /** * Describes the settings that can be provided to the CommandExecution constructor. */ interface $CommandExecutionSettings extends sap.ui.core.$ElementSettings { /** * The command's name, that has to be defined in the manifest. This property can only be applied initially. */ command?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Whether the CommandExecution is enabled or not. By default, it is enabled. If the CommandExecution is * disabled, the CommandExecution processes the event, but the event handler for it will not be called. * Therefore, also no event handler configured on CommandExecutions on ancestors is called. */ enabled?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Whether the CommandExecution is visible, or not. By default, it is visible. If not visible, the CommandExecution * won't process the event, and the event handler for it will not be called, regardless of the enabled state. * Therefore, the configured event handler on the next CommandExecution in the ancestor chain or, if no * ancestor in the ancestor chain has any CommandExecutions configured for this shortcut, the event handler * of the browser is called. */ visible?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Execute will be fired when the CommandExecution will be triggered. */ execute?: (oEvent: sap.ui.base.Event) => void; } /** * Describes the settings that can be provided to the Component constructor. */ interface $ComponentSettings extends sap.ui.base.$ManagedObjectSettings { componentData?: any; } /** * Describes the settings that can be provided to the ComponentContainer constructor. */ interface $ComponentContainerSettings extends sap.ui.core.$ControlSettings { /** * Component name, the package where the component is contained. This property can only be applied initially. */ name?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * The URL of the component. This property can only be applied initially. */ url?: | sap.ui.core.URI | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Flag whether the component should be created sync (default) or async. The default will be async when * initially the property `manifest` is set to a truthy value and for the property `async` no value has * been specified. This property can only be applied initially. */ async?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Enable/disable validation handling by Messaging for this component. The resulting Messages will be propagated * to the controls. This property can only be applied initially. */ handleValidation?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * The settings object passed to the component when created. This property can only be applied initially. */ settings?: | sap.ui.core.$ComponentSettings | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Defines whether binding information is propagated to the component. */ propagateModel?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Container width in CSS size */ width?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Container height in CSS size */ height?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Lifecycle behavior for the Component associated by the `ComponentContainer`. The default behavior is * `Legacy`. This means that the `ComponentContainer` takes care that the Component is destroyed when the * `ComponentContainer` is destroyed, but it is **not** destroyed when a new Component is associated. If * you use the `usage` property to create the Component, the default behavior is `Container`. This means * that the Component is destroyed when the `ComponentContainer` is destroyed or a new Component is associated. * This property must only be applied before a component instance is created. */ lifecycle?: | sap.ui.core.ComponentLifecycle | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Flag, whether to auto-prefix the ID of the nested Component or not. If this property is set to true the * ID of the Component will be prefixed with the ID of the ComponentContainer followed by a single hyphen. * This property can only be applied initially. */ autoPrefixId?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * The name of a component usage as configured in the app descriptor of the component owning this `ComponentContainer`. * * The configuration from the named usage will be used to create a component instance for this `ComponentContainer`. * If there's no owning component or if its app descriptor does not contain a usage with the given name, * an error will be logged. * * See {@link https://ui5.sap.com/#/topic/346599f0890d4dfaaa11c6b4ffa96312 Using and Nesting Components } * for more information about component usages. * * This property can only be applied initially. */ usage?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Controls when and from where to load the manifest for the Component. When set to any truthy value, the * manifest will be loaded asynchronously by default and evaluated before the Component controller, if it * is set to a falsy value other than `undefined`, the manifest will be loaded after the controller. A non-empty * string value will be interpreted as the URL location from where to load the manifest. A non-null object * value will be interpreted as manifest content. This property can only be applied initially. */ manifest?: | any | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * The component displayed in this ComponentContainer. */ component?: sap.ui.core.UIComponent | string; /** * Fired when the component instance has been created by the ComponentContainer. * * @since 1.50 */ componentCreated?: ( oEvent: ComponentContainer$ComponentCreatedEvent ) => void; /** * Fired when the creation of the component instance has failed. * * By default, the `ComponentContainer` also logs the error that occurred. Since 1.83, this default behavior * can be prevented by calling `preventDefault()` on the event object. * * @since 1.60 */ componentFailed?: ( oEvent: ComponentContainer$ComponentFailedEvent ) => void; } /** * Describes the settings that can be provided to the Control constructor. */ interface $ControlSettings extends sap.ui.core.$ElementSettings { /** * Whether the control is currently in blocked state. * * @deprecated As of version 1.69. The blocked property is deprecated. There is no accessibility support * for this property. Blocked controls should not be used inside Controls, which rely on keyboard navigation, * e.g. List controls. */ blocked?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Whether the control is currently in busy state. */ busy?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * The delay in milliseconds, after which the busy indicator will show up for this control. */ busyIndicatorDelay?: | int | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * The size of the BusyIndicator. For controls with a width smaller 3rem a `sap.ui.core.BusyIndicatorSize.Small` * should be used. If the size could vary in width and the width could get smaller than 3rem, the `sap.ui.core.BusyIndicatorSize.Auto` * option could be used. The default is set to `sap.ui.core.BusyIndicatorSize.Medium` For a full screen * BusyIndicator use `sap.ui.core.BusyIndicatorSize.Large`. * * @since 1.54 */ busyIndicatorSize?: | sap.ui.core.BusyIndicatorSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Whether the control should be visible on the screen. * * If set to false, a placeholder will be rendered to mark the location of the invisible control in the * DOM of the current page. The placeholder will be hidden and have zero dimensions (`display: none`). * * Also see {@link module:sap/ui/core/InvisibleRenderer InvisibleRenderer}. */ visible?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * The IDs of a logical field group that this control belongs to. * * All fields in a logical field group should share the same `fieldGroupId`. Once a logical field group * is left, the `validateFieldGroup` event is fired. * * For backward compatibility with older releases, field group IDs are syntactically not limited, but it * is suggested to use only valid {@link sap.ui.core.ID}s. * * See {@link #attachValidateFieldGroup} or consult the {@link https://ui5.sap.com/#/topic/5b0775397e394b1fb973fa207554003e Field Group } * documentation. * * @since 1.31 */ fieldGroupIds?: | string[] | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Event is fired if a logical field group defined by `fieldGroupIds` of a control was left or when the * user explicitly pressed the key combination that triggers validation. * * By default, the `RETURN` key without any modifier keys triggers validation, see {@link #triggerValidateFieldGroup}. * * Listen to this event to validate data of the controls belonging to a field group. See {@link #setFieldGroupIds}, * or consult the {@link https://ui5.sap.com/#/topic/5b0775397e394b1fb973fa207554003e Field Group} documentation. */ validateFieldGroup?: (oEvent: Control$ValidateFieldGroupEvent) => void; } /** * Describes the settings that can be provided to the CustomData constructor. */ interface $CustomDataSettings extends sap.ui.core.$ElementSettings { /** * The key of the data in this CustomData object. When the data is just stored, it can be any string, but * when it is to be written to HTML (`writeToDom == true`) then it must also be a valid HTML attribute name. * It must conform to the {@link sap.ui.core.ID} type and may contain no colon. To avoid collisions, it * also may not start with "sap-ui". When written to HTML, the key is prefixed with "data-". If any restriction * is violated, a warning will be logged and nothing will be written to the DOM. */ key?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * The data stored in this CustomData object. When the data is just stored, it can be any JS type, but when * it is to be written to HTML (`writeToDom == true`) then it must be a string. If this restriction is violated, * a warning will be logged and nothing will be written to the DOM. */ value?: | any | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * If set to "true" and the value is of type "string" and the key conforms to the documented restrictions, * this custom data is written to the HTML root element of the control as a "data-*" attribute. If the key * is "abc" and the value is "cde", the HTML will look as follows: * * * ```javascript * * * ``` * * * Thus the application can provide stable attributes by data binding which can be used for styling or identification * purposes. * * **ATTENTION:** use carefully to not create huge attributes or a large number of them. * * @since 1.9.0 */ writeToDom?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; } /** * Describes the settings that can be provided to the Element constructor. */ interface $ElementSettings extends sap.ui.base.$ManagedObjectSettings { /** * The tooltip that should be shown for this Element. * * In the most simple case, a tooltip is a string that will be rendered by the control and displayed by * the browser when the mouse pointer hovers over the control's DOM. In this variant, `tooltip` behaves * like a simple control property. * * Controls need to explicitly support this kind of tooltip as they have to render it, but most controls * do. Exceptions will be documented for the corresponding controls (e.g. `sap.ui.core.HTML` does not support * tooltips). * * Alternatively, `tooltip` can act like a 0..1 aggregation and can be set to a tooltip control (an instance * of a subclass of `sap.ui.core.TooltipBase`). In that case, the framework will take care of rendering * the tooltip control in a popup-like manner. Such a tooltip control can display arbitrary content, not * only a string. * * UI5 currently does not provide a recommended implementation of `TooltipBase` as the use of content-rich * tooltips is discouraged by the Fiori Design Guidelines. Existing subclasses of `TooltipBase` therefore * have been deprecated. * * See the section {@link https://experience.sap.com/fiori-design-web/using-tooltips/ Using Tooltips} in * the Fiori Design Guideline. */ tooltip?: | string | sap.ui.core.TooltipBase | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Custom Data, a data structure like a map containing arbitrary key value pairs. */ customData?: | sap.ui.core.CustomData[] | sap.ui.core.CustomData | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; /** * Defines the layout constraints for this control when it is used inside a Layout. LayoutData classes are * typed classes and must match the embedding Layout. See VariantLayoutData for aggregating multiple alternative * LayoutData instances to a single Element. */ layoutData?: sap.ui.core.LayoutData; /** * Dependents are not rendered, but their databinding context and lifecycle are bound to the aggregating * ManagedObject. * * @since 1.19 */ dependents?: | sap.ui.base.ManagedObject[] | sap.ui.base.ManagedObject | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; /** * Defines the drag-and-drop configuration. **Note:** This configuration might be ignored due to control * {@link sap.ui.core.Element.extend metadata} restrictions. * * @since 1.56 */ dragDropConfig?: | sap.ui.core.dnd.DragDropBase[] | sap.ui.core.dnd.DragDropBase | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; /** * Reference to the element to show the field help for this control; if unset, field help is show on the * control itself. */ fieldHelpDisplay?: sap.ui.core.Element | string; } /** * Describes the settings that can be provided to the Fragment constructor. */ interface $FragmentSettings extends sap.ui.base.$ManagedObjectSettings { /** * The Fragment type. */ type?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; fragmentName?: string; fragmentContent?: any; } /** * Describes the settings that can be provided to the HTML constructor. */ interface $HTMLSettings extends sap.ui.core.$ControlSettings { /** * HTML content to be displayed, defined as a string. * * The content is converted to DOM nodes with a call to `new jQuery(content)`, so any restrictions for the * jQuery constructor apply to the content of the HTML control as well. * * Some of these restrictions (there might be others!) are: * - the content must be enclosed in tags, pure text is not supported. * - if the content contains script tags, they will be executed but they will not appear in the resulting * DOM tree. When the contained code tries to find the corresponding script tag, it will fail. * - if the control is used in an {@link sap/ui/core/mvc/XMLView XMLView}, ensure proper escaping as described * in {@link https://ui5.sap.com/#/topic/5ee3be4727864bb08b991414e0428e38 Control Properties and Associations in XML Views } * * * Please consider to consult the jQuery documentation as well. * * The HTML control currently doesn't prevent the usage of multiple root nodes in its DOM content (e.g. * `setContent("
    ")`), but this is not a guaranteed feature. The accepted * content might be restricted to single root nodes in future versions. To notify applications about this * fact, a warning is written in the log when multiple root nodes are used. * * When changing the content dynamically, ensure that the ID of the root node remains the same as the HTML * control's ID. Otherwise it cannot be guaranteed that certain lifecycle events take place. */ content?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Whether existing DOM content is preferred over the given content string. * * There are two scenarios where this flag is relevant (when set to true): * - for the initial rendering: when an HTML control is added to a UIArea for the first time and if the * root node of that UIArea contained DOM content with the same id as the HTML control, then that content * will be used for rendering instead of any specified string content * - any follow-up rendering: when an HTML control is rendered for the second or any later time and the * preferDOM flag is set, then the DOM from the first rendering is preserved and not replaced by the string * content * * As preserving the existing DOM is the most common use case of the HTML control, the default value is * true. */ preferDOM?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Whether to run the HTML sanitizer once the content (HTML markup) is applied or not. * * To configure the set of allowed URLs, you can use the {@link module:sap/base/security/URLListValidator.add URLListValidator API}. */ sanitizeContent?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Specifies whether the control is visible. Invisible controls are not rendered. */ visible?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Fired after the HTML control has been rendered. Allows to manipulate the resulting DOM. * * When the control doesn't have string content and no preserved DOM existed for this control, then this * event will fire, but there won't be a DOM node for this control. */ afterRendering?: (oEvent: HTML$AfterRenderingEvent) => void; } /** * Describes the settings that can be provided to the Icon constructor. */ interface $IconSettings extends sap.ui.core.$ControlSettings { /** * This property can be set by following options: * * **Option 1:** * The value has to be matched by following pattern `sap-icon://collection-name/icon-name` where `collection-name` * and `icon-name` have to be replaced by the desired values. In case the default UI5 icons are used the * `collection-name` can be omited. * Example: `sap-icon://accept` * * **Option 2:** The value is determined by using {@link sap.ui.core.IconPool.getIconURI} with an Icon name * parameter and an optional collection parameter which is required when using application extended Icons. * Example: `IconPool.getIconURI("accept")` */ src?: | sap.ui.core.URI | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Since Icon uses font, this property will be applied to the css font-size property on the rendered DOM * element. */ size?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * The color of the Icon. If color is not defined here, the Icon inherits the color from its DOM parent. * * The property can be set with {@link sap.ui.core.CSSColor CSS Color} or {@link sap.ui.core.IconColor Semantic Icon Color}. */ color?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * This color is shown when icon is hovered. This property has no visual effect when run on mobile device. * * The property can be set with {@link sap.ui.core.CSSColor CSS Color} or {@link sap.ui.core.IconColor Semantic Icon Color}. */ hoverColor?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * This color is shown when icon is pressed/activated by the user. * * The property can be set with {@link sap.ui.core.CSSColor CSS Color} or {@link sap.ui.core.IconColor Semantic Icon Color}. */ activeColor?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * This is the width of the DOM element which contains the Icon. Setting this property doesn't affect the * size of the font. If you want to make the font bigger, increase the size property. */ width?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * This is the height of the DOM element which contains the Icon. Setting this property doesn't affect the * size of the font. If you want to make the font bigger, increase the size property. */ height?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Background color of the Icon in normal state. * * The property can be set with {@link sap.ui.core.CSSColor CSS Color} or {@link sap.ui.core.IconColor Semantic Icon Color}. */ backgroundColor?: | string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Background color for Icon in hover state. This property has no visual effect when run on mobile device. * * The property can be set with {@link sap.ui.core.CSSColor CSS Color} or {@link sap.ui.core.IconColor Semantic Icon Color}. */ hoverBackgroundColor?: | string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Background color for Icon in active state. * * The property can be set with {@link sap.ui.core.CSSColor CSS Color} or {@link sap.ui.core.IconColor Semantic Icon Color}. */ activeBackgroundColor?: | string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * A decorative icon is included for design reasons. Accessibility tools will ignore decorative icons. Tab * stop isn't affected by this property anymore and it's now controlled by the existence of press event * handler and the noTabStop property. * * @since 1.16.4 */ decorative?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Decides whether a default Icon tooltip should be used if no tooltip is set. * * @since 1.30.0 */ useIconTooltip?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * This defines the alternative text which is used for outputting the aria-label attribute on the DOM. * * @since 1.30.0 */ alt?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Defines whether the tab stop of icon is controlled by the existence of press event handler. When it's * set to false, Icon control has tab stop when press event handler is attached. If it's set to true, Icon * control never has tab stop no matter whether press event handler exists or not. * * @since 1.30.1 */ noTabStop?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Association to controls / ids which label this control (see WAI-ARIA attribute aria-labelledby). */ ariaLabelledBy?: Array; /** * This event is fired when icon is pressed/activated by the user. When a handler is attached to this event, * the Icon gets tab stop. If you want to disable this behavior, set the noTabStop property to true. */ press?: (oEvent: sap.ui.base.Event) => void; } /** * Describes the settings that can be provided to the InvisibleMessage constructor. */ interface $InvisibleMessageSettings extends sap.ui.base.$ManagedObjectSettings {} /** * Describes the settings that can be provided to the InvisibleText constructor. */ interface $InvisibleTextSettings extends sap.ui.core.$ControlSettings { /** * The text of the InvisibleText. */ text?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; } /** * Describes the settings that can be provided to the Item constructor. */ interface $ItemSettings extends sap.ui.core.$ElementSettings { /** * The text to be displayed for the item. */ text?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Enabled items can be selected. */ enabled?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Options are RTL and LTR. Alternatively, an item can inherit its text direction from its parent control. */ textDirection?: | sap.ui.core.TextDirection | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Can be used as input for subsequent actions. */ key?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; } /** * Describes the settings that can be provided to the LayoutData constructor. */ interface $LayoutDataSettings extends sap.ui.core.$ElementSettings {} /** * Describes the settings that can be provided to the ListItem constructor. */ interface $ListItemSettings extends sap.ui.core.$ItemSettings { /** * The icon belonging to this list item instance. This can be a URI to an image or an icon font URI. */ icon?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Some additional text of type string, optionally to be displayed along with this item. */ additionalText?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; } /** * Describes the settings that can be provided to the LocalBusyIndicator constructor. * * @deprecated As of version 1.14.2. The LocalBusyIndicator Control is not needed anymore by the new implementation * of the LBI. Hence, it is not used anymore. */ interface $LocalBusyIndicatorSettings extends sap.ui.core.$ControlSettings { /** * This property is the width of the control that has to be covered. With this width the position of the * animation can be properly set. */ width?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * This property is the height of the control that has to be covered. With this height the position of the * animation can be properly set. */ height?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; } /** * Describes the settings that can be provided to the Message constructor. * * @deprecated As of version 1.120. Please use {@link sap.ui.core.message.Message} instead. */ interface $MessageSettings extends sap.ui.core.$ElementSettings { /** * Message text */ text?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Message's timestamp. It is just a simple String that will be used without any transformation. So the * application that uses messages needs to format the timestamp to its own needs. */ timestamp?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * A possible icon URI of the message */ icon?: | sap.ui.core.URI | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Setting the message's level. */ level?: | sap.ui.core.MessageType | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Determines whether the message should be read only. This helps the application to handle a message a * different way if the application differentiates between read-only and common messages. * * @since 1.19.0 */ readOnly?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; } /** * Describes the settings that can be provided to the Popup constructor. */ interface $PopupSettings extends sap.ui.base.$ManagedObjectSettings { /** * Fired when the popup has completely opened (after any animation). * * @since 1.2 */ opened?: (oEvent: sap.ui.base.Event) => void; /** * Fired when the popup has completely closed (after any animation). * * @since 1.2 */ closed?: (oEvent: sap.ui.base.Event) => void; } /** * Describes the settings that can be provided to the ScrollBar constructor. * * @deprecated As of version 1.56. the concept has been discarded. */ interface $ScrollBarSettings extends sap.ui.core.$ControlSettings { /** * Orientation. Defines if the Scrollbar is vertical or horizontal. */ vertical?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Scroll position in steps or pixels. */ scrollPosition?: | int | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Size of the Scrollbar (in pixels). */ size?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Size of the scrollable content (in pixels). */ contentSize?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Number of steps to scroll. Used if the size of the content is not known as the data is loaded dynamically. */ steps?: | int | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Scroll event. */ scroll?: (oEvent: ScrollBar$ScrollEvent) => void; } /** * Describes the settings that can be provided to the SeparatorItem constructor. */ interface $SeparatorItemSettings extends sap.ui.core.$ItemSettings {} /** * Describes the settings that can be provided to the Title constructor. */ interface $TitleSettings extends sap.ui.core.$ElementSettings { /** * Defines the title text */ text?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Defines the URL for icon display */ icon?: | sap.ui.core.URI | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Defines the level of the title. If set to auto the level of the title is chosen by the control rendering * the title. * * Currently not all controls using the Title.control supporting this property. */ level?: | sap.ui.core.TitleLevel | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * If set the title is displayed emphasized. This feature is nor supported by all controls using the Title.control. */ emphasized?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; } /** * Describes the settings that can be provided to the TooltipBase constructor. */ interface $TooltipBaseSettings extends sap.ui.core.$ControlSettings { /** * The text that is shown in the tooltip that extends the TooltipBase class, for example in RichTooltip. */ text?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Optional. Open Duration in milliseconds. */ openDuration?: | int | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Optional. Close Duration in milliseconds. */ closeDuration?: | int | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Optional. My position defines which position on the extended tooltip being positioned to align with the * target control. */ myPosition?: | sap.ui.core.Dock | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Optional. At position defines which position on the target control to align the positioned tooltip. */ atPosition?: | sap.ui.core.Dock | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Optional. Offset adds these left-top values to the calculated position. Example: "10 3". */ offset?: string | sap.ui.base.ManagedObject.PropertyBindingInfo; /** * Optional. Collision - when the positioned element overflows the window in some direction, move it to * an alternative position. */ collision?: | sap.ui.core.Collision | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Opening delay of the tooltip in milliseconds */ openDelay?: | int | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Closing delay of the tooltip in milliseconds */ closeDelay?: | int | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * This event is fired when the Tooltip has been closed * * @since 1.11.0 */ closed?: (oEvent: sap.ui.base.Event) => void; } /** * Describes the settings that can be provided to the UIArea constructor. */ interface $UIAreaSettings extends sap.ui.base.$ManagedObjectSettings { /** * Content that is displayed in the UIArea. */ content?: | sap.ui.core.Control[] | sap.ui.core.Control | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; /** * Dependent objects whose lifecycle is bound to the UIArea but which are not automatically rendered by * the UIArea. */ dependents?: | sap.ui.core.Control[] | sap.ui.core.Control | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; } /** * Describes the settings that can be provided to the UIComponent constructor. */ interface $UIComponentSettings extends sap.ui.core.$ComponentSettings {} /** * Describes the settings that can be provided to the VariantLayoutData constructor. */ interface $VariantLayoutDataSettings extends sap.ui.core.$LayoutDataSettings { /** * Allows multiple LayoutData. */ multipleLayoutData?: | sap.ui.core.LayoutData[] | sap.ui.core.LayoutData | sap.ui.base.ManagedObject.AggregationBindingInfo | `{${string}}`; } /** * Describes the settings that can be provided to the XMLComposite constructor. * * @deprecated As of version 1.88. use {@link topic:c1512f6ce1454ff1913e3857bad56392 Standard Composite Controls} * @experimental As of version 1.56.0. */ interface $XMLCompositeSettings extends sap.ui.core.$ControlSettings { /** * The width */ width?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * The height */ height?: | sap.ui.core.CSSSize | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; /** * Whether the CSS display should be set to "block". */ displayBlock?: | boolean | sap.ui.base.ManagedObject.PropertyBindingInfo | `{${string}}`; } /** * Parameters of the CommandExecution#execute event. */ interface CommandExecution$ExecuteEventParameters {} /** * Parameters of the ComponentContainer#componentCreated event. */ interface ComponentContainer$ComponentCreatedEventParameters { /** * Reference to the created component instance */ component?: sap.ui.core.UIComponent; } /** * Parameters of the ComponentContainer#componentFailed event. */ interface ComponentContainer$ComponentFailedEventParameters { /** * The reason object as returned by the component promise */ reason?: object; } /** * Parameters of the Control#validateFieldGroup event. */ interface Control$ValidateFieldGroupEventParameters { /** * field group IDs of the logical field groups to validate */ fieldGroupIds?: string[]; } /** * Parameters of the HTML#afterRendering event. */ interface HTML$AfterRenderingEventParameters { /** * Whether the current DOM of the control has been preserved (true) or not (e.g. rendered from content property * or it is an empty HTML control). */ isPreservedDOM?: boolean; } /** * Parameters of the Icon#press event. */ interface Icon$PressEventParameters {} /** * Parameters of the Popup#blockLayerStateChange event. */ interface Popup$BlockLayerStateChangeEventParameters { /** * Indicates whether a blocking layer is currently visible `visible: true` or not `visible: false` */ visible?: boolean; /** * In case a blocking layer is visible, the `zIndex` property will represent the zIndex at which the blocking * layer is displayed. In case of `visible: false`, `zIndex` represents the zIndex value of the last open * popup. */ zIndex?: number; } /** * Parameters of the Popup#closed event. */ interface Popup$ClosedEventParameters {} /** * Parameters of the Popup#opened event. */ interface Popup$OpenedEventParameters {} /** * Parameters of the ScrollBar#scroll event. */ interface ScrollBar$ScrollEventParameters { /** * Actions are: Click on track, button, drag of thumb, or mouse wheel click. */ action?: sap.ui.core.ScrollBarAction; /** * Direction of scrolling: back (up) or forward (down). */ forward?: boolean; /** * Current Scroll position either in pixels or in steps. */ newScrollPos?: int; /** * Old Scroll position - can be in pixels or in steps. */ oldScrollPos?: int; } /** * Parameters of the TooltipBase#closed event. */ interface TooltipBase$ClosedEventParameters {} /** * The AppCacheBuster is used to hook into URL relevant functions in jQuery and SAPUI5 and rewrite the URLs * with a timestamp segment. The timestamp information is fetched from the server and used later on for * the URL rewriting. */ interface AppCacheBuster { /** * Converts the given URL if it matches a URL in the cachebuster index. If not then the same URL will be * returned. To prevent URLs from being modified by the application cachebuster you can implement the function * `sap.ui.core.AppCacheBuster.handleURL`. * * * @returns modified URL when matching the index or unmodified when not */ convertURL( /** * any URL */ sUrl: string ): string; /** * Callback function which can be overwritten to programmatically decide whether to rewrite the given URL * or not. * * * @returns `true` to rewrite or `false` to ignore */ handleURL( /** * any URL */ sUrl: string ): boolean; /** * Normalizes the given URL and make it absolute. * * * @returns normalized URL */ normalizeURL( /** * any URL */ sUrl: string ): string; /** * Registers an application. Loads the cachebuster index file from this locations. All registered files * will be considered by the cachebuster and the URLs will be prefixed with the timestamp of the index file. */ register( /** * base URL of an application providing a cachebuster index file */ sBaseUrl: string ): void; } /** * Provides methods to show or hide a waiting animation covering the whole page and blocking user interaction. */ interface BusyIndicator { /** * Registers a handler for the {@link #event:Close Close} event. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to `sap.ui.core.BusyIndicator`. * * * @returns Reference to `this` in order to allow method chaining */ attachClose( /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with; defaults to `sap.ui.core.BusyIndicator` */ oListener?: object ): this; /** * Registers a handler for the {@link #event:Open Open} event. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to `sap.ui.core.BusyIndicator`. * * * @returns Reference to `this` in order to allow method chaining */ attachOpen( /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with; defaults to `sap.ui.core.BusyIndicator` */ oListener?: object ): this; /** * Unregisters a handler from the {@link #event:Close Close} event. * * * @returns Reference to `this` in order to allow method chaining */ detachClose( /** * The callback function to unregister */ fnFunction: Function, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Unregisters a handler from the {@link #event:Open Open} event. * * * @returns Reference to `this` in order to allow method chaining */ detachOpen( /** * The callback function to unregister */ fnFunction: Function, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Removes the BusyIndicator from the screen. */ hide(): void; /** * Displays the `BusyIndicator` and starts blocking all user input. This only happens after some delay, * and if, after that delay, the `BusyIndicator.hide()` has not yet been called in the meantime. * * There is a certain default value for the delay, which can be overridden. */ show( /** * The delay in milliseconds before opening the `BusyIndicator`; It is not opened if `hide()` is called * before the delay ends. If no delay (or no valid delay) is given, a delay of 1000 milliseconds is used. */ iDelay?: int ): void; } /** * Collects and stores the configuration of the current environment. * * The Configuration is initialized once when the {@link sap.ui.core.Core} is created. There are different * ways to set the environment configuration (in ascending priority): * - System defined defaults * - Server wide defaults, read from /sap-ui-config.json * - Properties of the global configuration object window["sap-ui-config"] * - A configuration string in the data-sap-ui-config attribute of the bootstrap tag. * - Individual data-sap-ui-xyz attributes of the bootstrap tag * - Using URL parameters * - Setters in this Configuration object (only for some parameters) * * That is, attributes of the DOM reference override the system defaults, URL parameters override the DOM * attributes (where empty URL parameters set the parameter back to its system default). Calling setters * at runtime will override any previous settings calculated during object creation. * * The naming convention for parameters is: * - in the URL : sap-ui-PARAMETER-NAME="value" * - in the DOM : data-sap-ui-PARAMETER-NAME="value" where PARAMETER-NAME is the name * of the parameter in lower case. * * Values of boolean parameters are case insensitive where "true" and "x" are interpreted as true. * * @deprecated As of version 1.120. There's no single replacement for this class. Instead, several facades * have been created for different topics, e.g. {@link module:sap/base/i18n/Localization Localization} for * settings related to localization, {@link module:sap/base/i18n/Formatting Formatting} for settings related * to data formatting, {@link module:sap/ui/core/Theming Theming} for theming related settings, {@link module:sap/ui/core/ControlBehavior ControlBehavior } * for settings that are typically required when implementing the behavior of a control, {@link module:sap/ui/security/Security Security } * for settings around security. * * Please check the individual methods of this class for their replacements, if any. */ interface Configuration { /** * Applies multiple changes to the configuration at once. * * If the changed settings contain localization related settings like `language` or calendarType, * then only a single `localizationChanged` event will be fired. As the framework has to inform all existing * components, elements, models etc. about localization changes, using `applySettings` can significantly * reduce the overhead for multiple changes, esp. when they occur after the UI has been created already. * * The `mSettings` can contain any property `xyz` for which a setter method `setXYZ` exists * in the API of this class. Similarly, values for the {@link sap.ui.core.Configuration.FormatSettings format settings } * API can be provided in a nested object with name `formatSettings`. * * @since 1.38.6 * @deprecated As of version 1.120. without a replacement. As the different settings have been spread across * multiple new APIs (see {@link sap.ui.core.Configuration the deprecation hint for this class}), a common * API for changing multiple settings no longer made sense. * * Please check the individual methods of this class for their replacements and call those replacement methods * one by one. * * @returns Returns `this` to allow method chaining */ applySettings( /** * Configuration options to apply */ mSettings: object ): this; /** * Creates a new subclass of class sap.ui.core.Configuration with name `sClassName` and enriches it with * the information contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.Object.extend}. * * * @returns Created class / constructor function */ extend( /** * Name of the class being created */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: object, /** * Constructor function for the metadata object; if not given, it defaults to the metadata implementation * used by this class */ FNMetaImpl?: Function ): Function; /** * Returns whether the accessibility mode is enabled or not. * * @since 1.20 * @deprecated As of version 1.120. Please use {@link module:sap/ui/core/ControlBehavior.isAccessibilityEnabled ControlBehavior.isAccessibilityEnabled } * instead. * * @returns whether the accessibility mode is enabled or not */ getAccessibility(): boolean; /** * Returns the list of active terminologies defined via the Configuration. * * @since 1.77.0 * @deprecated As of version 1.118. Please use {@link module:sap/base/i18n/Localization.getActiveTerminologies Localization.getActiveTerminologies } * instead. * * @returns if no active terminologies are set, the default value `undefined` is returned. */ getActiveTerminologies(): string[] | undefined; /** * URL of the allowlist service. * * @deprecated As of version 1.120. Please use {@link module:sap/ui/security/Security.getAllowlistService Security.getAllowlistService } * instead. * * @returns allowlist service URL */ getAllowlistService(): string; /** * Returns whether the animations are globally used. * * @deprecated As of version 1.50. Since 1.20, please use {@link module:sap/ui/core/ControlBehavior.getAnimationMode ControlBehavior.getAnimationMode } * instead. * * @returns whether the animations are globally used */ getAnimation(): boolean; /** * Returns the current animation mode. * * @since 1.50.0 * @deprecated As of version 1.120. Please use {@link module:sap/ui/core/ControlBehavior.getAnimationMode ControlBehavior.getAnimationMode } * instead. * * @returns The current animationMode */ getAnimationMode(): sap.ui.core.Configuration.AnimationMode; /** * Base URLs to AppCacheBuster ETag-Index files. * * @deprecated As of version 1.120. without a replacement. Was only used within the implementation of the * `AppCacheBuster`. * * @returns array of base URLs */ getAppCacheBuster(): string[]; /** * The loading mode (sync|async|batch) of the AppCacheBuster (sync is default) * * @deprecated As of version 1.120. without a replacement. Was only used within the implementation of the * `AppCacheBuster`. * * @returns "sync" | "async" | "batch" */ getAppCacheBusterMode(): string; /** * The name of the application to start or empty. * * @deprecated As of version 1.15.1. Please use {@link module:sap/ui/core/ComponentSupport ComponentSupport } * instead. See also {@link topic:82a0fcecc3cb427c91469bc537ebdddf Declarative API for Initial Components}. * * @returns name of the application */ getApplication(): string; /** * Returns whether the framework automatically adds the ARIA role 'application' to the HTML body or not. * * @since 1.27.0 * @deprecated As of version 1.120. without a replacement. Was only used in the implementation of the framework * itself. * * @returns Wether the ARIA role 'application' should be added to the HTML body or not */ getAutoAriaBodyRole(): boolean; /** * Returns the calendar type which is being used in locale dependent functionality. * * When it's explicitly set by calling `setCalendar`, the set calendar type is returned. Otherwise, the * calendar type is determined by checking the format settings and current locale. * * @since 1.28.6 * @deprecated As of version 1.120. Please use {@link module:sap/base/i18n/Formatting.getCalendarType Formatting.getCalendarType } * instead. * * @returns the current calendar type, e.g. `Gregorian` */ getCalendarType(): sap.ui.core.CalendarType; /** * Returns the calendar week numbering algorithm used to determine the first day of the week and the first * calendar week of the year, see {@link sap.ui.core.date.CalendarWeekNumbering}. * * @since 1.113.0 * @deprecated As of version 1.120. Please use {@link module:sap/base/i18n/Formatting.getCalendarWeekNumbering Formatting.getCalendarWeekNumbering } * instead. * * @returns The calendar week numbering algorithm */ getCalendarWeekNumbering(): sap.ui.core.date.CalendarWeekNumbering; /** * Returns the used compatibility version for the given feature. * * @deprecated As of version 1.119. without a replacement. All features that have been controlled by a compatibility * version in UI5 1.x will abandon their legacy behavior, starting with the next major version. In other * words, they will behave as if compatibility version "edge" was configured. Due to this, no more access * to the compatibility version will be required starting with the next major version. * * @returns the used compatibility version */ getCompatibilityVersion( /** * the key of desired feature */ sFeature: string ): import("sap/base/util/Version").default; /** * Returns whether the page runs in full debug mode. * * @deprecated As of version 1.120. without a replacement. All debug mode functionality is implemented within * the framework and should be transparent for application code. There's no need for a public accessor method. * * @returns Whether the page runs in full debug mode */ getDebug(): boolean; /** * Name (ID) of a UI5 module that implements file share support. * * If no implementation is known, `undefined` is returned. * * The contract of the module is not defined by the configuration API. * * @since 1.102 * @deprecated As of version 1.120. without a replacement. The configuration is only relevant for the `sap.ui.export` * library. * * @returns Module name (ID) of a file share support module */ getFileShareSupport(): string | undefined; /** * Returns whether the Fiori2Adaptation is on. * * @deprecated As of version 1.120. without a replacement. All the Fiori 2.0 adaptation logic is handled * by the framework, there should be no need for apps to know about it. * * @returns false - no adaptation, true - full adaptation, comma-separated list - partial adaptation Possible * values: style, collapse, title, back, hierarchy */ getFiori2Adaptation(): boolean | string; /** * Returns the URL from where the UI5 flexibility services are called; if empty, the flexibility services * are not called. * * @since 1.60.0 * @deprecated As of version 1.120. without a replacement. Was only used by the Flexibility feature which * now resolves this on its own. * * @returns Flexibility services configuration */ getFlexibilityServices(): object[]; /** * Returns the format locale string with language and region code. Falls back to language configuration, * in case it has not been explicitly defined. * * @deprecated As of version 1.120. Please use {@link module:sap/base/i18n/Formatting.getLanguageTag Formatting.getLanguageTag } * instead. * * @returns the format locale string with language and country code */ getFormatLocale(): string; /** * Returns a configuration object that bundles the format settings of UI5. * * @deprecated As of version 1.120. Please use {@link module:sap/base/i18n/Formatting Formatting} instead. * * @returns A FormatSettings object. */ getFormatSettings(): sap.ui.core.Configuration.FormatSettings; /** * frameOptions mode (allow/deny/trusted). * * @deprecated As of version 1.120. Please use {@link module:sap/ui/security/Security.getFrameOptions Security.getFrameOptions } * instead. * * @returns frameOptions mode */ getFrameOptions(): string; /** * Returns whether the UI5 control inspector is displayed. * * Has only an effect when the sap-ui-debug module has been loaded. * * @deprecated As of version 1.120. without a replacement. The inspect option is related to the very old * sap-ui-debug module. As there are now much better development tools (e.g. the UI5 Inpsector browser extension), * this option has been deprecated and the sap-ui-debug feature might be removed in future major versions * of UI5. * * @returns whether the UI5 control inspector is displayed */ getInspect(): boolean; /** * Returns a string that identifies the current language. * * The value returned by config method in most cases corresponds to the exact value that has been configured * by the user or application or that has been determined from the user agent settings. It has not been * normalized, but has been validated against a relaxed version of {@link http://www.ietf.org/rfc/bcp/bcp47.txt BCP47}, * allowing underscores ('_') instead of the suggested hyphens ('-') and not taking the case of letters * into account. * * The exceptions mentioned above affect languages that have been specified via the URL parameter `sap-language`. * That parameter by definition represents an SAP logon language code ('ABAP language'). Most but not all * of these language codes are valid ISO639 two-letter languages and as such are valid BCP47 language tags. * For better BCP47 compliance, the framework maps the following non-BCP47 SAP logon codes to a BCP47 substitute: * * ```javascript * * "ZH" --> "zh-Hans" // script 'Hans' added to distinguish it from zh-Hant * "ZF" --> "zh-Hant" // ZF is not a valid ISO639 code, use the compliant language + script 'Hant' * "1Q" --> "en-US-x-saptrc" // special language code for supportability (tracing), * represented as en-US with a private extension * "2Q" --> "en-US-x-sappsd" // special language code for supportability (pseudo translation), * represented as en-US with a private extension * "3Q" --> "en-US-x-saprigi" // special language code for the Rigi pseudo language, * represented as en-US with a private extension * ``` * * * For a normalized BCP47 tag, call {@link #.getLanguageTag Configuration.getLanguageTag} or call {@link #.getLocale Configuration.getLocale } * to get a {@link sap.ui.core.Locale Locale} object matching the language. * * @deprecated As of version 1.119. Please use {@link module:sap/base/i18n/Localization.getLanguage Localization.getLanguage } * instead. * * @returns Language string as configured */ getLanguage(): string; /** * Returns a BCP47-compliant language tag for the current language. * * The return value of config method is especially useful for an HTTP `Accept-Language` header. * * Retrieves the modern locale, e.g. sr-Latn (Serbian (Latin)), he (Hebrew), yi (Yiddish) * * @deprecated As of version 1.119. Please use {@link module:sap/base/i18n/Localization.getLanguageTag Localization.getLanguageTag } * instead. * * @returns The language tag for the current language, conforming to BCP47 */ getLanguageTag(): string; /** * Returns a Locale object for the current language. * * The Locale is derived from the {@link #.getLanguage language} property. * * @deprecated As of version 1.119. Please use {@link module:sap/base/i18n/Localization.getLanguageTag Localization.getLanguageTag } * instead. * * @returns The locale */ getLocale(): sap.ui.core.Locale; /** * Flag whether a Component should load the manifest first. * * @since 1.33.0 * @deprecated As of version 1.120. 'manifest-first' is the default for the {@link sap.ui.core.Component.create Component.create } * factory. * * @returns true if a Component should load the manifest first */ getManifestFirst(): boolean; /** * Returns a metadata object for class sap.ui.core.Configuration. * * * @returns Metadata object describing this class */ getMetadata(): sap.ui.base.Metadata; /** * Returns whether there should be an exception on any duplicate element IDs. * * @deprecated As of version 1.120. without a replacement. Future major versions of UI5 will always report * duplicate IDs as an error as the framework heavily relies on their uniqueness. * * @returns whether there should be an exception on any duplicate element IDs */ getNoDuplicateIds(): boolean; /** * Returns whether the text origin information is collected. * * @deprecated As of version 1.120. The origin info was intended as a mean to track down translation issues * to the origin of a translated text. Meanwhile, with the pseudo logon language 3Q, a similar, more lightweight * feature exists for use with OpenUI5 or SAPUI5 libraries. * * @returns whether the text info is collected */ getOriginInfo(): boolean; /** * The name of the root component to start or empty. * * @deprecated As of version 1.95. Please use {@link module:sap/ui/core/ComponentSupport ComponentSupport } * instead. See also {@link topic:82a0fcecc3cb427c91469bc537ebdddf Declarative API for Initial Components}. * * @returns name of the root component */ getRootComponent(): string; /** * Returns whether the page uses the RTL text direction. * * If no mode has been explicitly set (neither `true` nor `false`), the mode is derived from the current * language setting. * * @deprecated As of version 1.119. Please use {@link module:sap/base/i18n/Localization.getRTL Localization.getRTL } * instead. * * @returns whether the page uses the RTL text direction */ getRTL(): boolean; /** * Returns an SAP logon language for the current language. * * It will be returned in uppercase. e.g. "EN", "DE" * * @deprecated As of version 1.119. Please use {@link module:sap/base/i18n/Localization.getSAPLogonLanguage Localization.getSAPLogonLanguage } * instead. * * @returns The SAP logon language code for the current language */ getSAPLogonLanguage(): string; /** * Returns the security token handlers of an OData V4 model. * See: * {@link #.setSecurityTokenHandlers} * * @deprecated As of version 1.120. Please use {@link module:sap/ui/security/Security.getSecurityTokenHandlers Security.getSecurityTokenHandlers } * instead. * * @returns the security token handlers (an empty array if there are none) */ getSecurityTokenHandlers(): Array< (p1: sap.ui.core.URI) => Promise >; /** * Flag if statistics are requested. * * Flag set by TechnicalInfo Popup will also be checked. So it's active if set by URL parameter or manually * via TechnicalInfo. * * @since 1.106.0 * @deprecated As of version 1.120. without a replacment. The configuration is only relevant within the * framework. * * @returns Whether statistics are enabled */ getStatisticsEnabled(): boolean; /** * Returns the theme name * * @deprecated As of version 1.119. Please use {@link module:sap/ui/core/Theming.getTheme Theming.getTheme } * instead. * * @returns the theme name */ getTheme(): string; /** * Retrieves the configured IANA timezone ID. * * @deprecated As of version 1.119. Please use {@link module:sap/base/i18n/Localization.getTimezone Localization.getTimezone } * instead. * * @returns The configured IANA timezone ID, e.g. "America/New_York" */ getTimezone(): string; /** * Prefix to be used for automatically generated control IDs. Default is a double underscore "__". * * @deprecated As of version 1.119. Please use {@link sap.ui.base.ManagedObjectMetadata.getUIDPrefix ManagedObjectMetadata.getUIDPrefix } * instead. * * @returns the prefix to be used */ getUIDPrefix(): string; /** * Returns the version of the framework. * * Similar to `sap.ui.version`. * * @deprecated As of version 1.120. Please use the async {@link module:sap/ui/VersionInfo.load VersionInfo.load } * instead. * * @returns the version */ getVersion(): import("sap/base/util/Version").default; /** * URL of the whitelist service. * * @deprecated As of version 1.85. Use {@link module:sap/ui/security/Security.getAllowlistService Security.getAllowlistService } * instead. SAP strives to replace insensitive terms with inclusive language. Since APIs cannot be renamed * or immediately removed for compatibility reasons, this API has been deprecated. * * @returns whitelist service URL */ getWhitelistService(): string; /** * Sets the current animation mode. * * Expects an animation mode as string and validates it. If a wrong animation mode was set, an error is * thrown. If the mode is valid it is set, then the attributes `data-sap-ui-animation` and `data-sap-ui-animation-mode` * of the HTML document root element are also updated. If the `animationMode` is `Configuration.AnimationMode.none` * the old `animation` property is set to `false`, otherwise it is set to `true`. * * @since 1.50.0 * @deprecated As of version 1.120. Please use {@link module:sap/ui/core/ControlBehavior.setAnimationMode ControlBehavior.setAnimationMode } * instead. */ setAnimationMode( /** * A valid animation mode */ sAnimationMode: sap.ui.core.Configuration.AnimationMode ): void; /** * Sets the new calendar type to be used from now on in locale dependent functionality (for example, formatting, * translation texts, etc.). * * @since 1.28.6 * @deprecated As of version 1.120. Please use {@link module:sap/base/i18n/Formatting.setCalendarType Formatting.setCalendarType } * instead. * * @returns `this` to allow method chaining */ setCalendarType( /** * the new calendar type. Set it with null to clear the calendar type and the calendar type is calculated * based on the format settings and current locale. */ sCalendarType: sap.ui.core.CalendarType | null ): this; /** * Sets the calendar week numbering algorithm which is used to determine the first day of the week and the * first calendar week of the year, see {@link sap.ui.core.date.CalendarWeekNumbering}. * * @since 1.113.0 * @deprecated As of version 1.120. Please use {@link module:sap/base/i18n/Formatting.setCalendarWeekNumbering Formatting.setCalendarWeekNumbering } * instead. * * @returns `this` to allow method chaining */ setCalendarWeekNumbering( /** * The calendar week numbering algorithm */ sCalendarWeekNumbering: sap.ui.core.date.CalendarWeekNumbering ): this; /** * Sets a new format locale to be used from now on for retrieving locale specific formatters. Modifying * this setting does not have an impact on the retrieval of translated texts! * * Can either be set to a concrete value (a BCP47 or Java locale compliant language tag) or to `null`. When * set to `null` (default value) then locale specific formatters are retrieved for the current language. * * After changing the format locale, the framework tries to update localization specific parts of the UI. * See the documentation of {@link #.setLanguage} for details and restrictions. * * **Note**: When a format locale is set, it has higher priority than a number, date or time format defined * with a call to `setLegacyNumberFormat`, `setLegacyDateFormat` or `setLegacyTimeFormat`. * * **Note**: See documentation of {@link #.setLanguage} for restrictions. * * @deprecated As of version 1.120. Please use {@link module:sap/base/i18n/Formatting.setLanguageTag Formatting.setLanguageTag } * instead. * * @returns `this` to allow method chaining */ setFormatLocale( /** * the new format locale as a BCP47 compliant language tag; case doesn't matter and underscores can be used * instead of hyphens to separate components (compatibility with Java Locale IDs) */ sFormatLocale: string | null ): this; /** * Sets a new language to be used from now on for language/region dependent functionality (e.g. formatting, * data types, translated texts, ...). * * When the language can't be interpreted as a BCP47 language (using the relaxed syntax described in {@link #.getLanguage Configuration.getLanguage}, * an error will be thrown. * * When the language has changed, the Core will fire its {@link sap.ui.core.Core#event:localizationChanged localizationChanged } * event. * * Restrictions: * * The framework **does not** guarantee that already created, language dependent objects will be updated * by config call. It therefore remains best practice for applications to switch the language early, e.g. * before any language dependent objects are created. Applications that need to support more dynamic changes * of the language should listen to the `localizationChanged` event and adapt all language dependent objects * that they use (e.g. by rebuilding their UI). * * Currently, the framework notifies the following objects about a change of the localization settings before * it fires the `localizationChanged` event: * * * - date and number data types that are used in property bindings or composite bindings in existing Elements, * Controls, UIAreas or Components * - ResourceModels currently assigned to the Core, a UIArea, Component, Element or Control * - Elements or Controls that implement the `onLocalizationChanged` hook * * It furthermore derives the RTL mode from the new language, if no explicit RTL mode has been set. If the * RTL mode changes, the following additional actions will be taken: * * * - the URLs of already loaded library theme files will be changed * - the `dir` attribute of the page will be changed to reflect the new mode. * - all UIAreas will be invalidated (which results in a rendering of the whole UI5 UI) * * config method does not accept SAP language codes for `sLanguage`. Instead, a second parameter `sSAPLogonLanguage` * can be provided with an SAP language code corresponding to the given language. A given value will be * returned by the {@link #.getSAPLogonLanguage Configuration.getSAPLogonLanguage} method. It is up to the * caller to provide a consistent pair of BCP47 language and SAP language code. The SAP language code is * only checked to be of length 2 and must consist of letters or digits only. * * **Note**: When using config method please take note of and respect the above mentioned restrictions. * See: * http://scn.sap.com/docs/DOC-14377 * * @deprecated As of version 1.119. Please use {@link module:sap/base/i18n/Localization.setLanguage Localization.setLanguage } * instead. * * @returns `this` to allow method chaining */ setLanguage( /** * the new language as a BCP47 compliant language tag; case doesn't matter and underscores can be used instead * of hyphens to separate components (compatibility with Java Locale IDs) */ sLanguage: string, /** * SAP language code that corresponds to the `sLanguage`; if a value is specified, future calls to `getSAPLogonLanguage` * will return that value; if no value is specified, the framework will use the ISO639 language part of * `sLanguage` as SAP Logon language. */ sSAPLogonLanguage?: string ): this; /** * Sets the character orientation mode to be used from now on. * * Can either be set to a concrete value (true meaning right-to-left, false meaning left-to-right) or to * `null` which means that the character orientation mode should be derived from the current language (incl. * region) setting. * * After changing the character orientation mode, the framework tries to update localization specific parts * of the UI. See the documentation of {@link #.setLanguage} for details and restrictions. * * **Note**: See documentation of {@link #.setLanguage} for restrictions. * * @deprecated As of version 1.119. Please use {@link module:sap/base/i18n/Localization.setRTL Localization.setRTL } * instead. * * @returns `this` to allow method chaining */ setRTL( /** * new character orientation mode or `null` */ bRTL: boolean | null ): this; /** * Sets the security token handlers for an OData V4 model. See chapter {@link https://ui5.sap.com/#/topic/9613f1f2d88747cab21896f7216afdac/section_STH Security Token Handling}. * See: * {@link #.getSecurityTokenHandlers} * * @deprecated As of version 1.120. Please use {@link module:sap/ui/security/Security.setSecurityTokenHandlers Security.setSecurityTokenHandlers } * instead. */ setSecurityTokenHandlers( /** * The security token handlers */ aSecurityTokenHandlers: Array<(p1: sap.ui.core.URI) => Promise> ): void; /** * Allows setting the theme name * * @deprecated As of version 1.119. Please use {@link module:sap/ui/core/Theming.setTheme Theming.setTheme } * instead. * * @returns `this` to allow method chaining */ setTheme( /** * the theme name */ sTheme: string ): this; /** * Sets the timezone such that all date and time based calculations use config timezone. * * **Important:** It is strongly recommended to only use config API at the earliest point of time while * initializing a UI5 app. A later adjustment of the time zone should be avoided. It can lead to unexpected * data inconsistencies in a running application, because date objects could still be related to a previously * configured time zone. Instead, the app should be completely restarted with the new time zone. For more * information, see {@link https://ui5.sap.com/#/topic/6c9e61dc157a40c19460660ece8368bc Dates, Times, Timestamps, and Time Zones}. * * When the timezone has changed, the Core will fire its {@link sap.ui.core.Core#event:localizationChanged localizationChanged } * event. * * @since 1.99.0 * @deprecated As of version 1.119. Please use {@link module:sap/base/i18n/Localization.setTimezone Localization.setTimezone } * instead. * * @returns `this` to allow method chaining */ setTimezone( /** * IANA timezone ID, e.g. "America/New_York". Use `null` to reset the timezone to the browser's local timezone. * An invalid IANA timezone ID will fall back to the browser's timezone. */ sTimezone?: string | null ): this; } /** * Singleton Core instance of the SAP UI Library. * * The module export of `sap/ui/core/Core` is **not** a class, but the singleton Core instance itself. The * `sap.ui.core.Core` class itself must not be instantiated, except by the framework itself. * * The Core provides a {@link #ready ready function} to execute code after the Core was booted. * * Example: * ```javascript * * * sap.ui.require(["sap/ui/core/Core"], async function(Core) { * * // Usage of a callback function * Core.ready(function() { * ... * }); * * // Usage of Core.ready() as a Promise * await Core.ready(); * ... * }); * * ``` */ interface Core { /** * Creates a new subclass of class `sap.ui.core.Core` with name `sClassName` and enriches it with the information * contained in `oClassInfo`. * * `oClassInfo` might contain the same kind of information as described in {@link sap.ui.base.ManagedObject.extend}. * * @deprecated As of version 1.119. without replacement. In future major versions, the Core no longer has * a class nature and therefore can't be extended. * * @returns The created class / constructor function */ extend( /** * Qualified name of the newly created class */ sClassName: string, /** * Object literal with information about the class */ oClassInfo?: { /** * The metadata object describing the class. See {@link sap.ui.core.Component.MetadataOptions MetadataOptions } * for the values allowed in every extend. */ metadata?: sap.ui.core.Component.MetadataOptions; } ): Function; /** * Returns the metadata for class `sap.ui.core.Core`. * * @deprecated As of version 1.119. without replacement. In future major versions, the Core no longer has * a class nature and no longer inherits from sap.ui.base.Object and therefore no longer has metadata. * * @returns Metadata object describing this class */ getMetadata(): sap.ui.base.Metadata; /** * Enforces an immediate update of the visible UI (aka "rendering"). * * In general, applications and Controls should avoid calling this method and instead let the framework * manage any necessary rendering. * * @deprecated As of version 1.118. without replacement. In the next major version, synchronously rendering * UI updates is no longer supported as it can lead to unnecessary intermediate DOM updates or layout shifting * etc. Controls should rather use invalidation and apps should not trigger rendering at all but rather * rely on the framework's automatic update mechanisms. Test code can use the test module `sap/ui/test/utils/nextUIUpdate` * as a convenient way to wait for the next asynchronous rendering. */ applyChanges(): void; /** * Applies the theme with the given name (by loading the respective style sheets, which does not disrupt * the application). * * By default, the theme files are expected to be located at path relative to the respective control library * ([libraryLocation]/themes/[themeName]). Different locations can be configured by using the method setThemePath() * or by using the second parameter "sThemeBaseUrl" of applyTheme(). Usage of this second parameter is a * shorthand for setThemePath and internally calls setThemePath, so the theme location is then known. * * sThemeBaseUrl is a single URL to specify the default location of all theme files. This URL is the base * folder below which the control library folders are located. E.g. if the CSS files are not located relative * to the root location of UI5, but instead they are at locations like http://my.server/myapp/resources/sap/ui/core/themes/my_theme/library.css * then the URL that needs to be given is: http://my.server/myapp/resources All theme resources are then * loaded from below this folder - except if for a certain library a different location has been registered. * * If the theme resources are not all either below this base location or with their respective libraries, * then setThemePath must be used to configure individual locations. * * @deprecated As of version 1.119. Please use {@link module:sap/ui/core/Theming.setTheme Theming.setTheme } * instead. */ applyTheme( /** * the name of the theme to be loaded */ sThemeName: string, /** * the (optional) base location of the theme */ sThemeBaseUrl?: string ): void; /** * Registers a listener for control events. * * When called, the context of the listener (its `this`) will be bound to `oListener` if specified, otherwise * it will be bound to a dummy event provider object. * * @deprecated As of version 1.119. without a replacement. Applications should not have the need to intercept * all control events. */ attachControlEvent( /** * Callback to be called for each control event */ fnFunction: Function, /** * Optional context object to call the callback on */ oListener?: object ): void; /** * Attaches event handler `fnFunction` to the {@link #event:formatError formatError} event of `sap.ui.core.Core`. * * When called, the context of the listener (its `this`) will be bound to `oListener` if specified, otherwise * it will be bound to a dummy event provider object. * * Please note that this event is a bubbling event and may already be canceled before reaching the core. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#attachFormatError ManagedObject#attachFormatError } * instead. * * @returns Reference to `this` in order to allow method chaining */ attachFormatError( /** * An object that will be passed to the handler along with the event object when the event is fired */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to a dummy event provider object */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:formatError formatError} event of `sap.ui.core.Core`. * * When called, the context of the listener (its `this`) will be bound to `oListener` if specified, otherwise * it will be bound to a dummy event provider object. * * Please note that this event is a bubbling event and may already be canceled before reaching the core. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#attachFormatError ManagedObject#attachFormatError } * instead. * * @returns Reference to `this` in order to allow method chaining */ attachFormatError( /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to a dummy event provider object */ oListener?: object ): this; /** * Registers a given function that is executed after the framework has been initialized. * * The given function will either be called as soon as the framework has been initialized or, if it has * been initialized already, it will be called immediately. * * More information about the initialization process and the steps it consists of can be found in the documentation * topic "{@link https://ui5.sap.com/#/topic/91f2c9076f4d1014b6dd926db0e91070 Initialization Process}". * * @since 1.13.2 * @deprecated As of version 1.118. Please use {@link sap.ui.core.Core.ready Core.ready} instead. */ attachInit( /** * Function to be after initialization of the framework */ fnFunction: Function ): void; /** * Registers a given function that is executed after the framework has been initialized. * * The method is executed only once and only if the framework has not been initialized already. This could * be checked by calling {@link #isInitialized}, but in most cases it is more convenient to use {@link #attachInit } * instead. This guarantees that the given function is executed exactly once, independent of the state of * the framework. * * @deprecated As of version 1.13.2. Register with the more convenient {@link #attachInit} function instead */ attachInitEvent( /** * Function that is called after initialization of the framework */ fnFunction: Function ): void; /** * Registers a listener to the central interval timer. * * When called, the context of the listener (its `this`) will be bound to `oListener` if specified, otherwise * it will be bound to the interval timer instance. * * @since 1.16.0 * @deprecated As of version 1.61. Use `IntervalTrigger.addListener()` from "sap/ui/core/IntervalTrigger" * module. */ attachIntervalTimer( /** * Callback to be called periodically */ fnFunction: Function, /** * Optional context object to call the callback on */ oListener?: object ): void; /** * Register a listener for the {@link #event:localizationChanged localizationChanged} event. * * When called, the context of the listener (its `this`) will be bound to `oListener` if specified, otherwise * it will be bound to a dummy event provider object. * * @deprecated As of version 1.118. Please use {@link module:sap/base/i18n/Localization.attachChange Localization.attachChange } * instead. */ attachLocalizationChanged( /** * Callback to be called when the event occurs */ fnFunction: Function, /** * Context object to call the function on */ oListener?: object ): void; /** * Attaches event handler `fnFunction` to the {@link #event:parseError parseError} event of `sap.ui.core.Core`. * * When called, the context of the listener (its `this`) will be bound to `oListener` if specified, otherwise * it will be bound to a dummy event provider object. * * Please note that this event is a bubbling event and may already be canceled before reaching the core. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#attachParseError ManagedObject#attachParseError } * instead. * * @returns Reference to `this` in order to allow method chaining */ attachParseError( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to a dummy event provider object */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:parseError parseError} event of `sap.ui.core.Core`. * * When called, the context of the listener (its `this`) will be bound to `oListener` if specified, otherwise * it will be bound to a dummy event provider object. * * Please note that this event is a bubbling event and may already be canceled before reaching the core. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#attachParseError ManagedObject#attachParseError } * instead. * * @returns Reference to `this` in order to allow method chaining */ attachParseError( /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to a dummy event provider object */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:ThemeChanged ThemeChanged} event of this `sap.ui.core.Core`. * * When called, the context of the event handler (its `this`) will be bound to `oListener` if specified, * otherwise it will be bound to a dummy event provider object. * * @deprecated As of version 1.118. See {@link module:sap/ui/core/Theming.attachApplied Theming.attachApplied } * instead. */ attachThemeChanged( /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to a dummy event provider object */ oListener?: object ): void; /** * Attaches event handler `fnFunction` to the {@link #event:validationError validationError} event of `sap.ui.core.Core`. * * When called, the context of the listener (its `this`) will be bound to `oListener` if specified, otherwise * it will be bound to a dummy event provider object. * * Please note that this event is a bubbling event and may already be canceled before reaching the core. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#attachValidationError ManagedObject#attachValidationError } * instead. * * @returns Reference to `this` in order to allow method chaining */ attachValidationError( /** * An application-specific payload object that will be passed to the event handler along with the event * object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to a dummy event provider object */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:validationError validationError} event of `sap.ui.core.Core`. * * When called, the context of the listener (its `this`) will be bound to `oListener` if specified, otherwise * it will be bound to a dummy event provider object. * * Please note that this event is a bubbling event and may already be canceled before reaching the core. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#attachValidationError ManagedObject#attachValidationError } * instead. * * @returns Reference to `this` in order to allow method chaining */ attachValidationError( /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to a dummy event provider object */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:validationSuccess validationSuccess} event of * `sap.ui.core.Core`. * * When called, the context of the listener (its `this`) will be bound to `oListener` if specified, otherwise * it will be bound to a dummy event provider object. * * Please note that this event is a bubbling event and may already be canceled before reaching the core. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#attachValidationSuccess ManagedObject#attachValidationSuccess } * instead. * * @returns Reference to `this` in order to allow method chaining */ attachValidationSuccess( /** * The object, that should be passed along with the event-object when firing the event */ oData: object, /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to a dummy event provider object */ oListener?: object ): this; /** * Attaches event handler `fnFunction` to the {@link #event:validationSuccess validationSuccess} event of * `sap.ui.core.Core`. * * When called, the context of the listener (its `this`) will be bound to `oListener` if specified, otherwise * it will be bound to a dummy event provider object. * * Please note that this event is a bubbling event and may already be canceled before reaching the core. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#attachValidationSuccess ManagedObject#attachValidationSuccess } * instead. * * @returns Reference to `this` in order to allow method chaining */ attachValidationSuccess( /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object to call the event handler with. Defaults to a dummy event provider object */ oListener?: object ): this; /** * Returns a list of all controls with a field group ID. See {@link sap.ui.core.Control#checkFieldGroupIds Control.prototype.checkFieldGroupIds } * for a description of the `vFieldGroupIds` parameter. * * @deprecated As of version 1.118. use {@link sap.ui.core.Control.getControlsByFieldGroupId Control.getControlsByFieldGroupId } * instead. * * @returns The list of controls with matching field group IDs */ byFieldGroupId( /** * ID of the field group or an array of field group IDs to match */ vFieldGroupIds?: string | string[] ): sap.ui.core.Control[]; /** * Returns the registered element with the given ID, if any. * * The ID must be the globally unique ID of an element, the same as returned by `oElement.getId()`. * * When the element has been created from a declarative source (e.g. XMLView), that source might have used * a shorter, non-unique local ID. A search for such a local ID cannot be executed with this method. It * can only be executed on the corresponding scope (e.g. on an XMLView instance), by using the {@link sap.ui.core.mvc.View#byId View#byId } * method of that scope. * * @deprecated As of version 1.119. Please use {@link sap.ui.core.Element.getElementById Element.getElementById } * instead. * * @returns Element with the given ID or `undefined` */ byId( /** * ID of the element to search for */ sId: sap.ui.core.ID | null | undefined ): sap.ui.core.Element | undefined; /** * Creates a component with the provided id and settings. * * When the optional parameter `sUrl` is given, then all request for resources of the library will be redirected * to the given URL. This is convenience for a call to * ```javascript * * sap.ui.loader.config({ * paths: { * "lib/with/slashes": vUrl * } * }); * ``` * * * @deprecated As of version 1.95. Please use {@link sap.ui.core.Component.create Component.create} instead. * * @returns The created component instance or a promise on it in the async use case */ createComponent( /** * name of the component to import or object containing all needed parameters */ vComponent: | string | { /** * name of the component to import */ name?: string; /** * URL to load the component from */ url?: string; /** * ID for the component instance */ id?: string; /** * settings object for the component */ settings?: object; /** * user specific data which is available during the whole lifecycle of the component */ componentData?: any; }, /** * the URL to load the component from */ sUrl?: string, /** * the ID for the component instance */ sId?: string, /** * the settings object for the component */ mSettings?: object ): sap.ui.core.Component | Promise; /** * Returns a new instance of the RenderManager for exclusive use by the caller. * * The caller must take care to destroy the render manager when it is no longer needed. Calling this method * before the Core has been {@link #isInitialized initialized}, is not recommended. * * @deprecated As of version 1.119. without replacement. In the next major version, synchronously rendering * UI updates is no longer supported as it can lead to unnecessary intermediate DOM updates or layout shifting * etc. Controls should rather use invalidation. * * @returns New instance of the RenderManager */ createRenderManager(): sap.ui.core.RenderManager; /** * Creates a new {@link sap.ui.core.UIArea UIArea}. * * @deprecated As of version 1.1. use {@link sap.ui.core.Control#placeAt Control#placeAt} instead! * * @returns a new UIArea */ createUIArea( /** * a DOM Element or ID string of the UIArea */ oDomRef: string | /* was Element */ global_Element ): sap.ui.core.UIArea; /** * Unregisters a listener for control events. * * The passed function and listener object must match the ones used for event registration. * * @deprecated As of version 1.119. without a replacement. Applications should not have the need to intercept * all control events. */ detachControlEvent( /** * Function to unregister */ fnFunction: Function, /** * Context object on which the given function had to be called */ oListener?: object ): void; /** * Detaches event handler `fnFunction` from the {@link #event:formatError formatError} event of `sap.ui.core.Core`. * * The passed function and listener object must match the ones used for event registration. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#detachFormatError ManagedObject#detachFormatError } * instead. * * @returns Reference to `this` in order to allow method chaining */ detachFormatError( /** * The callback function to unregister */ fnFunction: Function, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Unregisters a listener for the central interval timer. * * A listener will only be unregistered if the same function/context combination is given as in the `attachIntervalTimer` * call. * * @since 1.16.0 * @deprecated As of version 1.61. Use `IntervalTrigger.removeListener()` from "sap/ui/core/IntervalTrigger" * module. */ detachIntervalTimer( /** * function to unregister */ fnFunction: Function, /** * context object given during registration */ oListener?: object ): void; /** * Unregister a listener from the {@link #event:localizationChanged localizationChanged} event. * * The listener will only be unregistered if the same function/context combination is given as in the call * to `attachLocalizationListener`. * * @deprecated As of version 1.118. Please use {@link module:sap/base/i18n/Localization.detachChange Localization.detachChange } * instead. */ detachLocalizationChanged( /** * Callback to be deregistered */ fnFunction: Function, /** * Context object on which the given function had to be called */ oListener?: object ): void; /** * Detaches event handler `fnFunction` from the {@link #event:parseError parseError} event of `sap.ui.core.Core`. * * The passed function and listener object must match the ones used for event registration. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#detachParseError ManagedObject#detachParseError } * instead. * * @returns Reference to `this` in order to allow method chaining */ detachParseError( /** * The callback function to unregister. */ fnFunction: Function, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:ThemeChanged ThemeChanged} event of this `sap.ui.core.Core`. * * The passed function and listener object must match the ones used for event registration. * * @deprecated As of version 1.118. See {@link module:sap/ui/core/Theming.detachApplied Theming#detachApplied } * instead. */ detachThemeChanged( /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Object on which the given function had to be called. */ oListener?: object ): void; /** * Detaches event handler `fnFunction` from the {@link #event:validationError validationError} event of * `sap.ui.core.Core`. * * The passed function and listener object must match the ones used for event registration. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#detachValidationError ManagedObject#detachValidationError } * instead. * * @returns Reference to `this` in order to allow method chaining */ detachValidationError( /** * The callback function to unregister */ fnFunction: Function, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Detaches event handler `fnFunction` from the {@link #event:validationSuccess validationSuccess} event * of `sap.ui.core.Core`. * * The passed function and listener object must match the ones used for event registration. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#detachValidationSuccess ManagedObject#detachValidationSuccess } * instead. * * @returns Reference to `this` in order to allow method chaining */ detachValidationSuccess( /** * The function to be called, when the event occurs */ fnFunction: Function, /** * Context object on which the given function had to be called */ oListener?: object ): this; /** * Fires event {@link #event:formatError formatError} to attached listeners. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#fireFormatError ManagedObject#fireFormatError } * instead. * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireFormatError( /** * Parameters to pass along with the event. */ oParameters?: { /** * Element where the format error occurred */ element: sap.ui.core.Element; /** * Name of the property of the element where the format error occurred */ property: string; /** * Type of the property */ type: sap.ui.model.Type; /** * Value of the property which was entered when the format error occurred */ newValue: any; /** * Value of the property which was present before a new value was entered (before the format error) */ oldValue: any; /** * Exception object which occurred and has more information about the format error */ exception: object; } ): this; /** * Fires event {@link #event:parseError parseError} to attached listeners. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#fireParseError ManagedObject#fireParseError } * instead. * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireParseError( /** * Parameters to pass along with the event. */ oParameters?: { /** * Element where the parse error occurred */ element: sap.ui.core.Element; /** * Name of the property of the element where the parse error occurred */ property: string; /** * Type of the property */ type: sap.ui.model.Type; /** * Value of the property which was entered when the parse error occurred */ newValue: object; /** * Value of the property which was present before a new value was entered (before the parse error) */ oldValue: object; /** * Exception object which occurred and has more information about the parse error */ exception: object; } ): this; /** * Fires event {@link #event:validationError validationError} to attached listeners. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#fireValidationError ManagedObject.fireValidationError } * instead. * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireValidationError( /** * Parameters to pass along with the event. */ oParameters?: { /** * The Element where the validation error occurred */ element: sap.ui.core.Element; /** * Property name of the element where the validation error occurred */ property: string; /** * Type of the property */ type: sap.ui.model.Type; /** * Value of the property which was entered when the validation error occurred */ newValue: object; /** * Value of the property which was present before a new value was entered (before the validation error) */ oldValue: object; /** * Exception object which occurred and has more information about the validation error */ exception: object; } ): this; /** * Fires event {@link #event:validationSuccess validationSuccess} to attached listeners. * * Expects following event parameters: * - 'element' of type `sap.ui.core.Element` * - 'property' of type `string` * - 'type' of type `string` * - 'newValue' of type `object` * - 'oldValue' of type `object` * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#fireValidationSuccess ManagedObject#fireValidationSuccess } * instead. * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Reference to `this` in order to allow method chaining */ fireValidationSuccess( /** * Parameters to pass along with the event */ oParameters?: object ): this; /** * Returns the instance of the application (if exists). * * @deprecated As of version 1.15.1. The Component class is enhanced to take care about the Application * code. * * @returns instance of the current application */ getApplication(): sap.ui.app.Application; /** * Returns the registered component for the given id, if any. * * @deprecated As of version 1.95. Please use {@link sap.ui.core.Component.get Component.get} instead. * * @returns the component for the given id */ getComponent(sId: string): sap.ui.core.Component; /** * Returns the Configuration of the Core. * * @deprecated As of version 1.120. Please see {@link sap.ui.core.Configuration Configuration} for the corresponding * replacements. * * @returns the Configuration of the current Core. */ getConfiguration(): sap.ui.core.Configuration; /** * Returns the registered element for the given ID, if any. * * @deprecated As of version 1.1. use `sap.ui.core.Core.prototype.byId` instead! * * @returns Element for the given ID or `undefined` */ getControl( /** * ID of the control to retrieve */ sId: sap.ui.core.ID | null | undefined ): sap.ui.core.Element | undefined; /** * Returns the ID of the control/element currently in focus. * * @deprecated As of version 1.119. Please use {@link sap.ui.core.Element.getActiveElement Element.getActiveElement } * to get the currently focused element. You can then retrieve the ID of that element with {@link sap.ui.core.Element#getId Element#getId}. * Please be aware, {@link sap.ui.core.Element.getActiveElement Element.getActiveElement} can return 'undefined'. * * @returns the ID of the control/element currently in focus. */ getCurrentFocusedControlId(): string; /** * Returns the registered element for the given ID, if any. * * @deprecated As of version 1.1. use `sap.ui.core.Core.byId` instead! * * @returns Element for the given ID or `undefined` */ getElementById( /** * ID of the element to retrieve */ sId: sap.ui.core.ID | null | undefined ): sap.ui.core.Element | undefined; /** * Returns the event bus. * * @since 1.8.0 * @deprecated As of version 1.119.0. Please use {@link sap.ui.core.EventBus.getInstance EventBus.getInstance } * for global usage instead. Creating an own local instance is the preferred usage. * * @returns the event bus */ getEventBus(): sap.ui.core.EventBus; /** * Retrieves a resource bundle for the given library and locale. * * If only one argument is given, it is assumed to be the libraryName. The locale then falls back to the * current {@link module:sap/base/i18n/Localization.getLanguage session locale}. If no argument is given, * the library also falls back to a default: "sap.ui.core". * * Configuration via App Descriptor: When the App Descriptor for the library is available without further * request (manifest.json has been preloaded) and when the App Descriptor is at least of version 1.9.0 or * higher, then this method will evaluate the App Descriptor entry `"sap.ui5" / "library" / "i18n"`. * * - When the entry is `true`, a bundle with the default name "messagebundle.properties" will be loaded * * - If it is a string, then that string will be used as name of the bundle * - If it is `false`, no bundle will be loaded and the result will be `undefined` * * Caching: Once a resource bundle for a library has been loaded, it will be cached by this method. Further * calls for the same library and locale won't create new requests, but return the already loaded bundle. * There's therefore no need for control code to cache the returned bundle for a longer period of time. * Not further caching the result also prevents stale texts after a locale change. * * Asynchronous Loading: The asynchronous variant of {@link #loadLibrary} will evaluate the same descriptor * entry as described above. If it is not `false`, loading the main resource bundle of the library will * become a subtask of the asynchronous loading of the library. * * Due to this preload of the main bundle and the caching behavior of this method, controls in such a library * still can use the synchronous variant of `getLibraryResourceBundle` in their API, behavior and rendering * code. Only when the bundle is needed at module execution time (by top level code in a control module), * then the asynchronous variant of this method should be preferred. * * @deprecated As of version 1.119. Please use {@link sap.ui.core.Lib.getResourceBundleFor Lib.getResourceBundleFor } * instead. * * @returns The best matching resource bundle for the given parameters or `undefined`; in asynchronous case * a Promise on that bundle is returned */ getLibraryResourceBundle( /** * Name of the library to retrieve the bundle for */ sLibraryName?: string, /** * Locale to retrieve the resource bundle for */ sLocale?: string, /** * Whether the resource bundle is loaded asynchronously */ bAsync?: boolean ): | import("sap/base/i18n/ResourceBundle").default | undefined | Promise; /** * Retrieves a resource bundle for the given library and locale. * * If only one argument is given, it is assumed to be the libraryName. The locale then falls back to the * current {@link module:sap/base/i18n/Localization.getLanguage session locale}. If no argument is given, * the library also falls back to a default: "sap.ui.core". * * Configuration via App Descriptor: When the App Descriptor for the library is available without further * request (manifest.json has been preloaded) and when the App Descriptor is at least of version 1.9.0 or * higher, then this method will evaluate the App Descriptor entry `"sap.ui5" / "library" / "i18n"`. * * - When the entry is `true`, a bundle with the default name "messagebundle.properties" will be loaded * * - If it is a string, then that string will be used as name of the bundle * - If it is `false`, no bundle will be loaded and the result will be `undefined` * * Caching: Once a resource bundle for a library has been loaded, it will be cached by this method. Further * calls for the same library and locale won't create new requests, but return the already loaded bundle. * There's therefore no need for control code to cache the returned bundle for a longer period of time. * Not further caching the result also prevents stale texts after a locale change. * * Asynchronous Loading: The asynchronous variant of {@link #loadLibrary} will evaluate the same descriptor * entry as described above. If it is not `false`, loading the main resource bundle of the library will * become a subtask of the asynchronous loading of the library. * * Due to this preload of the main bundle and the caching behavior of this method, controls in such a library * still can use the synchronous variant of `getLibraryResourceBundle` in their API, behavior and rendering * code. Only when the bundle is needed at module execution time (by top level code in a control module), * then the asynchronous variant of this method should be preferred. * * @deprecated As of version 1.119. Please use {@link sap.ui.core.Lib.getResourceBundleFor Lib.getResourceBundleFor } * instead. * * @returns The best matching resource bundle for the given parameters or `undefined`; in asynchronous case * a Promise on that bundle is returned */ getLibraryResourceBundle( /** * Name of the library to retrieve the bundle for */ sLibraryName?: string, /** * Whether the resource bundle is loaded asynchronously */ bAsync?: boolean ): | import("sap/base/i18n/ResourceBundle").default | undefined | Promise; /** * Returns a map of library info objects for all currently loaded libraries, keyed by their names. * * The structure of the library info objects matches the structure of the info object that the {@link #initLibrary } * method expects. Only property names documented with `initLibrary` should be accessed, any additional * properties might change or disappear in future. When a property does not exists, its default value (as * documented with `initLibrary`) should be assumed. * * **Note:** The returned info objects must not be modified. They might be a living copy of the internal * data (for efficiency reasons) and the framework is not prepared to handle modifications to these objects. * * @deprecated As of version 1.119. without a 1:1 replacement. Callers that used `getLoadedLibraries` to * check whether a certain library is loaded, should rather use {@link sap.ui.core.Lib#isLoaded Library#isLoaded}. * * @returns Map of library info objects keyed by the library names. */ getLoadedLibraries(): Record; /** * Returns the `Messaging` module. * * @since 1.33.0 * @deprecated As of version 1.118. Please use {@link module:sap/ui/core/Messaging Messaging} instead. */ getMessageManager(): import("sap/ui/core/Messaging").default; /** * Get the model with the given model name. * * The name can be omitted to reference the default model or it must be a non-empty string. * * Note: to be compatible with future versions of this API, applications must not use the value `null`, * the empty string `""` or the string literals `"null"` or `"undefined"` as model name. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#getModel ManagedObject#getModel } * instead. * * @returns oModel */ getModel( /** * name of the model to be retrieved */ sName?: string ): sap.ui.model.Model; /** * Creates a new `RenderManager` instance for use by the caller. * * @deprecated As of version 0.15.0. Replaced by `createRenderManager()` * * @returns A newly created RenderManager */ getRenderManager(): sap.ui.core.RenderManager; /** * Returns the instance of the root component (if exists). * * @deprecated As of version 1.95. Please use {@link module:sap/ui/core/ComponentSupport} instead. See also * {@link topic:82a0fcecc3cb427c91469bc537ebdddf Declarative API for Initial Components}. * * @returns instance of the current root component */ getRootComponent(): sap.ui.core.Component; /** * Returns the static, hidden area DOM element belonging to this core instance. * * It can be used e.g. for hiding elements like Popups, Shadow, Blocklayer etc. * * If it is not yet available, a DIV is created and appended to the body. * * @deprecated As of version 1.119.0. Please use {@link module:sap/ui/core/StaticArea.getDomRef StaticArea.getDomRef } * instead. * * @returns the static, hidden area DOM element belonging to this core instance. */ getStaticAreaRef(): /* was Element */ global_Element; /** * Returns the registered template for the given id, if any. * * @deprecated As of version 1.29.1. Require 'sap/ui/core/tmpl/Template' and use {@link sap.ui.core.tmpl.Template.byId Template.byId } * instead. * * @returns the template for the given id */ getTemplate(sId: string): sap.ui.core.Component; /** * Returns the {@link sap.ui.core.UIArea UIArea} with the given ID or that belongs to the given DOM element. * * @deprecated As of version 1.107. For access to the static UIArea, please use the {@link module:sap/ui/core/StaticArea StaticArea } * instead. * * @returns UIArea with the given ID or DOM element or `null` or `undefined`. */ getUIArea( /** * DOM element or ID of the UIArea */ o: string | /* was Element */ global_Element ): sap.ui.core.UIArea | null | undefined; /** * Returns `true` if there are any pending rendering tasks or when such rendering tasks are currently being * executed. * * @deprecated As of version 1.118. without replacement. The known use cases in testing environments are * covered by other APIs or features, e.g. OPA's waitFor mechanism. * * @returns true if there are pending (or executing) rendering tasks. */ getUIDirty(): boolean; /** * Check if a Model is set to the core * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#hasModel ManagedObject#hasModel } * instead. * * @returns true or false */ hasModel(): boolean; /** * Includes a library theme into the current page (if a variant is specified it will include the variant * library theme) * * @deprecated As of version 1.119. without replacement. There's no known use case that would require a * public API. */ includeLibraryTheme( /** * the name of the UI library */ sLibName: string, /** * the variant to include (optional) */ sVariant?: string, /** * to be used only by the Core */ sQuery?: string ): void; /** * Provides the framework with information about a library. * * This method is intended to be called exactly once while the main module of a library (its `library.js` * module) is executing, typically at its begin. The single parameter `oLibInfo` is an info object that * describes the content of the library. * * When the `oLibInfo` has been processed, a normalized version of it will be kept and will be returned * as library information in later calls to {@link #getLoadedLibraries}. Finally, `initLibrary` fires (the * currently private) {@link #event:LibraryChanged} event with operation 'add' for the newly loaded library. * * Side Effects: * * While analyzing the `oLibInfo`, the framework takes some additional actions: * * * - If the info object contains a list of `interfaces`, they will be registered with the {@link sap.ui.base.DataType } * class to make them available as aggregation types in managed objects. * * * - If the object contains a list of `controls` or `elements`, {@link sap.ui.lazyRequire lazy stubs } * will be created for their constructor as well as for their static `extend` and `getMetadata` methods. * **Note:** Future versions might abandon the concept of lazy stubs as it requires synchronous XMLHttpRequests * which have been deprecated (see {@link http://xhr.spec.whatwg.org}). To be on the safe side, productive * applications should always require any modules that they directly depend on. * * * - With the `noLibraryCSS` property, the library can be marked as 'theming-free'. Otherwise, the framework * will add a tag to the page's head, pointing to the library's theme-specific stylesheet. * The creation of such a tag can be suppressed with the {@link https://ui5.sap.com/#/topic/91f2d03b6f4d1014b6dd926db0e91070 global configuration option } * `preloadLibCss`. It can contain a list of library names for which no stylesheet should be included. This * is e.g. useful when an application merges the CSS for multiple libraries and already loaded the resulting * stylesheet. * * * - If a list of library `dependencies` is specified in the info object, those libraries will be loaded * synchronously by `initLibrary`. * **Note:** Dependencies between libraries don't have to be modeled as AMD dependencies. Only when enums * or types from an additional library are used in the coding of the `library.js` module, the library should * be additionally listed in the AMD dependencies. * * Last but not least, higher layer frameworks might want to include their own metadata for libraries. The * property `extensions` might contain such additional metadata. Its structure is not defined by the framework, * but it is strongly suggested that each extension only occupies a single property in the `extensions` * object and that the name of that property contains some namespace information (e.g. library name that * introduces the feature) to avoid conflicts with other extensions. The framework won't touch the content * of `extensions` but will make it available in the library info objects returned by {@link #getLoadedLibraries}. * * Relationship to Descriptor for Libraries (manifest.json): * * The information contained in `oLibInfo` is partially redundant to the content of the descriptor for the * same library (its `manifest.json` file). Future versions of UI5 might ignore the information provided * in `oLibInfo` and might evaluate the descriptor file instead. Library developers therefore should keep * the information in both files in sync. * * When the `manifest.json` is generated from the `.library` file (which is the default for UI5 libraries * built with Maven), then the content of the `.library` and `library.js` files must be kept in sync. * * @deprecated As of version 1.119. Please use {@link sap.ui.core.Lib.init Lib.init} instead. * * @returns As of version 1.101; returns the library namespace, based on the given library name. Returns * 'undefined' if no library name is provided. */ initLibrary( /** * Info object for the library */ oLibInfo: sap.ui.core.LibraryInfo ): object | undefined; /** * Returns true if the Core has already been initialized. This means that instances of RenderManager etc. * do already exist and the init event has already been fired (and will not be fired again). * * @deprecated As of version 1.118. Please use {@link sap.ui.core.Core.ready Core.ready} instead. * * @returns whether the Core has already been initialized */ isInitialized(): boolean; /** * Returns the locked state of the `sap.ui.core.Core`. * * @deprecated As of version 1.118. without a replacement. The ability to prevent the re-rendering of all * `UIArea`s wasn't really used in the past and did not provide a meaningful feature. It therefore has been * abandoned. * * @returns locked state */ isLocked(): boolean; /** * Check if the script is running on mobile * * @deprecated As of version 1.118. use {@link sap.ui.Device.browser.mobile Device.browser.mobile} instead. * * @returns true or false */ isMobile(): boolean; /** * Checks whether the given DOM element is the root of the static area. * * @deprecated As of version 1.119.0. Please use {@link module:sap/ui/core/StaticArea.contains StaticArea.contains } * instead. * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns Whether the given DOM element is the root of the static area */ isStaticAreaRef( /** * DOM element to check */ oDomRef: /* was Element */ global_Element ): boolean; /** * Returns true, if the styles of the current theme are already applied, false otherwise. * * This function must not be used before the init event of the Core. If the styles are not yet applied a * theme changed event will follow when the styles will be applied. * * @deprecated As of version 1.119. Please use {@link module:sap/ui/core/Theming.attachApplied Theming.attachApplied } * instead. * * @returns whether the styles of the current theme are already applied */ isThemeApplied(): boolean; /** * Loads the given library and its dependencies and makes its content available to the application. * * What it does: * * When library preloads are not suppressed for the given library, then a library-preload bundle will be * loaded for it. By default, the bundle will be loaded synchronously (for compatibility reasons). Only * when the optional parameter `vUrl` is given as `true` or as a configuration object with a property of * `async:true`, then the bundle will be loaded asynchronously and a `Promise` will be returned (preferred * usage). * * After preloading the bundle, dependency information from the bundle is evaluated and any missing libraries * are also preloaded. * * Only then the library entry module (named `your/lib/library.js`) will be required and executed. * The module is supposed to call `sap.ui.getCore().initLibrary(...)` providing the framework with additional * metadata about the library, e.g. its version, the set of contained enums, types, interfaces, controls * and elements and whether the library requires CSS. If the library requires CSS, a will be * added to the page referring to the corresponding `library.css` stylesheet for the library and the current * theme. * * When the optional parameter `vUrl` is given as a string or when a configuration object is given with * a non-empty, string-valued property `url`, then that URL will be registered for the namespace of the * library and all resources will be loaded from that location. This is convenience for a call like * ```javascript * * sap.ui.loader.config({ * paths: { * "lib/with/slashes": vUrl * } * }); * ``` * * * When the given library has been loaded already, no further action will be taken, especially, a given * URL will not be registered! In the case of asynchronous loading, a Promise will be returned, but will * be resolved immediately. * * When to use: * * For applications that follow the best practices and use components with component descriptors (manifest.json), * the framework will load all declared mandatory libraries and their dependencies automatically before * instantiating the application component. * * The same is true for libraries that are listed in the bootstrap configuration (e.g. with the attribute * `data-sap-ui-libs`). They will be loaded before the `init` event of the UI5 Core is fired. * * Only when an app declares a library to be a lazy library dependency or when code does not use descriptors * at all, then an explicit call to `loadLibrary` becomes necessary. The call should be made before artifacts * (controls, elements, types, helpers, modules etc.) from the library are used or required. This allows * the framework to optimize access to those artifacts. * * For example, when an app uses a heavy-weight charting library that shouldn't be loaded during startup, * it can declare it as "lazy" and load it just before it loads and displays a view that uses the charting * library: * ```javascript * * sap.ui.getCore().loadLibrary("heavy.charting", {async: true}) * .then(function() { * View.create({ * name: "myapp.views.HeavyChartingView", * type: ViewType.XML * }); * }); * ``` * * * @deprecated As of version 1.119. Please use {@link sap.ui.core.Lib.load Lib.load} instead. * * @returns An info object for the library (sync) or a Promise on it (async). */ loadLibrary( /** * Name of the library to load */ sLibrary: string, /** * URL to load the library from or the async flag or a complex configuration object */ vUrl?: | string | boolean | { /** * Whether to load the library asynchronously */ async?: boolean; /** * URL to load the library from */ url?: string; } ): sap.ui.core.LibraryInfo | Promise; /** * Locks the Core. No browser events are dispatched to the controls. * * Lock should be called before and after the DOM is modified for rendering, roundtrips... Exceptions might * be the case for asynchronous UI behavior * * @deprecated As of version 1.118. without a replacement. The ability to prevent the re-rendering of all * `UIArea`s wasn't really used in the past and did not provide a meaningful feature. It therefore has been * abandoned. */ lock(): void; /** * Triggers a realignment of controls * * This method should be called after changing the cozy/compact CSS class of a DOM element at runtime, for * example at the `` tag. Controls can listen to the themeChanged event to realign their appearance * after changing the theme. Changing the cozy/compact CSS class should then also be handled as a theme * change. In more simple scenarios where the cozy/compact CSS class is added to a DOM element which contains * only a few controls it might not be necessary to trigger the realignment of all controls placed in the * DOM, for example changing the cozy/compact CSS class at a single control * * @deprecated As of version 1.119. Please use {@link module:sap/ui/core/Theming.notifyContentDensityChanged Theming.notifyContentDensityChanged } * instead. */ notifyContentDensityChanged(): void; /** * Returns a Promise that resolves if the Core is initialized. Additionally, a callback function can be * passed, for use cases where using Promises is not an option. * * @since 1.118.0 * * @returns The ready promise */ ready( /** * If the Core is ready the function will be called immediately, otherwise when the ready Promise resolves. */ fnReady?: () => void ): Promise; /** * Registers a Plugin to the `sap.ui.core.Core`, which lifecycle will be managed (start and stop). * * Plugin object need to implement two methods: * - `startPlugin(oCore)`: will be invoked, when the Plugin should start (as parameter the reference to * the Core will be provided * - `stopPlugin()`: will be invoked, when the Plugin should stop * * @deprecated As of version 1.73. Plugins never have been meant as a public offering, but were intended * for internal usage only. They unfortunately allow access to all internals of the Core and therefore break * encapsulation and hinder evolution of the Core. The most common use case of accessing the set of all * controls/elements or all components can now be addressed by using the APIs {@link sap.ui.core.Element.registry } * or {@link sap.ui.core.Component.registry}, respectively. Future refactoring of the Core will only take * existing plugins in the OpenUI5 repository into account. */ registerPlugin( /** * reference to a Plugin object */ oPlugin: object ): void; /** * Sets or unsets a model for the given model name. * * The `sName` must either be `undefined` (or omitted) or a non-empty string. When the name is omitted, * the default model is set/unset. * * When `oModel` is `null` or `undefined`, a previously set model with that name is removed from the Core. * * Any change (new model, removed model) is propagated to all existing UIAreas and their descendants as * long as a descendant doesn't have its own model set for the given name. * * Note: to be compatible with future versions of this API, applications must not use the value `null`, * the empty string `""` or the string literals `"null"` or `"undefined"` as model name. * * @deprecated As of version 1.118. Please use {@link sap.ui.base.ManagedObject#setModel ManagedObject#setModel } * instead. * * @returns Reference to `this` in order to allow method chaining */ setModel( /** * the model to be set or `null` or `undefined` */ oModel: sap.ui.model.Model, /** * the name of the model or `undefined` */ sName?: string ): this; /** * Implicitly creates a new `UIArea` (or reuses an exiting one) for the given DOM reference and adds the * given control reference to the UIAreas content (existing content will be removed). * * @deprecated As of version 1.1. use {@link sap.ui.core.Control#placeAt oControl.placeAt(oDomRef, "only") } * instead. */ setRoot( /** * a DOM Element or Id (string) of the UIArea */ oDomRef: string | /* was Element */ global_Element, /** * the Control that should be the added to the `UIArea`. */ oControl: sap.ui.base.Interface | sap.ui.core.Control ): void; /** * Defines the root directory from below which UI5 should load the theme with the given name. Optionally * allows restricting the setting to parts of a theme covering specific control libraries. * * Example: * ```javascript * * sap.ui.getCore().setThemeRoot("my_theme", "https://mythemeserver.com/allThemes"); * sap.ui.getCore().applyTheme("my_theme"); * ``` * * * will cause the following file to be loaded (assuming that the bootstrap is configured to load libraries * `sap.m` and `sap.ui.layout`): * ```javascript * * https://mythemeserver.com/allThemes/sap/ui/core/themes/my_theme/library.css * https://mythemeserver.com/allThemes/sap/ui/layout/themes/my_theme/library.css * https://mythemeserver.com/allThemes/sap/m/themes/my_theme/library.css * ``` * * * If parts of the theme are at different locations (e.g. because you provide a standard theme like "sap_horizon" * for a custom control library and this self-made part of the standard theme is at a different location * than the UI5 resources), you can also specify for which control libraries the setting should be used, * by giving an array with the names of the respective control libraries as second parameter: * ```javascript * * sap.ui.getCore().setThemeRoot("sap_horizon", ["my.own.library"], "https://mythemeserver.com/allThemes"); * ``` * * * This will cause the Horizon theme to be loaded from the UI5 location for all standard libraries. Resources * for styling the `my.own.library` controls will be loaded from the configured location: * ```javascript * * https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/library.css * https://sdk.openui5.org/resources/sap/ui/layout/themes/sap_horizon/library.css * https://sdk.openui5.org/resources/sap/m/themes/sap_horizon/library.css * https://mythemeserver.com/allThemes/my/own/library/themes/sap_horizon/library.css * ``` * * * If the custom theme should be loaded initially (via bootstrap attribute), the `themeRoots` property of * the `window["sap-ui-config"]` object must be used instead of calling `sap.ui.getCore().setThemeRoot(...)` * in order to configure the theme location early enough. * * @since 1.10 * @deprecated As of version 1.119. without replacement. The need to define the location for a theme should * be fully covered with the capabilities of the {@link sap/base/config base configuration}. * * @returns the Core, to allow method chaining */ setThemeRoot( /** * Name of the theme for which to configure the location */ sThemeName: string, /** * Optional library names to which the configuration should be restricted */ aLibraryNames: string[], /** * Base URL below which the CSS file(s) will be loaded from */ sThemeBaseUrl: string, /** * Force updating URLs of currently loaded theme */ bForceUpdate?: boolean ): this; /** * Defines the root directory from below which UI5 should load the theme with the given name. Optionally * allows restricting the setting to parts of a theme covering specific control libraries. * * Example: * ```javascript * * sap.ui.getCore().setThemeRoot("my_theme", "https://mythemeserver.com/allThemes"); * sap.ui.getCore().applyTheme("my_theme"); * ``` * * * will cause the following file to be loaded (assuming that the bootstrap is configured to load libraries * `sap.m` and `sap.ui.layout`): * ```javascript * * https://mythemeserver.com/allThemes/sap/ui/core/themes/my_theme/library.css * https://mythemeserver.com/allThemes/sap/ui/layout/themes/my_theme/library.css * https://mythemeserver.com/allThemes/sap/m/themes/my_theme/library.css * ``` * * * If parts of the theme are at different locations (e.g. because you provide a standard theme like "sap_horizon" * for a custom control library and this self-made part of the standard theme is at a different location * than the UI5 resources), you can also specify for which control libraries the setting should be used, * by giving an array with the names of the respective control libraries as second parameter: * ```javascript * * sap.ui.getCore().setThemeRoot("sap_horizon", ["my.own.library"], "https://mythemeserver.com/allThemes"); * ``` * * * This will cause the Horizon theme to be loaded from the UI5 location for all standard libraries. Resources * for styling the `my.own.library` controls will be loaded from the configured location: * ```javascript * * https://sdk.openui5.org/resources/sap/ui/core/themes/sap_horizon/library.css * https://sdk.openui5.org/resources/sap/ui/layout/themes/sap_horizon/library.css * https://sdk.openui5.org/resources/sap/m/themes/sap_horizon/library.css * https://mythemeserver.com/allThemes/my/own/library/themes/sap_horizon/library.css * ``` * * * If the custom theme should be loaded initially (via bootstrap attribute), the `themeRoots` property of * the `window["sap-ui-config"]` object must be used instead of calling `sap.ui.getCore().setThemeRoot(...)` * in order to configure the theme location early enough. * * @since 1.10 * @deprecated As of version 1.119. without replacement. The need to define the location for a theme should * be fully covered with the capabilities of the {@link sap/base/config base configuration}. * * @returns the Core, to allow method chaining */ setThemeRoot( /** * Name of the theme for which to configure the location */ sThemeName: string, /** * Base URL below which the CSS file(s) will be loaded from */ sThemeBaseUrl: string, /** * Force updating URLs of currently loaded theme */ bForceUpdate?: boolean ): this; /** * Unlocks the Core. * * Browser events are dispatched to the controls again after this method is called. * * @deprecated As of version 1.118. without a replacement. The ability to prevent the re-rendering of all * `UIArea`s wasn't really used in the past and did not provide a meaningful feature. It therefore has been * abandoned. */ unlock(): void; /** * Unregisters a Plugin out of the `sap.ui.core.Core` * * @deprecated As of version 1.73. Plugins never have been meant as a public offering, but were intended * for internal usage only. They unfortunately allow access to all internals of the Core and therefore break * encapsulation and hinder evolution of the Core. The most common use case of accessing the set of all * controls/elements or all components can now be addressed by using the APIs {@link sap.ui.core.Element.registry } * or {@link sap.ui.core.Component.registry}, respectively. Future refactoring of the Core will only take * existing plugins in the OpenUI5 repository into account. */ unregisterPlugin( /** * reference to a Plugin object */ oPlugin: object ): void; } interface ExtensionPoint { /** * Creates 0..n UI5 controls from an `ExtensionPoint`. * * One control if the `ExtensionPoint` is e.g. filled with a `View`, zero for extension points without configured * extension and n controls for multi-root `Fragments` as extension. * * @since 1.56.0 * * @returns a Promise, which resolves with an array of 0..n controls created from an `ExtensionPoint`. If * `mOptions.createDefaultContent` is called and returns a Promise, that Promise is returned by `ExtensionPoint.load`. */ load( /** * an object map (see below) */ mOptions: { /** * The view or fragment containing the extension point */ container: sap.ui.core.mvc.View | sap.ui.core.Fragment; /** * The `mOptions.name` is used to identify the extension point in the customizing */ name: string; /** * Optional callback function creating default content, returning an array of controls. It is executed when * there's no customizing, if not provided, no default content will be rendered. `mOptions.createDefaultContent` * might also return a Promise, which resolves with an array of controls. */ createDefaultContent?: Function; /** * Whether the ExtensionPoint content should be loaded asynchronously */ async?: boolean; } ): Promise; } /** * The IconPool is a static class for retrieving or registering icons. It also provides helping methods * for easier consumption of icons. There are already icons registered in IconPool, please use the Demo * App named "Icon Explorer" to find the name of the icon. * * In order to use the icon inside an existing control, please call {@link sap.ui.core.IconPool.getIconURI } * and assign the URI to the control's property which supports icons. If you want to support both, icons * and standard images in your own control, please use the static method {@link sap.ui.core.IconPool.createControlByURI } * to either create an Icon in case the first argument is an icon-URL or another control which you define * by providing it as the second argument. */ interface IconPool { /** * Register an additional icon to the sap.ui.core.IconPool. * * * @returns the info object of the registered icon which has the name, collection, uri, fontFamily, content * and suppressMirroring properties. */ addIcon( /** * the name of the icon. */ iconName: string, /** * the name of icon collection. The built in icons are with empty collectionName, so if additional icons * need to be registered in IconPool, the collectionName can't be empty. */ collectionName: string, /** * the icon info which contains the following properties: */ iconInfo: { /** * is the name of the font when importing the font using @font-face in CSS */ fontFamily: string; /** * is the special hexadecimal code without the prefix, for example "e000" or several of them */ content: string | string[]; /** * indicates if already registered icons should be overwritten when the same name and collection are given. * The built in icons can never be overwritten. */ overWrite?: boolean; /** * indicates whether this icon should NOT be mirrored in RTL (right to left) mode. */ suppressMirroring?: boolean; /** * ResourceBundle to be used for translation. Key format: "Icon.". */ resourceBundle?: import("sap/base/i18n/ResourceBundle").default; } ): sap.ui.core.IconPool.IconInfo; /** * Creates an instance of {@link sap.ui.core.Icon} if the given URI is an icon URI, otherwise the given * constructor is called. The given URI is set to the src property of the control. * * * @returns Either an instance of `sap.ui.core.Icon` or instance created by calling the given constructor */ createControlByURI( /** * Contains the properties which will be used to instantiate the returned control. All properties of the * associated constructor can be used. Unknown properties are ignored. It should contain at least a property * named src. If it's given with a string type, it will be taken as the value of src property. */ setting: | string | { /** * either an icon URI or the URL that points to the image file */ src: sap.ui.core.URI; }, /** * The constructor function which is called when the given URI isn't an icon URI */ constructor: Function ): sap.ui.core.Control; /** * Checks if the icon font is loaded * * @since 1.56.0 * * @returns a Promise that resolves when the icon font is loaded; or `undefined` if the icon font has not * been registered yet */ fontLoaded( /** * icon collection name */ sCollectionName: string ): Promise | undefined; /** * Returns all names of registered collections in IconPool * * * @returns An array contains all of the registered collections' names. */ getIconCollectionNames(): any[]; /** * Returns the icon url based on the given mime type * * @since 1.25.0 * * @returns the icon url (e.g. "sap-icon://attachment-zip-file") */ getIconForMimeType( /** * the mime type of a file (e.g. "application/zip") */ sMimeType: string ): string; /** * Returns an info object for the icon with the given `iconName` and `collectionName`. * * Instead of giving name and collection, a complete icon-URI can be provided as `iconName`. The method * will determine name and collection from the URI, see {@link #.isIconURI IconPool.isIconURI} for details. * * The returned info object has the following properties: * - `string: name` Name of the icon * - `string: collection` Name of the collection that contains the icon or `undefined` in case of the * default collection * - `string: uri` Icon URI that identifies the icon * - `string: fontFamily` CSS font family to use for this icon * - `string: content` Character sequence that represents the icon in the icon font * - `string: text` Alternative text describing the icon (optional, might be empty) * - `boolean: suppressMirroring` Whether the icon needs no mirroring in right-to-left mode * * * @returns Info object or Promise for the icon depending on the loadingMode or `undefined` when the icon * can't be found or no icon name was given. */ getIconInfo( /** * Name of the icon, or a complete icon-URI with icon collection and icon name; must not be empty */ iconName: string, /** * Name of the icon collection; to access built-in icons, omit the collection name */ collectionName?: string, /** * The approach for loading the icon info, if it is not already available: sync - font metadata is loaded * synchronously and the icon info is returned immediately async - a promise is returned that returns the * icon info when the font metadata is loaded mixed - until the font metadata is loaded a promise is returned, * afterwards the icon info */ loadingMode?: string ): | sap.ui.core.IconPool.IconInfo | undefined | Promise; /** * Returns all name of icons that are registered under the given collection. * * * @returns An array contains all of the registered icon names under the given collection. */ getIconNames( /** * the name of collection where icon names are retrieved. */ collectionName: string ): any[]; /** * Returns the URI of the icon in the pool which has the given `iconName` and `collectionName`. * * * @returns URI of the icon or `undefined` if the icon can't be found in the IconPool */ getIconURI( /** * Name of the icon, must not be empty */ iconName: string, /** * Name of the icon collection; to access built-in icons, omit the collection name */ collectionName?: string ): string | undefined; /** * Adds CSS code to load an icon font to the DOM */ insertFontFaceStyle( /** * the file name of the font face */ sFontFace: string, /** * the path to the font file */ sPath: string, /** * the collection name, if not specified the font face is used */ sCollectionName?: string ): void; /** * Returns whether the given `uri` is an icon URI. * * A string is an icon URI when it can be parsed as a URI and when it has one of the two forms * - sap-icon://collectionName/iconName * - sap-icon://iconName where collectionName and iconName must be non-empty. * * * @returns Whether the URI matches the icon URI format */ isIconURI( /** * The URI to check */ uri: string ): boolean; /** * Registers an additional icon font to the icon pool * * @since 1.56.0 */ registerFont( /** * configuration object for registering the font */ oConfig: { /** * the file name of the font face */ fontFamily: string; /** * a collection name for the font, if not specified the font face will be used */ collectionName?: string; /** * the location where the font files are physically located */ fontURI: sap.ui.core.URI; /** * a configuration object mapping the icon name to the hexadecimal icon address in the font */ metadata?: object; /** * an URI to a file containing the configuration object specified with oConfig.metadata */ metadataURI?: object; /** * load the icon font metadata only when an icon is requested with {@link #.getIconInfo} if not specified * a JSON file with the name oConfig.fontFamily will be loaded from the location specified in oConfig.fontURI */ lazy?: boolean; } ): void; } /** * Helper functionality for indication color support. * * @since 1.66 */ interface IndicationColorSupport { /** * Returns a generic indication color message if the given Element has a property `IndicationColor` with * one of the states or the given `indicationColor` string represents one of five states. * * * @returns the indication color text, if appropriate; otherwise `null` */ getAdditionalText( /** * the Element of which the indicationColor needs to be checked, or the IndicationColor explicitly */ vValue: sap.ui.core.Element | sap.ui.core.IndicationColor ): string | null; } /** * Helper functionality for enhancement of a `Label` with common label functionality. * See: * sap.ui.core.LabelEnablement#enrich * * @since 1.28.0 * @ui5-protected DO NOT USE IN APPLICATIONS (only for related classes in the framework) */ interface LabelEnablement { /** * This function should be called on a label control to enrich its functionality. * * **Usage:** The function can be called with a control prototype: ` sap.ui.core.LabelEnablement.enrich(my.Label.prototype); * ` Or the function can be called on instance level in the init function of a label control: ` my.Label.prototype.init: * function(){ sap.ui.core.LabelEnablement.enrich(this); } ` * * **Preconditions:** The given control must implement the interface sap.ui.core.Label and have an association * 'labelFor' with cardinality 0..1. This function extends existing API functions. Ensure not to override * these extensions AFTER calling this function. * * **What does this function do?** * * A mechanism is added that ensures that a bidirectional reference between the label and its labeled control * is established: The label references the labeled control via the HTML 'for' attribute (see {@link sap.ui.core.LabelEnablement#writeLabelForAttribute}). * If the labeled control supports the aria-labelledby attribute, a reference to the label is added automatically. * * In addition an alternative to apply a 'for' reference without influencing the labelFor association of * the API is applied (e.g. used by Form). For this purpose the functions setAlternativeLabelFor and getLabelForRendering * are added. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ enrich( /** * the label control which should be enriched with further label functionality. */ oControl: sap.ui.core.Control ): void; /** * Returns an array of IDs of the labels referencing the given element. * * * @returns an array of ids of the labels referencing the given element */ getReferencingLabels( /** * The element whose referencing labels should be returned */ oElement: sap.ui.core.Element ): string[]; /** * Returns `true` when the given control is required (property 'required') or one of its referencing labels, * `false` otherwise. * * @since 1.29.0 * * @returns `true` when the given control is required (property 'required') or one of its referencing labels, * `false` otherwise */ isRequired( /** * The element which should be checked for its required state */ oElement: sap.ui.core.Element ): boolean; /** * Helper function for the `Label` control to render the HTML 'for' attribute. * * This function should be called at the desired location in the renderer code of the `Label` control. It * can be used with both rendering APIs, with the new semantic rendering API (`apiVersion 2`) as well as * with the old, string-based API. * * As this method renders an attribute, it can only be called while a start tag is open. For the new semantic * rendering API, this means it can only be called between an `openStart/voidStart` call and the corresponding * `openEnd/voidEnd` call. In the context of the old rendering API, it can be called only after the prefix * of a start tag has been written (e.g. after `rm.write("" of the start tag has been written. * * @ui5-protected Do not call from applications (only from related classes in the framework) */ writeLabelForAttribute( /** * The RenderManager that can be used for rendering. */ oRenderManager: sap.ui.core.RenderManager, /** * The `Label` for which the 'for' HTML attribute should be rendered. */ oLabel: sap.ui.core.Label ): void; } /** * Base Class for a Renderer. */ interface Renderer { /** * Creates a new renderer that extends a given renderer. * * This method can be used with two signatures that are explained below. In both variants, the returned * renderer inherits all properties (methods, fields) from the given parent renderer. Both variants also * add an 'extend' method to the created renderer that behaves like the modern signature variant of this * `Renderer.extend` method, but allows to extend the new renderer instead of `sap.ui.core.Renderer`. * * Modern Signature: * * In the modern signature variant, two parameters must be given: a qualified name for the new renderer * (its global name, in dot-notation), and an optional object literal that contains methods or fields to * be added to the new renderer class. * * This signature has been designed to resemble the class extension mechanism as provided by {@link sap.ui.base.Object.extend Object.extend}. * * * ```javascript * * sap.ui.define(['sap/ui/core/Renderer'], * function(Renderer) { * "use strict"; * * var LabelRenderer = Renderer.extend('sap.m.LabelRenderer', { * render: function(oRM, oControl) { * * renderPreamble(oRM, oControl); * * // implementation core renderer logic here * * renderPostamble(oRM, oControl); * * }, * * renderPreamble : function(oRM, oControl) { * ... * }, * * renderPostamble : function(oRM, oControl) { * ... * } * * }); * * return LabelRenderer; * }); * ``` * * * The extension of renderers works across multiple levels. A `FancyLabelRenderer` can extend the above * `LabelRenderer`: * * * ```javascript * * sap.ui.define(['sap/m/LabelRenderer'], * function(LabelRenderer) { * "use strict"; * * var FancyLabelRenderer = LabelRenderer.extend('sap.mylib.FancyLabelRenderer', { * render: function(oRM, oControl) { * * // call base renderer * LabelRenderer.renderPreamble(oRM, oControl); * * // ... do your own fancy rendering here * * // call base renderer again * LabelRenderer.renderPostamble(oRM, oControl); * } * }); * * return FancyLabelRenderer; * }); * ``` * * * **Note:** The modern signature no longer requires the `bExport` flag to be set for the enclosing {@link sap.ui.define } * call. The Renderer base class takes care of the necessary global export of the renderer. This allows * non-SAP developers to write a renderer that complies with the documented restriction for `sap.ui.define` * (no use of bExport = true outside sap.ui.core projects). * * Deprecated Signature: * * The deprecated old signature expects just one parameter: a renderer that should be extended. With that * signature, the renderer can't be exported globally as the name of the renderer class is not known. * * For compatibility reasons, the class created by the deprecated signature contains a property `_super` * that references the parent class. It shouldn't be used by applications / control developers as it doesn't * work reliably for deeper inheritance chains: if the old variant of `Renderer.extend` is used on two or * more levels of the inheritance hierarchy, the `_super` property of the resulting renderer class will * always point to the implementation of the base renderer of the last call to extend. Instead of using * `this._super`, renderer implementations should use the new signature variant and access the base implementation * of a method via the AMD reference to the base renderer (as shown in the FancyLabelRenderer example above). * * Use as a Generic Method: * * Only renderers that have been created with a call to `extend` will get their own `extend` method to create * new subclasses. To allow extending from older renderers that have been written from scratch as a plain * object, the `Renderer.extend` method can be called as a generic method, providing the base renderer * as `this`. * * Example: Derive from `HBoxRenderer` (which is assumed to be a plain object) * ```javascript * * sap.ui.define(['sap/ui/core/Renderer', 'sap/m/HBoxRenderer'], * function(Renderer, HBoxRenderer) { * "use strict"; * * // Call 'extend' as a generic method, providing the HBoxRenderer as 'this' * var MyRenderer = Renderer.extend.call(HBoxRenderer, 'sap.m.LabelRenderer', { * * someOverriddenHook: function(oRM, oControl) { * ... * }, * * }); * * return LabelRenderer; * }); * ``` * * * **Note:** The deprecated signature cannot be used generically, it is only supported when called on `sap.ui.core.Renderer`. * * * @returns A new renderer that can be enriched further */ extend( /** * Either the name of the new renderer class (modern signature) or the base renderer to extend (deprecated * signature) */ vName: string | object, /** * Methods and/or properties that should be added to the new renderer class */ oRendererInfo?: object ): object; /** * Returns the TextAlignment for the provided configuration. * * @ui5-protected Do not call from applications (only from related classes in the framework) * * @returns the actual text alignment that must be set for this environment */ getTextAlign( /** * the text alignment of the Control */ oTextAlign: sap.ui.core.TextAlign, /** * the text direction of the Control */ oTextDirection: sap.ui.core.TextDirection ): string; } /** * Helper functionality for value state support. */ interface ValueStateSupport { /** * Appends a generic success, warning or error message to the given tooltip text if the given Element has * a property "valueState" with one of these three states. * * * @returns the given text, with appended success/warning/error text, if appropriate */ enrichTooltip( /** * the Element of which the tooltip needs to be modified */ oElement: sap.ui.core.Element, /** * the original tooltip text (may be null) */ sTooltipText: string ): string; /** * Returns a ValueState object based on the given integer value * * 0 : ValueState.None 1 : ValueState.Warning 2 : ValueState.Success 3 : ValueState.Error 4 : ValueState.Information * * @since 1.25.0 * * @returns the corresponding ValueState object */ formatValueState( /** * the state as an integer */ iState: int ): sap.ui.core.ValueState; /** * Returns a generic success, warning or error message if the given Element has a property "valueState" * with one of these three states or the given ValueState represents one of these states. * * * @returns the success/warning/error text, if appropriate; otherwise null */ getAdditionalText( /** * the Element of which the valueState needs to be checked, or the ValueState explicitly */ vValue: sap.ui.core.Element | sap.ui.core.ValueState ): string | null; } /** * The CommandExecution registers a shortcut when it is added to the dependent aggregation of a control. * The shortcut information is retrieved from the owner components manifest (`/sap.ui5/commands/`). * * You can use a CommandExecution instead of an event handler in XMLViews by using `cmd:` plus the command * name. * * Example for `sap.m.Button`: * * * ```javascript * *