added flow support for Transaction.js

This commit is contained in:
Kevin Jahns
2015-11-30 14:26:22 +01:00
parent e9c40f9a83
commit 0ebfae6997
2 changed files with 61 additions and 30 deletions

View File

@@ -4,7 +4,8 @@ type YGlobal = {
utils: Object,
Struct: any,
AbstractDatabase: any,
AbstractConnector: any
AbstractConnector: any,
Transaction: any
}
type YConfig = {
@@ -17,4 +18,15 @@ declare var YConcurrency_TestingMode : boolean
type Transaction<A> = Generator<any, A, any>
type SyncRole = 'master' | 'slave'
type SyncRole = 'master' | 'slave'
declare class Store {
find: (id:Id) => Transaction<any>;
put: (n:any) => Transaction<void>;
delete: (id:Id) => Transaction<void>;
findWithLowerBound: (start:Id) => Transaction<any>;
findWithUpperBound: (end:Id) => Transaction<any>;
findNext: (id:Id) => Transaction<any>;
findPrev: (id:Id) => Transaction<any>;
iterate: (t:any,start:?Id,end:?Id,gen:any) => Transaction<any>;
}