import type { ParsedEdition, ParsedEntity, ParsedSeries } from '../types/parser'; import type { AliasWithIdT } from '../types/aliases'; import type { EntityTypeString } from '../types/entity'; import type { ORM } from '..'; import type { Transaction } from './types'; /** * @param {Object} entityData - Object holding all data related to an entity * @param {string} entityType - The type of the entity * @returns {Object} - Returns all the additional entity specific data */ export declare function getAdditionalEntityProps(entityData: ParsedEntity, entityType: EntityTypeString): Pick | Partial | Partial | Pick | { beginAreaId: number; beginDate: string; beginDay: number; beginMonth: number; beginYear: number; endAreaId: number; endDate: string; endDay: number; endMonth: number; endYear: number; ended: boolean; genderId: number; typeId: number; areaId?: undefined; } | { areaId: number; beginDate: string; beginDay: number; beginMonth: number; beginYear: number; endDate: string; endDay: number; endMonth: number; endYear: number; ended: boolean; typeId: number; beginAreaId?: undefined; endAreaId?: undefined; genderId?: undefined; }; /** * Returns all entity models defined in bookbrainz-data-js * * @param {object} orm - the BookBrainz ORM, initialized during app setup * @returns {object} - Object mapping model name to the entity model */ export declare function getEntityModels(orm: ORM): { Author: typeof import("@metabrainz/bookshelf").default.Model; Edition: typeof import("@metabrainz/bookshelf").default.Model; EditionGroup: typeof import("@metabrainz/bookshelf").default.Model; Publisher: typeof import("@metabrainz/bookshelf").default.Model; Series: typeof import("@metabrainz/bookshelf").default.Model; Work: typeof import("@metabrainz/bookshelf").default.Model; }; /** * Retrieves the Bookshelf entity model with the given the model name * * @param {object} orm - the BookBrainz ORM, initialized during app setup * @param {string} type - Name or type of model * @throws {Error} Throws a custom error if the param 'type' does not * map to a model * @returns {object} - Bookshelf model object with the type specified in the * single param */ export declare function getEntityModelByType(orm: ORM, type: EntityTypeString): typeof import("@metabrainz/bookshelf").default.Model; /** * Finds the bbid an entity redirects to, if any. * Do a recursive search in case the redirected bbid also redirects, etc. * @param {object} orm - the BookBrainz ORM, initialized during app setup * @param {string} bbid - The target entity's bbid. * @param {any} transacting - Optional ORM transaction object * @returns {string} The final bbid to redirect to */ export declare function recursivelyGetRedirectBBID(orm: ORM, bbid: string, transacting?: Transaction): any; /** * Fetches an entity with related data * @param {object} orm - the BookBrainz ORM, initialized during app setup * @param {string} entityType - The entity model name. * @param {string} bbid - The target entity's bbid. * @param {string[]} relations - Extra model relationships to fetch along with the entity * @returns {Promise} A Promise that resolves to the entity in JSON format */ export declare function getEntity(orm: ORM, entityType: EntityTypeString, bbid: string, relations?: string[]): Promise>; /** * Fetches an entity's last known default alias from its revision parent. * This is necessary to display the name of a 'deleted' entity * @param {object} orm - the BookBrainz ORM, initialized during app setup * @param {string} entityType - The entity model name. * @param {string} bbid - The target entity's bbid. * @returns {Promise} The returned Promise returns the entity's * parent default alias */ export declare function getEntityParentAlias(orm: ORM, entityType: EntityTypeString, bbid: string): Promise;