nope/test/testDecorators.ts
2020-08-21 16:49:48 +02:00

28 lines
427 B
TypeScript

import { eportApi, exportMethod, exportProperty } from "../lib/decorators";
@eportApi({
url: 'icemaker'
})
export class Icemaker {
toppings = [];
sugar = 0;
@exportMethod()
addTopping(topping) {
this.toppings.push(topping);
}
@exportMethod()
addSugar() {
this.sugar++;
}
@exportProperty()
name: string;
}
const instance = new Icemaker();
instance.addTopping('caramel')
console.log(instance)