Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 91 additions & 1 deletion src/Parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,97 @@ import StorageController from './StorageController';
import WebSocketController from './WebSocketController';
import type { EventuallyQueue } from './CoreManager';

const Parse = {
/**
* The interface for the Parse SDK.
* This interface can be augmented in build-specific type definitions (e.g., node.d.ts)
* to provide environment-specific type signatures.
*/
export interface Parse {
ACL: typeof ACL;
Analytics: typeof Analytics;
AnonymousUtils: typeof AnonymousUtils;
Cloud: typeof Cloud;
CLP: typeof CLP;
CoreManager: typeof CoreManager;
Config: typeof Config;
Error: typeof ParseError;
FacebookUtils: typeof FacebookUtils;
File: typeof File;
GeoPoint: typeof GeoPoint;
Polygon: typeof Polygon;
Installation: typeof Installation;
LocalDatastore: typeof LocalDatastore;
Object: typeof ParseObject;
Op: {
Set: typeof ParseOp.SetOp;
Unset: typeof ParseOp.UnsetOp;
Increment: typeof ParseOp.IncrementOp;
Add: typeof ParseOp.AddOp;
Remove: typeof ParseOp.RemoveOp;
AddUnique: typeof ParseOp.AddUniqueOp;
Relation: typeof ParseOp.RelationOp;
};
Push: typeof Push;
Query: typeof Query;
Relation: typeof Relation;
Role: typeof Role;
Schema: typeof Schema;
Session: typeof Session;
Storage: typeof Storage;
User: typeof User;
LiveQueryClient: typeof LiveQueryClient;
IndexedDB: any;
Hooks: any;
Parse: any;

EventuallyQueue: EventuallyQueue;

/**
* Call this method first to set up your authentication tokens for Parse.
*
* @param applicationId Your Parse Application ID.
* @param javaScriptKey Your Parse JavaScript Key (Not needed for parse-server)
*/
initialize(applicationId: string, javaScriptKey: string): void;

_initialize(
applicationId: string,
javaScriptKey: string,
masterKey?: string,
maintenanceKey?: string
): void;

setAsyncStorage(storage: any): void;
setLocalDatastoreController(controller: any): void;
getServerHealth(): Promise<any>;

applicationId: string | undefined;
javaScriptKey: string | undefined;
masterKey: string | undefined;
maintenanceKey: string | undefined;
serverURL: string | undefined;
LiveQuery: ParseLiveQuery;
liveQueryServerURL: string | undefined;
encryptedUser: boolean;
secret: string | undefined;
idempotency: boolean | undefined;
allowCustomObjectId: boolean | undefined;
nodeLogging: boolean | undefined;

_request(...args: any[]): Promise<any>;
_ajax(...args: any[]): Promise<any>;
_decode(_: any, value: any): any;
_encode(value: any, _: any, disallowObjects?: boolean): any;
_getInstallationId(): Promise<string>;

enableLocalDatastore(polling?: boolean, ms?: number): void;
isLocalDatastoreEnabled(): boolean;
dumpLocalDatastore(): Promise<any>;
enableEncryptedUser(): void;
isEncryptedUserEnabled(): boolean;
}

const Parse: Parse = {
ACL,
Analytics,
AnonymousUtils,
Expand Down
Loading