fhir-snapshot-generator
Version:
Generate snapshots for FHIR Profiles
27 lines • 1.58 kB
TypeScript
/**
* © Copyright Outburn Ltd. 2022-2025 All Rights Reserved
* Project name: fhir-snapshot-generator
*/
import { ILogger } from 'fhir-package-explorer';
import { ElementDefinition } from '../../../types';
import { DefinitionFetcher } from '..';
/**
* Apply a single diff element to the working snapshot array and return the updated array.
* The existing element will be replaced by the result of merging it with the diff element.
* This function assumes that an element with the same id already exists in the working snapshot array.
* If the element does not exist, an error will be thrown.
* @param elements working snapshot array
* @param diffElement the diff element to apply
* @returns the updated element array after applying the diff element
*/
export declare const applySingleDiff: (elements: ElementDefinition[], diffElement: ElementDefinition) => ElementDefinition[];
/**
* Apply all diffs to the working snapshot array, in order, and return the updated array.
* Missing (but valid) elements and their containing branches will be added to the working snapshot array on the fly.
* The diff is an array of ElementDefinition objects that will be applied to the target element.
* @param elements working snapshot array
* @param diffElements the diff elements to apply
* @returns the updated element array after applying the diff elements
*/
export declare const applyDiffs: (elements: ElementDefinition[], diffs: ElementDefinition[], fetcher: DefinitionFetcher, logger: ILogger) => Promise<ElementDefinition[]>;
//# sourceMappingURL=applyDiffs.d.ts.map