-
-
Notifications
You must be signed in to change notification settings - Fork 595
/
Copy pathParseConfig.d.ts
69 lines (69 loc) · 2.34 KB
/
ParseConfig.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import type { RequestOptions } from './RESTController';
/**
* Parse.Config is a local representation of configuration data that
* can be set from the Parse dashboard.
*
* @alias Parse.Config
*/
declare class ParseConfig {
attributes: Record<string, any>;
_escapedAttributes: Record<string, any>;
constructor();
/**
* Gets the value of an attribute.
*
* @param {string} attr The name of an attribute.
* @returns {*}
*/
get(attr: string): any;
/**
* Gets the HTML-escaped value of an attribute.
*
* @param {string} attr The name of an attribute.
* @returns {string}
*/
escape(attr: string): string;
/**
* Retrieves the most recently-fetched configuration object, either from
* memory or from local storage if necessary.
*
* @static
* @returns {Parse.Config} The most recently-fetched Parse.Config if it
* exists, else an empty Parse.Config.
*/
static current(): ParseConfig | Promise<ParseConfig>;
/**
* Gets a new configuration object from the server.
*
* @static
* @param {object} options
* Valid options are:<ul>
* <li>useMasterKey: In Cloud Code and Node only, causes the Master Key to
* be used for this request.
* </ul>
* @returns {Promise} A promise that is resolved with a newly-created
* configuration object when the get completes.
*/
static get(options?: RequestOptions): Promise<ParseConfig>;
/**
* Save value keys to the server.
*
* @static
* @param {object} attrs The config parameters and values.
* @param {object} masterKeyOnlyFlags The flags that define whether config parameters listed
* in `attrs` should be retrievable only by using the master key.
* For example: `param1: true` makes `param1` only retrievable by using the master key.
* If a parameter is not provided or set to `false`, it can be retrieved without
* using the master key.
* @returns {Promise} A promise that is resolved with a newly-created
* configuration object or with the current with the update.
*/
static save(attrs: Record<string, any>, masterKeyOnlyFlags: Record<string, any>): Promise<ParseConfig>;
/**
* Used for testing
*
* @private
*/
static _clearCache(): void;
}
export default ParseConfig;