UNPKG

usfm-editor

Version:
24 lines (23 loc) 1.31 kB
import { Editor, Descendant } from "slate"; import { IdentificationHeaders } from "../UsfmEditor"; /** * Applies the desired updates to an identification json object * * @param {Object} current - Json specifying the current identificaton * headers * @param {Object} updates - Json specifying the identification headers * to add, update, or remove, and the desired values. * example: {'toc1': 'new_toc1', 'id': 'updated_id'} * Unspecified headers will be kept the same. * To delete a header, pass a null value like {'toc1': null} * @returns The updated identification json */ export declare function mergeIdentification(current: IdentificationHeaders, updates: IdentificationHeaders): IdentificationHeaders; export declare function filterInvalidIdentification(ids: IdentificationHeaders): IdentificationHeaders; /** * Normalizes all json values so that every non-null value is a string. */ export declare function normalizeIdentificationValues(ids: IdentificationHeaders): IdentificationHeaders; export declare function identificationToSlate(ids: IdentificationHeaders): Descendant[]; export declare function parseIdentificationFromUsfm(usfm: string): IdentificationHeaders; export declare function parseIdentificationFromSlateTree(editor: Editor): IdentificationHeaders;