diff --git a/www/resources/template/integration/typescript_description.html b/www/resources/template/integration/typescript_description.html new file mode 100644 index 0000000..83dcffa --- /dev/null +++ b/www/resources/template/integration/typescript_description.html @@ -0,0 +1,3 @@ +The TypeScript TypeSchema integration uses only interfaces to describe the JSON payload. +Note TypeScript is a special case since with TypeScript we only describe the JSON payload +we don`t actually parse the JSON payload and transform it into actual objects. diff --git a/www/resources/template/integration/typescript_dto.txt b/www/resources/template/integration/typescript_dto.txt new file mode 100644 index 0000000..b6c0325 --- /dev/null +++ b/www/resources/template/integration/typescript_dto.txt @@ -0,0 +1,8 @@ +/** + * A simple student struct + */ +export interface Student { + firstName?: string + lastName?: string + age?: number +} diff --git a/www/resources/template/integration/typescript_integration.txt b/www/resources/template/integration/typescript_integration.txt new file mode 100644 index 0000000..414c8bb --- /dev/null +++ b/www/resources/template/integration/typescript_integration.txt @@ -0,0 +1,5 @@ +const student: Student = JSON.parse('{...}'); + +const output = JSON.stringify(student); + +console.log(output);