28 lines
427 B
TypeScript
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) |