|
@@ -1,56 +0,0 @@
|
|
|
-// To parse this data:
|
|
|
-//
|
|
|
-// import { Convert, Productos } from "./file";
|
|
|
-//
|
|
|
-// const productos = Convert.toProductos(json);
|
|
|
-//
|
|
|
-// These functions will throw an error if the JSON doesn't
|
|
|
-// match the expected interface, even if the JSON is valid.
|
|
|
-
|
|
|
-export class Productos {
|
|
|
- paginacion: Paginacion;
|
|
|
- resultado: Resultado[];
|
|
|
-
|
|
|
- constructor(json?: Partial<Productos>){
|
|
|
- this.paginacion = new Paginacion();
|
|
|
- this.resultado = [];
|
|
|
- if (json !== null) {
|
|
|
- Object.assign(this, json);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-export class Paginacion {
|
|
|
- total: number;
|
|
|
- pagina: number;
|
|
|
- limite: number;
|
|
|
-
|
|
|
- constructor(json?: Partial<Productos>){
|
|
|
- this.total = 0;
|
|
|
- this.pagina = 0;
|
|
|
- this.limite =0;
|
|
|
- if (json !== null) {
|
|
|
- Object.assign(this, json);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-export class Resultado {
|
|
|
- id: number;
|
|
|
- nombre: string;
|
|
|
- precio: string;
|
|
|
- existencia: number;
|
|
|
-
|
|
|
- constructor(json?: Partial<Productos>){
|
|
|
- this.id = 0;
|
|
|
- this.nombre = "";
|
|
|
- this.precio = "";
|
|
|
- this.existencia = 0;
|
|
|
- if (json !== null) {
|
|
|
- Object.assign(this, json);
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-// Converts JSON strings to/from your types
|
|
|
-// and asserts the results of JSON.parse at runtime
|