@types/parse
Advanced tools
Comparing version 2.10.0 to 2.10.1
@@ -22,3 +22,3 @@ // Type definitions for parse 2.10 | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.4 | ||
// TypeScript Version: 3.3 | ||
@@ -88,6 +88,7 @@ /// <reference types="node" /> | ||
let javaScriptKey: string | undefined; | ||
let liveQueryServerURL: string; | ||
let masterKey: string | undefined; | ||
let serverAuthToken: string | undefined; | ||
let serverAuthType: string | undefined; | ||
let serverURL: string; | ||
let liveQueryServerURL: string; | ||
let VERSION: string; | ||
@@ -170,6 +171,2 @@ interface BatchSizeOption { | ||
interface IBaseObject { | ||
toJSON(): any; | ||
} | ||
interface AuthData { | ||
@@ -179,6 +176,2 @@ [key: string]: any; | ||
class BaseObject implements IBaseObject { | ||
toJSON(): any; | ||
} | ||
/** | ||
@@ -192,3 +185,2 @@ * Creates a new ACL. | ||
* @see Parse.Object#setACL | ||
* @class | ||
* | ||
@@ -199,3 +191,3 @@ * <p>An ACL, or Access Control List can be added to any | ||
*/ | ||
class ACL extends BaseObject { | ||
class ACL { | ||
permissionsById: any; | ||
@@ -211,22 +203,15 @@ | ||
setReadAccess(userId: User, allowed: boolean): void; | ||
getReadAccess(userId: User): boolean; | ||
setReadAccess(userId: User | string, allowed: boolean): void; | ||
getReadAccess(userId: User | string): boolean; | ||
setReadAccess(userId: string, allowed: boolean): void; | ||
getReadAccess(userId: string): boolean; | ||
setWriteAccess(userId: User | string, allowed: boolean): void; | ||
getWriteAccess(userId: User | string): boolean; | ||
setRoleReadAccess(role: Role, allowed: boolean): void; | ||
setRoleReadAccess(role: string, allowed: boolean): void; | ||
getRoleReadAccess(role: Role): boolean; | ||
getRoleReadAccess(role: string): boolean; | ||
setRoleReadAccess(role: Role | string, allowed: boolean): void; | ||
getRoleReadAccess(role: Role | string): boolean; | ||
setRoleWriteAccess(role: Role, allowed: boolean): void; | ||
setRoleWriteAccess(role: string, allowed: boolean): void; | ||
getRoleWriteAccess(role: Role): boolean; | ||
getRoleWriteAccess(role: string): boolean; | ||
setRoleWriteAccess(role: Role | string, allowed: boolean): void; | ||
getRoleWriteAccess(role: Role | string): boolean; | ||
setWriteAccess(userId: User, allowed: boolean): void; | ||
setWriteAccess(userId: string, allowed: boolean): void; | ||
getWriteAccess(userId: User): boolean; | ||
getWriteAccess(userId: string): boolean; | ||
toJSON(): any; | ||
} | ||
@@ -237,8 +222,7 @@ | ||
* cloud. | ||
* @class | ||
* @param name {String} The file's name. This will be prefixed by a unique | ||
* @param name The file's name. This will be prefixed by a unique | ||
* value once the file has finished saving. The file name must begin with | ||
* an alphanumeric character, and consist of alphanumeric characters, | ||
* periods, spaces, underscores, or dashes. | ||
* @param data {Array} The data for the file, as either: | ||
* @param data The data for the file, as either: | ||
* 1. an Array of byte value Numbers, or | ||
@@ -260,3 +244,3 @@ * 2. an Object like { base64: "..." } with a base64-encoded String. | ||
* }</pre> | ||
* @param type {String} Optional Content-Type header to use for the file. If | ||
* @param type Optional Content-Type header to use for the file. If | ||
* this is omitted, the content type will be inferred from the name's | ||
@@ -290,3 +274,2 @@ * extension. | ||
* </pre> | ||
* @class | ||
* | ||
@@ -305,3 +288,3 @@ * <p>Represents a latitude / longitude point that may be associated | ||
*/ | ||
class GeoPoint extends BaseObject { | ||
class GeoPoint { | ||
latitude: number; | ||
@@ -316,2 +299,3 @@ longitude: number; | ||
milesTo(point: GeoPoint): number; | ||
toJSON(): any; | ||
} | ||
@@ -323,3 +307,3 @@ | ||
*/ | ||
class Relation<S extends Object = Object, T extends Object = Object> extends BaseObject { | ||
class Relation<S extends Object = Object, T extends Object = Object> { | ||
parent: S; | ||
@@ -331,4 +315,4 @@ key: string; | ||
//Adds a Parse.Object or an array of Parse.Objects to the relation. | ||
add(object: T | Array<T>): void; | ||
// Adds a Parse.Object or an array of Parse.Objects to the relation. | ||
add(object: T | T[]): void; | ||
@@ -339,5 +323,11 @@ // Returns a Parse.Query that is limited to objects in this relation. | ||
// Removes a Parse.Object or an array of Parse.Objects from this relation. | ||
remove(object: T | Array<T>): void; | ||
remove(object: T | T[]): void; | ||
toJSON(): any; | ||
} | ||
interface Attributes { | ||
[key: string]: any; | ||
} | ||
/** | ||
@@ -360,12 +350,10 @@ * Creates a new model with defined attributes. A client id (cid) is | ||
* | ||
* @param {Object} attributes The initial set of data to store in the object. | ||
* @param {Object} options The options for this object instance. | ||
* @param attributes The initial set of data to store in the object. | ||
* @param options The options for this object instance. | ||
* @see Parse.Object.extend | ||
* | ||
* @class | ||
* | ||
* Creates a new model with defined attributes. | ||
*/ | ||
class Object<T extends any = any> extends BaseObject { | ||
interface Object<T extends Attributes = Attributes> { | ||
id: string; | ||
@@ -375,66 +363,55 @@ createdAt: Date; | ||
attributes: T; | ||
cid: string; | ||
changed: boolean; | ||
className: string; | ||
constructor(className?: string, attributes?: T, options?: any); | ||
static createWithoutData<T extends Object>(id: string): T; | ||
static destroyAll<T extends Object>(list: T[], options?: Object.DestroyAllOptions): Promise<T[]>; | ||
static extend(className: string | { className: string }, protoProps?: any, classProps?: any): any; | ||
static fetchAll<T extends Object>(list: T[], options: Object.FetchAllOptions): Promise<T[]>; | ||
static fetchAllIfNeeded<T extends Object>(list: T[], options?: Object.FetchAllOptions): Promise<T[]>; | ||
static fetchAllIfNeededWithInclude<T extends Object>(list: T[], keys: string | Array<string | Array<string>>, options?: RequestOptions): Promise<T[]>; | ||
static fetchAllWithInclude<T extends Object>(list: T[], keys: string | Array<string | Array<string>>, options?: RequestOptions): Promise<T[]>; | ||
static fromJSON<T extends Object>(json: any, override?: boolean): T; | ||
static pinAll(objects: Object[]): Promise<void>; | ||
static pinAllWithName(name: string, objects: Object[]): Promise<void>; | ||
static registerSubclass<T extends Object>(className: string, clazz: new (options?: any) => T): void; | ||
static saveAll<T extends Object>(list: T[], options?: Object.SaveAllOptions): Promise<T[]>; | ||
static unPinAll(objects: Object[]): Promise<void>; | ||
static unPinAllObjects(): Promise<void>; | ||
static unPinAllObjectsWithName(name: string): Promise<void>; | ||
static unPinAllWithName(name: string, objects: Object[]): Promise<void>; | ||
add(attr: string, item: any): this | false; | ||
addAll(attr: string, items: any[]): this | false; | ||
addAllUnique(attr: string, items: any[]): this | false; | ||
addUnique(attr: string, item: any): this | false; | ||
change(options: any): this; | ||
changedAttributes(diff: any): boolean; | ||
add<K extends Extract<keyof T, string>>( | ||
attr: K, | ||
item: ((x: any[]) => void) extends ((x: T[K]) => void) ? T[K][number] : never | ||
): this | false; | ||
addAll<K extends Extract<keyof T, string>>( | ||
attr: K, | ||
items: ((x: any[]) => void) extends ((x: T[K]) => void) ? T[K] : never | ||
): this | false; | ||
addAllUnique: this['addAll']; | ||
addUnique: this['add']; | ||
clear(options: any): any; | ||
clone(): this; | ||
destroy(options?: Object.DestroyOptions): Promise<this>; | ||
dirty(attr?: string): boolean; | ||
dirty(attr?: Extract<keyof T, string>): boolean; | ||
dirtyKeys(): string[]; | ||
equals(other: any): boolean; | ||
escape(attr: string): string; | ||
equals<T extends Object>(other: T): boolean; | ||
escape(attr: Extract<keyof T, string>): string; | ||
existed(): boolean; | ||
exists(options?: RequestOptions): Promise<boolean>; | ||
fetch(options?: Object.FetchOptions): Promise<this>; | ||
fetchFromLocalDatastore(): Promise<this>; | ||
fetchWithInclude(keys: string | Array<string | Array<string>>, options?: RequestOptions): Promise<this>; | ||
get<K extends Exclude<keyof T, symbol | number>>(attr: K): T[K]; | ||
fetchWithInclude<K extends Extract<keyof T, string>>( | ||
keys: K | Array<K | K[]>, | ||
options?: RequestOptions | ||
): Promise<this>; | ||
get<K extends Extract<keyof T, string>>(attr: K): T[K]; | ||
getACL(): ACL | undefined; | ||
has(attr: string): boolean; | ||
hasChanged(attr: string): boolean; | ||
increment(attr: string, amount?: number): any; | ||
has(attr: Extract<keyof T, string>): boolean; | ||
increment(attr: Extract<keyof T, string>, amount?: number): this | false; | ||
initialize(): void; | ||
isDataAvailable(): boolean; | ||
isNew(): boolean; | ||
isPinned(): Promise<boolean>; | ||
isValid(): boolean; | ||
op(attr: string): any; | ||
newInstance(): this; | ||
op(attr: Extract<keyof T, string>): any; | ||
pin(): Promise<void>; | ||
pinWithName(name: string): Promise<void>; | ||
previous(attr: string): any; | ||
previousAttributes(): any; | ||
relation(attr: string): Relation<this, Object>; | ||
remove(attr: string, item: any): this | false; | ||
removeAll(attr: string, items: any): this | false; | ||
revert(): void; | ||
revert(...keys: string[]): void; | ||
save( | ||
attrs?: Partial<T> | null, | ||
relation<R extends Object, K extends Extract<keyof T, string> = Extract<keyof T, string>>( | ||
attr: T[K] extends Relation ? K : never | ||
): Relation<this, R>; | ||
remove: this['add']; | ||
removeAll: this['addAll']; | ||
revert(...keys: Array<Extract<keyof T, string>>): void; | ||
save<K extends Extract<keyof T, string>>( | ||
attrs?: (((x: T) => void) extends ((x: Attributes) => void) ? Partial<T> : { | ||
[key in K]: T[K]; | ||
}) | null, | ||
options?: Object.SaveOptions | ||
): Promise<this>; | ||
save<K extends keyof T>( | ||
save<K extends Extract<keyof T, string>>( | ||
key: K, | ||
@@ -444,7 +421,9 @@ value: T[K], | ||
): Promise<this>; | ||
set( | ||
attrs: Partial<T>, | ||
set<K extends Extract<keyof T, string>>( | ||
attrs: ((x: T) => void) extends ((x: Attributes) => void) ? Partial<T> : { | ||
[key in K]: T[K]; | ||
}, | ||
options?: Object.SetOptions | ||
): this | false; | ||
set<K extends keyof T>( | ||
set<K extends Extract<keyof T, string>>( | ||
key: K, | ||
@@ -455,8 +434,40 @@ value: T[K], | ||
setACL(acl: ACL, options?: SuccessFailureOptions): this | false; | ||
toJSON(): any; | ||
toPointer(): Pointer; | ||
unPin(): Promise<void>; | ||
unPinWithName(name: string): Promise<void>; | ||
unset(attr: string, options?: any): any; | ||
validate(attrs: any, options?: SuccessFailureOptions): boolean; | ||
unset(attr: Extract<keyof T, string>, options?: any): this | false; | ||
validate(attrs: Attributes, options?: SuccessFailureOptions): Error | false; | ||
} | ||
interface ObjectStatic { | ||
createWithoutData<T extends Object>(id: string): T; | ||
destroyAll<T extends Object>(list: T[], options?: Object.DestroyAllOptions): Promise<T[]>; | ||
extend(className: string | { className: string }, protoProps?: any, classProps?: any): any; | ||
fetchAll<T extends Object>(list: T[], options: Object.FetchAllOptions): Promise<T[]>; | ||
fetchAllIfNeeded<T extends Object>(list: T[], options?: Object.FetchAllOptions): Promise<T[]>; | ||
fetchAllIfNeededWithInclude<T extends Object>( | ||
list: T[], | ||
keys: string | Array<string | string[]>, | ||
options?: RequestOptions | ||
): Promise<T[]>; | ||
fetchAllWithInclude<T extends Object>( | ||
list: T[], | ||
keys: string | Array<string | string[]>, | ||
options?: RequestOptions, | ||
): Promise<T[]>; | ||
fromJSON<T extends Object>(json: any, override?: boolean): T; | ||
pinAll(objects: Object[]): Promise<void>; | ||
pinAllWithName(name: string, objects: Object[]): Promise<void>; | ||
registerSubclass<T extends Object>(className: string, clazz: new (options?: any) => T): void; | ||
saveAll<T extends Object>(list: T[], options?: Object.SaveAllOptions): Promise<T[]>; | ||
unPinAll(objects: Object[]): Promise<void>; | ||
unPinAllObjects(): Promise<void>; | ||
unPinAllObjectsWithName(name: string): Promise<void>; | ||
unPinAllWithName(name: string, objects: Object[]): Promise<void>; | ||
} | ||
interface ObjectConstructor extends ObjectStatic { | ||
new<T extends Attributes>(className: string, attributes: T, options?: any): Object<T>; | ||
new(className?: string, attributes?: Attributes, options?: any): Object; | ||
} | ||
const Object: ObjectConstructor; | ||
@@ -486,7 +497,9 @@ namespace Object { | ||
class Polygon extends BaseObject { | ||
class Polygon { | ||
constructor(arg1: GeoPoint[] | number[][]); | ||
containsPoint(point: GeoPoint): boolean; | ||
equals(other: Polygon | any): boolean; | ||
equals(other: any): boolean; | ||
toJSON(): any; | ||
} | ||
/** | ||
@@ -496,4 +509,3 @@ * Every Parse application installed on a device registered for | ||
*/ | ||
class Installation<T extends any = any> extends Object<T> { | ||
interface Installation<T extends Attributes = Attributes> extends Object<T> { | ||
badge: any; | ||
@@ -512,2 +524,8 @@ channels: string[]; | ||
} | ||
interface InstallationConstructor extends ObjectStatic { | ||
new<T extends Attributes>(attributes: T): Installation<T>; | ||
new(): Installation; | ||
} | ||
const Installation: InstallationConstructor; | ||
/** | ||
@@ -517,3 +535,2 @@ * Creates a new parse Parse.Query for the given Parse.Object subclass. | ||
* An instance of a subclass of Parse.Object, or a Parse className string. | ||
* @class | ||
* | ||
@@ -570,20 +587,16 @@ * <p>Parse.Query defines a query that is used to fetch Parse.Objects. The | ||
*/ | ||
class Query<T extends Object = Object> extends BaseObject { | ||
class Query<T extends Object = Object> { | ||
objectClass: any; | ||
className: string; | ||
constructor(objectClass: string); | ||
constructor(objectClass: new (...args: any[]) => T); | ||
constructor(objectClass: string | (new (...args: any[]) => T | Object)); | ||
static and<U extends Object>(...args: Query<U>[]): Query<U>; | ||
static and<U extends Object>(...args: Array<Query<U>>): Query<U>; | ||
static fromJSON<U extends Object>(className: string, json: any): Query<U>; | ||
static nor<U extends Object>(...args: Query<U>[]): Query<U>; | ||
static or<U extends Object>(...var_args: Query<U>[]): Query<U>; | ||
static nor<U extends Object>(...args: Array<Query<U>>): Query<U>; | ||
static or<U extends Object>(...var_args: Array<Query<U>>): Query<U>; | ||
addAscending(key: string): Query<T>; | ||
addAscending(key: string[]): Query<T>; | ||
addDescending(key: string): Query<T>; | ||
addDescending(key: string[]): Query<T>; | ||
ascending(key: string): Query<T>; | ||
ascending(key: string[]): Query<T>; | ||
addAscending(key: string | string[]): Query<T>; | ||
addDescending(key: string | string[]): Query<T>; | ||
ascending(key: string | string[]): Query<T>; | ||
aggregate<V = any>(pipeline: Query.AggregationOptions | Query.AggregationOptions[]): Promise<V>; | ||
@@ -596,4 +609,3 @@ containedBy(key: string, values: any[]): Query<T>; | ||
count(options?: Query.CountOptions): Promise<number>; | ||
descending(key: string): Query<T>; | ||
descending(key: string[]): Query<T>; | ||
descending(key: string | string[]): Query<T>; | ||
doesNotExist(key: string): Query<T>; | ||
@@ -616,4 +628,3 @@ doesNotMatchKeyInQuery<U extends Object>(key: string, queryKey: string, query: Query<U>): Query<T>; | ||
greaterThanOrEqualTo(key: string, value: any): Query<T>; | ||
include(key: string): Query<T>; | ||
include(keys: string[]): Query<T>; | ||
include(key: string | string[]): Query<T>; | ||
includeAll(): Query<T>; | ||
@@ -635,2 +646,3 @@ lessThan(key: string, value: any): Query<T>; | ||
subscribe(): Promise<LiveQuerySubscription>; | ||
toJSON(): any; | ||
withJSON(json: any): this; | ||
@@ -685,5 +697,5 @@ withinGeoBox(key: string, southwest: GeoPoint, northeast: GeoPoint): Query<T>; | ||
* | ||
``` | ||
subscription.on('open', () => {}); | ||
``` | ||
* ``` | ||
* subscription.on('open', () => {}); | ||
* ``` | ||
* --- | ||
@@ -693,5 +705,5 @@ * `create` - when a new ParseObject is created and it fulfills the ParseQuery you subscribe, | ||
* | ||
``` | ||
subscription.on('create', (object: Parse.Object) => {}); | ||
``` | ||
* ``` | ||
* subscription.on('create', (object: Parse.Object) => {}); | ||
* ``` | ||
* --- | ||
@@ -703,5 +715,5 @@ * `update` event - when an existing ParseObject which fulfills the ParseQuery you subscribe | ||
* | ||
``` | ||
subscription.on('update', (object: Parse.Object) => {}); | ||
``` | ||
* ``` | ||
* subscription.on('update', (object: Parse.Object) => {}); | ||
* ``` | ||
* --- | ||
@@ -712,5 +724,5 @@ * `enter` event - when an existing ParseObject's old value doesn't fulfill the ParseQuery | ||
* | ||
``` | ||
subscription.on('enter', (object: Parse.Object) => {}); | ||
``` | ||
* ``` | ||
* subscription.on('enter', (object: Parse.Object) => {}); | ||
* ``` | ||
* --- | ||
@@ -721,5 +733,5 @@ * `update` event - when an existing ParseObject's old value fulfills the ParseQuery but its new value | ||
* | ||
``` | ||
subscription.on('leave', (object: Parse.Object) => {}); | ||
``` | ||
* ``` | ||
* subscription.on('leave', (object: Parse.Object) => {}); | ||
* ``` | ||
* --- | ||
@@ -729,5 +741,5 @@ * `delete` event - when an existing ParseObject which fulfills the ParseQuery is deleted, you'll | ||
* | ||
``` | ||
subscription.on('delete', (object: Parse.Object) => {}); | ||
``` | ||
* ``` | ||
* subscription.on('delete', (object: Parse.Object) => {}); | ||
* ``` | ||
* --- | ||
@@ -737,5 +749,5 @@ * `close` event - when the client loses the WebSocket connection to the LiveQuery | ||
* | ||
``` | ||
subscription.on('close', () => {}); | ||
``` | ||
* ``` | ||
* subscription.on('close', () => {}); | ||
* ``` | ||
*/ | ||
@@ -746,5 +758,5 @@ class LiveQuerySubscription extends NodeJS.EventEmitter { | ||
* | ||
* @param {string} id | ||
* @param {string} query | ||
* @param {string} [sessionToken] | ||
* @param id | ||
* @param query | ||
* @param [sessionToken] | ||
*/ | ||
@@ -771,10 +783,6 @@ constructor(id: string, query: string, sessionToken?: string); | ||
* role), and must specify an ACL.</p> | ||
* @class | ||
* A Parse.Role is a local representation of a role persisted to the Parse | ||
* cloud. | ||
*/ | ||
class Role<T extends any = any> extends Object<T> { | ||
constructor(name: string, acl: ACL); | ||
interface Role<T extends Attributes = Attributes> extends Object<T> { | ||
getRoles(): Relation<Role, Role>; | ||
@@ -785,4 +793,9 @@ getUsers(): Relation<Role, User>; | ||
} | ||
interface RoleConstructor extends ObjectStatic { | ||
new<T extends Attributes>(name: string, acl: ACL): Role<Partial<T>>; | ||
new(name: string, acl: ACL): Role; | ||
} | ||
const Role: RoleConstructor; | ||
class Config<T extends any = any> extends Object<T> { | ||
class Config { | ||
static get(options?: UseMasterKeyOption): Promise<Config>; | ||
@@ -796,11 +809,15 @@ static current(): Config; | ||
class Session<T extends any = any> extends Object<T> { | ||
static current(): Promise<Session>; | ||
interface Session<T extends Attributes = Attributes> extends Object<T> { | ||
getSessionToken(): string; | ||
isCurrentSessionRevocable(): boolean; | ||
} | ||
interface SessionConstructor extends ObjectStatic { | ||
new<T extends Attributes>(attributes: T): Session<T>; | ||
new(): Session; | ||
current(): Promise<Session>; | ||
} | ||
const Session: SessionConstructor; | ||
/** | ||
* @class | ||
* | ||
@@ -813,16 +830,3 @@ * <p>A Parse.User object is a local representation of a user persisted to the | ||
*/ | ||
class User<T extends any = any> extends Object<T> { | ||
static allowCustomUserClass(isAllowed: boolean): void; | ||
static become(sessionToken: string, options?: UseMasterKeyOption): Promise<User>; | ||
static current(): User | undefined; | ||
static currentAsync(): Promise<User | null>; | ||
static signUp(username: string, password: string, attrs: any, options?: SignUpOptions): Promise<User>; | ||
static logIn(username: string, password: string, options?: FullOptions): Promise<User>; | ||
static logOut(): Promise<User>; | ||
static requestPasswordReset(email: string, options?: SuccessFailureOptions): Promise<User>; | ||
static extend(protoProps?: any, classProps?: any): any; | ||
static hydrate(userJSON: any): Promise<User>; | ||
static enableUnsafeCurrentUser(): void; | ||
interface User<T extends Attributes = Attributes> extends Object<T> { | ||
signUp(attrs?: any, options?: SignUpOptions): Promise<this>; | ||
@@ -845,3 +849,20 @@ logIn(options?: FullOptions): Promise<this>; | ||
} | ||
interface UserConstructor extends ObjectStatic { | ||
new<T extends Attributes>(attributes: T): User<T>; | ||
new(): User; | ||
allowCustomUserClass(isAllowed: boolean): void; | ||
become(sessionToken: string, options?: UseMasterKeyOption): Promise<User>; | ||
current<T extends Attributes>(): User<T> | undefined; | ||
currentAsync(): Promise<User | null>; | ||
signUp(username: string, password: string, attrs: any, options?: SignUpOptions): Promise<User>; | ||
logIn(username: string, password: string, options?: FullOptions): Promise<User>; | ||
logOut(): Promise<User>; | ||
requestPasswordReset(email: string, options?: SuccessFailureOptions): Promise<User>; | ||
extend(protoProps?: any, classProps?: any): any; | ||
hydrate(userJSON: any): Promise<User>; | ||
enableUnsafeCurrentUser(): void; | ||
} | ||
const User: UserConstructor; | ||
/** | ||
@@ -851,3 +872,3 @@ * A Parse.Schema object is for handling schema data from Parse. | ||
* | ||
* @param {String} className Parse Class string | ||
* @param className Parse Class string | ||
* | ||
@@ -883,4 +904,4 @@ * https://parseplatform.org/Parse-SDK-JS/api/master/Parse.Schema.html | ||
* Adding an Index to Create / Update a Schema | ||
* @param {String} name Name of the field that will be created on Parse | ||
* @param {Schema.Index} index { 'field': value } `field` should exist in the schema before using addIndex. `value` can be a (String|Number|Boolean|Date|Parse.File|Parse.GeoPoint|Array|Object|Pointer|Parse.Relation) | ||
* @param name Name of the field that will be created on Parse | ||
* @param index `{ 'field': value }` where `field` should exist in the schema before using addIndex. | ||
* @return Returns the schema, so you can chain this call. | ||
@@ -899,4 +920,4 @@ * @example | ||
* Adding Pointer Field | ||
* @param {String} name Name of the field that will be created on Parse | ||
* @param {String} targetClass Name of the target Pointer Class | ||
* @param name Name of the field that will be created on Parse | ||
* @param targetClass Name of the target Pointer Class | ||
* @return Returns the schema, so you can chain this call. | ||
@@ -910,4 +931,4 @@ */ | ||
* Adding Relation Field | ||
* @param {String} name Name of the field that will be created on Parse | ||
* @param {String} targetClass Name of the target Pointer Class | ||
* @param name Name of the field that will be created on Parse | ||
* @param targetClass Name of the target Pointer Class | ||
* @return Returns the schema, so you can chain this call. | ||
@@ -925,3 +946,3 @@ */ | ||
* - sessionToken: A valid session token, used for making a request on behalf of a specific user. | ||
* @returns {Promise} A promise that is resolved with the result when the query completes. | ||
* @returns A promise that is resolved with the result when the query completes. | ||
*/ | ||
@@ -968,3 +989,3 @@ // @TODO Fix Promise<any> | ||
namespace Schema { | ||
type TYPE = string | number | boolean | Date | File | GeoPoint | Array<any> | object | Pointer | Relation; | ||
type TYPE = string | number | boolean | Date | File | GeoPoint | any[] | object | Pointer | Relation; | ||
@@ -982,3 +1003,2 @@ interface Index { | ||
* Provides a set of utilities for using Parse with Facebook. | ||
* @namespace | ||
* Provides a set of utilities for using Parse with Facebook. | ||
@@ -995,3 +1015,3 @@ */ | ||
/** | ||
* @namespace Contains functions for calling and declaring | ||
* Contains functions for calling and declaring | ||
* <a href="/docs/cloud_code_guide#functions">cloud functions</a>. | ||
@@ -1048,3 +1068,3 @@ * <p><strong><em> | ||
object: Object; | ||
original?: Parse.Object; | ||
original?: Object; | ||
} | ||
@@ -1055,4 +1075,4 @@ | ||
} | ||
interface AfterDeleteRequest extends TriggerRequest {} | ||
interface BeforeDeleteRequest extends TriggerRequest {} | ||
interface AfterDeleteRequest extends TriggerRequest {} // tslint:disable-line no-empty-interface | ||
interface BeforeDeleteRequest extends TriggerRequest {} // tslint:disable-line no-empty-interface | ||
interface BeforeSaveRequest extends TriggerRequest { | ||
@@ -1086,7 +1106,9 @@ context: object; | ||
function beforeSave(arg1: any, func?: (request: BeforeSaveRequest) => Promise<void> | void): void; | ||
function beforeFind(arg1: any, func?: (request: BeforeFindRequest) => Promise<void> | void): void; | ||
function beforeFind(arg1: any, func?: (request: BeforeFindRequest) => Promise<Query> | Query): void; | ||
function afterFind(arg1: any, func?: (request: AfterFindRequest) => Promise<any> | any): void; | ||
function beforeLogin(func?: (request: TriggerRequest) => Promise<any> | any): void; | ||
function define(name: string, func?: (request: FunctionRequest) => Promise<any> | any): void; | ||
function beforeFind( | ||
arg1: any, | ||
func?: (request: BeforeFindRequest) => Promise<Query> | Promise<void> | Query | void | ||
): void; | ||
function afterFind(arg1: any, func?: (request: AfterFindRequest) => any): void; | ||
function beforeLogin(func?: (request: TriggerRequest) => any): void; | ||
function define(name: string, func?: (request: FunctionRequest) => any): void; | ||
/** | ||
@@ -1142,3 +1164,3 @@ * Gets data for the current set of cloud jobs. | ||
/** | ||
*The method of the request (i.e GET, POST, etc). | ||
* The method of the request (i.e GET, POST, etc). | ||
*/ | ||
@@ -1224,3 +1246,2 @@ method?: string; | ||
/** | ||
* @class | ||
* A Parse.Op is an atomic operation that can be applied to a field in a | ||
@@ -1237,24 +1258,33 @@ * Parse.Object. For example, calling <code>object.set("foo", "bar")</code> | ||
namespace Op { | ||
interface BaseOperation extends IBaseObject { | ||
interface BaseOperation { | ||
objects(): any[]; | ||
} | ||
interface Add extends BaseOperation {} | ||
interface Add extends BaseOperation { | ||
toJSON(): any; | ||
} | ||
interface AddUnique extends BaseOperation {} | ||
interface AddUnique extends BaseOperation { | ||
toJSON(): any; | ||
} | ||
interface Increment extends IBaseObject { | ||
interface Increment { | ||
amount: number; | ||
toJSON(): any; | ||
} | ||
interface Relation extends IBaseObject { | ||
interface Relation { | ||
added(): Object[]; | ||
removed: Object[]; | ||
toJSON(): any; | ||
} | ||
interface Set extends IBaseObject { | ||
interface Set { | ||
value(): any; | ||
toJSON(): any; | ||
} | ||
interface Unset extends IBaseObject {} | ||
interface Unset { | ||
toJSON(): any; | ||
} | ||
} | ||
@@ -1264,4 +1294,2 @@ | ||
* Contains functions to deal with Push in Parse | ||
* @name Parse.Push | ||
* @namespace | ||
*/ | ||
@@ -1295,5 +1323,5 @@ namespace Push { | ||
* You can get your keys from the Data Browser on parse.com. | ||
* @param {String} applicationId Your Parse Application ID. | ||
* @param {String} javaScriptKey (optional) Your Parse JavaScript Key (Not needed for parse-server) | ||
* @param {String} masterKey (optional) Your Parse Master Key. (Node.js only!) | ||
* @param applicationId Your Parse Application ID. | ||
* @param javaScriptKey (optional) Your Parse JavaScript Key (Not needed for parse-server) | ||
* @param masterKey (optional) Your Parse Master Key. (Node.js only!) | ||
*/ | ||
@@ -1300,0 +1328,0 @@ function initialize(applicationId: string, javaScriptKey?: string, masterKey?: string): void; |
{ | ||
"name": "@types/parse", | ||
"version": "2.10.0", | ||
"version": "2.10.1", | ||
"description": "TypeScript definitions for parse", | ||
@@ -109,4 +109,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "a172e09c41f9c145c46ed061a720d7f2e163fa286d5946ff88f04e82dda65529", | ||
"typeScriptVersion": "2.8" | ||
"typesPublisherContentHash": "f93eef1075e2a21861457f930ad64646cbeae772ac262e7bbcadcdffa04d2ff9", | ||
"typeScriptVersion": "3.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Sat, 07 Dec 2019 01:18:35 GMT | ||
* Last updated: Tue, 10 Dec 2019 03:33:34 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
@@ -14,0 +14,0 @@ * Global values: `ErrorCode`, `Parse` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56052
1185