import type Bookshelf from '@metabrainz/bookshelf'; import type { Transaction } from './func/types'; export declare function snakeToCamel(attrs: S): C; export declare function snakeToCamelID(attrs: S): C; export declare function camelToSnake(attrs: C): S; export declare function uncapitalize(word: T): Uncapitalize; export declare class EntityTypeError extends Error { constructor(message: string); } export declare function validateEntityType(model: any): void; export declare function truncateTables(bookshelf: Bookshelf, tables: string[]): Promise; export declare function diffRevisions(base: any, other: any, includes: any): any; /** * Produce an ISO 8601-2004 formatted string for a date. * @param {number} year - A calendar year. * @param {number} [month] - A calendar month. * @param {number} [day] - A calendar day of month. * @returns {string} The provided date formatted as an ISO 8601-2004 year or calendar date. */ export declare function formatDate(year: number, month?: number, day?: number): string; /** * Split ISO 8601 calendar dates or years into a numerical array. * @param {string} date - A date of the format 'YYYY', 'YYYY-MM', or 'YYYY-MM-DD'. * @returns {Array} - Year, month, and day of month respectively. */ export declare function parseDate(date: string): Array; /** * Create a new Edition Group for an Edition. * The Edition Group will be part of the same revision, and will have the same * alias set and author credit for that revision * Subsequent changes to the alias set or author credit for either entity will * only impact that entity's new revision. * @param {Bookshelf} orm - The Bookshelf ORM * @param {Transaction} transacting - The Bookshelf/Knex SQL transaction in progress * @param {number|string} aliasSetId - The id of the new edition's alias set * @param {number|string} revisionId - The id of the new edition's revision * @param {number|string} authorCreditId - The id of the new edition's author credit * @param {boolean} creditSection - The state of author credit section of the new edition * @returns {string} BBID of the newly created Edition Group */ export declare function createEditionGroupForNewEdition(orm: Bookshelf, transacting: Transaction, aliasSetId: number | string, revisionId: number | string, authorCreditId: number | string, creditSection: boolean): Promise; /** * Replacement for Bluebird's Promise.props * @param {Object} promiseObj - an object containing string keys and promises * to be resolved as the values * @returns {Object} an object containing the same keys, but resolved promises */ export declare function promiseProps(promiseObj: Record): Promise>>; export declare function convertMapToObject(value: any): any;