From 7bf7633ddaa04faec71f02992422553bc49b14a0 Mon Sep 17 00:00:00 2001
From: Diamond Lewis
Date: Wed, 19 Feb 2025 08:17:59 -0600
Subject: [PATCH 1/2] refactor: Autogenerate TS types with husky
---
package.json | 4 +-
types/Analytics.d.ts | 7 +-
types/AnonymousUtils.d.ts | 100 +-
types/CoreManager.d.ts | 555 ++---
types/CryptoController.d.ts | 4 +-
types/EventuallyQueue.d.ts | 328 ++-
types/FacebookUtils.d.ts | 190 +-
types/InstallationController.d.ts | 12 +-
types/LiveQueryClient.d.ts | 167 +-
types/LiveQuerySubscription.d.ts | 32 +-
types/LocalDatastore.d.ts | 64 +-
types/LocalDatastoreController.default.d.ts | 12 +-
...LocalDatastoreController.react-native.d.ts | 12 +-
types/LocalDatastoreUtils.d.ts | 6 +-
types/ObjectStateMutations.d.ts | 35 +-
types/OfflineQuery.d.ts | 4 +-
types/Parse.d.ts | 1492 +++++-------
types/ParseACL.d.ts | 236 +-
types/ParseCLP.d.ts | 380 +--
types/ParseConfig.d.ts | 137 +-
types/ParseError.d.ts | 930 ++++----
types/ParseFile.d.ts | 353 ++-
types/ParseGeoPoint.d.ts | 162 +-
types/ParseHooks.d.ts | 44 +-
types/ParseInstallation.d.ts | 324 +--
types/ParseLiveQuery.d.ts | 34 +-
types/ParseObject.d.ts | 2068 ++++++++---------
types/ParseOp.d.ts | 118 +-
types/ParsePolygon.d.ts | 88 +-
types/ParseQuery.d.ts | 1833 +++++++--------
types/ParseRelation.d.ts | 76 +-
types/ParseRole.d.ts | 114 +-
types/ParseSchema.d.ts | 428 ++--
types/ParseSession.d.ts | 64 +-
types/ParseUser.d.ts | 1034 ++++-----
types/Push.d.ts | 13 +-
types/RESTController.d.ts | 56 +-
types/SingleInstanceStateController.d.ts | 9 +-
types/Socket.weapp.d.ts | 14 +-
types/Storage.d.ts | 22 +-
types/StorageController.browser.d.ts | 12 +-
types/StorageController.default.d.ts | 12 +-
types/StorageController.react-native.d.ts | 16 +-
types/StorageController.weapp.d.ts | 12 +-
types/TaskQueue.d.ts | 12 +-
types/Xhr.weapp.d.ts | 52 +-
types/encode.d.ts | 8 +-
types/promiseUtils.d.ts | 14 +-
types/unsavedChildren.d.ts | 5 +-
49 files changed, 5567 insertions(+), 6137 deletions(-)
diff --git a/package.json b/package.json
index 2acbc5a43..90ec2b8ca 100644
--- a/package.json
+++ b/package.json
@@ -97,7 +97,7 @@
},
"scripts": {
"build": "node build_releases.js",
- "build:types": "tsc && prettier --write 'types/{**/*,*}.ts' && npm run lint:fix",
+ "build:types": "tsc",
"release": "node build_releases.js && npm publish",
"test": "cross-env PARSE_BUILD=node jest",
"test:mongodb": "npm run test:mongodb:runnerstart && npm run integration",
@@ -114,7 +114,7 @@
"docs": "jsdoc -c ./jsdoc-conf.json ./src",
"madge:circular": "madge ./src --extensions js,ts --circular",
"prepare": "husky && npm run build",
- "pre-commit": "lint-staged",
+ "pre-commit": "lint-staged && npm run build:types",
"release_docs": "./release_docs.sh",
"gulp": "gulp",
"prettier": "prettier --write '{src,integration,types}/{**/*,*}.{js,ts}' && npm run lint:fix",
diff --git a/types/Analytics.d.ts b/types/Analytics.d.ts
index ae2ff3ac9..498c9c912 100644
--- a/types/Analytics.d.ts
+++ b/types/Analytics.d.ts
@@ -37,9 +37,6 @@
* @returns {Promise} A promise that is resolved when the round-trip
* to the server completes.
*/
-export declare function track(
- name: string,
- dimensions: {
+export declare function track(name: string, dimensions: {
[key: string]: string;
- }
-): Promise;
+}): Promise;
diff --git a/types/AnonymousUtils.d.ts b/types/AnonymousUtils.d.ts
index d7517bf94..aedb277d4 100644
--- a/types/AnonymousUtils.d.ts
+++ b/types/AnonymousUtils.d.ts
@@ -29,56 +29,56 @@ import type { RequestOptions } from './RESTController';
* @static
*/
declare const AnonymousUtils: {
- /**
- * Gets whether the user has their account linked to anonymous user.
- *
- * @function isLinked
- * @name Parse.AnonymousUtils.isLinked
- * @param {Parse.User} user User to check for.
- * The user must be logged in on this device.
- * @returns {boolean} true
if the user has their account
- * linked to an anonymous user.
- * @static
- */
- isLinked(user: ParseUser): boolean;
- /**
- * Logs in a user Anonymously.
- *
- * @function logIn
- * @name Parse.AnonymousUtils.logIn
- * @param {object} options MasterKey / SessionToken.
- * @returns {Promise} Logged in user
- * @static
- */
- logIn(options?: RequestOptions): Promise;
- /**
- * Links Anonymous User to an existing PFUser.
- *
- * @function link
- * @name Parse.AnonymousUtils.link
- * @param {Parse.User} user User to link. This must be the current user.
- * @param {object} options MasterKey / SessionToken.
- * @returns {Promise} Linked with User
- * @static
- */
- link(user: ParseUser, options?: RequestOptions): Promise;
- /**
- * Returns true if Authentication Provider has been registered for use.
- *
- * @function isRegistered
- * @name Parse.AnonymousUtils.isRegistered
- * @returns {boolean}
- * @static
- */
- isRegistered(): boolean;
- _getAuthProvider(): {
- restoreAuthentication(): boolean;
- getAuthType(): string;
- getAuthData(): {
- authData: {
- id: string;
- };
+ /**
+ * Gets whether the user has their account linked to anonymous user.
+ *
+ * @function isLinked
+ * @name Parse.AnonymousUtils.isLinked
+ * @param {Parse.User} user User to check for.
+ * The user must be logged in on this device.
+ * @returns {boolean} true
if the user has their account
+ * linked to an anonymous user.
+ * @static
+ */
+ isLinked(user: ParseUser): boolean;
+ /**
+ * Logs in a user Anonymously.
+ *
+ * @function logIn
+ * @name Parse.AnonymousUtils.logIn
+ * @param {object} options MasterKey / SessionToken.
+ * @returns {Promise} Logged in user
+ * @static
+ */
+ logIn(options?: RequestOptions): Promise;
+ /**
+ * Links Anonymous User to an existing PFUser.
+ *
+ * @function link
+ * @name Parse.AnonymousUtils.link
+ * @param {Parse.User} user User to link. This must be the current user.
+ * @param {object} options MasterKey / SessionToken.
+ * @returns {Promise} Linked with User
+ * @static
+ */
+ link(user: ParseUser, options?: RequestOptions): Promise;
+ /**
+ * Returns true if Authentication Provider has been registered for use.
+ *
+ * @function isRegistered
+ * @name Parse.AnonymousUtils.isRegistered
+ * @returns {boolean}
+ * @static
+ */
+ isRegistered(): boolean;
+ _getAuthProvider(): {
+ restoreAuthentication(): boolean;
+ getAuthType(): string;
+ getAuthData(): {
+ authData: {
+ id: string;
+ };
+ };
};
- };
};
export default AnonymousUtils;
diff --git a/types/CoreManager.d.ts b/types/CoreManager.d.ts
index f7aeefda3..d2bbd484f 100644
--- a/types/CoreManager.d.ts
+++ b/types/CoreManager.d.ts
@@ -16,364 +16,283 @@ import type LiveQueryClient from './LiveQueryClient';
import type ParseSchema from './ParseSchema';
import type ParseInstallation from './ParseInstallation';
type AnalyticsController = {
- track: (
- name: string,
- dimensions: {
- [key: string]: string;
- }
- ) => Promise;
+ track: (name: string, dimensions: {
+ [key: string]: string;
+ }) => Promise;
};
type CloudController = {
- run: (name: string, data: any, options: RequestOptions) => Promise;
- getJobsData: (options: RequestOptions) => Promise;
- /** Returns promise which resolves with JobStatusId of the job */
- startJob: (name: string, data: any, options: RequestOptions) => Promise;
+ run: (name: string, data: any, options: RequestOptions) => Promise;
+ getJobsData: (options: RequestOptions) => Promise;
+ /** Returns promise which resolves with JobStatusId of the job */
+ startJob: (name: string, data: any, options: RequestOptions) => Promise;
};
type ConfigController = {
- current: () => Promise | ParseConfig;
- get: (opts?: RequestOptions) => Promise;
- save: (
- attrs: {
- [key: string]: any;
- },
- masterKeyOnlyFlags?: {
- [key: string]: any;
- }
- ) => Promise;
+ current: () => Promise | ParseConfig;
+ get: (opts?: RequestOptions) => Promise;
+ save: (attrs: {
+ [key: string]: any;
+ }, masterKeyOnlyFlags?: {
+ [key: string]: any;
+ }) => Promise;
};
type CryptoController = {
- encrypt: (obj: any, secretKey: string) => string;
- decrypt: (encryptedText: string, secretKey: any) => string;
+ encrypt: (obj: any, secretKey: string) => string;
+ decrypt: (encryptedText: string, secretKey: any) => string;
};
type FileController = {
- saveFile: (name: string, source: FileSource, options?: FullOptions) => Promise;
- saveBase64: (
- name: string,
- source: FileSource,
- options?: FileSaveOptions
- ) => Promise<{
- name: string;
- url: string;
- }>;
- download: (
- uri: string,
- options?: any
- ) => Promise<{
- base64?: string;
- contentType?: string;
- }>;
- deleteFile: (
- name: string,
- options?: {
- useMasterKey?: boolean;
- }
- ) => Promise;
+ saveFile: (name: string, source: FileSource, options?: FullOptions) => Promise;
+ saveBase64: (name: string, source: FileSource, options?: FileSaveOptions) => Promise<{
+ name: string;
+ url: string;
+ }>;
+ download: (uri: string, options?: any) => Promise<{
+ base64?: string;
+ contentType?: string;
+ }>;
+ deleteFile: (name: string, options?: {
+ useMasterKey?: boolean;
+ }) => Promise;
};
type InstallationController = {
- currentInstallationId: () => Promise;
- currentInstallation: () => Promise;
- updateInstallationOnDisk: (installation: ParseInstallation) => Promise;
+ currentInstallationId: () => Promise;
+ currentInstallation: () => Promise;
+ updateInstallationOnDisk: (installation: ParseInstallation) => Promise;
};
type ObjectController = {
- fetch: (
- object: ParseObject | Array,
- forceFetch: boolean,
- options: RequestOptions
- ) => Promise | ParseObject | undefined>;
- save: (
- object: ParseObject | Array | null,
- options: RequestOptions
- ) => Promise | ParseFile | undefined>;
- destroy: (
- object: ParseObject | Array,
- options: RequestOptions
- ) => Promise>;
+ fetch: (object: ParseObject | Array, forceFetch: boolean, options: RequestOptions) => Promise | ParseObject | undefined>;
+ save: (object: ParseObject | Array | null, options: RequestOptions) => Promise | ParseFile | undefined>;
+ destroy: (object: ParseObject | Array, options: RequestOptions) => Promise>;
};
type ObjectStateController = {
- getState: (obj: any) => State | null;
- initializeState: (obj: any, initial?: State) => State;
- removeState: (obj: any) => State | null;
- getServerData: (obj: any) => AttributeMap;
- setServerData: (obj: any, attributes: AttributeMap) => void;
- getPendingOps: (obj: any) => Array;
- setPendingOp: (obj: any, attr: string, op?: Op) => void;
- pushPendingState: (obj: any) => void;
- popPendingState: (obj: any) => OpsMap | undefined;
- mergeFirstPendingState: (obj: any) => void;
- getObjectCache: (obj: any) => ObjectCache;
- estimateAttribute: (obj: any, attr: string) => any;
- estimateAttributes: (obj: any) => AttributeMap;
- commitServerChanges: (obj: any, changes: AttributeMap) => void;
- enqueueTask: (obj: any, task: () => Promise) => Promise;
- clearAllState: () => void;
- duplicateState: (source: any, dest: any) => void;
+ getState: (obj: any) => State | null;
+ initializeState: (obj: any, initial?: State) => State;
+ removeState: (obj: any) => State | null;
+ getServerData: (obj: any) => AttributeMap;
+ setServerData: (obj: any, attributes: AttributeMap) => void;
+ getPendingOps: (obj: any) => Array;
+ setPendingOp: (obj: any, attr: string, op?: Op) => void;
+ pushPendingState: (obj: any) => void;
+ popPendingState: (obj: any) => OpsMap | undefined;
+ mergeFirstPendingState: (obj: any) => void;
+ getObjectCache: (obj: any) => ObjectCache;
+ estimateAttribute: (obj: any, attr: string) => any;
+ estimateAttributes: (obj: any) => AttributeMap;
+ commitServerChanges: (obj: any, changes: AttributeMap) => void;
+ enqueueTask: (obj: any, task: () => Promise) => Promise;
+ clearAllState: () => void;
+ duplicateState: (source: any, dest: any) => void;
};
type PushController = {
- send: (data: PushData, options?: FullOptions) => Promise;
+ send: (data: PushData, options?: FullOptions) => Promise;
};
type QueryController = {
- find(
- className: string,
- params: QueryJSON,
- options: RequestOptions
- ): Promise<{
- results?: Array;
- className?: string;
- count?: number;
- }>;
- aggregate(
- className: string,
- params: any,
- options: RequestOptions
- ): Promise<{
- results?: Array;
- }>;
+ find(className: string, params: QueryJSON, options: RequestOptions): Promise<{
+ results?: Array;
+ className?: string;
+ count?: number;
+ }>;
+ aggregate(className: string, params: any, options: RequestOptions): Promise<{
+ results?: Array;
+ }>;
};
type EventuallyQueue = {
- save: (object: ParseObject, serverOptions: SaveOptions) => Promise;
- destroy: (object: ParseObject, serverOptions: RequestOptions) => Promise;
- poll: (ms?: number) => void;
+ save: (object: ParseObject, serverOptions: SaveOptions) => Promise;
+ destroy: (object: ParseObject, serverOptions: RequestOptions) => Promise;
+ poll: (ms?: number) => void;
};
type RESTController = {
- request: (method: string, path: string, data?: any, options?: RequestOptions) => Promise;
- ajax: (
- method: string,
- url: string,
- data: any,
- headers?: any,
- options?: FullOptions
- ) => Promise;
- handleError: (err?: any) => void;
+ request: (method: string, path: string, data?: any, options?: RequestOptions) => Promise;
+ ajax: (method: string, url: string, data: any, headers?: any, options?: FullOptions) => Promise;
+ handleError: (err?: any) => void;
};
type SchemaController = {
- purge: (className: string) => Promise;
- get: (
- className: string,
- options?: RequestOptions
- ) => Promise<{
- results: ParseSchema[];
- }>;
- delete: (className: string, options?: RequestOptions) => Promise;
- create: (className: string, params: any, options?: RequestOptions) => Promise;
- update: (className: string, params: any, options?: RequestOptions) => Promise;
- send(className: string, method: string, params: any, options: RequestOptions): Promise;
+ purge: (className: string) => Promise;
+ get: (className: string, options?: RequestOptions) => Promise<{
+ results: ParseSchema[];
+ }>;
+ delete: (className: string, options?: RequestOptions) => Promise;
+ create: (className: string, params: any, options?: RequestOptions) => Promise;
+ update: (className: string, params: any, options?: RequestOptions) => Promise;
+ send(className: string, method: string, params: any, options: RequestOptions): Promise;
};
type SessionController = {
- getSession: (token: RequestOptions) => Promise;
+ getSession: (token: RequestOptions) => Promise;
+};
+type StorageController = {
+ async: 0;
+ getItem: (path: string) => string | null;
+ setItem: (path: string, value: string) => void;
+ removeItem: (path: string) => void;
+ getItemAsync?: (path: string) => Promise;
+ setItemAsync?: (path: string, value: string) => Promise;
+ removeItemAsync?: (path: string) => Promise;
+ clear: () => void;
+ getAllKeys?: () => Array;
+ getAllKeysAsync?: () => Promise>;
+} | {
+ async: 1;
+ getItem?: (path: string) => string | null;
+ setItem?: (path: string, value: string) => void;
+ removeItem?: (path: string) => void;
+ getItemAsync: (path: string) => Promise;
+ setItemAsync: (path: string, value: string) => Promise;
+ removeItemAsync: (path: string) => Promise;
+ clear: () => void;
+ getAllKeys?: () => Array;
+ getAllKeysAsync?: () => Promise>;
};
-type StorageController =
- | {
- async: 0;
- getItem: (path: string) => string | null;
- setItem: (path: string, value: string) => void;
- removeItem: (path: string) => void;
- getItemAsync?: (path: string) => Promise;
- setItemAsync?: (path: string, value: string) => Promise;
- removeItemAsync?: (path: string) => Promise;
- clear: () => void;
- getAllKeys?: () => Array;
- getAllKeysAsync?: () => Promise>;
- }
- | {
- async: 1;
- getItem?: (path: string) => string | null;
- setItem?: (path: string, value: string) => void;
- removeItem?: (path: string) => void;
- getItemAsync: (path: string) => Promise;
- setItemAsync: (path: string, value: string) => Promise;
- removeItemAsync: (path: string) => Promise;
- clear: () => void;
- getAllKeys?: () => Array;
- getAllKeysAsync?: () => Promise>;
- };
type LocalDatastoreController = {
- fromPinWithName: (name: string) => any | undefined;
- pinWithName: (name: string, objects: any) => void;
- unPinWithName: (name: string) => void;
- getAllContents: () => any | undefined;
- clear: () => void;
+ fromPinWithName: (name: string) => any | undefined;
+ pinWithName: (name: string, objects: any) => void;
+ unPinWithName: (name: string) => void;
+ getAllContents: () => any | undefined;
+ clear: () => void;
};
type UserController = {
- setCurrentUser: (user: ParseUser) => Promise;
- currentUser: () => ParseUser | null;
- currentUserAsync: () => Promise;
- signUp: (user: ParseUser, attrs: AttributeMap, options: RequestOptions) => Promise;
- logIn: (user: ParseUser, options: RequestOptions) => Promise;
- loginAs: (user: ParseUser, userId: string) => Promise;
- become: (user: ParseUser, options: RequestOptions) => Promise;
- hydrate: (user: ParseUser, userJSON: AttributeMap) => Promise;
- logOut: (options: RequestOptions) => Promise;
- me: (user: ParseUser, options: RequestOptions) => Promise;
- requestPasswordReset: (email: string, options: RequestOptions) => Promise;
- updateUserOnDisk: (user: ParseUser) => Promise;
- upgradeToRevocableSession: (user: ParseUser, options: RequestOptions) => Promise;
- linkWith: (user: ParseUser, authData: AuthData, options?: FullOptions) => Promise;
- removeUserFromDisk: () => Promise;
- verifyPassword: (
- username: string,
- password: string,
- options: RequestOptions
- ) => Promise;
- requestEmailVerification: (email: string, options: RequestOptions) => Promise;
+ setCurrentUser: (user: ParseUser) => Promise;
+ currentUser: () => ParseUser | null;
+ currentUserAsync: () => Promise;
+ signUp: (user: ParseUser, attrs: AttributeMap, options: RequestOptions) => Promise;
+ logIn: (user: ParseUser, options: RequestOptions) => Promise;
+ loginAs: (user: ParseUser, userId: string) => Promise;
+ become: (user: ParseUser, options: RequestOptions) => Promise;
+ hydrate: (user: ParseUser, userJSON: AttributeMap) => Promise;
+ logOut: (options: RequestOptions) => Promise;
+ me: (user: ParseUser, options: RequestOptions) => Promise;
+ requestPasswordReset: (email: string, options: RequestOptions) => Promise;
+ updateUserOnDisk: (user: ParseUser) => Promise;
+ upgradeToRevocableSession: (user: ParseUser, options: RequestOptions) => Promise;
+ linkWith: (user: ParseUser, authData: AuthData, options?: FullOptions) => Promise;
+ removeUserFromDisk: () => Promise;
+ verifyPassword: (username: string, password: string, options: RequestOptions) => Promise;
+ requestEmailVerification: (email: string, options: RequestOptions) => Promise;
};
type HooksController = {
- get: (type: string, functionName?: string, triggerName?: string) => Promise;
- create: (hook: HookDeclaration) => Promise;
- remove: (hook: HookDeleteArg) => Promise;
- update: (hook: HookDeclaration) => Promise;
- sendRequest?: (method: string, path: string, body?: any) => Promise;
+ get: (type: string, functionName?: string, triggerName?: string) => Promise;
+ create: (hook: HookDeclaration) => Promise;
+ remove: (hook: HookDeleteArg) => Promise;
+ update: (hook: HookDeclaration) => Promise;
+ sendRequest?: (method: string, path: string, body?: any) => Promise;
};
type LiveQueryControllerType = {
- setDefaultLiveQueryClient(liveQueryClient: LiveQueryClient): void;
- getDefaultLiveQueryClient(): Promise;
- _clearCachedDefaultClient(): void;
+ setDefaultLiveQueryClient(liveQueryClient: LiveQueryClient): void;
+ getDefaultLiveQueryClient(): Promise;
+ _clearCachedDefaultClient(): void;
};
/** Based on https://github.com/react-native-async-storage/async-storage/blob/main/packages/default-storage-backend/src/types.ts */
type AsyncStorageType = {
- /** Fetches an item for a `key` and invokes a callback upon completion. */
- getItem: (
- key: string,
- callback?: (error?: Error | null, result?: string | null) => void
- ) => Promise;
- /** Sets the value for a `key` and invokes a callback upon completion. */
- setItem: (key: string, value: string, callback?: (error?: Error | null) => void) => Promise;
- /** Removes an item for a `key` and invokes a callback upon completion. */
- removeItem: (key: string, callback?: (error?: Error | null) => void) => Promise;
- /** Merges an existing `key` value with an input value, assuming both values are stringified JSON. */
- mergeItem: (
- key: string,
- value: string,
- callback?: (error?: Error | null) => void
- ) => Promise;
- /**
- * Erases *all* `AsyncStorage` for all clients, libraries, etc. You probably
- * don't want to call this; use `removeItem` or `multiRemove` to clear only
- * your app's keys.
- */
- clear: (callback?: (error?: Error | null) => void) => Promise;
- /** Gets *all* keys known to your app; for all callers, libraries, etc. */
- getAllKeys: (
- callback?: (error?: Error | null, result?: readonly string[] | null) => void
- ) => Promise;
- /**
- * This allows you to batch the fetching of items given an array of `key`
- * inputs. Your callback will be invoked with an array of corresponding
- * key-value pairs found.
- */
- multiGet: (
- keys: readonly string[],
- callback?: (
- errors?: readonly (Error | null)[] | null,
- result?: readonly [string, string][]
- ) => void
- ) => Promise;
- /**
- * Use this as a batch operation for storing multiple key-value pairs. When
- * the operation completes you'll get a single callback with any errors.
- *
- * See https://react-native-async-storage.github.io/async-storage/docs/api#multiset
- */
- multiSet: (
- keyValuePairs: [string, string][],
- callback?: (errors?: readonly (Error | null)[] | null) => void
- ) => Promise;
- /**
- * Call this to batch the deletion of all keys in the `keys` array.
- *
- * See https://react-native-async-storage.github.io/async-storage/docs/api#multiremove
- */
- multiRemove: (
- keys: readonly string[],
- callback?: (errors?: readonly (Error | null)[] | null) => void
- ) => Promise;
- /**
- * Batch operation to merge in existing and new values for a given set of
- * keys. This assumes that the values are stringified JSON.
- *
- * See https://react-native-async-storage.github.io/async-storage/docs/api#multimerge
- */
- multiMerge: (
- keyValuePairs: [string, string][],
- callback?: (errors?: readonly (Error | null)[] | null) => void
- ) => Promise;
+ /** Fetches an item for a `key` and invokes a callback upon completion. */
+ getItem: (key: string, callback?: (error?: Error | null, result?: string | null) => void) => Promise;
+ /** Sets the value for a `key` and invokes a callback upon completion. */
+ setItem: (key: string, value: string, callback?: (error?: Error | null) => void) => Promise;
+ /** Removes an item for a `key` and invokes a callback upon completion. */
+ removeItem: (key: string, callback?: (error?: Error | null) => void) => Promise;
+ /** Merges an existing `key` value with an input value, assuming both values are stringified JSON. */
+ mergeItem: (key: string, value: string, callback?: (error?: Error | null) => void) => Promise;
+ /**
+ * Erases *all* `AsyncStorage` for all clients, libraries, etc. You probably
+ * don't want to call this; use `removeItem` or `multiRemove` to clear only
+ * your app's keys.
+ */
+ clear: (callback?: (error?: Error | null) => void) => Promise;
+ /** Gets *all* keys known to your app; for all callers, libraries, etc. */
+ getAllKeys: (callback?: (error?: Error | null, result?: readonly string[] | null) => void) => Promise;
+ /**
+ * This allows you to batch the fetching of items given an array of `key`
+ * inputs. Your callback will be invoked with an array of corresponding
+ * key-value pairs found.
+ */
+ multiGet: (keys: readonly string[], callback?: (errors?: readonly (Error | null)[] | null, result?: readonly [string, string][]) => void) => Promise;
+ /**
+ * Use this as a batch operation for storing multiple key-value pairs. When
+ * the operation completes you'll get a single callback with any errors.
+ *
+ * See https://react-native-async-storage.github.io/async-storage/docs/api#multiset
+ */
+ multiSet: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise;
+ /**
+ * Call this to batch the deletion of all keys in the `keys` array.
+ *
+ * See https://react-native-async-storage.github.io/async-storage/docs/api#multiremove
+ */
+ multiRemove: (keys: readonly string[], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise;
+ /**
+ * Batch operation to merge in existing and new values for a given set of
+ * keys. This assumes that the values are stringified JSON.
+ *
+ * See https://react-native-async-storage.github.io/async-storage/docs/api#multimerge
+ */
+ multiMerge: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise;
};
export type WebSocketController = {
- onopen: () => void;
- onmessage: (message: any) => void;
- onclose: (arg?: any) => void;
- onerror: (error: any) => void;
- send: (data: any) => void;
- close: () => void;
+ onopen: () => void;
+ onmessage: (message: any) => void;
+ onclose: (arg?: any) => void;
+ onerror: (error: any) => void;
+ send: (data: any) => void;
+ close: () => void;
};
declare const CoreManager: {
- get: (key: string) => any;
- set: (key: string, value: any) => void;
- setIfNeeded: (key: string, value: any) => any;
- setAnalyticsController(controller: AnalyticsController): void;
- getAnalyticsController(): AnalyticsController;
- setCloudController(controller: CloudController): void;
- getCloudController(): CloudController;
- setConfigController(controller: ConfigController): void;
- getConfigController(): ConfigController;
- setCryptoController(controller: CryptoController): void;
- getCryptoController(): CryptoController;
- setEventEmitter(eventEmitter: any): void;
- getEventEmitter(): any;
- setFileController(controller: FileController): void;
- setEventuallyQueue(controller: EventuallyQueue): void;
- getEventuallyQueue(): EventuallyQueue;
- getFileController(): FileController;
- setInstallationController(controller: InstallationController): void;
- getInstallationController(): InstallationController;
- setLiveQuery(liveQuery: any): void;
- getLiveQuery(): any;
- setObjectController(controller: ObjectController): void;
- getObjectController(): ObjectController;
- setObjectStateController(controller: ObjectStateController): void;
- getObjectStateController(): ObjectStateController;
- setPushController(controller: PushController): void;
- getPushController(): PushController;
- setQueryController(controller: QueryController): void;
- getQueryController(): QueryController;
- setRESTController(controller: RESTController): void;
- getRESTController(): RESTController;
- setSchemaController(controller: SchemaController): void;
- getSchemaController(): SchemaController;
- setSessionController(controller: SessionController): void;
- getSessionController(): SessionController;
- setStorageController(controller: StorageController): void;
- setLocalDatastoreController(controller: LocalDatastoreController): void;
- getLocalDatastoreController(): LocalDatastoreController;
- setLocalDatastore(store: any): void;
- getLocalDatastore(): any;
- getStorageController(): StorageController;
- setAsyncStorage(storage: AsyncStorageType): void;
- getAsyncStorage(): AsyncStorageType;
- setWebSocketController(
- controller: new (
- url: string | URL,
- protocols?: string | string[] | undefined
- ) => WebSocketController
- ): void;
- getWebSocketController(): new (
- url: string | URL,
- protocols?: string | string[] | undefined
- ) => WebSocketController;
- setUserController(controller: UserController): void;
- getUserController(): UserController;
- setLiveQueryController(controller: LiveQueryControllerType): void;
- getLiveQueryController(): LiveQueryControllerType;
- setHooksController(controller: HooksController): void;
- getHooksController(): HooksController;
- setParseOp(op: any): void;
- getParseOp(): any;
- setParseObject(object: any): void;
- getParseObject(): any;
- setParseQuery(query: any): void;
- getParseQuery(): any;
- setParseRole(role: any): void;
- getParseRole(): any;
- setParseUser(user: any): void;
- getParseUser(): any;
+ get: (key: string) => any;
+ set: (key: string, value: any) => void;
+ setIfNeeded: (key: string, value: any) => any;
+ setAnalyticsController(controller: AnalyticsController): void;
+ getAnalyticsController(): AnalyticsController;
+ setCloudController(controller: CloudController): void;
+ getCloudController(): CloudController;
+ setConfigController(controller: ConfigController): void;
+ getConfigController(): ConfigController;
+ setCryptoController(controller: CryptoController): void;
+ getCryptoController(): CryptoController;
+ setEventEmitter(eventEmitter: any): void;
+ getEventEmitter(): any;
+ setFileController(controller: FileController): void;
+ setEventuallyQueue(controller: EventuallyQueue): void;
+ getEventuallyQueue(): EventuallyQueue;
+ getFileController(): FileController;
+ setInstallationController(controller: InstallationController): void;
+ getInstallationController(): InstallationController;
+ setLiveQuery(liveQuery: any): void;
+ getLiveQuery(): any;
+ setObjectController(controller: ObjectController): void;
+ getObjectController(): ObjectController;
+ setObjectStateController(controller: ObjectStateController): void;
+ getObjectStateController(): ObjectStateController;
+ setPushController(controller: PushController): void;
+ getPushController(): PushController;
+ setQueryController(controller: QueryController): void;
+ getQueryController(): QueryController;
+ setRESTController(controller: RESTController): void;
+ getRESTController(): RESTController;
+ setSchemaController(controller: SchemaController): void;
+ getSchemaController(): SchemaController;
+ setSessionController(controller: SessionController): void;
+ getSessionController(): SessionController;
+ setStorageController(controller: StorageController): void;
+ setLocalDatastoreController(controller: LocalDatastoreController): void;
+ getLocalDatastoreController(): LocalDatastoreController;
+ setLocalDatastore(store: any): void;
+ getLocalDatastore(): any;
+ getStorageController(): StorageController;
+ setAsyncStorage(storage: AsyncStorageType): void;
+ getAsyncStorage(): AsyncStorageType;
+ setWebSocketController(controller: new (url: string | URL, protocols?: string | string[] | undefined) => WebSocketController): void;
+ getWebSocketController(): new (url: string | URL, protocols?: string | string[] | undefined) => WebSocketController;
+ setUserController(controller: UserController): void;
+ getUserController(): UserController;
+ setLiveQueryController(controller: LiveQueryControllerType): void;
+ getLiveQueryController(): LiveQueryControllerType;
+ setHooksController(controller: HooksController): void;
+ getHooksController(): HooksController;
+ setParseOp(op: any): void;
+ getParseOp(): any;
+ setParseObject(object: any): void;
+ getParseObject(): any;
+ setParseQuery(query: any): void;
+ getParseQuery(): any;
+ setParseRole(role: any): void;
+ getParseRole(): any;
+ setParseUser(user: any): void;
+ getParseUser(): any;
};
export default CoreManager;
diff --git a/types/CryptoController.d.ts b/types/CryptoController.d.ts
index 362d3eca7..1f6e27162 100644
--- a/types/CryptoController.d.ts
+++ b/types/CryptoController.d.ts
@@ -1,5 +1,5 @@
declare const CryptoController: {
- encrypt(obj: any, secretKey: string): string;
- decrypt(encryptedText: string, secretKey: string): string;
+ encrypt(obj: any, secretKey: string): string;
+ decrypt(encryptedText: string, secretKey: string): string;
};
export default CryptoController;
diff --git a/types/EventuallyQueue.d.ts b/types/EventuallyQueue.d.ts
index 78d76d077..c5ffbcf49 100644
--- a/types/EventuallyQueue.d.ts
+++ b/types/EventuallyQueue.d.ts
@@ -2,14 +2,14 @@ import ParseObject from './ParseObject';
import type { SaveOptions } from './ParseObject';
import type { RequestOptions } from './RESTController';
type QueueObject = {
- queueId: string;
- action: string;
- object: ParseObject;
- serverOptions: SaveOptions | RequestOptions;
- id: string;
- className: string;
- hash: string;
- createdAt: Date;
+ queueId: string;
+ action: string;
+ object: ParseObject;
+ serverOptions: SaveOptions | RequestOptions;
+ id: string;
+ className: string;
+ hash: string;
+ createdAt: Date;
};
type Queue = Array;
/**
@@ -20,163 +20,159 @@ type Queue = Array;
* @static
*/
declare const EventuallyQueue: {
- /**
- * Add object to queue with save operation.
- *
- * @function save
- * @name Parse.EventuallyQueue.save
- * @param {ParseObject} object Parse.Object to be saved eventually
- * @param {object} [serverOptions] See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#save Parse.Object.save} options.
- * @returns {Promise} A promise that is fulfilled if object is added to queue.
- * @static
- * @see Parse.Object#saveEventually
- */
- save(object: ParseObject, serverOptions?: SaveOptions): Promise;
- /**
- * Add object to queue with save operation.
- *
- * @function destroy
- * @name Parse.EventuallyQueue.destroy
- * @param {ParseObject} object Parse.Object to be destroyed eventually
- * @param {object} [serverOptions] See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#destroy Parse.Object.destroy} options
- * @returns {Promise} A promise that is fulfilled if object is added to queue.
- * @static
- * @see Parse.Object#destroyEventually
- */
- destroy(object: ParseObject, serverOptions?: RequestOptions): Promise;
- /**
- * Generate unique identifier to avoid duplicates and maintain previous state.
- *
- * @param {string} action save / destroy
- * @param {object} object Parse.Object to be queued
- * @returns {string}
- * @static
- * @ignore
- */
- generateQueueId(action: string, object: ParseObject): string;
- /**
- * Build queue object and add to queue.
- *
- * @param {string} action save / destroy
- * @param {object} object Parse.Object to be queued
- * @param {object} [serverOptions]
- * @returns {Promise} A promise that is fulfilled if object is added to queue.
- * @static
- * @ignore
- */
- enqueue(
- action: string,
- object: ParseObject,
- serverOptions: SaveOptions | RequestOptions
- ): Promise;
- store(data: QueueObject[]): Promise;
- load(): Promise;
- /**
- * Sets the in-memory queue from local storage and returns.
- *
- * @function getQueue
- * @name Parse.EventuallyQueue.getQueue
- * @returns {Promise}
- * @static
- */
- getQueue(): Promise;
- /**
- * Saves the queue to local storage
- *
- * @param {Queue} queue Queue containing Parse.Object data.
- * @returns {Promise} A promise that is fulfilled when queue is stored.
- * @static
- * @ignore
- */
- setQueue(queue: Queue): Promise;
- /**
- * Removes Parse.Object data from queue.
- *
- * @param {string} queueId Unique identifier for Parse.Object data.
- * @returns {Promise} A promise that is fulfilled when queue is stored.
- * @static
- * @ignore
- */
- remove(queueId: string): Promise;
- /**
- * Removes all objects from queue.
- *
- * @function clear
- * @name Parse.EventuallyQueue.clear
- * @returns {Promise} A promise that is fulfilled when queue is cleared.
- * @static
- */
- clear(): Promise;
- /**
- * Return the index of a queueId in the queue. Returns -1 if not found.
- *
- * @param {Queue} queue Queue containing Parse.Object data.
- * @param {string} queueId Unique identifier for Parse.Object data.
- * @returns {number}
- * @static
- * @ignore
- */
- queueItemExists(queue: Queue, queueId: string): number;
- /**
- * Return the number of objects in the queue.
- *
- * @function length
- * @name Parse.EventuallyQueue.length
- * @returns {Promise}
- * @static
- */
- length(): Promise;
- /**
- * Sends the queue to the server.
- *
- * @function sendQueue
- * @name Parse.EventuallyQueue.sendQueue
- * @returns {Promise} Returns true if queue was sent successfully.
- * @static
- */
- sendQueue(): Promise;
- /**
- * Build queue object and add to queue.
- *
- * @param {ParseObject} object Parse.Object to be processed
- * @param {QueueObject} queueObject Parse.Object data from the queue
- * @returns {Promise} A promise that is fulfilled when operation is performed.
- * @static
- * @ignore
- */
- sendQueueCallback(object: ParseObject, queueObject: QueueObject): Promise;
- /**
- * Start polling server for network connection.
- * Will send queue if connection is established.
- *
- * @function poll
- * @name Parse.EventuallyQueue.poll
- * @param [ms] Milliseconds to ping the server. Default 2000ms
- * @static
- */
- poll(ms?: number): void;
- /**
- * Turns off polling.
- *
- * @function stopPoll
- * @name Parse.EventuallyQueue.stopPoll
- * @static
- */
- stopPoll(): void;
- /**
- * Return true if pinging the server.
- *
- * @function isPolling
- * @name Parse.EventuallyQueue.isPolling
- * @returns {boolean}
- * @static
- */
- isPolling(): boolean;
- _setPolling(flag: boolean): void;
- process: {
- create(ObjectType: any, queueObject: any): Promise;
- byId(ObjectType: any, queueObject: any): Promise;
- byHash(ObjectType: any, queueObject: any): Promise;
- };
+ /**
+ * Add object to queue with save operation.
+ *
+ * @function save
+ * @name Parse.EventuallyQueue.save
+ * @param {ParseObject} object Parse.Object to be saved eventually
+ * @param {object} [serverOptions] See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#save Parse.Object.save} options.
+ * @returns {Promise} A promise that is fulfilled if object is added to queue.
+ * @static
+ * @see Parse.Object#saveEventually
+ */
+ save(object: ParseObject, serverOptions?: SaveOptions): Promise;
+ /**
+ * Add object to queue with save operation.
+ *
+ * @function destroy
+ * @name Parse.EventuallyQueue.destroy
+ * @param {ParseObject} object Parse.Object to be destroyed eventually
+ * @param {object} [serverOptions] See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Object.html#destroy Parse.Object.destroy} options
+ * @returns {Promise} A promise that is fulfilled if object is added to queue.
+ * @static
+ * @see Parse.Object#destroyEventually
+ */
+ destroy(object: ParseObject, serverOptions?: RequestOptions): Promise;
+ /**
+ * Generate unique identifier to avoid duplicates and maintain previous state.
+ *
+ * @param {string} action save / destroy
+ * @param {object} object Parse.Object to be queued
+ * @returns {string}
+ * @static
+ * @ignore
+ */
+ generateQueueId(action: string, object: ParseObject): string;
+ /**
+ * Build queue object and add to queue.
+ *
+ * @param {string} action save / destroy
+ * @param {object} object Parse.Object to be queued
+ * @param {object} [serverOptions]
+ * @returns {Promise} A promise that is fulfilled if object is added to queue.
+ * @static
+ * @ignore
+ */
+ enqueue(action: string, object: ParseObject, serverOptions: SaveOptions | RequestOptions): Promise;
+ store(data: QueueObject[]): Promise;
+ load(): Promise;
+ /**
+ * Sets the in-memory queue from local storage and returns.
+ *
+ * @function getQueue
+ * @name Parse.EventuallyQueue.getQueue
+ * @returns {Promise}
+ * @static
+ */
+ getQueue(): Promise;
+ /**
+ * Saves the queue to local storage
+ *
+ * @param {Queue} queue Queue containing Parse.Object data.
+ * @returns {Promise} A promise that is fulfilled when queue is stored.
+ * @static
+ * @ignore
+ */
+ setQueue(queue: Queue): Promise;
+ /**
+ * Removes Parse.Object data from queue.
+ *
+ * @param {string} queueId Unique identifier for Parse.Object data.
+ * @returns {Promise} A promise that is fulfilled when queue is stored.
+ * @static
+ * @ignore
+ */
+ remove(queueId: string): Promise;
+ /**
+ * Removes all objects from queue.
+ *
+ * @function clear
+ * @name Parse.EventuallyQueue.clear
+ * @returns {Promise} A promise that is fulfilled when queue is cleared.
+ * @static
+ */
+ clear(): Promise;
+ /**
+ * Return the index of a queueId in the queue. Returns -1 if not found.
+ *
+ * @param {Queue} queue Queue containing Parse.Object data.
+ * @param {string} queueId Unique identifier for Parse.Object data.
+ * @returns {number}
+ * @static
+ * @ignore
+ */
+ queueItemExists(queue: Queue, queueId: string): number;
+ /**
+ * Return the number of objects in the queue.
+ *
+ * @function length
+ * @name Parse.EventuallyQueue.length
+ * @returns {Promise}
+ * @static
+ */
+ length(): Promise;
+ /**
+ * Sends the queue to the server.
+ *
+ * @function sendQueue
+ * @name Parse.EventuallyQueue.sendQueue
+ * @returns {Promise} Returns true if queue was sent successfully.
+ * @static
+ */
+ sendQueue(): Promise;
+ /**
+ * Build queue object and add to queue.
+ *
+ * @param {ParseObject} object Parse.Object to be processed
+ * @param {QueueObject} queueObject Parse.Object data from the queue
+ * @returns {Promise} A promise that is fulfilled when operation is performed.
+ * @static
+ * @ignore
+ */
+ sendQueueCallback(object: ParseObject, queueObject: QueueObject): Promise;
+ /**
+ * Start polling server for network connection.
+ * Will send queue if connection is established.
+ *
+ * @function poll
+ * @name Parse.EventuallyQueue.poll
+ * @param [ms] Milliseconds to ping the server. Default 2000ms
+ * @static
+ */
+ poll(ms?: number): void;
+ /**
+ * Turns off polling.
+ *
+ * @function stopPoll
+ * @name Parse.EventuallyQueue.stopPoll
+ * @static
+ */
+ stopPoll(): void;
+ /**
+ * Return true if pinging the server.
+ *
+ * @function isPolling
+ * @name Parse.EventuallyQueue.isPolling
+ * @returns {boolean}
+ * @static
+ */
+ isPolling(): boolean;
+ _setPolling(flag: boolean): void;
+ process: {
+ create(ObjectType: any, queueObject: any): Promise;
+ byId(ObjectType: any, queueObject: any): Promise;
+ byHash(ObjectType: any, queueObject: any): Promise;
+ };
};
export default EventuallyQueue;
diff --git a/types/FacebookUtils.d.ts b/types/FacebookUtils.d.ts
index 3cfebcaff..f4cd41a2d 100644
--- a/types/FacebookUtils.d.ts
+++ b/types/FacebookUtils.d.ts
@@ -8,100 +8,100 @@ import type { AuthProviderType } from './ParseUser';
* @hideconstructor
*/
declare const FacebookUtils: {
- /**
- * Initializes Parse Facebook integration. Call this function after you
- * have loaded the Facebook Javascript SDK with the same parameters
- * as you would pass to
- *
- * FB.init()
. Parse.FacebookUtils will invoke FB.init() for you
- * with these arguments.
- *
- * @function init
- * @name Parse.FacebookUtils.init
- * @param {object} options Facebook options argument as described here:
- *
- * FB.init(). The status flag will be coerced to 'false' because it
- * interferes with Parse Facebook integration. Call FB.getLoginStatus()
- * explicitly if this behavior is required by your application.
- */
- init(options: any): void;
- /**
- * Gets whether the user has their account linked to Facebook.
- *
- * @function isLinked
- * @name Parse.FacebookUtils.isLinked
- * @param {Parse.User} user User to check for a facebook link.
- * The user must be logged in on this device.
- * @returns {boolean} true
if the user has their account
- * linked to Facebook.
- */
- isLinked(user: any): any;
- /**
- * Logs in a user using Facebook. This method delegates to the Facebook
- * SDK to authenticate the user, and then automatically logs in (or
- * creates, in the case where it is a new user) a Parse.User.
- *
- * Standard API:
- *
- * logIn(permission: string, authData: Object);
- *
- * Advanced API: Used for handling your own oAuth tokens
- * {@link https://docs.parseplatform.org/rest/guide/#linking-users}
- *
- * logIn(authData: Object, options?: Object);
- *
- * @function logIn
- * @name Parse.FacebookUtils.logIn
- * @param {(string | object)} permissions The permissions required for Facebook
- * log in. This is a comma-separated string of permissions.
- * Alternatively, supply a Facebook authData object as described in our
- * REST API docs if you want to handle getting facebook auth tokens
- * yourself.
- * @param {object} options MasterKey / SessionToken. Alternatively can be used for authData if permissions is a string
- * @returns {Promise}
- */
- logIn(permissions: any, options: any): Promise;
- /**
- * Links Facebook to an existing PFUser. This method delegates to the
- * Facebook SDK to authenticate the user, and then automatically links
- * the account to the Parse.User.
- *
- * Standard API:
- *
- * link(user: Parse.User, permission: string, authData?: Object);
- *
- * Advanced API: Used for handling your own oAuth tokens
- * {@link https://docs.parseplatform.org/rest/guide/#linking-users}
- *
- * link(user: Parse.User, authData: Object, options?: FullOptions);
- *
- * @function link
- * @name Parse.FacebookUtils.link
- * @param {Parse.User} user User to link to Facebook. This must be the
- * current user.
- * @param {(string | object)} permissions The permissions required for Facebook
- * log in. This is a comma-separated string of permissions.
- * Alternatively, supply a Facebook authData object as described in our
- * REST API docs if you want to handle getting facebook auth tokens
- * yourself.
- * @param {object} options MasterKey / SessionToken. Alternatively can be used for authData if permissions is a string
- * @returns {Promise}
- */
- link(user: any, permissions: any, options: any): any;
- /**
- * Unlinks the Parse.User from a Facebook account.
- *
- * @function unlink
- * @name Parse.FacebookUtils.unlink
- * @param {Parse.User} user User to unlink from Facebook. This must be the
- * current user.
- * @param {object} options Standard options object with success and error
- * callbacks.
- * @returns {Promise}
- */
- unlink: (user: any, options: any) => any;
- _getAuthProvider(): AuthProviderType;
+ /**
+ * Initializes Parse Facebook integration. Call this function after you
+ * have loaded the Facebook Javascript SDK with the same parameters
+ * as you would pass to
+ *
+ * FB.init()
. Parse.FacebookUtils will invoke FB.init() for you
+ * with these arguments.
+ *
+ * @function init
+ * @name Parse.FacebookUtils.init
+ * @param {object} options Facebook options argument as described here:
+ *
+ * FB.init(). The status flag will be coerced to 'false' because it
+ * interferes with Parse Facebook integration. Call FB.getLoginStatus()
+ * explicitly if this behavior is required by your application.
+ */
+ init(options: any): void;
+ /**
+ * Gets whether the user has their account linked to Facebook.
+ *
+ * @function isLinked
+ * @name Parse.FacebookUtils.isLinked
+ * @param {Parse.User} user User to check for a facebook link.
+ * The user must be logged in on this device.
+ * @returns {boolean} true
if the user has their account
+ * linked to Facebook.
+ */
+ isLinked(user: any): any;
+ /**
+ * Logs in a user using Facebook. This method delegates to the Facebook
+ * SDK to authenticate the user, and then automatically logs in (or
+ * creates, in the case where it is a new user) a Parse.User.
+ *
+ * Standard API:
+ *
+ * logIn(permission: string, authData: Object);
+ *
+ * Advanced API: Used for handling your own oAuth tokens
+ * {@link https://docs.parseplatform.org/rest/guide/#linking-users}
+ *
+ * logIn(authData: Object, options?: Object);
+ *
+ * @function logIn
+ * @name Parse.FacebookUtils.logIn
+ * @param {(string | object)} permissions The permissions required for Facebook
+ * log in. This is a comma-separated string of permissions.
+ * Alternatively, supply a Facebook authData object as described in our
+ * REST API docs if you want to handle getting facebook auth tokens
+ * yourself.
+ * @param {object} options MasterKey / SessionToken. Alternatively can be used for authData if permissions is a string
+ * @returns {Promise}
+ */
+ logIn(permissions: any, options: any): Promise;
+ /**
+ * Links Facebook to an existing PFUser. This method delegates to the
+ * Facebook SDK to authenticate the user, and then automatically links
+ * the account to the Parse.User.
+ *
+ * Standard API:
+ *
+ * link(user: Parse.User, permission: string, authData?: Object);
+ *
+ * Advanced API: Used for handling your own oAuth tokens
+ * {@link https://docs.parseplatform.org/rest/guide/#linking-users}
+ *
+ * link(user: Parse.User, authData: Object, options?: FullOptions);
+ *
+ * @function link
+ * @name Parse.FacebookUtils.link
+ * @param {Parse.User} user User to link to Facebook. This must be the
+ * current user.
+ * @param {(string | object)} permissions The permissions required for Facebook
+ * log in. This is a comma-separated string of permissions.
+ * Alternatively, supply a Facebook authData object as described in our
+ * REST API docs if you want to handle getting facebook auth tokens
+ * yourself.
+ * @param {object} options MasterKey / SessionToken. Alternatively can be used for authData if permissions is a string
+ * @returns {Promise}
+ */
+ link(user: any, permissions: any, options: any): any;
+ /**
+ * Unlinks the Parse.User from a Facebook account.
+ *
+ * @function unlink
+ * @name Parse.FacebookUtils.unlink
+ * @param {Parse.User} user User to unlink from Facebook. This must be the
+ * current user.
+ * @param {object} options Standard options object with success and error
+ * callbacks.
+ * @returns {Promise}
+ */
+ unlink: (user: any, options: any) => any;
+ _getAuthProvider(): AuthProviderType;
};
export default FacebookUtils;
diff --git a/types/InstallationController.d.ts b/types/InstallationController.d.ts
index 9797e9d93..1409c39db 100644
--- a/types/InstallationController.d.ts
+++ b/types/InstallationController.d.ts
@@ -1,10 +1,10 @@
import ParseInstallation from './ParseInstallation';
declare const InstallationController: {
- updateInstallationOnDisk(installation: ParseInstallation): Promise;
- currentInstallationId(): Promise;
- currentInstallation(): Promise;
- _clearCache(): void;
- _setInstallationIdCache(iid: string): void;
- _setCurrentInstallationCache(installation: ParseInstallation, matchesDisk?: boolean): void;
+ updateInstallationOnDisk(installation: ParseInstallation): Promise;
+ currentInstallationId(): Promise;
+ currentInstallation(): Promise;
+ _clearCache(): void;
+ _setInstallationIdCache(iid: string): void;
+ _setCurrentInstallationCache(installation: ParseInstallation, matchesDisk?: boolean): void;
};
export default InstallationController;
diff --git a/types/LiveQueryClient.d.ts b/types/LiveQueryClient.d.ts
index 49fbe38c5..4f41545dc 100644
--- a/types/LiveQueryClient.d.ts
+++ b/types/LiveQueryClient.d.ts
@@ -44,92 +44,85 @@ import type ParseQuery from './ParseQuery';
* @alias Parse.LiveQueryClient
*/
declare class LiveQueryClient {
- attempts: number;
- id: number;
- requestId: number;
- applicationId: string;
- serverURL: string;
- javascriptKey?: string;
- masterKey?: string;
- sessionToken?: string;
- installationId?: string;
- additionalProperties: boolean;
- connectPromise: any;
- subscriptions: Map;
- socket: WebSocketController & {
- closingPromise?: any;
- };
- state: string;
- reconnectHandle: any;
- emitter: any;
- on: any;
- emit: any;
- /**
- * @param {object} options
- * @param {string} options.applicationId - applicationId of your Parse app
- * @param {string} options.serverURL - the URL of your LiveQuery server
- * @param {string} options.javascriptKey (optional)
- * @param {string} options.masterKey (optional) Your Parse Master Key. (Node.js only!)
- * @param {string} options.sessionToken (optional)
- * @param {string} options.installationId (optional)
- */
- constructor({
- applicationId,
- serverURL,
- javascriptKey,
- masterKey,
- sessionToken,
- installationId,
- }: {
- applicationId: any;
- serverURL: any;
- javascriptKey: any;
- masterKey: any;
- sessionToken: any;
- installationId: any;
- });
- shouldOpen(): any;
- /**
- * Subscribes to a ParseQuery
- *
- * If you provide the sessionToken, when the LiveQuery server gets ParseObject's
- * updates from parse server, it'll try to check whether the sessionToken fulfills
- * the ParseObject's ACL. The LiveQuery server will only send updates to clients whose
- * sessionToken is fit for the ParseObject's ACL. You can check the LiveQuery protocol
- * here for more details. The subscription you get is the same subscription you get
- * from our Standard API.
- *
- * @param {ParseQuery} query - the ParseQuery you want to subscribe to
- * @param {string} sessionToken (optional)
- * @returns {LiveQuerySubscription | undefined}
- */
- subscribe(query: ParseQuery, sessionToken?: string): LiveQuerySubscription | undefined;
- /**
- * After calling unsubscribe you'll stop receiving events from the subscription object.
- *
- * @param {object} subscription - subscription you would like to unsubscribe from.
- * @returns {Promise | undefined}
- */
- unsubscribe(subscription: LiveQuerySubscription): Promise;
- /**
- * After open is called, the LiveQueryClient will try to send a connect request
- * to the LiveQuery server.
- *
- */
- open(): void;
- resubscribe(): void;
- /**
- * This method will close the WebSocket connection to this LiveQueryClient,
- * cancel the auto reconnect and unsubscribe all subscriptions based on it.
- *
- * @returns {Promise | undefined} CloseEvent {@link https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event}
- */
- close(): Promise;
- _handleReset(): void;
- _handleWebSocketOpen(): void;
- _handleWebSocketMessage(event: any): void;
- _handleWebSocketClose(): void;
- _handleWebSocketError(error: any): void;
- _handleReconnect(): void;
+ attempts: number;
+ id: number;
+ requestId: number;
+ applicationId: string;
+ serverURL: string;
+ javascriptKey?: string;
+ masterKey?: string;
+ sessionToken?: string;
+ installationId?: string;
+ additionalProperties: boolean;
+ connectPromise: any;
+ subscriptions: Map;
+ socket: WebSocketController & {
+ closingPromise?: any;
+ };
+ state: string;
+ reconnectHandle: any;
+ emitter: any;
+ on: any;
+ emit: any;
+ /**
+ * @param {object} options
+ * @param {string} options.applicationId - applicationId of your Parse app
+ * @param {string} options.serverURL - the URL of your LiveQuery server
+ * @param {string} options.javascriptKey (optional)
+ * @param {string} options.masterKey (optional) Your Parse Master Key. (Node.js only!)
+ * @param {string} options.sessionToken (optional)
+ * @param {string} options.installationId (optional)
+ */
+ constructor({ applicationId, serverURL, javascriptKey, masterKey, sessionToken, installationId, }: {
+ applicationId: any;
+ serverURL: any;
+ javascriptKey: any;
+ masterKey: any;
+ sessionToken: any;
+ installationId: any;
+ });
+ shouldOpen(): any;
+ /**
+ * Subscribes to a ParseQuery
+ *
+ * If you provide the sessionToken, when the LiveQuery server gets ParseObject's
+ * updates from parse server, it'll try to check whether the sessionToken fulfills
+ * the ParseObject's ACL. The LiveQuery server will only send updates to clients whose
+ * sessionToken is fit for the ParseObject's ACL. You can check the LiveQuery protocol
+ * here for more details. The subscription you get is the same subscription you get
+ * from our Standard API.
+ *
+ * @param {ParseQuery} query - the ParseQuery you want to subscribe to
+ * @param {string} sessionToken (optional)
+ * @returns {LiveQuerySubscription | undefined}
+ */
+ subscribe(query: ParseQuery, sessionToken?: string): LiveQuerySubscription | undefined;
+ /**
+ * After calling unsubscribe you'll stop receiving events from the subscription object.
+ *
+ * @param {object} subscription - subscription you would like to unsubscribe from.
+ * @returns {Promise | undefined}
+ */
+ unsubscribe(subscription: LiveQuerySubscription): Promise;
+ /**
+ * After open is called, the LiveQueryClient will try to send a connect request
+ * to the LiveQuery server.
+ *
+ */
+ open(): void;
+ resubscribe(): void;
+ /**
+ * This method will close the WebSocket connection to this LiveQueryClient,
+ * cancel the auto reconnect and unsubscribe all subscriptions based on it.
+ *
+ * @returns {Promise | undefined} CloseEvent {@link https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/close_event}
+ */
+ close(): Promise;
+ _handleReset(): void;
+ _handleWebSocketOpen(): void;
+ _handleWebSocketMessage(event: any): void;
+ _handleWebSocketClose(): void;
+ _handleWebSocketError(error: any): void;
+ _handleReconnect(): void;
}
export default LiveQueryClient;
diff --git a/types/LiveQuerySubscription.d.ts b/types/LiveQuerySubscription.d.ts
index e312d2a86..1eb9293cf 100644
--- a/types/LiveQuerySubscription.d.ts
+++ b/types/LiveQuerySubscription.d.ts
@@ -82,21 +82,21 @@ import type ParseQuery from './ParseQuery';
* });
*/
declare class Subscription {
- id: string | number;
- query: ParseQuery;
- sessionToken?: string;
- subscribePromise: any;
- unsubscribePromise: any;
- subscribed: boolean;
- emitter: any;
- on: any;
- emit: any;
- constructor(id: string | number, query: ParseQuery, sessionToken?: string);
- /**
- * Close the subscription
- *
- * @returns {Promise}
- */
- unsubscribe(): Promise;
+ id: string | number;
+ query: ParseQuery;
+ sessionToken?: string;
+ subscribePromise: any;
+ unsubscribePromise: any;
+ subscribed: boolean;
+ emitter: any;
+ on: any;
+ emit: any;
+ constructor(id: string | number, query: ParseQuery, sessionToken?: string);
+ /**
+ * Close the subscription
+ *
+ * @returns {Promise}
+ */
+ unsubscribe(): Promise;
}
export default Subscription;
diff --git a/types/LocalDatastore.d.ts b/types/LocalDatastore.d.ts
index 4559910a9..d6f795de0 100644
--- a/types/LocalDatastore.d.ts
+++ b/types/LocalDatastore.d.ts
@@ -20,37 +20,37 @@ import type ParseObject from './ParseObject';
* @static
*/
declare const LocalDatastore: {
- isEnabled: boolean;
- isSyncing: boolean;
- fromPinWithName(name: string): Promise>;
- pinWithName(name: string, value: any): Promise;
- unPinWithName(name: string): Promise;
- _getAllContents(): Promise;
- _getRawStorage(): Promise;
- _clear(): Promise;
- _handlePinAllWithName(name: string, objects: Array): Promise;
- _handleUnPinAllWithName(name: string, objects: Array): Promise;
- _getChildren(object: ParseObject): any;
- _traverse(object: any, encountered: any): void;
- _serializeObjectsFromPinName(name: string): Promise;
- _serializeObject(objectKey: string, localDatastore: any): Promise;
- _updateObjectIfPinned(object: ParseObject): Promise;
- _destroyObjectIfPinned(object: ParseObject): Promise;
- _updateLocalIdForObject(localId: string, object: ParseObject): Promise;
- /**
- * Updates Local Datastore from Server
- *
- *
- * await Parse.LocalDatastore.updateFromServer();
- *
- *
- * @function updateFromServer
- * @name Parse.LocalDatastore.updateFromServer
- * @static
- */
- updateFromServer(): Promise;
- getKeyForObject(object: any): string;
- getPinName(pinName?: string): string;
- checkIfEnabled(): any;
+ isEnabled: boolean;
+ isSyncing: boolean;
+ fromPinWithName(name: string): Promise>;
+ pinWithName(name: string, value: any): Promise;
+ unPinWithName(name: string): Promise;
+ _getAllContents(): Promise;
+ _getRawStorage(): Promise;
+ _clear(): Promise;
+ _handlePinAllWithName(name: string, objects: Array): Promise;
+ _handleUnPinAllWithName(name: string, objects: Array): Promise;
+ _getChildren(object: ParseObject): any;
+ _traverse(object: any, encountered: any): void;
+ _serializeObjectsFromPinName(name: string): Promise;
+ _serializeObject(objectKey: string, localDatastore: any): Promise;
+ _updateObjectIfPinned(object: ParseObject): Promise;
+ _destroyObjectIfPinned(object: ParseObject): Promise;
+ _updateLocalIdForObject(localId: string, object: ParseObject): Promise;
+ /**
+ * Updates Local Datastore from Server
+ *
+ *
+ * await Parse.LocalDatastore.updateFromServer();
+ *
+ *
+ * @function updateFromServer
+ * @name Parse.LocalDatastore.updateFromServer
+ * @static
+ */
+ updateFromServer(): Promise;
+ getKeyForObject(object: any): string;
+ getPinName(pinName?: string): string;
+ checkIfEnabled(): any;
};
export default LocalDatastore;
diff --git a/types/LocalDatastoreController.default.d.ts b/types/LocalDatastoreController.default.d.ts
index 3737f59a7..14416a1b7 100644
--- a/types/LocalDatastoreController.default.d.ts
+++ b/types/LocalDatastoreController.default.d.ts
@@ -1,9 +1,9 @@
declare const LocalDatastoreController: {
- fromPinWithName(name: string): Promise>;
- pinWithName(name: string, value: any): Promise;
- unPinWithName(name: string): Promise;
- getAllContents(): Promise;
- getRawStorage(): Promise;
- clear(): Promise;
+ fromPinWithName(name: string): Promise>;
+ pinWithName(name: string, value: any): Promise;
+ unPinWithName(name: string): Promise;
+ getAllContents(): Promise;
+ getRawStorage(): Promise;
+ clear(): Promise;
};
export default LocalDatastoreController;
diff --git a/types/LocalDatastoreController.react-native.d.ts b/types/LocalDatastoreController.react-native.d.ts
index 96b58dfd5..2db09d794 100644
--- a/types/LocalDatastoreController.react-native.d.ts
+++ b/types/LocalDatastoreController.react-native.d.ts
@@ -1,9 +1,9 @@
declare const LocalDatastoreController: {
- fromPinWithName(name: string): Promise>;
- pinWithName(name: string, value: any): Promise;
- unPinWithName(name: string): Promise;
- getAllContents(): Promise;
- getRawStorage(): Promise;
- clear(): Promise;
+ fromPinWithName(name: string): Promise>;
+ pinWithName(name: string, value: any): Promise;
+ unPinWithName(name: string): Promise;
+ getAllContents(): Promise;
+ getRawStorage(): Promise;
+ clear(): Promise;
};
export default LocalDatastoreController;
diff --git a/types/LocalDatastoreUtils.d.ts b/types/LocalDatastoreUtils.d.ts
index db607c44e..7472e6570 100644
--- a/types/LocalDatastoreUtils.d.ts
+++ b/types/LocalDatastoreUtils.d.ts
@@ -1,5 +1,5 @@
-declare const DEFAULT_PIN = '_default';
-declare const PIN_PREFIX = 'parsePin_';
-declare const OBJECT_PREFIX = 'Parse_LDS_';
+declare const DEFAULT_PIN = "_default";
+declare const PIN_PREFIX = "parsePin_";
+declare const OBJECT_PREFIX = "Parse_LDS_";
declare function isLocalDatastoreKey(key: string): boolean;
export { DEFAULT_PIN, PIN_PREFIX, OBJECT_PREFIX, isLocalDatastoreKey };
diff --git a/types/ObjectStateMutations.d.ts b/types/ObjectStateMutations.d.ts
index 75d1793eb..7a2086d80 100644
--- a/types/ObjectStateMutations.d.ts
+++ b/types/ObjectStateMutations.d.ts
@@ -2,20 +2,20 @@ import TaskQueue from './TaskQueue';
import type { Op } from './ParseOp';
import type ParseObject from './ParseObject';
export type AttributeMap = {
- [attr: string]: any;
+ [attr: string]: any;
};
export type OpsMap = {
- [attr: string]: Op;
+ [attr: string]: Op;
};
export type ObjectCache = {
- [attr: string]: string;
+ [attr: string]: string;
};
export type State = {
- serverData: AttributeMap;
- pendingOps: Array;
- objectCache: ObjectCache;
- tasks: TaskQueue;
- existed: boolean;
+ serverData: AttributeMap;
+ pendingOps: Array;
+ objectCache: ObjectCache;
+ tasks: TaskQueue;
+ existed: boolean;
};
export declare function defaultState(): State;
export declare function setServerData(serverData: AttributeMap, attributes: AttributeMap): void;
@@ -23,19 +23,6 @@ export declare function setPendingOp(pendingOps: Array, attr: string, op
export declare function pushPendingState(pendingOps: Array): void;
export declare function popPendingState(pendingOps: Array): OpsMap;
export declare function mergeFirstPendingState(pendingOps: Array): void;
-export declare function estimateAttribute(
- serverData: AttributeMap,
- pendingOps: Array,
- object: ParseObject,
- attr: string
-): any;
-export declare function estimateAttributes(
- serverData: AttributeMap,
- pendingOps: Array,
- object: ParseObject
-): AttributeMap;
-export declare function commitServerChanges(
- serverData: AttributeMap,
- objectCache: ObjectCache,
- changes: AttributeMap
-): void;
+export declare function estimateAttribute(serverData: AttributeMap, pendingOps: Array, object: ParseObject, attr: string): any;
+export declare function estimateAttributes(serverData: AttributeMap, pendingOps: Array, object: ParseObject): AttributeMap;
+export declare function commitServerChanges(serverData: AttributeMap, objectCache: ObjectCache, changes: AttributeMap): void;
diff --git a/types/OfflineQuery.d.ts b/types/OfflineQuery.d.ts
index 1361e7efc..9cca71c1b 100644
--- a/types/OfflineQuery.d.ts
+++ b/types/OfflineQuery.d.ts
@@ -14,7 +14,7 @@
declare function matchesQuery(className: any, object: any, objects: any, query: any): boolean;
declare function validateQuery(query: any): void;
declare const OfflineQuery: {
- matchesQuery: typeof matchesQuery;
- validateQuery: typeof validateQuery;
+ matchesQuery: typeof matchesQuery;
+ validateQuery: typeof validateQuery;
};
export default OfflineQuery;
diff --git a/types/Parse.d.ts b/types/Parse.d.ts
index 4500ea0ab..893fe34da 100644
--- a/types/Parse.d.ts
+++ b/types/Parse.d.ts
@@ -22,434 +22,254 @@ import User from './ParseUser';
import ParseLiveQuery from './ParseLiveQuery';
import LiveQueryClient from './LiveQueryClient';
declare const Parse: {
- ACL: typeof ACL;
- Analytics: typeof Analytics;
- AnonymousUtils: {
- isLinked(user: User): boolean;
- logIn(options?: import('./RESTController').RequestOptions): Promise;
- link(user: User, options?: import('./RESTController').RequestOptions): Promise;
- isRegistered(): boolean;
- _getAuthProvider(): {
- restoreAuthentication(): boolean;
- getAuthType(): string;
- getAuthData(): {
- authData: {
- id: string;
+ ACL: typeof ACL;
+ Analytics: typeof Analytics;
+ AnonymousUtils: {
+ isLinked(user: User): boolean;
+ logIn(options?: import("./RESTController").RequestOptions): Promise;
+ link(user: User, options?: import("./RESTController").RequestOptions): Promise;
+ isRegistered(): boolean;
+ _getAuthProvider(): {
+ restoreAuthentication(): boolean;
+ getAuthType(): string;
+ getAuthData(): {
+ authData: {
+ id: string;
+ };
+ };
};
- };
};
- };
- Cloud: typeof Cloud;
- CLP: typeof CLP;
- CoreManager: {
- get: (key: string) => any;
- set: (key: string, value: any) => void;
- setIfNeeded: (key: string, value: any) => any;
- setAnalyticsController(controller: {
- track: (
- name: string,
- dimensions: {
- [key: string]: string;
- }
- ) => Promise;
- }): void;
- getAnalyticsController(): {
- track: (
- name: string,
- dimensions: {
- [key: string]: string;
- }
- ) => Promise;
- };
- setCloudController(controller: {
- run: (
- name: string,
- data: any,
- options: import('./RESTController').RequestOptions
- ) => Promise;
- getJobsData: (options: import('./RESTController').RequestOptions) => Promise;
- startJob: (
- name: string,
- data: any,
- options: import('./RESTController').RequestOptions
- ) => Promise;
- }): void;
- getCloudController(): {
- run: (
- name: string,
- data: any,
- options: import('./RESTController').RequestOptions
- ) => Promise;
- getJobsData: (options: import('./RESTController').RequestOptions) => Promise;
- startJob: (
- name: string,
- data: any,
- options: import('./RESTController').RequestOptions
- ) => Promise;
- };
- setConfigController(controller: {
- current: () => Promise | Config;
- get: (opts?: import('./RESTController').RequestOptions) => Promise;
- save: (
- attrs: {
- [key: string]: any;
- },
- masterKeyOnlyFlags?: {
- [key: string]: any;
- }
- ) => Promise;
- }): void;
- getConfigController(): {
- current: () => Promise | Config;
- get: (opts?: import('./RESTController').RequestOptions) => Promise;
- save: (
- attrs: {
- [key: string]: any;
- },
- masterKeyOnlyFlags?: {
- [key: string]: any;
- }
- ) => Promise;
- };
- setCryptoController(controller: {
- encrypt: (obj: any, secretKey: string) => string;
- decrypt: (encryptedText: string, secretKey: any) => string;
- }): void;
- getCryptoController(): {
- encrypt: (obj: any, secretKey: string) => string;
- decrypt: (encryptedText: string, secretKey: any) => string;
- };
- setEventEmitter(eventEmitter: any): void;
- getEventEmitter(): any;
- setFileController(controller: {
- saveFile: (
- name: string,
- source: import('./ParseFile').FileSource,
- options?: import('./RESTController').FullOptions
- ) => Promise;
- saveBase64: (
- name: string,
- source: import('./ParseFile').FileSource,
- options?: import('./ParseFile').FileSaveOptions
- ) => Promise<{
- name: string;
- url: string;
- }>;
- download: (
- uri: string,
- options?: any
- ) => Promise<{
- base64?: string;
- contentType?: string;
- }>;
- deleteFile: (
- name: string,
- options?: {
- useMasterKey?: boolean;
- }
- ) => Promise;
- }): void;
- setEventuallyQueue(controller: {
- save: (
- object: ParseObject,
- serverOptions: import('./ParseObject').SaveOptions
- ) => Promise;
- destroy: (
- object: ParseObject,
- serverOptions: import('./RESTController').RequestOptions
- ) => Promise;
- poll: (ms?: number) => void;
- }): void;
- getEventuallyQueue(): {
- save: (
- object: ParseObject,
- serverOptions: import('./ParseObject').SaveOptions
- ) => Promise;
- destroy: (
- object: ParseObject,
- serverOptions: import('./RESTController').RequestOptions
- ) => Promise;
- poll: (ms?: number) => void;
- };
- getFileController(): {
- saveFile: (
- name: string,
- source: import('./ParseFile').FileSource,
- options?: import('./RESTController').FullOptions
- ) => Promise;
- saveBase64: (
- name: string,
- source: import('./ParseFile').FileSource,
- options?: import('./ParseFile').FileSaveOptions
- ) => Promise<{
- name: string;
- url: string;
- }>;
- download: (
- uri: string,
- options?: any
- ) => Promise<{
- base64?: string;
- contentType?: string;
- }>;
- deleteFile: (
- name: string,
- options?: {
- useMasterKey?: boolean;
- }
- ) => Promise;
- };
- setInstallationController(controller: {
- currentInstallationId: () => Promise;
- currentInstallation: () => Promise;
- updateInstallationOnDisk: (installation: Installation) => Promise;
- }): void;
- getInstallationController(): {
- currentInstallationId: () => Promise;
- currentInstallation: () => Promise;
- updateInstallationOnDisk: (installation: Installation) => Promise;
- };
- setLiveQuery(liveQuery: any): void;
- getLiveQuery(): any;
- setObjectController(controller: {
- fetch: (
- object: ParseObject | Array,
- forceFetch: boolean,
- options: import('./RESTController').RequestOptions
- ) => Promise | ParseObject | undefined>;
- save: (
- object: ParseObject | Array | null,
- options: import('./RESTController').RequestOptions
- ) => Promise | File | undefined>;
- destroy: (
- object: ParseObject | Array,
- options: import('./RESTController').RequestOptions
- ) => Promise>;
- }): void;
- getObjectController(): {
- fetch: (
- object: ParseObject | Array,
- forceFetch: boolean,
- options: import('./RESTController').RequestOptions
- ) => Promise | ParseObject | undefined>;
- save: (
- object: ParseObject | Array | null,
- options: import('./RESTController').RequestOptions
- ) => Promise | File | undefined>;
- destroy: (
- object: ParseObject | Array,
- options: import('./RESTController').RequestOptions
- ) => Promise>;
- };
- setObjectStateController(controller: {
- getState: (obj: any) => import('./ObjectStateMutations').State | null;
- initializeState: (
- obj: any,
- initial?: import('./ObjectStateMutations').State
- ) => import('./ObjectStateMutations').State;
- removeState: (obj: any) => import('./ObjectStateMutations').State | null;
- getServerData: (obj: any) => import('./ObjectStateMutations').AttributeMap;
- setServerData: (obj: any, attributes: import('./ObjectStateMutations').AttributeMap) => void;
- getPendingOps: (obj: any) => Array;
- setPendingOp: (obj: any, attr: string, op?: ParseOp.Op) => void;
- pushPendingState: (obj: any) => void;
- popPendingState: (obj: any) => import('./ObjectStateMutations').OpsMap | undefined;
- mergeFirstPendingState: (obj: any) => void;
- getObjectCache: (obj: any) => import('./ObjectStateMutations').ObjectCache;
- estimateAttribute: (obj: any, attr: string) => any;
- estimateAttributes: (obj: any) => import('./ObjectStateMutations').AttributeMap;
- commitServerChanges: (
- obj: any,
- changes: import('./ObjectStateMutations').AttributeMap
- ) => void;
- enqueueTask: (obj: any, task: () => Promise) => Promise;
- clearAllState: () => void;
- duplicateState: (source: any, dest: any) => void;
- }): void;
- getObjectStateController(): {
- getState: (obj: any) => import('./ObjectStateMutations').State | null;
- initializeState: (
- obj: any,
- initial?: import('./ObjectStateMutations').State
- ) => import('./ObjectStateMutations').State;
- removeState: (obj: any) => import('./ObjectStateMutations').State | null;
- getServerData: (obj: any) => import('./ObjectStateMutations').AttributeMap;
- setServerData: (obj: any, attributes: import('./ObjectStateMutations').AttributeMap) => void;
- getPendingOps: (obj: any) => Array;
- setPendingOp: (obj: any, attr: string, op?: ParseOp.Op) => void;
- pushPendingState: (obj: any) => void;
- popPendingState: (obj: any) => import('./ObjectStateMutations').OpsMap | undefined;
- mergeFirstPendingState: (obj: any) => void;
- getObjectCache: (obj: any) => import('./ObjectStateMutations').ObjectCache;
- estimateAttribute: (obj: any, attr: string) => any;
- estimateAttributes: (obj: any) => import('./ObjectStateMutations').AttributeMap;
- commitServerChanges: (
- obj: any,
- changes: import('./ObjectStateMutations').AttributeMap
- ) => void;
- enqueueTask: (obj: any, task: () => Promise) => Promise;
- clearAllState: () => void;
- duplicateState: (source: any, dest: any) => void;
- };
- setPushController(controller: {
- send: (data: Push.PushData, options?: import('./RESTController').FullOptions) => Promise;
- }): void;
- getPushController(): {
- send: (data: Push.PushData, options?: import('./RESTController').FullOptions) => Promise;
- };
- setQueryController(controller: {
- find(
- className: string,
- params: import('./ParseQuery').QueryJSON,
- options: import('./RESTController').RequestOptions
- ): Promise<{
- results?: Array;
- className?: string;
- count?: number;
- }>;
- aggregate(
- className: string,
- params: any,
- options: import('./RESTController').RequestOptions
- ): Promise<{
- results?: Array;
- }>;
- }): void;
- getQueryController(): {
- find(
- className: string,
- params: import('./ParseQuery').QueryJSON,
- options: import('./RESTController').RequestOptions
- ): Promise<{
- results?: Array;
- className?: string;
- count?: number;
- }>;
- aggregate(
- className: string,
- params: any,
- options: import('./RESTController').RequestOptions
- ): Promise<{
- results?: Array;
- }>;
- };
- setRESTController(controller: {
- request: (
- method: string,
- path: string,
- data?: any,
- options?: import('./RESTController').RequestOptions
- ) => Promise;
- ajax: (
- method: string,
- url: string,
- data: any,
- headers?: any,
- options?: import('./RESTController').FullOptions
- ) => Promise;
- handleError: (
- err? /**
- * Call this method to set your LocalDatastoreStorage engine
- * If using React-Native use {@link Parse.setAsyncStorage Parse.setAsyncStorage()}
- *
- * @param {LocalDatastoreController} controller a data storage.
- * @static
- */
- : any
- ) => void;
- }): void;
- getRESTController(): {
- request: (
- method: string,
- path: string,
- data?: any,
- options?: import('./RESTController').RequestOptions
- ) => Promise;
- ajax: (
- method: string,
- url: string,
- data: any,
- headers?: any,
- options?: import('./RESTController').FullOptions
- ) => Promise;
- handleError: (
- err? /**
- * Call this method to set your LocalDatastoreStorage engine
- * If using React-Native use {@link Parse.setAsyncStorage Parse.setAsyncStorage()}
- *
- * @param {LocalDatastoreController} controller a data storage.
- * @static
- */
- : any
- ) => void;
- };
- setSchemaController(controller: {
- purge: (className: string) => Promise;
- get: (
- className: string,
- options?: import('./RESTController').RequestOptions
- ) => Promise<{
- results: Schema[];
- }>;
- delete: (
- className: string,
- options?: import('./RESTController').RequestOptions
- ) => Promise;
- create: (
- className: string,
- params: any,
- options?: import('./RESTController').RequestOptions
- ) => Promise;
- update: (
- className: string,
- params: any,
- options?: import('./RESTController').RequestOptions
- ) => Promise;
- send(
- className: string,
- method: string,
- params: any,
- options: import('./RESTController').RequestOptions
- ): Promise;
- }): void;
- getSchemaController(): {
- purge: (className: string) => Promise;
- get: (
- className: string,
- options?: import('./RESTController').RequestOptions
- ) => Promise<{
- results: Schema[];
- }>;
- delete: (
- className: string,
- options?: import('./RESTController').RequestOptions
- ) => Promise;
- create: (
- className: string,
- params: any,
- options?: import('./RESTController').RequestOptions
- ) => Promise;
- update: (
- className: string,
- params: any,
- options?: import('./RESTController').RequestOptions
- ) => Promise;
- send(
- className: string,
- method: string,
- params: any,
- options: import('./RESTController').RequestOptions
- ): Promise;
- };
- setSessionController(controller: {
- getSession: (token: import('./RESTController').RequestOptions) => Promise;
- }): void;
- getSessionController(): {
- getSession: (token: import('./RESTController').RequestOptions) => Promise;
- };
- setStorageController(
- controller:
- | {
+ Cloud: typeof Cloud;
+ CLP: typeof CLP;
+ CoreManager: {
+ get: (key: string) => any;
+ set: (key: string, value: any) => void;
+ setIfNeeded: (key: string, value: any) => any;
+ setAnalyticsController(controller: {
+ track: (name: string, dimensions: {
+ [key: string]: string;
+ }) => Promise;
+ }): void;
+ getAnalyticsController(): {
+ track: (name: string, dimensions: {
+ [key: string]: string;
+ }) => Promise;
+ };
+ setCloudController(controller: {
+ run: (name: string, data: any, options: import("./RESTController").RequestOptions) => Promise;
+ getJobsData: (options: import("./RESTController").RequestOptions) => Promise;
+ startJob: (name: string, data: any, options: import("./RESTController").RequestOptions) => Promise;
+ }): void;
+ getCloudController(): {
+ run: (name: string, data: any, options: import("./RESTController").RequestOptions) => Promise;
+ getJobsData: (options: import("./RESTController").RequestOptions) => Promise;
+ startJob: (name: string, data: any, options: import("./RESTController").RequestOptions) => Promise;
+ };
+ setConfigController(controller: {
+ current: () => Promise | Config;
+ get: (opts?: import("./RESTController").RequestOptions) => Promise;
+ save: (attrs: {
+ [key: string]: any;
+ }, masterKeyOnlyFlags?: {
+ [key: string]: any;
+ }) => Promise;
+ }): void;
+ getConfigController(): {
+ current: () => Promise | Config;
+ get: (opts?: import("./RESTController").RequestOptions) => Promise;
+ save: (attrs: {
+ [key: string]: any;
+ }, masterKeyOnlyFlags?: {
+ [key: string]: any;
+ }) => Promise;
+ };
+ setCryptoController(controller: {
+ encrypt: (obj: any, secretKey: string) => string;
+ decrypt: (encryptedText: string, secretKey: any) => string;
+ }): void;
+ getCryptoController(): {
+ encrypt: (obj: any, secretKey: string) => string;
+ decrypt: (encryptedText: string, secretKey: any) => string;
+ };
+ setEventEmitter(eventEmitter: any): void;
+ getEventEmitter(): any;
+ setFileController(controller: {
+ saveFile: (name: string, source: import("./ParseFile").FileSource, options?: import("./RESTController").FullOptions) => Promise;
+ saveBase64: (name: string, source: import("./ParseFile").FileSource, options?: import("./ParseFile").FileSaveOptions) => Promise<{
+ name: string;
+ url: string;
+ }>;
+ download: (uri: string, options?: any) => Promise<{
+ base64?: string;
+ contentType?: string;
+ }>;
+ deleteFile: (name: string, options?: {
+ useMasterKey?: boolean;
+ }) => Promise;
+ }): void;
+ setEventuallyQueue(controller: {
+ save: (object: ParseObject, serverOptions: import("./ParseObject").SaveOptions) => Promise;
+ destroy: (object: ParseObject, serverOptions: import("./RESTController").RequestOptions) => Promise;
+ poll: (ms?: number) => void;
+ }): void;
+ getEventuallyQueue(): {
+ save: (object: ParseObject, serverOptions: import("./ParseObject").SaveOptions) => Promise;
+ destroy: (object: ParseObject, serverOptions: import("./RESTController").RequestOptions) => Promise;
+ poll: (ms?: number) => void;
+ };
+ getFileController(): {
+ saveFile: (name: string, source: import("./ParseFile").FileSource, options?: import("./RESTController").FullOptions) => Promise;
+ saveBase64: (name: string, source: import("./ParseFile").FileSource, options?: import("./ParseFile").FileSaveOptions) => Promise<{
+ name: string;
+ url: string;
+ }>;
+ download: (uri: string, options?: any) => Promise<{
+ base64?: string;
+ contentType?: string;
+ }>;
+ deleteFile: (name: string, options?: {
+ useMasterKey?: boolean;
+ }) => Promise;
+ };
+ setInstallationController(controller: {
+ currentInstallationId: () => Promise;
+ currentInstallation: () => Promise;
+ updateInstallationOnDisk: (installation: Installation) => Promise;
+ }): void;
+ getInstallationController(): {
+ currentInstallationId: () => Promise;
+ currentInstallation: () => Promise;
+ updateInstallationOnDisk: (installation: Installation) => Promise;
+ };
+ setLiveQuery(liveQuery: any): void;
+ getLiveQuery(): any;
+ setObjectController(controller: {
+ fetch: (object: ParseObject | Array, forceFetch: boolean, options: import("./RESTController").RequestOptions) => Promise | ParseObject | undefined>;
+ save: (object: ParseObject | Array | null, options: import("./RESTController").RequestOptions) => Promise | File | undefined>;
+ destroy: (object: ParseObject | Array, options: import("./RESTController").RequestOptions) => Promise>;
+ }): void;
+ getObjectController(): {
+ fetch: (object: ParseObject | Array, forceFetch: boolean, options: import("./RESTController").RequestOptions) => Promise | ParseObject | undefined>;
+ save: (object: ParseObject | Array | null, options: import("./RESTController").RequestOptions) => Promise | File | undefined>;
+ destroy: (object: ParseObject | Array, options: import("./RESTController").RequestOptions) => Promise>;
+ };
+ setObjectStateController(controller: {
+ getState: (obj: any) => import("./ObjectStateMutations").State | null;
+ initializeState: (obj: any, initial?: import("./ObjectStateMutations").State) => import("./ObjectStateMutations").State;
+ removeState: (obj: any) => import("./ObjectStateMutations").State | null;
+ getServerData: (obj: any) => import("./ObjectStateMutations").AttributeMap;
+ setServerData: (obj: any, attributes: import("./ObjectStateMutations").AttributeMap) => void;
+ getPendingOps: (obj: any) => Array;
+ setPendingOp: (obj: any, attr: string, op?: ParseOp.Op) => void;
+ pushPendingState: (obj: any) => void;
+ popPendingState: (obj: any) => import("./ObjectStateMutations").OpsMap | undefined;
+ mergeFirstPendingState: (obj: any) => void;
+ getObjectCache: (obj: any) => import("./ObjectStateMutations").ObjectCache;
+ estimateAttribute: (obj: any, attr: string) => any;
+ estimateAttributes: (obj: any) => import("./ObjectStateMutations").AttributeMap;
+ commitServerChanges: (obj: any, changes: import("./ObjectStateMutations").AttributeMap) => void;
+ enqueueTask: (obj: any, task: () => Promise) => Promise;
+ clearAllState: () => void;
+ duplicateState: (source: any, dest: any) => void;
+ }): void;
+ getObjectStateController(): {
+ getState: (obj: any) => import("./ObjectStateMutations").State | null;
+ initializeState: (obj: any, initial?: import("./ObjectStateMutations").State) => import("./ObjectStateMutations").State;
+ removeState: (obj: any) => import("./ObjectStateMutations").State | null;
+ getServerData: (obj: any) => import("./ObjectStateMutations").AttributeMap;
+ setServerData: (obj: any, attributes: import("./ObjectStateMutations").AttributeMap) => void;
+ getPendingOps: (obj: any) => Array;
+ setPendingOp: (obj: any, attr: string, op?: ParseOp.Op) => void;
+ pushPendingState: (obj: any) => void;
+ popPendingState: (obj: any) => import("./ObjectStateMutations").OpsMap | undefined;
+ mergeFirstPendingState: (obj: any) => void;
+ getObjectCache: (obj: any) => import("./ObjectStateMutations").ObjectCache;
+ estimateAttribute: (obj: any, attr: string) => any;
+ estimateAttributes: (obj: any) => import("./ObjectStateMutations").AttributeMap;
+ commitServerChanges: (obj: any, changes: import("./ObjectStateMutations").AttributeMap) => void;
+ enqueueTask: (obj: any, task: () => Promise) => Promise;
+ clearAllState: () => void;
+ duplicateState: (source: any, dest: any) => void;
+ };
+ setPushController(controller: {
+ send: (data: Push.PushData, options?: import("./RESTController").FullOptions) => Promise;
+ }): void;
+ getPushController(): {
+ send: (data: Push.PushData, options?: import("./RESTController").FullOptions) => Promise;
+ };
+ setQueryController(controller: {
+ find(className: string, params: import("./ParseQuery").QueryJSON, options: import("./RESTController").RequestOptions): Promise<{
+ results?: Array;
+ className?: string;
+ count?: number;
+ }>;
+ aggregate(className: string, params: any, options: import("./RESTController").RequestOptions): Promise<{
+ results?: Array;
+ }>;
+ }): void;
+ getQueryController(): {
+ find(className: string, params: import("./ParseQuery").QueryJSON, options: import("./RESTController").RequestOptions): Promise<{
+ results?: Array;
+ className?: string;
+ count?: number;
+ }>;
+ aggregate(className: string, params: any, options: import("./RESTController").RequestOptions): Promise<{
+ results?: Array;
+ }>;
+ };
+ setRESTController(controller: {
+ request: (method: string, path: string, data?: any, options?: import("./RESTController").RequestOptions) => Promise;
+ ajax: (method: string, url: string, data: any, headers?: any, options?: import("./RESTController").FullOptions) => Promise;
+ handleError: (err
+ /**
+ * Call this method to set your LocalDatastoreStorage engine
+ * If using React-Native use {@link Parse.setAsyncStorage Parse.setAsyncStorage()}
+ *
+ * @param {LocalDatastoreController} controller a data storage.
+ * @static
+ */
+ ?: any) => void;
+ }): void;
+ getRESTController(): {
+ request: (method: string, path: string, data?: any, options?: import("./RESTController").RequestOptions) => Promise;
+ ajax: (method: string, url: string, data: any, headers?: any, options?: import("./RESTController").FullOptions) => Promise;
+ handleError: (err
+ /**
+ * Call this method to set your LocalDatastoreStorage engine
+ * If using React-Native use {@link Parse.setAsyncStorage Parse.setAsyncStorage()}
+ *
+ * @param {LocalDatastoreController} controller a data storage.
+ * @static
+ */
+ ?: any) => void;
+ };
+ setSchemaController(controller: {
+ purge: (className: string) => Promise;
+ get: (className: string, options?: import("./RESTController").RequestOptions) => Promise<{
+ results: Schema[];
+ }>;
+ delete: (className: string, options?: import("./RESTController").RequestOptions) => Promise;
+ create: (className: string, params: any, options?: import("./RESTController").RequestOptions) => Promise;
+ update: (className: string, params: any, options?: import("./RESTController").RequestOptions) => Promise;
+ send(className: string, method: string, params: any, options: import("./RESTController").RequestOptions): Promise;
+ }): void;
+ getSchemaController(): {
+ purge: (className: string) => Promise;
+ get: (className: string, options?: import("./RESTController").RequestOptions) => Promise<{
+ results: Schema[];
+ }>;
+ delete: (className: string, options?: import("./RESTController").RequestOptions) => Promise;
+ create: (className: string, params: any, options?: import("./RESTController").RequestOptions) => Promise;
+ update: (className: string, params: any, options?: import("./RESTController").RequestOptions) => Promise;
+ send(className: string, method: string, params: any, options: import("./RESTController").RequestOptions): Promise;
+ };
+ setSessionController(controller: {
+ getSession: (token: import("./RESTController").RequestOptions) => Promise;
+ }): void;
+ getSessionController(): {
+ getSession: (token: import("./RESTController").RequestOptions) => Promise;
+ };
+ setStorageController(controller: {
async: 0;
getItem: (path: string) => string | null;
setItem: (path: string, value: string) => void;
@@ -460,8 +280,7 @@ declare const Parse: {
clear: () => void;
getAllKeys?: () => Array;
getAllKeysAsync?: () => Promise>;
- }
- | {
+ } | {
async: 1;
getItem?: (path: string) => string | null;
setItem?: (path: string, value: string) => void;
@@ -472,476 +291,361 @@ declare const Parse: {
clear: () => void;
getAllKeys?: () => Array;
getAllKeysAsync?: () => Promise>;
- }
- ): void;
- setLocalDatastoreController(controller: {
- fromPinWithName: (name: string) => any | undefined;
- pinWithName: (name: string, objects: any) => void;
- unPinWithName: (name: string) => void;
- getAllContents: () => any | undefined;
- clear: () => void;
- }): void;
- getLocalDatastoreController(): {
- fromPinWithName: (name: string) => any | undefined;
- pinWithName: (name: string, objects: any) => void;
- unPinWithName: (name: string) => void;
- getAllContents: () => any | undefined;
- clear: () => void;
- };
- setLocalDatastore(store: any): void;
- getLocalDatastore(): any;
- getStorageController():
- | {
- async: 0;
- getItem: (path: string) => string | null;
- setItem: (path: string, value: string) => void;
- removeItem: (path: string) => void;
- getItemAsync?: (path: string) => Promise;
- setItemAsync?: (path: string, value: string) => Promise;
- removeItemAsync?: (path: string) => Promise;
- clear: () => void;
- getAllKeys?: () => Array;
- getAllKeysAsync?: () => Promise>;
- }
- | {
- async: 1;
- getItem?: (path: string) => string | null;
- setItem?: (path: string, value: string) => void;
- removeItem?: (path: string) => void;
- getItemAsync: (path: string) => Promise;
- setItemAsync: (path: string, value: string) => Promise;
- removeItemAsync: (path: string) => Promise;
- clear: () => void;
- getAllKeys?: () => Array;
- getAllKeysAsync?: () => Promise>;
+ }): void;
+ setLocalDatastoreController(controller: {
+ fromPinWithName: (name: string) => any | undefined;
+ pinWithName: (name: string, objects: any) => void;
+ unPinWithName: (name: string) => void;
+ getAllContents: () => any | undefined;
+ clear: () => void;
+ }): void;
+ getLocalDatastoreController(): {
+ fromPinWithName: (name: string) => any | undefined;
+ pinWithName: (name: string, objects: any) => void;
+ unPinWithName: (name: string) => void;
+ getAllContents: () => any | undefined;
+ clear: () => void;
+ };
+ setLocalDatastore(store: any): void;
+ getLocalDatastore(): any;
+ getStorageController(): {
+ async: 0;
+ getItem: (path: string) => string | null;
+ setItem: (path: string, value: string) => void;
+ removeItem: (path: string) => void;
+ getItemAsync?: (path: string) => Promise;
+ setItemAsync?: (path: string, value: string) => Promise;
+ removeItemAsync?: (path: string) => Promise;
+ clear: () => void;
+ getAllKeys?: () => Array;
+ getAllKeysAsync?: () => Promise>;
+ } | {
+ async: 1;
+ getItem?: (path: string) => string | null;
+ setItem?: (path: string, value: string) => void;
+ removeItem?: (path: string) => void;
+ getItemAsync: (path: string) => Promise;
+ setItemAsync: (path: string, value: string) => Promise;
+ removeItemAsync: (path: string) => Promise;
+ clear: () => void;
+ getAllKeys?: () => Array;
+ getAllKeysAsync?: () => Promise>;
+ };
+ setAsyncStorage(storage: {
+ getItem: (key: string, callback?: (error?: Error | null, result?: string | null) => void) => Promise;
+ setItem: (key: string, value: string, callback?: (error?: Error | null) => void) => Promise;
+ removeItem: (key: string, callback?: (error?: Error | null) => void) => Promise;
+ mergeItem: (key: string, value: string, callback?: (error?: Error | null) => void) => Promise;
+ clear: (callback?: (error?: Error | null) => void) => Promise;
+ getAllKeys: (callback?: (error?: Error | null, result?: readonly string[] | null) => void) => Promise;
+ multiGet: (keys: readonly string[], callback?: (errors?: readonly (Error | null)[] | null, result?: readonly [string, string][]) => void) => Promise;
+ multiSet: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise;
+ multiRemove: (keys: readonly string[], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise;
+ multiMerge: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise;
+ }): void;
+ getAsyncStorage(): {
+ getItem: (key: string, callback?: (error?: Error | null, result?: string | null) => void) => Promise;
+ setItem: (key: string, value: string, callback?: (error?: Error | null) => void) => Promise;
+ removeItem: (key: string, callback?: (error?: Error | null) => void) => Promise;
+ mergeItem: (key: string, value: string, callback?: (error?: Error | null) => void) => Promise;
+ clear: (callback?: (error?: Error | null) => void) => Promise;
+ getAllKeys: (callback?: (error?: Error | null, result?: readonly string[] | null) => void) => Promise;
+ multiGet: (keys: readonly string[], callback?: (errors?: readonly (Error | null)[] | null, result?: readonly [string, string][]) => void) => Promise;
+ multiSet: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise;
+ multiRemove: (keys: readonly string[], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise;
+ multiMerge: (keyValuePairs: [string, string][], callback?: (errors?: readonly (Error | null)[] | null) => void) => Promise;
+ };
+ setWebSocketController(controller: new (url: string | URL, protocols?: string | string[] | undefined) => import("./CoreManager").WebSocketController): void;
+ getWebSocketController(): new (url: string | URL, protocols?: string | string[] | undefined) => import("./CoreManager").WebSocketController;
+ setUserController(controller: {
+ setCurrentUser: (user: User) => Promise;
+ currentUser: () => User | null;
+ currentUserAsync: () => Promise