|
1 |
| -export {}; |
| 1 | +// @ts-nocheck |
| 2 | +export default CoreManager; |
| 3 | +declare namespace CoreManager { |
| 4 | + function get(key: string): any; |
| 5 | + function set(key: string, value: any): void; |
| 6 | + function setAnalyticsController(controller: AnalyticsController): void; |
| 7 | + function getAnalyticsController(): AnalyticsController; |
| 8 | + function setCloudController(controller: CloudController): void; |
| 9 | + function getCloudController(): CloudController; |
| 10 | + function setConfigController(controller: ConfigController): void; |
| 11 | + function getConfigController(): ConfigController; |
| 12 | + function setCryptoController(controller: CryptoController): void; |
| 13 | + function getCryptoController(): CryptoController; |
| 14 | + function setFileController(controller: FileController): void; |
| 15 | + function getFileController(): FileController; |
| 16 | + function setInstallationController(controller: InstallationController): void; |
| 17 | + function getInstallationController(): InstallationController; |
| 18 | + function setObjectController(controller: ObjectController): void; |
| 19 | + function getObjectController(): ObjectController; |
| 20 | + function setObjectStateController(controller: ObjectStateController): void; |
| 21 | + function getObjectStateController(): ObjectStateController; |
| 22 | + function setPushController(controller: PushController): void; |
| 23 | + function getPushController(): PushController; |
| 24 | + function setQueryController(controller: QueryController): void; |
| 25 | + function getQueryController(): QueryController; |
| 26 | + function setRESTController(controller: RESTController): void; |
| 27 | + function getRESTController(): RESTController; |
| 28 | + function setSchemaController(controller: SchemaController): void; |
| 29 | + function getSchemaController(): SchemaController; |
| 30 | + function setSessionController(controller: SessionController): void; |
| 31 | + function getSessionController(): SessionController; |
| 32 | + function setStorageController(controller: StorageController): void; |
| 33 | + function setLocalDatastoreController(controller: LocalDatastoreController): void; |
| 34 | + function getLocalDatastoreController(): LocalDatastoreController; |
| 35 | + function setLocalDatastore(store: any): void; |
| 36 | + function getLocalDatastore(): mixed; |
| 37 | + function getStorageController(): StorageController; |
| 38 | + function setAsyncStorage(storage: any): void; |
| 39 | + function getAsyncStorage(): mixed; |
| 40 | + function setWebSocketController(controller: WebSocketController): void; |
| 41 | + function getWebSocketController(): WebSocketController; |
| 42 | + function setUserController(controller: UserController): void; |
| 43 | + function getUserController(): UserController; |
| 44 | + function setLiveQueryController(controller: any): void; |
| 45 | + function getLiveQueryController(): any; |
| 46 | + function setHooksController(controller: HooksController): void; |
| 47 | + function getHooksController(): HooksController; |
| 48 | +} |
| 49 | +type AnalyticsController = { |
| 50 | + track: (name: string, dimensions: { |
| 51 | + [key: string]: string; |
| 52 | + }) => Promise<any>; |
| 53 | +}; |
| 54 | +type CloudController = { |
| 55 | + run: (name: string, data: mixed, options: RequestOptions) => Promise<any>; |
| 56 | + getJobsData: (options: RequestOptions) => Promise<any>; |
| 57 | + startJob: (name: string, data: mixed, options: RequestOptions) => Promise<any>; |
| 58 | +}; |
| 59 | +type ConfigController = { |
| 60 | + current: () => Promise<any>; |
| 61 | + get: () => Promise<any>; |
| 62 | + save: (attrs: { |
| 63 | + [key: string]: any; |
| 64 | + }) => Promise<any>; |
| 65 | +}; |
| 66 | +type CryptoController = { |
| 67 | + encrypt: (obj: any, secretKey: string) => string; |
| 68 | + decrypt: (encryptedText: string, secretKey: any) => string; |
| 69 | +}; |
| 70 | +type FileController = { |
| 71 | + saveFile: (name: string, source: FileSource, options: FullOptions) => Promise<any>; |
| 72 | + saveBase64: (name: string, source: FileSource, options: FullOptions) => Promise<any>; |
| 73 | + download: (uri: string) => Promise<any>; |
| 74 | +}; |
| 75 | +type InstallationController = { |
| 76 | + currentInstallationId: () => Promise<any>; |
| 77 | +}; |
| 78 | +type ObjectController = { |
| 79 | + fetch: (object: ParseObject | ParseObject[], forceFetch: boolean, options: RequestOptions) => Promise<any>; |
| 80 | + save: (object: ParseObject | (ParseFile | ParseObject)[], options: RequestOptions) => Promise<any>; |
| 81 | + destroy: (object: ParseObject | ParseObject[], options: RequestOptions) => Promise<any>; |
| 82 | +}; |
| 83 | +type ObjectStateController = { |
| 84 | + getState: (obj: any) => State; |
| 85 | + initializeState: (obj: any, initial?: State) => State; |
| 86 | + removeState: (obj: any) => State; |
| 87 | + getServerData: (obj: any) => AttributeMap; |
| 88 | + setServerData: (obj: any, attributes: AttributeMap) => void; |
| 89 | + getPendingOps: (obj: any) => OpsMap[]; |
| 90 | + setPendingOp: (obj: any, attr: string, op: Op) => void; |
| 91 | + pushPendingState: (obj: any) => void; |
| 92 | + popPendingState: (obj: any) => OpsMap; |
| 93 | + mergeFirstPendingState: (obj: any) => void; |
| 94 | + getObjectCache: (obj: any) => ObjectCache; |
| 95 | + estimateAttribute: (obj: any, attr: string) => mixed; |
| 96 | + estimateAttributes: (obj: any) => AttributeMap; |
| 97 | + commitServerChanges: (obj: any, changes: AttributeMap) => void; |
| 98 | + enqueueTask: (obj: any, task: () => Promise<any>) => Promise<any>; |
| 99 | + clearAllState: () => void; |
| 100 | + duplicateState: (source: any, dest: any) => void; |
| 101 | +}; |
| 102 | +type PushController = { |
| 103 | + send: (data: PushData) => Promise<any>; |
| 104 | +}; |
| 105 | +type QueryController = { |
| 106 | + find: (className: string, params: QueryJSON, options: RequestOptions) => Promise<any>; |
| 107 | + aggregate: (className: string, params: any, options: RequestOptions) => Promise<any>; |
| 108 | +}; |
| 109 | +type RESTController = { |
| 110 | + request: (method: string, path: string, data: mixed, options: RequestOptions) => Promise<any>; |
| 111 | + ajax: (method: string, url: string, data: any, headers?: any, options: FullOptions) => Promise<any>; |
| 112 | +}; |
| 113 | +type SchemaController = { |
| 114 | + purge: (className: string) => Promise<any>; |
| 115 | + get: (className: string, options: RequestOptions) => Promise<any>; |
| 116 | + delete: (className: string, options: RequestOptions) => Promise<any>; |
| 117 | + create: (className: string, params: any, options: RequestOptions) => Promise<any>; |
| 118 | + update: (className: string, params: any, options: RequestOptions) => Promise<any>; |
| 119 | + send(className: string, method: string, params: any, options: RequestOptions): Promise<any>; |
| 120 | +}; |
| 121 | +type SessionController = { |
| 122 | + getSession: (token: RequestOptions) => Promise<any>; |
| 123 | +}; |
| 124 | +type StorageController = { |
| 125 | + async: 0; |
| 126 | + getItem: (path: string) => string; |
| 127 | + setItem: (path: string, value: string) => void; |
| 128 | + removeItem: (path: string) => void; |
| 129 | + getItemAsync?: (path: string) => Promise<any>; |
| 130 | + setItemAsync?: (path: string, value: string) => Promise<any>; |
| 131 | + removeItemAsync?: (path: string) => Promise<any>; |
| 132 | + clear: () => void; |
| 133 | +} | { |
| 134 | + async: 1; |
| 135 | + getItem?: (path: string) => string; |
| 136 | + setItem?: (path: string, value: string) => void; |
| 137 | + removeItem?: (path: string) => void; |
| 138 | + getItemAsync: (path: string) => Promise<any>; |
| 139 | + setItemAsync: (path: string, value: string) => Promise<any>; |
| 140 | + removeItemAsync: (path: string) => Promise<any>; |
| 141 | + clear: () => void; |
| 142 | +}; |
| 143 | +type LocalDatastoreController = { |
| 144 | + fromPinWithName: (name: string) => any; |
| 145 | + pinWithName: (name: string, objects: any) => void; |
| 146 | + unPinWithName: (name: string) => void; |
| 147 | + getAllContents: () => any; |
| 148 | + clear: () => void; |
| 149 | +}; |
| 150 | +type WebSocketController = { |
| 151 | + onopen: () => void; |
| 152 | + onmessage: (message: any) => void; |
| 153 | + onclose: () => void; |
| 154 | + onerror: (error: any) => void; |
| 155 | + send: (data: any) => void; |
| 156 | + close: () => void; |
| 157 | +}; |
| 158 | +type UserController = { |
| 159 | + setCurrentUser: (user: ParseUser) => Promise<any>; |
| 160 | + currentUser: () => ParseUser; |
| 161 | + currentUserAsync: () => Promise<any>; |
| 162 | + signUp: (user: ParseUser, attrs: AttributeMap, options: RequestOptions) => Promise<any>; |
| 163 | + logIn: (user: ParseUser, options: RequestOptions) => Promise<any>; |
| 164 | + become: (options: RequestOptions) => Promise<any>; |
| 165 | + hydrate: (userJSON: AttributeMap) => Promise<any>; |
| 166 | + logOut: (options: RequestOptions) => Promise<any>; |
| 167 | + me: (options: RequestOptions) => Promise<any>; |
| 168 | + requestPasswordReset: (email: string, options: RequestOptions) => Promise<any>; |
| 169 | + updateUserOnDisk: (user: ParseUser) => Promise<any>; |
| 170 | + upgradeToRevocableSession: (user: ParseUser, options: RequestOptions) => Promise<any>; |
| 171 | + linkWith: (user: ParseUser, authData: { |
| 172 | + [key: string]: mixed; |
| 173 | + }) => Promise<any>; |
| 174 | + removeUserFromDisk: () => Promise<any>; |
| 175 | + verifyPassword: (username: string, password: string, options: RequestOptions) => Promise<any>; |
| 176 | + requestEmailVerification: (email: string, options: RequestOptions) => Promise<any>; |
| 177 | +}; |
| 178 | +type HooksController = { |
| 179 | + get: (type: string, functionName?: string, triggerName?: string) => Promise<any>; |
| 180 | + create: (hook: mixed) => Promise<any>; |
| 181 | + delete: (hook: mixed) => Promise<any>; |
| 182 | + update: (hook: mixed) => Promise<any>; |
| 183 | + send: (method: string, path: string, body?: mixed) => Promise<any>; |
| 184 | +}; |
0 commit comments