import { IncomingMessage, ServerResponse, IncomingHttpHeaders } from 'node:http'; import { ParsedUrlQuery } from 'node:querystring'; import { FC } from 'react'; declare function base64ToString(text: string): string; declare function stringToBase64(text: string): string; type Json = string | number | boolean | null | Json[] | { [key: string]: Json; }; type ValueOf = T[keyof T]; type LiteralUnion = T | Omit; type PreviewData = string | false | object | undefined; type IContextBaseParams = { market: string; locale: string; }; type IContextParams = IContextBaseParams & { id: string; }; type StaticPropsContext = { params: Q; draftMode?: boolean; locale?: string; locales?: string[]; defaultLocale?: string; revalidateReason?: 'build' | 'stale' | 'on-demand'; preview?: boolean; previewData?: D; }; type IStaticContext = StaticPropsContext; declare type NextApiRequestCookies = Partial<{ [key: string]: string; }>; type ServerSidePropsContext = { req: IncomingMessage & { cookies: NextApiRequestCookies; }; res: ServerResponse; params: Q; draftMode?: boolean; query: ParsedUrlQuery; resolvedUrl: string; locale?: string; locales?: string[]; defaultLocale?: string; revalidateReason?: 'build' | 'stale' | 'on-demand'; preview?: boolean; previewData?: D; }; type IServerSideSplatContext = ServerSidePropsContext; type IServerSideContext = ServerSidePropsContext; type IPartial = { [P in keyof T]?: Partial; }; type DeepPartial = T extends object ? { [P in keyof T]?: DeepPartial; } : T; type IPrettify = { [K in keyof T]: T[K]; } & {}; type IOverrideReturnValue = T extends Record ? IPrettify> : T; type IOverrideValue = T extends FromType ? (keyof T extends keyof FromType ? ToType : IOverrideReturnValue) : IOverrideReturnValue; type IOverride = { [Property in keyof T]: IOverrideValue; }; type RequireAtLeastOne = { [K in keyof T]-?: Required> & Partial>>; }[keyof T]; type Shift = ((...t: T) => any) extends ((first: any, ...rest: infer Rest) => any) ? Rest : never; type ShiftUnion

= T extends any[] ? T[0] extends P ? Shift : never : never; type DeepRequiredProps = T extends object ? (Omit> & Required<{ [K in Extract]: NonNullable>>; }>) : T; type DeepRequired = { [K in keyof T]: Required>; }; /** * List of ISO 639 language codes (set 1) * https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes */ type ILetter = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'; type ILocaleId = `${ILetter}${ILetter}`; type ILocalizedString = Partial>; type ILocalizable = string | ILocalizedString; type ILocalized = IPrettify>; type ILegalNotice = { id: string; text: ILocalizable; }; type IPreference = { id: string; description: string; legalNotice: ILegalNotice; }; type IConsentPreference = { id: string; consentPreference: IPreference; date: Date | string; }; type User = Record & { collection: string; id: string; email: string; }; type UserRole = ('admin' | 'editor' | 'guest' | 'user') & string; type UserWithRoles = User & { roles: UserRole[]; }; type IEndUser = UserWithRoles & { email: string; consentPreferences: IConsentPreference[]; createdAt: string; updatedAt: string; }; type IAction = Record & { id: string; collection: string; consentPreferences: IConsentPreference[]; consentsRevoked?: boolean; consentsRevokedDate?: string | Date; endUser: IEndUser; email?: string; password?: string; createdAt?: string; updatedAt?: string; }; type IActionEmailData = { id?: string; from?: string; to?: string; cc?: string; bcc?: string; subject: string; html: string; }; type IAnchor = { hash: string; title: string; }; type IMediaType = 'image' | 'video' | 'json' | 'pdf' | string; type IMediaInfo = { id: string; alt?: string; filename: string; mimeType: string; filesize: number; focalX?: number; focalY?: number; createdAt: Date | string; updatedAt?: Date | string; url: string; }; type IMedia = Record & Partial & { title?: string; abstract?: string; type: IMediaType; src?: string; media?: IMedia; width?: string | number; height?: string | number; }; type IMediaImage = Omit & { type: 'image'; }; type IMediaVideo = Omit & { type: 'video'; }; type IMediaJson = Omit & { type: 'json'; }; type IMediaPdf = Omit & { type: 'pdf'; }; declare function resolveMediaType(media: { type?: string; mimeType?: string; }): IMediaType; declare function isMediaImage(media: { type?: string; mimeType?: string; }): media is IMediaImage; declare function isMediaVideo(media: { type?: string; mimeType?: string; }): media is IMediaVideo; declare function isMediaJson(media: { type?: string; mimeType?: string; }): media is IMediaJson; declare function isMediaPdf(media: { type?: string; mimeType?: string; }): media is IMediaPdf; declare function isMedia(item: unknown): item is IMedia; type IAppExtended = Record; type IApp = { id: 'app'; brand: { name: string; businessName?: string; appName?: string; logo?: IMedia; email?: string; telephone?: string; address?: string; city?: string; provinceCode?: string; zipCode?: string; countryCode?: string; twitterName?: string; social: { key: string; url: string; }[]; }; } & T; type IEquatable = number | string; type SchemaType = string; type ISchema = { id: IEquatable; schema?: string; }; type IEntity = ISchema & Record; type INamedEntity = IEntity & { name: ILocalizable; }; type ITitledEntity = IEntity & { title: ILocalizable; }; type IOption = Record & { id: IEquatable; name: string; }; type IFeature = Record & { id: IEquatable; title: string; }; type IFeatureType = IEntity & { id: string; title: string; mode: string; features: IFeature[]; }; type Headings = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; type IComponent = { id?: IEquatable; blockType?: string; schema?: string; anchor?: IAnchor; seoWeight?: Headings; [key: string]: unknown; }; type IMeta = { title?: string; description?: string; keywords?: string; robots?: string; image?: IMedia; }; type ICategory = IEntity & { category?: IEquatable | ICategory; id: IEquatable; media?: IMedia; order?: number; slug: ILocalizable; title: ILocalizable; isHidden?: boolean; }; type ICategoryItem = ICategory & { items: ICategory[]; }; type ICategorized = IEntity & { title: ILocalizable; abstract?: string; description?: string; media?: IMedia; meta?: IMeta; components?: IComponent[]; category: IEquatable | ICategory; slug: ILocalizable; template?: string; isDefault?: boolean; useSplat?: boolean; order?: number; markets?: string[]; createdAt?: Date; updatedAt?: Date; _status?: string; }; type IClassNameValue = string | boolean | number | null | undefined; type IClassNameCollection = Record; type IClassName = IClassNameCollection | IClassNameValue; type IEmailConfig = IEntity & { id: string; subject: string; fromAddress: string; to: [{ address: string; }]; cc: [{ address: string; }]; bcc: [{ address: string; }]; }; type FetchRequestOptions = { method?: string; headers?: { [key: string]: string; }; body?: Blob | BufferSource | FormData | URLSearchParams | string | ReadableStream; mode?: 'cors' | 'no-cors' | 'same-origin'; credentials?: 'omit' | 'same-origin' | 'include'; cache?: 'default' | 'no-store' | 'reload' | 'no-cache' | 'force-cache' | 'only-if-cached'; redirect?: 'follow' | 'error' | 'manual'; referrer?: string; referrerPolicy?: 'no-referrer, no-referrer-when-downgrade, same-origin, origin, strict-origin, origin-when-cross-origin, strict-origin-when-cross-origin, or unsafe-url'; integrity?: string; keepalive?: boolean; signal?: AbortSignal; }; type FetchService = (url: string, options?: FetchRequestOptions, serviceOptions?: any) => Promise; type FetchError = any; declare enum ImageStrategy { None = "none", Next = "next", Mixer = "mixer", Oven = "oven", Token = "token", Custom = "custom" } type IImageResize = { q: number; w: number; h?: number; x?: number; y?: number; src: string; }; type ILabel = IEntity & { id: IEquatable; text?: ILocalizable; }; type ILocale = IEntity & { id: string; title?: string; isActive?: boolean; isDefault?: boolean; isHidden?: boolean; }; type IMarket = IEntity & { id: string; title?: string; countries?: string[] | IEntity[]; languages?: string[] | IEntity[]; defaultLanguage?: string | IEntity; isActive?: boolean; isDefault?: boolean; isHidden?: boolean; }; type IRoute = { category: IEquatable; id: string; isDefault?: boolean; isRoot?: boolean; locale: string; market: string; media?: IMedia; noindex?: boolean; order?: number; page: IEquatable; resolvedCategory: IEquatable; schema: string; template?: string; title: string; updatedAt?: Date; useSplat?: boolean; }; type IRouteCanonical = IRoute & { alternates: IRoute[]; }; type IRouteLink = { category: IEquatable; href: string; id: IEquatable; items?: IRouteLink[]; media?: IMedia; schema: string; title: string; }; type IRouteParams = Record & { id: IEquatable; locale: string; market: string; }; /** * Represents a listing item returned from the findMany method of a page collection. * @template T - The type of the categorized item. */ type IPageItem = ILocalized & { schema: string; category: ILocalized & { href: string; }; href: string; locale: string; market: string; }; /** * Represents a detail item returned from the findOne method of a page collection. * @template T - The type of the categorized item. */ type IPage = ILocalized & { schema: string; alternates: IRoute[]; breadcrumb: IRouteLink[]; category: ILocalized & { href: string; }; href: string; locale: string; market: string; parentRoute?: IRouteLink; slug: string; title: string; }; /** * Represents the props for a page component. * @template T - The type of the categorized item. */ type PageProps = { layout: ILayout; page: IPage; params: IRouteParams; locales?: string[]; locale?: string; defaultLocale?: string; }; /** * Represents the result of a page relation. * @template T - The type of the categorized item. */ type IPageRelationResult = { href: string; } & T; /** * Represents a page relation. * @template T - The type of the categorized item. */ type IPageRelation = { relationTo: string; value: IPageRelationResult | IPageRelationResult[]; }; /** * Represents an unresolved page relation. */ type IPageUnresolvedRelation = { relationTo: string; value: IEquatable | IEquatable[]; }; declare enum MenuCategoryStrategy { Default = "default",// show hidden categories recursively, ExcludeHidden = "exclude-hidden", ExcludeRoute = "exclude-route", ExcludeHiddenAndRoute = "exclude-hidden-and-route" } type IMenuBase = { abstract?: ILocalizable; extra?: ILocalizable; customClass?: string; id: IEquatable; items?: IMenuItem[]; media?: IMedia; title: ILocalizable; }; type IMenuCategory = IMenuBase & { type: 'category'; href: string; category: IEquatable; customTitle?: ILocalizable; }; type IMenuGroup = IMenuBase & { type: 'group'; }; type IMenuLink = IMenuBase & { type: 'link'; href: string; target: string; }; type IMenuRoute = IMenuBase & { type: 'route'; href: string; page: IEquatable; schema: string; }; type IMenuPage = IMenuBase & { type: 'page'; href: string; page: IEquatable; schema: string; customTitle?: ILocalizable; }; type IMenuCustom = Record & { id: IEquatable; type: string; }; type IMenuItem = IMenuCategory | IMenuGroup | IMenuLink | IMenuPage | IMenuRoute; type IMenuHref = IMenuCategory | IMenuLink | IMenuPage | IMenuRoute; declare function isMenuHref(item: IMenuItem): item is IMenuHref; declare function isMenuCategory(item: IMenuItem): item is IMenuCategory; declare function isMenuGroup(item: IMenuItem): item is IMenuGroup; declare function isMenuLink(item: IMenuItem): item is IMenuLink; declare function isMenuPage(item: IMenuItem): item is IMenuPage; declare function isMenuRoute(item: IMenuItem): item is IMenuRoute; type IMenu = { id: string; items: IMenuItem[]; }; type ILocalizedMenu = { id: string; items: ILocalized[]; }; /** * this is the original menu model from cms */ type IUndecoratedMenuBase = { abstract?: ILocalizable; extra?: ILocalizable; customClass?: string; id?: string; items: IUndecoratedMenuItem[]; markets?: string[]; media?: IMedia; type: string; }; type IUndecoratedMenuCategory = Omit & { type: 'category'; category: string; maxDepth?: number; strategy?: MenuCategoryStrategy; title?: ILocalizable; }; type IUndecoratedMenuGroup = Omit & { type: 'group'; title: ILocalizable; }; type IUndecoratedMenuLink = Omit & { type: 'link'; title: ILocalizable; href: string; target?: string; }; type IUndecoratedMenuPage = Omit & { type: 'page'; page: IPageRelation; title?: ILocalizable; }; type IUndecoratedMenuCustom = Omit & { type: 'custom'; blockType: string; }; type IUndecoratedMenuItem = IUndecoratedMenuCategory | IUndecoratedMenuGroup | IUndecoratedMenuLink | IUndecoratedMenuPage | IUndecoratedMenuCustom; type IUndecoratedMenu = IEntity & { id: string; items: IUndecoratedMenuItem[]; }; type ILayout = { labels: ILabel[]; locale: string; locales: ILocale[]; market: string; markets: IMarket[]; app: IPrettify>; menu: Record; topLevelHrefs: Record; topLevelRoutes: Record; tree?: IRouteLink; }; type IUndecoratedNav = IUndecoratedMenuPage; type IDecoratedNav = IMenuPage; type Pagination = { hasNextPage: boolean; hasPrevPage: boolean; limit: number; nextPage: number | null; page: number; pagingCounter: number; prevPage: number | null; totalDocs: number; totalPages: number; }; type IPaginationResult = { docs: T[]; } & Pagination; /** equals The value must be exactly equal. not_equals The query will return all documents where the value is not equal. exists Only return documents where the value either exists (true) or does not exist (false). greater_than For numeric or date-based fields. greater_than_equal For numeric or date-based fields. less_than For numeric or date-based fields. less_than_equal For numeric or date-based fields. like Case-insensitive string must be present. If string of words, all words must be present, in any order. contains Must contain the value entered, case-insensitive. in The value must be found within the provided comma-delimited list of values. not_in The value must NOT be within the provided comma-delimited list of values. all The value must contain all values provided in the comma-delimited list. near For distance related to a point field comma separated as , , , . */ type Operator = 'equals' | 'not_equals' | 'exists' | 'greater_than' | 'greater_than_equal' | 'less_than' | 'less_than_equal' | 'like' | 'contains' | 'in' | 'not_in' | 'all' | 'near'; type WhereField = { [key in Operator]?: unknown; }; type WhereBase = { [key: string]: WhereField | Where[]; }; type WhereAndOr = { or?: Where[]; and?: Where[]; }; type Where = WhereBase & WhereAndOr; type QueryParams = { depth?: number; draft?: boolean; limit?: number; locale?: string; market?: string; page?: number; pagination?: boolean; richText?: boolean; sort?: string; where?: Where; }; type GlobalQueryParams = { depth?: number; draft?: boolean; locale?: string; market?: string; richText?: boolean; }; type IPagedResult = { docs: T[]; } & Pagination; type IQuerable = { findGlobal(params?: GlobalQueryParams, token?: string): Promise; findOne(id: IEquatable, params?: QueryParams, token?: string): Promise; findMany(params?: QueryParams, token?: string): Promise; findPaged(params?: QueryParams, token?: string): Promise>; create(payload: Omit, params?: QueryParams, token?: string): Promise; updateOne(id: IEquatable, payload: Partial, params?: Omit, token?: string): Promise; updateMany(payload: Partial, params?: QueryParams, token?: string): Promise; deleteOne(id: IEquatable, params?: Omit, token?: string): Promise; deleteMany(params?: QueryParams, token?: string): Promise; update(payload: Partial, params?: QueryParams, token?: string): Promise; delete(id: IEquatable, token?: string): Promise; }; type FindParams = { where?: { [key: string]: unknown; }; market?: string; locale?: string; }; type FindWhereParams = { where: { [key: string]: unknown; }; market?: string; locale?: string; }; declare function toFindParams(idOrParams: IEquatable | FindWhereParams): FindWhereParams; declare enum RedirectReason { MovedPermanently = "301", Found = "302", TemporaryRedirect = "307", PermanentRedirect = "308", Gone = "410" } type IRedirect = { id: IEquatable; status: RedirectReason; from: string; to?: string; name?: string; order?: number; isActive: boolean; }; type IMemoryStore = Record; type IStore = Record; type IConfig = { collections: string[]; mocks: string[]; pages: string[]; }; type IPackages = { icons: string; models: string; ui: string; }; type ICollectionDescription = { singularName: string; pluralName: string; pluralDisplayName: string; displayName: string; title: string; }; type ISerializedCollection = ICollectionDescription & { items: T[]; }; type ISerializedStore = Record; type ITemplate = { id: IEquatable; name: ILocalizable; collections: string[]; }; /** * Retrieves the root category from the given list of categories. * @param categories - The list of categories. * @returns The root category, if found; otherwise undefined. */ declare function getRootCategory(categories: ICategory[]): ICategory | undefined; /** * Retrieves the parent category of an item. * @param categories - The array of categories. * @param item - The item to find the parent category for. * @returns The parent category of the item, or undefined if not found. */ declare function getParentCategory(categories: ICategory[], item: ICategorized): ICategory | undefined; /** * Retrieves the parent categories of a category with the given ID. * @param categories - The list of categories. * @param id - The ID of the category. * @returns An array of parent categories. */ declare function getParentCategoriesById(categories: ICategory[], id?: string): ICategory[]; /** * Retrieves the category segments for an ICategorized item. * @param item - The item to retrieve the category segments for. * @param categories - The list of categories. * @returns An array of category segments. */ declare function getCategorySegments(categories: ICategory[], item: ICategorized): ICategory[]; /** * Retrieves the category segments for a category. * @param item - The category to retrieve the category segments for. * @param categories - The list of categories. * @returns An array of category segments. */ declare function getCategorySegmentsByCategory(categories: ICategory[], item: ICategory): ICategory[]; /** * Retrieves the ID of a category or an object that implements IEquatable. * @param value - The category or object to retrieve the ID from. * @returns The ID of the category or object as a string. */ declare function asCategoryId(value: undefined): undefined; declare function asCategoryId(value: string): string; declare function asCategoryId(value: IEntity | IEquatable): string; declare function asCategoryId(value: IEntity | IEquatable | undefined): string | undefined; /** * Finds a category in the given array of categories based on the provided item. * @param categories - The array of categories to search in. * @param item - The item to find in the categories array. * @returns The found category, if any, or undefined. */ declare function findCategoryInCategories(categories: ICategory[], item: ICategory | IEquatable | undefined): ICategory | undefined; /** * Finds child categories based on the given item. * @param categories - The array of categories to search in. * @param item - The item to find child categories for. * @returns An array of child categories. */ declare function findChildCategories(categories: ICategory[], item: ICategory | IEquatable | undefined): ICategory[]; /** * Combines multiple IClassName objects into a single string of class names. * @param props - The IClassName objects to combine. * @returns A string of class names. */ declare function getClassNames(...props: Array): string; /** * Retrieves the collection description based on the given text. * @param text - The input text. * @returns The collection description object. */ declare function getCollectionDescription(text: string): ICollectionDescription; /** * Converts a camel case string to snake case. * @param text - The input text. * @returns The converted snake case string. */ declare function camelToSnakeCase(text: string): string; /** * Checks if the given collection description is valid. * @param description - The collection description object. * @returns True if the collection description is valid, false otherwise. */ declare function isValidCollectionDescription(description: ICollectionDescription): boolean; /** * Checks if the given collection description is reserved. * @param description - The collection description object. * @returns True if the collection description is reserved, false otherwise. */ declare function isReservedCollectionDescription(description: ICollectionDescription): boolean; /** * Converts a string to a display name by removing spaces. * @param text - The input text. * @returns The converted display name. */ declare function toDisplayName(text: string): string; /** * Converts a string to its plural form. * @param text - The input text. * @returns The plural form of the input text. */ declare function toPluralName(text: string): string; /** * Converts a string to title case. * @param text - The input text. * @returns The converted title case string. */ declare function toTitleCase(text: string): string; /** * Converts a string to a valid collection name by removing special characters and converting to snake case. * @param text - The input text. * @returns The converted valid collection name. */ declare function toValidCollectionName(text: string): string; declare function consoleWarn(message: string, component?: string): void; /** * Retrieves the ID of a category or an object that implements IEquatable. * @param value - The category or object to retrieve the ID from. * @returns The ID of the category or object as a string. */ declare function asEntityId(value: undefined): undefined; declare function asEntityId(value: string): string; declare function asEntityId(value: number): number; declare function asEntityId(value: IEntity | IEquatable): string | number; declare function asEntityId(value: IEntity | IEquatable | undefined): string | number | undefined; /** * Performs an HTTP fetch request. * @param url - The URL to fetch. * @param options - The fetch request options. * @param serviceOptions - Additional service options. * @returns A promise that resolves to the response data. */ declare function httpFetch(url: string, options?: FetchRequestOptions, serviceOptions?: any): Promise; /** * Performs an HTTP GET request. * @param url - The URL to fetch. * @param options - The fetch request options. * @returns A promise that resolves to the response data. */ declare function httpGet(url: string, options?: FetchRequestOptions): Promise; /** * Performs an HTTP POST request. * @param url - The URL to fetch. * @param payload - The payload to send in the request body. * @param options - The fetch request options. * @returns A promise that resolves to the response data. */ declare function httpPost(url: string, payload: any, options?: FetchRequestOptions): Promise; /** * Performs an HTTP PUT request. * @param url - The URL to fetch. * @param payload - The payload to send in the request body. * @param options - The fetch request options. * @returns A promise that resolves to the response data. */ declare function httpPut(url: string, payload: any, options?: FetchRequestOptions): Promise; /** * Performs an HTTP PATCH request. * @param url - The URL to fetch. * @param payload - The payload to send in the request body. * @param options - The fetch request options. * @returns A promise that resolves to the response data. */ declare function httpPatch(url: string, payload: any, options?: FetchRequestOptions): Promise; /** * Performs an HTTP DELETE request. * @param url - The URL to fetch. * @param options - The fetch request options. * @returns A promise that resolves to the response data. */ declare function httpDelete(url: string, options?: FetchRequestOptions): Promise; declare function encryptImageToken(imageResize: IImageResize): string; declare function decryptImageResize(token: string): IImageResize; declare class JsonService implements IQuerable { items: T[]; constructor(items: T[]); getItems(): Promise; protected whereId_(id: IEquatable): WhereField; findGlobal(params?: GlobalQueryParams): Promise; findOne(id: IEquatable, params?: QueryParams): Promise; findMany(params?: QueryParams): Promise; findPaged(params?: QueryParams): Promise>; create(payload: Omit): Promise; updateOne(id: IEquatable, payload: Partial, params?: QueryParams): Promise; updateMany(payload: Partial, params?: QueryParams): Promise; deleteOne(id: IEquatable, params?: QueryParams): Promise; deleteMany(params?: QueryParams): Promise; update(payload: Partial): Promise; delete(id: IEquatable): Promise; protected decorateOne_(item: B, params?: QueryParams): Promise; protected decorateMany_(items: B[], params?: QueryParams): Promise; protected newUUID_(): number; protected equalsClause_(value: unknown, equals?: unknown): boolean; protected notEqualsClause_(value: unknown, not_equals?: unknown): boolean; protected existsClause_(value: unknown, exists?: boolean): boolean; protected greaterThanClause_(value: unknown, greater_than?: unknown): boolean; protected greaterThanEqualClause_(value: unknown, greater_than_equal?: unknown): boolean; protected lessThanClause_(value: unknown, less_than?: unknown): boolean; protected lessThanEqualClause_(value: unknown, less_than_equal?: unknown): boolean; protected likeClause_(value: unknown, query?: string): boolean; protected containsClause_(value: unknown, contains?: IEquatable): boolean; protected inClause_(value: unknown, values?: unknown[]): boolean; protected notInClause_(value: unknown, values?: unknown[]): boolean; protected allClause_(value: unknown, values?: unknown[]): boolean; protected nearClause_(value: unknown, near?: unknown[]): boolean; protected whereItem_(item: B, where?: Where): boolean; /** equals The value must be exactly equal. not_equals The query will return all documents where the value is not equal. exists Only return documents where the value either exists (true) or does not exist (false). greater_than For numeric or date-based fields. greater_than_equal For numeric or date-based fields. less_than For numeric or date-based fields. less_than_equal For numeric or date-based fields. like Case-insensitive string must be present. If string of words, all words must be present, in any order. contains Must contain the value entered, case-insensitive. in The value must be found within the provided comma-delimited list of values. not_in The value must NOT be within the provided comma-delimited list of values. all The value must contain all values provided in the comma-delimited list. near For distance related to a point field comma separated as , , , . */ protected whereItems_(items: B[], where?: Where, limit?: number): B[]; protected sortCollection_(items: B[], sort?: string): B[]; protected limitCollection_(items: B[], limit?: number): B[]; protected paginatedItems_(items: B[], page?: number, limit?: number): ({ docs: B[]; } & Pagination); } declare const defaultLocale: string; /** * Checks if a value is a localized string. * @param value - The value to check. * @returns A boolean indicating whether the value is a localized string. */ declare function isLocalizedString(value: any): value is ILocalizedString; /** * Converts a localized string object to a string based on the specified locale. * @param json - The localized string object. * @param locale - The locale to use. * @param defaultLocale - The default locale to use if the specified locale is not found. * @returns The localized string. */ declare function localizedToString(json: ILocalizedString, locale: string, defaultLocale?: string): string; /** * Localizes a value based on the specified locale. * @param value - The value to localize. * @param locale - The locale to use. * @param defaultLocale - The default locale to use if the specified locale is not found. * @returns The localized value as a string. */ declare function localize(value: ILocalizable, locale: string, defaultLocale?: string): string; /** * Localizes a value or an array/object of values based on the specified locale. * @param value - The value or array/object of values to localize. * @param locale - The locale to use. * @param defaultLocale - The default locale to use if the specified locale is not found. * @returns The localized value or array/object of localized values. */ declare function localizeValue(value: any, locale: string, defaultLocale?: string): any; /** * Localizes an array/object of values based on the specified locale. * @param item - The array/object of values to localize. * @param locale - The locale to use. * @param defaultLocale - The default locale to use if the specified locale is not found. * @returns The localized array/object of values. */ declare function localizeItem(item: T, locale: string, defaultLocale?: string): T; declare enum LoggerLevel { NONE = 0, ERROR = 1, WARN = 2, INFO = 3, LOG = 4, ALL = 5 } declare class Logger { static level_: LoggerLevel; static setLevel(level: LoggerLevel): void; static getLevel(): LoggerLevel; static error(...args: unknown[]): void; static warn(...args: unknown[]): void; static info(...args: unknown[]): void; static log(...args: unknown[]): void; } declare const defaultMarket: string; /** * STORE */ type IMockStore = { collections: { [key: string]: IMockCollection[]; } & { category: IMockCategory[]; label: IMockLabel[]; locale: IMockLocale[]; market: IMockMarket[]; menu?: IMockMenu[]; redirect?: IMockCollection[]; template?: IMockTemplate[]; }; pages: Record; }; type IMockPage = { id?: IEquatable; title: ILocalizable; abstract?: ILocalizable; description?: ILocalizable; media?: IMockMedia; meta?: IMockMeta; components?: IMockComponent[]; category: string; slug?: ILocalizable; template?: string; isDefault?: boolean; isProtected?: boolean; useSplat?: boolean; order?: number; markets?: string[]; $inherit?: boolean; [key: string]: unknown; }; type IMockComponent = { schema?: string; anchor?: IAnchor; [key: string]: unknown; }; type IMockMeta = { title?: ILocalizable; description?: ILocalizable; keywords?: ILocalizable; robots?: ILocalizable; }; type IMockTemplate = { id: string; name: string; collections?: string[]; }; type IMockCategory = { id: string; title: ILocalizable; slug?: ILocalizable; category?: string; isHidden?: boolean; }; type IMockLocale = { id: ILocaleId; title: ILocalizable; isDefault?: boolean; }; type IMockMarket = { id: string; title: ILocalizable; isDefault?: boolean; isActive?: boolean; defaultLanguage?: ILocaleId; countries?: string[]; languages?: ILocaleId[]; }; type IMockLabel = { id: string; text: ILocalizable; }; type IMockMedia = { id?: IEquatable; title?: ILocalizable; abstract?: ILocalizable; alt?: ILocalizable; type: IMediaType; src: string; [key: string]: unknown; }; type IMockCollection = { id?: IEquatable; title?: ILocalizable; abstract?: ILocalizable; description?: ILocalizable; media?: IMockMedia; order?: number; markets?: string[]; $inherit?: boolean; [key: string]: unknown; }; type IMockRedirect = { status: string; from: string; to?: string; name: string; order?: number; isActive?: boolean; }; /** * MENU */ type IMockMenu = { id: string; items: IMockMenuItem[]; }; type IMockMenuItem = IMockMenuGroup | IMockMenuCategory | IMockMenuPage | IMockMenuLink | IMockMenuCustom; type IMockMenuGroup = IMockMenuBase & { type: 'group'; title?: ILocalizable; items: IMockMenuItem[]; }; type IMockMenuCategory = IMockMenuBase & IMockMenuExtra & { type: 'category'; category: string; customTitle?: ILocalizable; strategy?: MenuCategoryStrategy; maxDepth?: number; }; type IMockMenuPage = IMockMenuBase & IMockMenuExtra & { type: 'page'; page: IMockSingleRelation; customTitle?: ILocalizable; }; type IMockMenuLink = IMockMenuBase & { type: 'link'; title: ILocalizable; href: string; target?: ('_self' | '_blank' | '_parent' | '_top' | '_unfencedTop') & string; }; type IMockMenuCustom = IMockMenuBase & { type: 'custom'; title: ILocalizable; blockType: string; }; type IMockMenuBase = { abstract?: ILocalizable; media?: IMockMedia; markets?: string[]; customClass?: string; }; type IMockMenuExtra = { extra?: ILocalizable; }; type IMockRelation = { relationTo: string; value: IEquatable | IEquatable[]; }; type IMockSingleRelation = { relationTo: string; value: IEquatable; }; type IMockManyRelation = { relationTo: string; value: IEquatable[]; }; declare const passwordStrategy: string; /** * Serializes query parameters into a query string. * @param queryParams - The query parameters to serialize. * @returns The serialized query string. */ declare function qsSerialize(queryParams?: QueryParams): string; /** * Serializes query parameters into a raw query string. * @param queryParams - The query parameters to serialize. * @returns The serialized raw query string. */ declare function qsSerializeRaw(queryParams?: {}): string; /** * Deserializes a query string into query parameters. * @param query - The query string to deserialize. * @param deserializedParams - The deserialized query parameters. * @returns The deserialized query parameters. */ declare function qsDeserialize(query?: string, deserializedParams?: {}): QueryParams; /** * Deserializes a raw query string into parameters. * @param query - The raw query string to deserialize. * @param deserializedParams - The deserialized parameters. * @returns The deserialized parameters. */ declare function qsDeserializeRaw(query?: string, deserializedParams?: {}): {}; /** * Checks if the given headers object is an instance of the Headers class. * @param headers - The headers object to check. * @returns True if the headers object is an instance of Headers, false otherwise. */ declare function isHeaders(headers?: IncomingHttpHeaders | Headers): headers is Headers; /** * Checks if the given headers object is an instance of IncomingHttpHeaders. * @param headers - The headers object to check. * @returns True if the headers object is an instance of IncomingHttpHeaders, false otherwise. */ declare function isIncomingHttpHeaders(headers?: IncomingHttpHeaders | Headers): headers is IncomingHttpHeaders; /** * Retrieves the host from the headers object. * @param headers - The headers object. * @returns The host value from the headers object, or null if not found. */ declare function getHost(headers?: IncomingHttpHeaders | Headers): string | null; /** * Retrieves the protocol from the headers object. * @param headers - The headers object. * @returns The protocol value from the headers object, or 'https' if not found. */ declare function getProto(headers?: IncomingHttpHeaders | Headers): string; /** * Retrieves the origin from the headers object. * @param headers - The headers object. * @returns The origin value based on the host and protocol from the headers object, or an empty string if not found. */ declare function getOrigin(headers?: IncomingHttpHeaders | Headers): string; /** * Represents the route strategy options. * - **Auto** dynamically add/remove prefixes based on number of markets & languages. * - **Default** add prefixes based on !isDefault market or language flag. * - **Manual** add prefixes based on !isHidden market or language flag. */ declare enum RouteStrategy { Auto = "auto", Default = "default", Manual = "manual" } /** * Collects routes based on the provided data. * * @param store - The memory store containing categorized items. * @param categories - The list of categories. * @param markets - The list of markets. * @param locales - The list of locales. * @returns An array of collected routes. */ declare function collectRoutes(store: IMemoryStore, categories: ICategory[], markets: IMarket[], locales: ILocale[], medias?: IMedia[]): IRoute[]; /** * Iterates over each market and locale combination and invokes the callback function. * * @param markets - The list of markets. * @param locales - The list of locales. * @param callback - The callback function to be invoked for each market and locale combination. */ declare function eachMarketLocale(markets: IMarket[], locales: ILocale[], callback: (market: IMarket, locale: ILocale, markets: IMarket[], locales: ILocale[]) => void): void; /** * Iterates over each categorized item in the store and invokes the callback function. * * @param store - The memory store containing categorized items. * @param callback - The callback function to be invoked for each categorized item. */ declare function eachCategorized(store: IMemoryStore, callback: (item: ICategorized, key: string) => void): void; /** * Finds the default route of a category by categoryId, market, and locale. * @param routes - The array of routes to search. * @param categoryId - The category ID to match. * @param market - The market to match (optional). * @param locale - The locale to match (optional). * @returns The matching route, if found. Otherwise, undefined. */ declare function findRouteOfCategory(routes: IRoute[], categoryId: IEquatable, market?: string, locale?: string): IRoute | undefined; /** * Finds the routes of a category by categoryId. * @param routes - The array of routes to search. * @param categoryId - The category ID to filter routes by. * @param isDefault - Optional. Specifies whether to filter routes by default status. Default is true. * @returns An array of routes that match the specified category and default status. */ declare function findRoutesOfCategory(routes: IRoute[], categoryId: IEquatable, isDefault?: boolean): IRoute[]; /** * Generates the route href based on the provided segments, market, locale, markets, and locales. * * @param segments - The segments of the route. * @param market - The market object. * @param locale - The locale object. * @param markets - The list of markets. * @param locales - The list of locales. * @returns The generated route href. */ declare function getRouteHref(segments: { slug: ILocalizable; }[], market: IMarket, locale: ILocale, markets: IMarket[], locales: ILocale[]): string; declare function hasMarket(item: ICategorized, market: IMarket): boolean; declare function arrayShuffle(items: T[]): T[]; /** * Converts a value to an `IEquatable` or `undefined`. * If the value is an `IEntity`, it extracts the `id` property. * If the `id` is a string that represents a valid number, it returns the number. * Otherwise, it returns the `id` as is. * * @param value The value to convert. * @returns The converted value as an `IEquatable` or `undefined`. */ declare function asEquatable(value: string): IEquatable; declare function asEquatable(value: number): number; /** * Converts a value to a string or `undefined`. * If the value is an `IEntity`, it extracts the `id` property. * If the `id` is defined, it returns it as a string. * Otherwise, it returns `undefined`. * * @param value The value to convert. * @returns The converted value as a string or `undefined`. */ declare function asEquatableString(value: string): string; /** * Converts a value to a number or `undefined`. * If the value is an `IEntity`, it extracts the `id` property. * If the `id` is a string that represents a valid number, it returns the number. * Otherwise, it returns `undefined`. * * @param value The value to convert. * @returns The converted value as a number or `undefined`. */ declare function asEquatableNumber(value: number): number; /** * Reorder an array of INamedEntities into an options list sorted by name. * * @param items - The array of INamedEntities to reorder. * @returns An array of sorted IOption. */ declare function asSortedOptions(items: T[]): IOption[]; /** * PascalCase * camelCase * kebab-case * snake_case * char*case **/ declare function unknownCaseToPascalCase(unknownCase: string): string; declare function pascalCaseToCamelCase(pascalCase: string): string; declare function pascalCaseToCharCase(pascalCase: string, char?: string): string; declare function pascalCaseToKebabCase(pascalCase: string): string; declare function pascalCaseToSnakeCase(pascalCase: string): string; declare function toPascalCase(unknownCase: string): string; declare function toCamelCase(unknownCase: string): string; declare function toCharCase(unknownCase: string, char?: string): string; declare function toKebabCase(unknownCase: string): string; declare function toSnakeCase(unknownCase: string): string; declare function cloneItem(item: T): T; declare function collectFeatureTypes(items: T[], ...keys: string[]): Promise; declare function collectFeatureTypes__(items: T[], ...keys: string[]): Promise; /** * Collects options from an array of items based on specified keys. * @param items The array of items to collect options from. * @param keys The keys to collect options for. * @returns A promise that resolves to an object containing the collected options. */ declare function collectOptions(items: T[], ...keys: string[]): Promise>>; declare function isComponentOfType = Partial>(item: unknown, ...blockTypes: string[]): item is T; declare function pickComponent(items: IComponent[] | undefined, ...blockTypes: string[]): IComponent[] | undefined; declare function excludeComponent(items: IComponent[] | undefined, ...blockTypes: string[]): IComponent[] | undefined; declare function pickHero(items: IComponent[] | undefined, blockTypes?: string[]): [IComponent[] | undefined, IComponent[] | undefined]; declare function prependHero(items: IComponent[] | undefined, hero: IComponent | string, blockType?: string): IComponent[]; declare function groupComponents(items: IComponent[] | undefined, blockTypes: string[], blockType: string): IComponent[]; /** * Represents a primitive value that can be used in the deep merge operation. */ type Primitive = ((...args: any[]) => any) | string | number | boolean | null; /** * Represents a dynamic value that can be used in the deep merge operation. */ type Dynamic = { [key: string]: Dynamic; } | Dynamic[] | Primitive; /** * Deeply merges two objects or arrays. * * @param target - The target object or array to merge into. * @param source - The source object or array to merge from. * @returns The merged object or array. */ declare function deepMerge(target?: Partial, source?: Partial): T & R; declare function eachMedia(item: unknown, callback: (value: IMedia) => void): void; declare function eachValue(item: unknown, callback: (value: unknown) => void): void; type ListItem = { [K in keyof T]: { readonly key: string; readonly value: T[K]; }; }[keyof T]; /** * Helper to produce an array of enum descriptors. * @param enumeration Enumeration object. * @param separatorRegex Regex that would catch the separator in your enum key. */ declare function enumToList>(enumeration: T, separatorRegex?: RegExp): ListItem[]; /** * Checks if the given item is a number. * @param item The item to check. * @returns True if the item is a number, false otherwise. */ declare function isNumber(item: unknown): item is number; /** * Checks if the given item is a string. * @param item The item to check. * @returns True if the item is a string, false otherwise. */ declare function isString(item: unknown): item is string; /** * Checks if the given item is a valid non-empty string. * @param item The item to check. * @returns True if the item is a valid non-empty string, false otherwise. */ declare function isValidString(item: unknown): item is string; /** * Checks if the given item is an array. * @param item The item to check. * @returns True if the item is an array, false otherwise. */ declare function isArray(item: unknown): item is Array; /** * Checks if the given item is an array and is not empty. * @param item The item to check. * @returns True if the item is an array and its length is > 0, false otherwise. */ declare function isNonEmptyArray(item: unknown): item is Array; /** * Checks if the given item is an object. * @param item The item to check. * @returns True if the item is an object, false otherwise. */ declare function isObject>(item: unknown): item is T; /** * Checks if the given item is a promise. * @param result The item to check. * @returns True if the item is a promise, false otherwise. */ declare function isPromise(result: unknown): result is Promise; /** * Checks if the given item is a non-null string. * @param item The item to check. * @returns True if the item is a non-null string, false otherwise. */ declare function isNotNullString(item: unknown): item is string; /** * Checks if the given item is equatable. * @param item The item to check. * @returns True if the item is equatable, false otherwise. */ declare function isEquatable(item: unknown): item is IEquatable; /** * Checks if the given item is an entity. * @param item The item to check. * @returns True if the item is an entity, false otherwise. */ declare function isEntity(item: unknown): item is T; declare function isComponent(item: unknown): item is T; declare function hasComponents(item: unknown): item is T; /** * Checks if the given item is an unresolved relation. * @param item The item to check. * @returns True if the item is an unresolved relation, false otherwise. */ declare function isUnresolvedRelation(item: unknown): item is IPageUnresolvedRelation; /** * Checks if the given item is a relation. * @param item The item to check. * @returns True if the item is a relation, false otherwise. */ declare function isRelation(item: unknown): item is IPageRelation; declare function isUnresolvedCategory(category?: IEquatable | ICategory): category is IEquatable; declare function isUndecoratedCategory(category: unknown): category is Omit; /** * Checks if the given item is an undecorated menu item. * @param item The item to check. * @returns True if the item is an undecorated menu item, false otherwise. */ declare function isUndecoratedMenuItem(item: unknown): item is IUndecoratedMenuItem; /** * Checks if the given item is an undecorated menu category. * @param item The item to check. * @returns True if the item is an undecorated menu category, false otherwise. */ declare function isUndecoratedMenuCategory(item: unknown): item is IUndecoratedMenuCategory; /** * Checks if the given item is an undecorated menu page. * @param item The item to check. * @returns True if the item is an undecorated menu page, false otherwise. */ declare function isUndecoratedMenuPage(item: unknown): item is IUndecoratedMenuPage; /** * Checks if the given item is an undecorated navigation. * @param item The item to check. * @returns True if the item is an undecorated navigation, false otherwise. */ declare function isUndecoratedNav(item: unknown): item is IUndecoratedNav; /** * Generates a random UUID (Universally Unique Identifier) in version 4 format. * * @returns {string} The generated UUID. */ declare function uuidv4(): string; declare function getIsDevelopment(): boolean; declare function getIsProduction(): boolean; declare const isDevelopment: boolean; declare const isProduction: boolean; declare const isStage: boolean; declare const isBrowser: boolean; declare function getEnv(): Record; declare function withSchema, Schema>(component: Component, schema: Schema): Component & Schema; declare function asServerProps(props: any): any; declare function awaitAll(array: any, callback: (item: any, index: number) => Promise): Promise; declare function merge(target: any, source: any): any; export { type DeepPartial, type DeepRequired, type DeepRequiredProps, type Dynamic, type FetchError, type FetchRequestOptions, type FetchService, type FindParams, type FindWhereParams, type GlobalQueryParams, type Headings, type IAction, type IActionEmailData, type IAnchor, type IApp, type IAppExtended, type ICategorized, type ICategory, type ICategoryItem, type IClassName, type IClassNameCollection, type IClassNameValue, type ICollectionDescription, type IComponent, type IConfig, type IConsentPreference, type IContextBaseParams, type IContextParams, type IDecoratedNav, type IEmailConfig, type IEndUser, type IEntity, type IEquatable, type IFeature, type IFeatureType, type IImageResize, type ILabel, type ILayout, type ILegalNotice, type ILetter, type ILocale, type ILocaleId, type ILocalizable, type ILocalized, type ILocalizedMenu, type ILocalizedString, type IMarket, type IMedia, type IMediaImage, type IMediaInfo, type IMediaJson, type IMediaPdf, type IMediaType, type IMediaVideo, type IMemoryStore, type IMenu, type IMenuBase, type IMenuCategory, type IMenuCustom, type IMenuGroup, type IMenuHref, type IMenuItem, type IMenuLink, type IMenuPage, type IMenuRoute, type IMockCategory, type IMockCollection, type IMockComponent, type IMockLabel, type IMockLocale, type IMockManyRelation, type IMockMarket, type IMockMedia, type IMockMenu, type IMockMenuBase, type IMockMenuCategory, type IMockMenuCustom, type IMockMenuExtra, type IMockMenuGroup, type IMockMenuItem, type IMockMenuLink, type IMockMenuPage, type IMockMeta, type IMockPage, type IMockRedirect, type IMockRelation, type IMockSingleRelation, type IMockStore, type IMockTemplate, type INamedEntity, type IOption, type IOverride, type IOverrideReturnValue, type IOverrideValue, type IPackages, type IPage, type IPageItem, type IPageRelation, type IPageRelationResult, type IPageUnresolvedRelation, type IPagedResult, type IPaginationResult, type IPartial, type IPreference, type IPrettify, type IQuerable, type IRedirect, type IRoute, type IRouteCanonical, type IRouteLink, type IRouteParams, type ISchema, type ISerializedCollection, type ISerializedStore, type IServerSideContext, type IServerSideSplatContext, type IStaticContext, type IStore, type ITemplate, type ITitledEntity, type IUndecoratedMenu, type IUndecoratedMenuBase, type IUndecoratedMenuCategory, type IUndecoratedMenuCustom, type IUndecoratedMenuGroup, type IUndecoratedMenuItem, type IUndecoratedMenuLink, type IUndecoratedMenuPage, type IUndecoratedNav, ImageStrategy, type Json, JsonService, type LiteralUnion, Logger, LoggerLevel, MenuCategoryStrategy, type NextApiRequestCookies, type Operator, type PageProps, type Pagination, type PreviewData, type Primitive, type QueryParams, RedirectReason, type RequireAtLeastOne, RouteStrategy, type SchemaType, type ServerSidePropsContext, type Shift, type ShiftUnion, type StaticPropsContext, type User, type UserRole, type UserWithRoles, type ValueOf, type Where, type WhereAndOr, type WhereBase, type WhereField, arrayShuffle, asCategoryId, asEntityId, asEquatable, asEquatableNumber, asEquatableString, asServerProps, asSortedOptions, awaitAll, base64ToString, camelToSnakeCase, cloneItem, collectFeatureTypes, collectFeatureTypes__, collectOptions, collectRoutes, consoleWarn, decryptImageResize, deepMerge, defaultLocale, defaultMarket, eachCategorized, eachMarketLocale, eachMedia, eachValue, encryptImageToken, enumToList, excludeComponent, findCategoryInCategories, findChildCategories, findRouteOfCategory, findRoutesOfCategory, getCategorySegments, getCategorySegmentsByCategory, getClassNames, getCollectionDescription, getEnv, getHost, getIsDevelopment, getIsProduction, getOrigin, getParentCategoriesById, getParentCategory, getProto, getRootCategory, getRouteHref, groupComponents, hasComponents, hasMarket, httpDelete, httpFetch, httpGet, httpPatch, httpPost, httpPut, isArray, isBrowser, isComponent, isComponentOfType, isDevelopment, isEntity, isEquatable, isHeaders, isIncomingHttpHeaders, isLocalizedString, isMedia, isMediaImage, isMediaJson, isMediaPdf, isMediaVideo, isMenuCategory, isMenuGroup, isMenuHref, isMenuLink, isMenuPage, isMenuRoute, isNonEmptyArray, isNotNullString, isNumber, isObject, isProduction, isPromise, isRelation, isReservedCollectionDescription, isStage, isString, isUndecoratedCategory, isUndecoratedMenuCategory, isUndecoratedMenuItem, isUndecoratedMenuPage, isUndecoratedNav, isUnresolvedCategory, isUnresolvedRelation, isValidCollectionDescription, isValidString, localize, localizeItem, localizeValue, localizedToString, merge, pascalCaseToCamelCase, pascalCaseToCharCase, pascalCaseToKebabCase, pascalCaseToSnakeCase, passwordStrategy, pickComponent, pickHero, prependHero, qsDeserialize, qsDeserializeRaw, qsSerialize, qsSerializeRaw, resolveMediaType, stringToBase64, toCamelCase, toCharCase, toDisplayName, toFindParams, toKebabCase, toPascalCase, toPluralName, toSnakeCase, toTitleCase, toValidCollectionName, unknownCaseToPascalCase, uuidv4, withSchema };