import type { ValidationOptions } from 'simple-validators'; import type { Affiliation } from '../affiliations/types.js'; import type { Contributor } from '../contributors/types.js'; type WithId = T & { id: string; }; /** * Object to hold items referenced in multiple parts of frontmatter * * These will be normalized to the top level and replaced with ids elsewhere */ export type ReferenceStash = { affiliations?: WithId[]; contributors?: WithId[]; authorIds?: string[]; }; export declare function pseudoUniqueId(kind: string, index: number, file?: string): string; export declare function stashPlaceholder(value: string): { id: string; name: string; }; /** * Return true if object: * - has 2 keys and only 2 keys: id and name * - the values for id and name are the same * * Also allows nameParsed on object if it matches the parsed object from id/name, * as this must match the validated version of `stashPlaceholder` output */ export declare function isStashPlaceholder(object: { id?: string; name?: string; nameParsed?: { literal?: string; }; }): boolean; /** * Update stash of authors/affiliations based on input value * * Input may be: * - string name * - string id * - object without id * - object with id * * This function will normalize all of the above to an id and if a corresponding * object does not yet exist in the stash, it will be added. The id is returned. * * This function will warn if two objects are explicitly defined with the same id. */ export declare function validateAndStashObject(input: any, stash: ReferenceStash, kind: 'affiliations' | 'contributors', validateFn: (v: any, o: ValidationOptions) => T | undefined, opts: ValidationOptions): string | undefined; export {}; //# sourceMappingURL=referenceStash.d.ts.map