27 lines
425 B
TypeScript
27 lines
425 B
TypeScript
|
|
|
||
|
|
/**
|
||
|
|
*/
|
||
|
|
class type_output_json implements type_output<string>
|
||
|
|
{
|
||
|
|
public readonly kind : string = "json";
|
||
|
|
public readonly data : {};
|
||
|
|
public constructor(data : {}) {this.data = data;}
|
||
|
|
|
||
|
|
/**
|
||
|
|
*/
|
||
|
|
public render_element(
|
||
|
|
element : type_element
|
||
|
|
) : string
|
||
|
|
{
|
||
|
|
return lib_plankton.call.distinguish<string>(
|
||
|
|
element,
|
||
|
|
{
|
||
|
|
},
|
||
|
|
{
|
||
|
|
"fallback": (element) => JSON.stringify(element, undefined, "\t"),
|
||
|
|
}
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|