*
* @alias Parse.Schema
*/
declare class ParseSchema {
className: string;
_fields: Record;
_indexes: Record;
_clp: Record;
/**
* @param {string} className Parse Class string.
*/
constructor(className: string);
/**
* Static method to get all schemas
*
* @returns {Promise} A promise that is resolved with the result when
* the query completes.
*/
static all(): Promise;
/**
* Get the Schema from Parse
*
* @returns {Promise} A promise that is resolved with the result when
* the query completes.
*/
get(): Promise;
/**
* Create a new Schema on Parse
*
* @returns {Promise} A promise that is resolved with the result when
* the query completes.
*/
save(): Promise;
/**
* Update a Schema on Parse
*
* @returns {Promise} A promise that is resolved with the result when
* the query completes.
*/
update(): Promise;
/**
* Removing a Schema from Parse
* Can only be used on Schema without objects
*
* @returns {Promise} A promise that is resolved with the result when
* the query completes.
*/
delete(): Promise;
/**
* Removes all objects from a Schema (class) in Parse.
* EXERCISE CAUTION, running this will delete all objects for this schema and cannot be reversed
*
* @returns {Promise} A promise that is resolved with the result when
* the query completes.
*/
purge(): Promise;
/**
* Assert if ClassName has been filled
*
* @private
*/
assertClassName(): void;
/**
* Sets Class Level Permissions when creating / updating a Schema.
* EXERCISE CAUTION, running this may override CLP for this schema and cannot be reversed
*
* @param {object | Parse.CLP} clp Class Level Permissions
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
setCLP(clp: PermissionsMap | ParseCLP): this;
/**
* Adding a Field to Create / Update a Schema
*
* @param {string} name Name of the field that will be created on Parse
* @param {string} type Can be a (String|Number|Boolean|Date|Parse.File|Parse.GeoPoint|Array|Object|Pointer|Parse.Relation)
* @param {object} options
* Valid options are:
*
required: If field is not set, save operation fails (Requires Parse Server 3.7.0+)
*
defaultValue: If field is not set, a default value is selected (Requires Parse Server 3.7.0+)
*
targetClass: Required if type is Pointer or Parse.Relation
*
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
addField(name: string, type?: T, options?: FieldOptions): this;
/**
* Adding an Index to Create / Update a Schema
*
* @param {string} name Name of the index
* @param {object} index { field: value }
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*
*
*/
addIndex(name: string, index: Index): this;
/**
* Adding String Field
*
* @param {string} name Name of the field that will be created on Parse
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
addString(name: AttrType, options?: FieldOptions): this;
/**
* Adding Number Field
*
* @param {string} name Name of the field that will be created on Parse
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
addNumber(name: AttrType, options?: FieldOptions): this;
/**
* Adding Boolean Field
*
* @param {string} name Name of the field that will be created on Parse
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
addBoolean(name: AttrType, options?: FieldOptions): this;
/**
* Adding Bytes Field
*
* @param {string} name Name of the field that will be created on Parse
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
addBytes(name: AttrType, options?: FieldOptions): this;
/**
* Adding Date Field
*
* @param {string} name Name of the field that will be created on Parse
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
addDate(name: AttrType, options?: FieldOptions): this;
/**
* Adding File Field
*
* @param {string} name Name of the field that will be created on Parse
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
addFile(name: AttrType, options?: FieldOptions): this;
/**
* Adding GeoPoint Field
*
* @param {string} name Name of the field that will be created on Parse
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
addGeoPoint(name: AttrType, options?: FieldOptions): this;
/**
* Adding Polygon Field
*
* @param {string} name Name of the field that will be created on Parse
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
addPolygon(name: AttrType, options?: FieldOptions): this;
/**
* Adding Array Field
*
* @param {string} name Name of the field that will be created on Parse
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
addArray(name: AttrType, options?: FieldOptions): this;
/**
* Adding Object Field
*
* @param {string} name Name of the field that will be created on Parse
* @param {object} options See {@link https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html#addField addField}
* @returns {Parse.Schema} Returns the schema, so you can chain this call.
*/
addObject(name: AttrType, options?: FieldOptions