diff --git a/stamplay-js-sdk/stamplay-js-sdk-tests.ts b/stamplay-js-sdk/stamplay-js-sdk-tests.ts index f17da5c13..644d2c5b9 100644 --- a/stamplay-js-sdk/stamplay-js-sdk-tests.ts +++ b/stamplay-js-sdk/stamplay-js-sdk-tests.ts @@ -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 } ) diff --git a/stamplay-js-sdk/stamplay-js-sdk.d.ts b/stamplay-js-sdk/stamplay-js-sdk.d.ts index 50817ee2d..3cd9f3843 100644 --- a/stamplay-js-sdk/stamplay-js-sdk.d.ts +++ b/stamplay-js-sdk/stamplay-js-sdk.d.ts @@ -10,10 +10,10 @@ declare module Stamplay { export interface IStamplayModel { signup({}) : PromisesAPlus.Thenable 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 destroy() : PromisesAPlus.Thenable save({}?) : PromisesAPlus.Thenable } diff --git a/stamplay-js-sdk/tsconfig.json b/stamplay-js-sdk/tsconfig.json new file mode 100644 index 000000000..8d5b43ce4 --- /dev/null +++ b/stamplay-js-sdk/tsconfig.json @@ -0,0 +1,6 @@ +{ + "compilerOptions": { + "target": "ES5", + "module": "amd" + } +}