mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
type fixes
This commit is contained in:
56
types/parse/index.d.ts
vendored
56
types/parse/index.d.ts
vendored
@@ -24,6 +24,10 @@ declare namespace Parse {
|
||||
let liveQueryServerURL: string;
|
||||
let VERSION: string;
|
||||
|
||||
interface BatchSizeOption {
|
||||
batchSize?: number;
|
||||
}
|
||||
|
||||
interface SuccessOption {
|
||||
success?: Function;
|
||||
}
|
||||
@@ -267,25 +271,25 @@ declare namespace Parse {
|
||||
constructor(attributes?: string[], options?: any);
|
||||
|
||||
static createWithoutData<T extends Object>(id: string): T;
|
||||
static destroyAll<T>(list: T[], options?: Object.DestroyAllOptions): Promise<T[]>;
|
||||
static extend(className: string, protoProps?: any, classProps?: any): any;
|
||||
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 fetchAllWithInclude(list: any, keys: any, options: any): any;
|
||||
static fetchAllWithInclude<T extends Object>(list: T[], keys: string | Array<string | Array<string>>, options: Object.RequestOptions): any;
|
||||
static fromJSON(json: any, override: boolean): any;
|
||||
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: any): Promise<void>;
|
||||
static unPinAll(objects: Object[]): Promise<void>;
|
||||
static unPinAllObjects(): Promise<void>;
|
||||
static unPinAllObjectsWithName(name: string): Promise<void>;
|
||||
static unPinAllWithName(...args: any[]): Promise<void>;
|
||||
static unPinAllObjectsWithName(name: string): Promise<void>;
|
||||
static unPinAllWithName(name: string, objects: Object[]): Promise<void>;
|
||||
|
||||
add(attr: string, item: any): this;
|
||||
addAll(attr: string, items: any[]): this;
|
||||
addAllUnique(attr: string, items: any[]): this;
|
||||
addUnique(attr: string, item: any): this;
|
||||
add(attr: string, item: any): this | boolean;
|
||||
addAll(attr: string, items: any[]): this | boolean;
|
||||
addAllUnique(attr: string, items: any[]): this | boolean;
|
||||
addUnique(attr: string, item: any): this | boolean;
|
||||
change(options: any): this;
|
||||
changedAttributes(diff: any): boolean;
|
||||
clear(options: any): any;
|
||||
@@ -298,7 +302,7 @@ declare namespace Parse {
|
||||
existed(): boolean;
|
||||
fetch(options?: Object.FetchOptions): Promise<this>;
|
||||
fetchFromLocalDatastore(): Promise<this> | void;
|
||||
fetchWithInclude(keys: string[], options?: any): Promise<this>;
|
||||
fetchWithInclude(keys: keys: string | Array<string | Array<string>>, options?: Object.RequestOptions): Promise<this>;
|
||||
get(attr: string): any | undefined;
|
||||
getACL(): ACL | undefined;
|
||||
has(attr: string): boolean;
|
||||
@@ -306,16 +310,16 @@ declare namespace Parse {
|
||||
increment(attr: string, amount?: number): any;
|
||||
initialize(): void;
|
||||
isNew(): boolean;
|
||||
isPinned(...args: any[]): Promise<boolean>;
|
||||
isPinned(): Promise<boolean>;
|
||||
isValid(): boolean;
|
||||
op(attr: string): any;
|
||||
pin(): Promise<this>;
|
||||
pinWithName(name: string): Promise<this>;
|
||||
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): any;
|
||||
removeAll(attr: string, items: any): any;
|
||||
remove(attr: string, item: any): this | boolean;
|
||||
removeAll(attr: string, items: any): this | boolean;
|
||||
revert(): void;
|
||||
save(attrs?: { [key: string]: any } | null, options?: Object.SaveOptions): Promise<this>;
|
||||
save(key: string, value: any, options?: Object.SaveOptions): Promise<this>;
|
||||
@@ -324,8 +328,8 @@ declare namespace Parse {
|
||||
set(attrs: object, options?: Object.SetOptions): boolean;
|
||||
setACL(acl: ACL, options?: SuccessFailureOptions): boolean;
|
||||
toPointer(): Pointer;
|
||||
unPin(): Promise<this>;
|
||||
unPinWithName(name: string): Promise<this>;
|
||||
unPin(): Promise<void>;
|
||||
unPinWithName(name: string): Promise<void>;
|
||||
unset(attr: string, options?: any): any;
|
||||
validate(attrs: any, options?: SuccessFailureOptions): boolean;
|
||||
}
|
||||
@@ -333,7 +337,7 @@ declare namespace Parse {
|
||||
namespace Object {
|
||||
interface DestroyOptions extends SuccessFailureOptions, WaitOption, ScopeOptions { }
|
||||
|
||||
interface DestroyAllOptions extends SuccessFailureOptions, ScopeOptions { }
|
||||
interface DestroyAllOptions extends BatchSizeOption, ScopeOptions { }
|
||||
|
||||
interface FetchAllOptions extends SuccessFailureOptions, ScopeOptions { }
|
||||
|
||||
@@ -341,14 +345,14 @@ declare namespace Parse {
|
||||
|
||||
interface SaveOptions extends SuccessFailureOptions, SilentOption, ScopeOptions, WaitOption { }
|
||||
|
||||
interface SaveAllOptions extends SuccessFailureOptions, ScopeOptions { }
|
||||
interface SaveAllOptions extends BatchSizeOption, ScopeOptions { }
|
||||
|
||||
interface SetOptions extends ErrorOption, SilentOption {
|
||||
promise?: any;
|
||||
}
|
||||
}
|
||||
|
||||
class Polygon extends BaseObject {
|
||||
class Polygon extends BaseObject {
|
||||
constructor(arg1: GeoPoint[] | number[][]);
|
||||
containsPoint(point: GeoPoint): boolean;
|
||||
equals(other: Polygon | any): boolean;
|
||||
@@ -438,7 +442,7 @@ declare namespace Parse {
|
||||
constructor(objectClass: new (...args: any[]) => T);
|
||||
|
||||
static and<U extends Object>(...args: Query<U>[]): Query<U>;
|
||||
static fromJSON<U extends Object>(className: any, json: any): 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>;
|
||||
|
||||
@@ -453,7 +457,7 @@ declare namespace Parse {
|
||||
containedIn(key: string, values: any[]): Query<T>;
|
||||
contains(key: string, substring: string): Query<T>;
|
||||
containsAll(key: string, values: any[]): Query<T>;
|
||||
containsAllStartingWith(key: string, values: any[]): Query<T>;
|
||||
containsAllStartingWith(key: string, values: string[]): Query<T>;
|
||||
count(options?: Query.CountOptions): Promise<number>;
|
||||
descending(key: string): Query<T>;
|
||||
descending(key: string[]): Query<T>;
|
||||
@@ -489,10 +493,10 @@ declare namespace Parse {
|
||||
polygonContains(key: string, point: GeoPoint): Query<T>;
|
||||
select(...keys: string[]): Query<T>;
|
||||
skip(n: number): Query<T>;
|
||||
sortByTextScore(): any;
|
||||
sortByTextScore(): this;
|
||||
startsWith(key: string, prefix: string): Query<T>;
|
||||
subscribe(): LiveQuerySubscription;
|
||||
withJSON(json: any): any;
|
||||
withJSON(json: any): this;
|
||||
withinGeoBox(key: string, southwest: GeoPoint, northeast: GeoPoint): Query<T>;
|
||||
withinKilometers(key: string, point: GeoPoint, maxDistance: number): Query<T>;
|
||||
withinMiles(key: string, point: GeoPoint, maxDistance: number): Query<T>;
|
||||
@@ -659,7 +663,7 @@ subscription.on('close', () => {});
|
||||
class User extends Object {
|
||||
|
||||
static allowCustomUserClass(isAllowed: boolean): void;
|
||||
static become(sessionToken: string, options?: SuccessFailureOptions): Promise<User>;
|
||||
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>;
|
||||
|
||||
Reference in New Issue
Block a user