2020-11-09 06:42:24 +00:00
|
|
|
import { IJsonSchema } from '../../../../lib/types/IJSONSchema';
|
2020-10-29 18:20:42 +00:00
|
|
|
|
|
|
|
export interface IComplexTemplate<D> {
|
|
|
|
type: 'complex'
|
|
|
|
/** The Mustache Template */
|
|
|
|
mustache: string;
|
|
|
|
/** The Schema for the Query */
|
|
|
|
schema: IJsonSchema;
|
|
|
|
/** Sample Data => Required for Rendering */
|
|
|
|
example: {
|
|
|
|
[index: string]: any
|
|
|
|
}
|
|
|
|
// Function to Adapt the Template.
|
|
|
|
adaptSchema? (template: IComplexTemplate<D>, data: D): IComplexTemplate<D>,
|
|
|
|
adaptData? (data: D, genObject: {[index: string] : any}): {[index: string] : any}
|
|
|
|
}
|