Fix TS errors for stamplay-js-sdk

This commit is contained in:
ridermansb
2015-09-23 07:44:16 -03:00
parent 6fde16275a
commit bd7be4ea62
3 changed files with 15 additions and 8 deletions
+5 -4
View File
@@ -2,8 +2,8 @@
var userFn = Stamplay.User();
var user = new userFn.Model;
var tags = new Stamplay.Cobject('tag').Collection;
var colTags = new Stamplay.Cobject('tag');
var tags = colTags.Collection;
// Signing up
var registrationData = {
@@ -21,7 +21,8 @@ user.signup(registrationData).then(function(){
// Action
var fooMod = new Stamplay.Cobject('foo').Model;
var colFoo = new Stamplay.Cobject('foo');
var fooMod = colFoo.Model;
fooMod.fetch(5).then(
function(){
return fooMod.upVote()
@@ -29,7 +30,7 @@ fooMod.fetch(5).then(
).then(
function(){
//success callback
}, function( err ){
}, function( err : any ){
//error callback
}
)
+4 -4
View File
@@ -10,10 +10,10 @@ declare module Stamplay {
export interface IStamplayModel {
signup({}) : PromisesAPlus.Thenable<any>
new() : IStamplayModel
get(property : string)
set(property : string, value: any)
unset(property : string)
fetch(id : any)
get(property : string) : any
set(property : string, value: any) : void
unset(property : string) : void
fetch(id : any) : PromisesAPlus.Thenable<any>
destroy() : PromisesAPlus.Thenable<any>
save({}?) : PromisesAPlus.Thenable<any>
}
+6
View File
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"target": "ES5",
"module": "amd"
}
}