Skip to content

Instantly share code, notes, and snippets.

@hrajchert
Created April 29, 2017 01:46
Show Gist options
  • Save hrajchert/311a7083675a16238fb982e894195d82 to your computer and use it in GitHub Desktop.
Save hrajchert/311a7083675a16238fb982e894195d82 to your computer and use it in GitHub Desktop.
// TypeScript
let usuario1;
usuario1.nombre = 'Jose';
usuario1.apellido = 'Perez'
ajax('http://mi-api.com/getUser')
.then(usuario => console.log(`nombre: ${usuario.nombres}`))
// Crear interfaz IWorkshop
let workshop;
workshop.nombre = 'Introduccion a TS';
workshop.profe = 'sherman3ero';
workshop.lugar = {
oficina: 'Mercado libre',
calle: 'Leandro N Alem',
altura: 518
}
workshop.fecha = new Date();
declare function ajax<T = any>(url: string): Promise<T>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment