mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-10 14:25:58 +00:00
Adding documentation, TS definition and change log.
This commit is contained in:
parent
e669a221a1
commit
f94f351bfb
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,3 +1,15 @@
|
||||
x.x.x Release notes (yyyy-MM-dd)
|
||||
=============================================================
|
||||
### Breaking changes
|
||||
* `Realm.Sync.initialize()` must be called prior to any interaction with any Realm Object Server.
|
||||
|
||||
### Enhancements
|
||||
* None.
|
||||
|
||||
### Bug fixes
|
||||
* None.
|
||||
|
||||
|
||||
2.0.0 Release notes (2017-9-26)
|
||||
=============================================================
|
||||
### Breaking changes
|
||||
|
@ -20,6 +20,11 @@
|
||||
* @memberof Realm
|
||||
*/
|
||||
class Sync {
|
||||
/**
|
||||
* Initialize the interaction with Realm Object Server. It should only be called once.
|
||||
*/
|
||||
static initialize() {}
|
||||
|
||||
/**
|
||||
* Add a sync listener to listen to changes across multiple Realms
|
||||
* @param {string} server_url - the sync server to listen to
|
||||
|
5
lib/index.d.ts
vendored
5
lib/index.d.ts
vendored
@ -288,7 +288,7 @@ declare namespace Realm.Sync {
|
||||
openManagementRealm(): Realm;
|
||||
retrieveAccount(provider: string, username: string): Promise<Account>;
|
||||
|
||||
getGrantedPermissions(recipient: 'any' | 'currentUser' | 'otherUser'): Results<Permission>;
|
||||
getGrantedPermissions(recipient: 'any' | 'currentUser' | 'otherUser'): Results<Permission>;
|
||||
applyPermissions(condition: PermissionCondition, realmUrl: string, accessLevel: AccessLevel): Promise<PermissionChange>;
|
||||
offerPermissions(realmUrl: string, accessLevel: AccessLevel, expiresAt?: Date): Promise<string>;
|
||||
acceptPermissionOffer(token: string): Promise<string>
|
||||
@ -300,7 +300,7 @@ declare namespace Realm.Sync {
|
||||
{ metadataKey: string, metadataValue: string }
|
||||
};
|
||||
|
||||
type AccessLevel = 'none' | 'read' | 'write' | 'admin';
|
||||
type AccessLevel = 'none' | 'read' | 'write' | 'admin';
|
||||
|
||||
class Permission {
|
||||
readonly id: string;
|
||||
@ -396,6 +396,7 @@ declare namespace Realm.Sync {
|
||||
function removeListener(regex: string, name: string, changeCallback: (changeEvent: ChangeEvent) => void): void;
|
||||
function setLogLevel(logLevel: 'all' | 'trace' | 'debug' | 'detail' | 'info' | 'warn' | 'error' | 'fatal' | 'off'): void;
|
||||
function setFeatureToken(token: string): void;
|
||||
function initialize(): void;
|
||||
|
||||
/**
|
||||
* @deprecated, to be removed in 2.0
|
||||
|
@ -651,7 +651,7 @@ void SyncClass<T>::initialize(ContextType ctx, FunctionType, ObjectType this_obj
|
||||
// setup synced realmFile paths
|
||||
ensure_directory_exists_for_file(default_realm_file_directory());
|
||||
SyncManager::shared().configure_file_system(default_realm_file_directory(), SyncManager::MetadataMode::NoEncryption);
|
||||
return_value.set(Nan::Undefined());
|
||||
return_value.set_undefined();
|
||||
}
|
||||
} // js
|
||||
} // realm
|
||||
|
Loading…
x
Reference in New Issue
Block a user