Skip to content

Commit d8c9f55

Browse files
committed
fix conflict
1 parent 9ea3db1 commit d8c9f55

File tree

3 files changed

+38
-10
lines changed

3 files changed

+38
-10
lines changed

src/CoreManager.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,17 @@ export interface ConfigController {
2929
get: (opts?: RequestOptions) => Promise<ParseConfig>;
3030
save: (attrs: Record<string, any>, masterKeyOnlyFlags?: Record<string, any>) => Promise<void>;
3131
}
32-
export interface CryptoController {
33-
encrypt: (obj: any, secretKey: string) => string;
34-
decrypt: (encryptedText: string, secretKey: any) => string;
35-
}
32+
type CryptoController =
33+
| {
34+
async: 0;
35+
encrypt: (json: any, parseSecret: any) => string;
36+
decrypt: (encryptedJSON: string, secretKey: any) => string;
37+
}
38+
| {
39+
async: 1;
40+
encrypt: (json: any, parseSecret: any) => Promise<string>;
41+
decrypt: (encryptedJSON: string, secretKey: any) => Promise<string>;
42+
};
3643
export interface FileController {
3744
saveFile: (name: string, source: FileSource, options?: FullOptions) => Promise<any>;
3845
saveBase64: (

types/CoreManager.d.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@ export interface ConfigController {
2828
get: (opts?: RequestOptions) => Promise<ParseConfig>;
2929
save: (attrs: Record<string, any>, masterKeyOnlyFlags?: Record<string, any>) => Promise<void>;
3030
}
31-
export interface CryptoController {
32-
encrypt: (obj: any, secretKey: string) => string;
33-
decrypt: (encryptedText: string, secretKey: any) => string;
34-
}
31+
type CryptoController = {
32+
async: 0;
33+
encrypt: (json: any, parseSecret: any) => string;
34+
decrypt: (encryptedJSON: string, secretKey: any) => string;
35+
} | {
36+
async: 1;
37+
encrypt: (json: any, parseSecret: any) => Promise<string>;
38+
decrypt: (encryptedJSON: string, secretKey: any) => Promise<string>;
39+
};
3540
export interface FileController {
3641
saveFile: (name: string, source: FileSource, options?: FullOptions) => Promise<any>;
3742
saveBase64: (name: string, source: FileSource, options?: FileSaveOptions) => Promise<{

types/Parse.d.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,24 @@ declare const Parse: {
5050
getCloudController(): import("./CoreManager").CloudController;
5151
setConfigController(controller: import("./CoreManager").ConfigController): void;
5252
getConfigController(): import("./CoreManager").ConfigController;
53-
setCryptoController(controller: import("./CoreManager").CryptoController): void;
54-
getCryptoController(): import("./CoreManager").CryptoController;
53+
setCryptoController(controller: {
54+
async: 0;
55+
encrypt: (json: any, parseSecret: any) => string;
56+
decrypt: (encryptedJSON: string, secretKey: any) => string;
57+
} | {
58+
async: 1;
59+
encrypt: (json: any, parseSecret: any) => Promise<string>;
60+
decrypt: (encryptedJSON: string, secretKey: any) => Promise<string>;
61+
}): void;
62+
getCryptoController(): {
63+
async: 0;
64+
encrypt: (json: any, parseSecret: any) => string;
65+
decrypt: (encryptedJSON: string, secretKey: any) => string;
66+
} | {
67+
async: 1;
68+
encrypt: (json: any, parseSecret: any) => Promise<string>;
69+
decrypt: (encryptedJSON: string, secretKey: any) => Promise<string>;
70+
};
5571
setEventEmitter(eventEmitter: any): void;
5672
getEventEmitter(): any;
5773
setFileController(controller: import("./CoreManager").FileController): void;

0 commit comments

Comments
 (0)