mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-13 07:45:10 +00:00
Typescript definition for ssl_verify_callback.
This commit is contained in:
parent
c1e198cbab
commit
508a547898
30
lib/index.d.ts
vendored
30
lib/index.d.ts
vendored
@ -265,25 +265,25 @@ declare namespace Realm.Sync {
|
|||||||
readonly server: string;
|
readonly server: string;
|
||||||
readonly token: string;
|
readonly token: string;
|
||||||
static adminUser(adminToken: string, server?: string): User;
|
static adminUser(adminToken: string, server?: string): User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated, to be removed in future versions
|
* @deprecated, to be removed in future versions
|
||||||
*/
|
*/
|
||||||
static login(server: string, username: string, password: string, callback: (error: any, user: User) => void): void;
|
static login(server: string, username: string, password: string, callback: (error: any, user: User) => void): void;
|
||||||
static login(server: string, username: string, password: string): Promise<Realm.Sync.User>;
|
static login(server: string, username: string, password: string): Promise<Realm.Sync.User>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated, to be removed in future versions
|
* @deprecated, to be removed in future versions
|
||||||
*/
|
*/
|
||||||
static register(server: string, username: string, password: string, callback: (error: any, user: User) => void): void;
|
static register(server: string, username: string, password: string, callback: (error: any, user: User) => void): void;
|
||||||
static register(server: string, username: string, password: string): Promise<Realm.Sync.User>;
|
static register(server: string, username: string, password: string): Promise<Realm.Sync.User>;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated, to be removed in versions
|
* @deprecated, to be removed in versions
|
||||||
*/
|
*/
|
||||||
static registerWithProvider(server: string, options: { provider: string, providerToken: string, userInfo: any }, callback: (error: Error | null, user: User | null) => void): void;
|
static registerWithProvider(server: string, options: { provider: string, providerToken: string, userInfo: any }, callback: (error: Error | null, user: User | null) => void): void;
|
||||||
static registerWithProvider(server: string, options: { provider: string, providerToken: string, userInfo: any }): Promise<Realm.Sync.User>;
|
static registerWithProvider(server: string, options: { provider: string, providerToken: string, userInfo: any }): Promise<Realm.Sync.User>;
|
||||||
|
|
||||||
logout(): void;
|
logout(): void;
|
||||||
openManagementRealm(): Realm;
|
openManagementRealm(): Realm;
|
||||||
retrieveAccount(provider: string, username: string): Promise<Account>;
|
retrieveAccount(provider: string, username: string): Promise<Account>;
|
||||||
@ -299,7 +299,7 @@ declare namespace Realm.Sync {
|
|||||||
userId: string |
|
userId: string |
|
||||||
{ metadataKey: string, metadataValue: string }
|
{ metadataKey: string, metadataValue: string }
|
||||||
};
|
};
|
||||||
|
|
||||||
type AccessLevel = 'none' | 'read' | 'write' | 'admin';
|
type AccessLevel = 'none' | 'read' | 'write' | 'admin';
|
||||||
|
|
||||||
class Permission {
|
class Permission {
|
||||||
@ -310,7 +310,7 @@ declare namespace Realm.Sync {
|
|||||||
readonly mayRead?: boolean;
|
readonly mayRead?: boolean;
|
||||||
readonly mayWrite?: boolean;
|
readonly mayWrite?: boolean;
|
||||||
readonly mayManage?: boolean;
|
readonly mayManage?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PermissionChange {
|
class PermissionChange {
|
||||||
id: string;
|
id: string;
|
||||||
@ -342,19 +342,21 @@ declare namespace Realm.Sync {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ErrorCallback = (message?: string, isFatal?: boolean, category?: string, code?: number) => void;
|
type ErrorCallback = (message?: string, isFatal?: boolean, category?: string, code?: number) => void;
|
||||||
|
type SSLVerifyCallback = (serverAddress: string, serverPort: number, pemCertificate: string, preverifyOk: number, depth: number) => boolean;
|
||||||
|
|
||||||
interface SyncConfiguration {
|
interface SyncConfiguration {
|
||||||
user: User;
|
user: User;
|
||||||
url: string;
|
url: string;
|
||||||
validate_ssl?: boolean;
|
validate_ssl?: boolean;
|
||||||
ssl_trust_certificate_path?: string;
|
ssl_trust_certificate_path?: string;
|
||||||
|
ssl_verify_callback?: SSLVerifyCallback;
|
||||||
error?: ErrorCallback;
|
error?: ErrorCallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProgressNotificationCallback = (transferred: number, transferable: number) => void;
|
type ProgressNotificationCallback = (transferred: number, transferable: number) => void;
|
||||||
type ProgressDirection = 'download' | 'upload';
|
type ProgressDirection = 'download' | 'upload';
|
||||||
type ProgressMode = 'reportIndefinitely' | 'forCurrentlyOutstandingWork';
|
type ProgressMode = 'reportIndefinitely' | 'forCurrentlyOutstandingWork';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Session
|
* Session
|
||||||
* @see { @link https://realm.io/docs/javascript/latest/api/Realm.Sync.Session.html }
|
* @see { @link https://realm.io/docs/javascript/latest/api/Realm.Sync.Session.html }
|
||||||
@ -394,7 +396,7 @@ declare namespace Realm.Sync {
|
|||||||
function removeListener(regex: string, name: string, changeCallback: (changeEvent: ChangeEvent) => void): void;
|
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 setLogLevel(logLevel: 'all' | 'trace' | 'debug' | 'detail' | 'info' | 'warn' | 'error' | 'fatal' | 'off'): void;
|
||||||
function setFeatureToken(token: string): void;
|
function setFeatureToken(token: string): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated, to be removed in 2.0
|
* @deprecated, to be removed in 2.0
|
||||||
*/
|
*/
|
||||||
@ -458,19 +460,19 @@ declare class Realm {
|
|||||||
*/
|
*/
|
||||||
static schemaVersion(path: string, encryptionKey?: ArrayBuffer | ArrayBufferView): number;
|
static schemaVersion(path: string, encryptionKey?: ArrayBuffer | ArrayBufferView): number;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open a realm asynchronously with a promise. If the realm is synced, it will be fully synchronized before it is available.
|
* Open a realm asynchronously with a promise. If the realm is synced, it will be fully synchronized before it is available.
|
||||||
* @param {Configuration} config
|
* @param {Configuration} config
|
||||||
*/
|
*/
|
||||||
static open(config: Realm.Configuration): ProgressPromise;
|
static open(config: Realm.Configuration): ProgressPromise;
|
||||||
/**
|
/**
|
||||||
* @deprecated in favor of `Realm.open`
|
* @deprecated in favor of `Realm.open`
|
||||||
* Open a realm asynchronously with a callback. If the realm is synced, it will be fully synchronized before it is available.
|
* Open a realm asynchronously with a callback. If the realm is synced, it will be fully synchronized before it is available.
|
||||||
* @param {Configuration} config
|
* @param {Configuration} config
|
||||||
* @param {Function} callback will be called when the realm is ready.
|
* @param {Function} callback will be called when the realm is ready.
|
||||||
* @param {ProgressNotificationCallback} progressCallback? a progress notification callback for 'download' direction and 'forCurrentlyOutstandingWork' mode
|
* @param {ProgressNotificationCallback} progressCallback? a progress notification callback for 'download' direction and 'forCurrentlyOutstandingWork' mode
|
||||||
*/
|
*/
|
||||||
static openAsync(config: Realm.Configuration, callback: (error: any, realm: Realm) => void, progressCallback?: Realm.Sync.ProgressNotificationCallback): void
|
static openAsync(config: Realm.Configuration, callback: (error: any, realm: Realm) => void, progressCallback?: Realm.Sync.ProgressNotificationCallback): void
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user