@yellicode/elements
Version:
The meta model API for Yellicode - an extensible code generator.
91 lines (90 loc) • 4.25 kB
TypeScript
/**
* This code was generated by a tool.
*
* Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
*/
import * as elements from '../interfaces';
import { ElementComparer } from '../element-comparer-interface';
import { ElementReferenceResolver } from './element-reference-resolver';
export declare class ElementJSONTransformer {
private referenceResolver;
private elementComparer;
/**
* Creates a new ElementJSONTransformer instance. You only need an instance when parsing JSON. For
* serialization, use the static replace function.
* @param {ElementReferenceResolver} referenceResolver
* @param {ElementComparer} elementComparer An optional element comparer. Only provide a comparer when
* sortable elements and packages should be sorted during JSON parsing. This is typically only
* recommended when generating code and should be avoided when persisting a model (keeping the source
* data in its original order).
*/
constructor(referenceResolver: ElementReferenceResolver, elementComparer: ElementComparer | null);
resolveReferences(): void;
/**
* Creates a persistable string representation of the specified VisibilityKind value.
* @param {elements.VisibilityKind} value The value being stringified.
*/
private static stringifyVisibilityKind;
/**
* Parses a string representation of the specified VisibilityKind literal value.
* @param {string} value The value being parsed.
*/
private static parseVisibilityKind;
/**
* Creates a persistable string representation of the specified ParameterDirectionKind value.
* @param {elements.ParameterDirectionKind} value The value being stringified.
*/
private static stringifyParameterDirectionKind;
/**
* Parses a string representation of the specified ParameterDirectionKind literal value.
* @param {string} value The value being parsed.
*/
private static parseParameterDirectionKind;
/**
* Creates a persistable string representation of the specified ElementType value.
* @param {elements.ElementType} value The value being stringified.
*/
private static stringifyElementType;
/**
* Parses a string representation of the specified ElementType literal value.
* @param {string} value The value being parsed.
*/
private static parseElementType;
/**
* Creates a persistable string representation of the specified DocumentLocationKind value.
* @param {elements.DocumentLocationKind} value The value being stringified.
*/
private static stringifyDocumentLocationKind;
/**
* Parses a string representation of the specified DocumentLocationKind literal value.
* @param {string} value The value being parsed.
*/
private static parseDocumentLocationKind;
/**
* Creates a persistable string representation of the specified AggregationKind value.
* @param {elements.AggregationKind} value The value being stringified.
*/
private static stringifyAggregationKind;
/**
* Parses a string representation of the specified AggregationKind literal value.
* @param {string} value The value being parsed.
*/
private static parseAggregationKind;
/**
* A custom replacer function that is used as a replacer callback using JSON.stringify.
* @param {elements.Element | any} element The model element or nested object in which the key was
* found.
* @param {any} key The key being stringified.
* @param {any} value The value being stringified.
* @param {boolean} valueIsArray True if the value being stringified is an array.
*/
static toJSON(element: elements.Element | any, key: any, value: any, valueIsArray: boolean): any;
/**
* A custom mapper function that maps a JSON property value to a valid element value.
* @param {elements.Element | any} element The model element or nested object in which the key was
* found.
* @param {any} key The key being parsed.
* @param {any} value The value being parsed.
*/
fromJSON(element: elements.Element | any, key: any, value: any): any;
}