import { IItem, IUser } from '../../types'; /** * Object to store the matched recommended information in the item description. Each property is an array of strings to store multiple matches for each category. */ type MatchedRecommendedInfo = { /** * If true, the description contains source or citation information. This is a simple regex test that looks for the phrases "source:", "sources:", "citation:", "citations:", "data source:", or "source link:" in the description, and it is case insensitive. */ source: boolean; /** * Users always want to know what version or vintage of the data is. This is different than "date last updated" or "data downloaded on ". * Some users try to make vintage explicit, while others just casually reference the vintage or version and let the reader figure it out. */ vintage: boolean; /** * Users want to know how often an item is updated - its update frequency. For live feeds, it can be every X minutes, or every Y hours, or every Z days. * For content updated monthly or annually, it is the same core issue. */ updateFrequency: boolean; /** * If true, the description contains a statement about the intended use of the item. This is a simple regex test that looks for the phrase "intended use" in the description, and it is case insensitive. */ intendedUse: boolean; /** * If true, the description contains a statement about limitations of use. This is a simple regex test that looks for the phrase "limitation of use" or "limitations of use" in the description, and it is case insensitive. */ limitationsOfUse: boolean; }; /** * Analyzes an item description to identify the presence of recommended metadata information. * * This function examines a description string to detect whether it contains key information * that helps users understand the data, including sources, data vintage, update frequency, * intended use, and limitations of use. The description is first sanitized to remove HTML * and normalize the text before analysis. * * @param description - The raw description text to analyze. Can contain HTML markup. * @returns An object with boolean flags indicating which types of recommended information * were found in the description: * - `source`: Whether source or citation information is present * - `vintage`: Whether data vintage, version, or temporal information is present * - `updateFrequency`: Whether update frequency or maintenance schedule is present * - `intendedUse`: Whether intended use statement is present * - `limitationsOfUse`: Whether limitations of use statement is present * * @remarks * The function performs the following steps: * 1. Sanitizes the description using `sanitizeString` to remove HTML and normalize text * 2. Returns all flags as `false` if the sanitized description is empty * 3. Checks for each type of recommended information using specialized helper functions * 4. Returns an object with boolean flags for each information type found * * Each information type is checked independently using word boundary matching to avoid * false positives from partial word matches. */ export declare const checkRecommendedInfo: (description: string) => MatchedRecommendedInfo; /** * Check if the description contains a statement about limitations of use. * This is a simple regex test that looks for the phrase "limitation of use" or "limitations of use" in the description, * and it is case insensitive. * @param description Description text to check for limitations of use statement * @returns boolean indicating whether the description contains a statement about limitations of use */ export declare const containsLimitationsOfUse: (description: string) => boolean; /** * Check if the description contains a statement about intended use. * This is a simple regex test that looks for the phrase "intended use" in the description, and it is case insensitive. * @param description Description text to check for intended use statement * @returns boolean indicating whether the description contains a statement about intended use */ export declare const containsIntendedUse: (description: string) => boolean; /** * Check if the description contains source or citation information. This is a simple regex test that looks for the phrases "source:", "sources:", "citation:", "citations:", "data source:", or "source link:" in the description, and it is case insensitive. * @param description * @returns */ export declare const containsSource: (description: string) => boolean; /** * Checks if the description contains vintage-related information. * * The function searches for patterns indicating temporal information about the data, * including vintage dates, release information, versions, and real-time data indicators. * * @param description - The description text to search for vintage information * @returns `true` if the description contains vintage-related keywords or patterns, `false` otherwise * * @remarks * The function checks for two types of patterns: * - Standard vintage patterns: "Vintage of boundaries and attributes", "vintage", "version", * "Release", "Year", "Edition", "Revision", "release date", "publication date", * "version number", "as of date" (all followed by a colon) * - Optional colon patterns: "live data", "real-time", "real time", "continuously updated" * (with optional colon) * * @example * ```typescript * containsVintage("Vintage: 2023"); // returns true * containsVintage("Release: v1.0"); // returns true * containsVintage("live data"); // returns true * containsVintage("Some random text"); // returns false * ``` */ export declare const containsVintage: (description: string) => boolean; /** * Checks if the provided description contains information about update frequency. * * Searches for common phrases and patterns that indicate how often the data is updated, * including specific intervals (daily, weekly, monthly, etc.) and descriptors like * "real-time" or "continuously updated". * * @param description - The text to search for update frequency information * @returns `true` if the description contains update frequency information, `false` otherwise * */ export declare const containsUpdateFrequency: (description: string) => boolean; type ShouldCheckItemDescriptionRecommendedInfoOptions = { item: IItem; itemOwnerUserProfile: IUser; shouldCheckAdvisories?: boolean; }; /** * Checks whether the "item description recommended information" validation should be performed for a given item, based on its type and locale. * * The validation is only applicable for items that are English-based and are either feature services, imagery services, or non-tiled map services. If the item does not meet these criteria, the validation will be marked as "not applicable". * @param param0 * @returns */ export declare const shouldCheckItemDescriptionRecommendedInfo: ({ item, itemOwnerUserProfile, shouldCheckAdvisories, }: ShouldCheckItemDescriptionRecommendedInfoOptions) => boolean; export {};