Skip to content

Commit 87195ab

Browse files
authored
refactor: Add ability to watch typescript definition changes (#2489)
1 parent e7d12ae commit 87195ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+5596
-6280
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
},
9898
"scripts": {
9999
"build": "node build_releases.js",
100-
"build:types": "tsc && prettier --write 'types/{**/*,*}.ts'",
100+
"build:types": "tsc",
101101
"ci:typecheck": "node ./ci/typecheck.js",
102102
"release": "node build_releases.js && npm publish",
103103
"test": "cross-env PARSE_BUILD=node jest",
@@ -111,6 +111,7 @@
111111
"watch:browser": "cross-env PARSE_BUILD=browser npm run watch",
112112
"watch:node": "cross-env PARSE_BUILD=node npm run watch",
113113
"watch:react-native": "cross-env PARSE_BUILD=react-native npm run watch",
114+
"watch:ts": "tsc --watch",
114115
"integration": "cross-env TESTING=1 jasmine --config=jasmine.json",
115116
"docs": "jsdoc -c ./jsdoc-conf.json ./src",
116117
"madge:circular": "madge ./src --extensions js,ts --circular",

types/Analytics.d.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737
* @returns {Promise} A promise that is resolved when the round-trip
3838
* to the server completes.
3939
*/
40-
export declare function track(
41-
name: string,
42-
dimensions: {
40+
export declare function track(name: string, dimensions: {
4341
[key: string]: string;
44-
}
45-
): Promise<void>;
42+
}): Promise<void>;

types/AnonymousUtils.d.ts

+50-50
Original file line numberDiff line numberDiff line change
@@ -29,56 +29,56 @@ import type { RequestOptions } from './RESTController';
2929
* @static
3030
*/
3131
declare const AnonymousUtils: {
32-
/**
33-
* Gets whether the user has their account linked to anonymous user.
34-
*
35-
* @function isLinked
36-
* @name Parse.AnonymousUtils.isLinked
37-
* @param {Parse.User} user User to check for.
38-
* The user must be logged in on this device.
39-
* @returns {boolean} <code>true</code> if the user has their account
40-
* linked to an anonymous user.
41-
* @static
42-
*/
43-
isLinked(user: ParseUser): boolean;
44-
/**
45-
* Logs in a user Anonymously.
46-
*
47-
* @function logIn
48-
* @name Parse.AnonymousUtils.logIn
49-
* @param {object} options MasterKey / SessionToken.
50-
* @returns {Promise} Logged in user
51-
* @static
52-
*/
53-
logIn(options?: RequestOptions): Promise<ParseUser>;
54-
/**
55-
* Links Anonymous User to an existing PFUser.
56-
*
57-
* @function link
58-
* @name Parse.AnonymousUtils.link
59-
* @param {Parse.User} user User to link. This must be the current user.
60-
* @param {object} options MasterKey / SessionToken.
61-
* @returns {Promise} Linked with User
62-
* @static
63-
*/
64-
link(user: ParseUser, options?: RequestOptions): Promise<ParseUser>;
65-
/**
66-
* Returns true if Authentication Provider has been registered for use.
67-
*
68-
* @function isRegistered
69-
* @name Parse.AnonymousUtils.isRegistered
70-
* @returns {boolean}
71-
* @static
72-
*/
73-
isRegistered(): boolean;
74-
_getAuthProvider(): {
75-
restoreAuthentication(): boolean;
76-
getAuthType(): string;
77-
getAuthData(): {
78-
authData: {
79-
id: string;
80-
};
32+
/**
33+
* Gets whether the user has their account linked to anonymous user.
34+
*
35+
* @function isLinked
36+
* @name Parse.AnonymousUtils.isLinked
37+
* @param {Parse.User} user User to check for.
38+
* The user must be logged in on this device.
39+
* @returns {boolean} <code>true</code> if the user has their account
40+
* linked to an anonymous user.
41+
* @static
42+
*/
43+
isLinked(user: ParseUser): boolean;
44+
/**
45+
* Logs in a user Anonymously.
46+
*
47+
* @function logIn
48+
* @name Parse.AnonymousUtils.logIn
49+
* @param {object} options MasterKey / SessionToken.
50+
* @returns {Promise} Logged in user
51+
* @static
52+
*/
53+
logIn(options?: RequestOptions): Promise<ParseUser>;
54+
/**
55+
* Links Anonymous User to an existing PFUser.
56+
*
57+
* @function link
58+
* @name Parse.AnonymousUtils.link
59+
* @param {Parse.User} user User to link. This must be the current user.
60+
* @param {object} options MasterKey / SessionToken.
61+
* @returns {Promise} Linked with User
62+
* @static
63+
*/
64+
link(user: ParseUser, options?: RequestOptions): Promise<ParseUser>;
65+
/**
66+
* Returns true if Authentication Provider has been registered for use.
67+
*
68+
* @function isRegistered
69+
* @name Parse.AnonymousUtils.isRegistered
70+
* @returns {boolean}
71+
* @static
72+
*/
73+
isRegistered(): boolean;
74+
_getAuthProvider(): {
75+
restoreAuthentication(): boolean;
76+
getAuthType(): string;
77+
getAuthData(): {
78+
authData: {
79+
id: string;
80+
};
81+
};
8182
};
82-
};
8383
};
8484
export default AnonymousUtils;

types/Cloud.d.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,10 @@ import type { RequestOptions } from './RESTController';
3030
* @returns {Promise} A promise that will be resolved with the result
3131
* of the function.
3232
*/
33-
export declare function run<T extends () => any>(
34-
name: string,
35-
data?: null,
36-
options?: RequestOptions
37-
): Promise<ReturnType<T>>;
38-
export declare function run<
39-
T extends (param: {
33+
export declare function run<T extends () => any>(name: string, data?: null, options?: RequestOptions): Promise<ReturnType<T>>;
34+
export declare function run<T extends (param: {
4035
[P in keyof Parameters<T>[0]]: Parameters<T>[0][P];
41-
}) => any,
42-
>(name: string, data: Parameters<T>[0], options?: RequestOptions): Promise<ReturnType<T>>;
36+
}) => any>(name: string, data: Parameters<T>[0], options?: RequestOptions): Promise<ReturnType<T>>;
4337
/**
4438
* Gets data for the current set of cloud jobs.
4539
*

0 commit comments

Comments
 (0)