Last active
November 28, 2016 21:41
-
-
Save PyYoshi/457750f253acc1c3e511 to your computer and use it in GitHub Desktop.
flowtype interface for realm-js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare class RealmResults { | |
length:number; | |
filtered(query:string, arg:?any):RealmResults; | |
snapshot():RealmResults; | |
sorted(descriptor:any, reverse:?boolean):RealmResults; | |
} | |
declare class RealmList { | |
length:number; | |
filtered(query:string, arg:?any):RealmResults; | |
pop():Object|undefined; | |
push(...object:Object):number; | |
shift():Object|undefined; | |
snapshot():RealmResults; | |
sorted(descriptor:any, reverse:?boolean):RealmResults; | |
unshift(...object:Object):number; | |
} | |
declare type RealmObjectSchemaProperty = { | |
type:string; | |
objectType:?string; | |
default:?any; | |
optional:?boolean; | |
} | |
declare type RealmObjectSchema = { | |
name:string; | |
primaryKey:?string; | |
properties:any; | |
} | |
declare type RealmConfiguration = { | |
path:?string; | |
schema:?RealmObjectSchema; | |
schemaVersion:?number; | |
} | |
declare class Realm { | |
defaultPath:string; | |
constructor(config:?RealmConfiguration):void; | |
addListener(name:string, callback:()=>void); | |
create(type:string, properties:Object, update:?boolean):Object; | |
delete(object:Object|Array<Object>|RealmList|RealmResults):void; | |
deleteAll():void; | |
objects(type:string):RealmResults; | |
removeAllListeners(name:?string):void; | |
write(callback:()=>void); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment