52 lines
648 B
TypeScript
52 lines
648 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_object(
|
|
object : type_object
|
|
) : string
|
|
{
|
|
return lib_plankton.call.distinguish<string>(
|
|
object,
|
|
{
|
|
},
|
|
{
|
|
"fallback": (object) => JSON.stringify(object, undefined, "\t"),
|
|
}
|
|
);
|
|
}
|
|
|
|
|
|
/**
|
|
* @todo
|
|
* @implementation
|
|
*/
|
|
public render_document(
|
|
document : type_document
|
|
) : string
|
|
{
|
|
return ""
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/**
|
|
*/
|
|
output_kind_register(
|
|
"json",
|
|
(data, sub) => (
|
|
new type_output_json(
|
|
{
|
|
}
|
|
)
|
|
)
|
|
);
|