@types/parse
Advanced tools
Comparing version 2.10.10 to 2.10.11
@@ -24,3 +24,3 @@ // Type definitions for parse 2.10 | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 3.5 | ||
// TypeScript Version: 3.7 | ||
@@ -187,2 +187,8 @@ /// <reference types="node" /> | ||
interface JSONBaseAttributes { | ||
createdAt: string; | ||
objectId: string; | ||
updatedAt: string; | ||
} | ||
/** | ||
@@ -365,9 +371,9 @@ * Creates a new ACL. | ||
add<K extends Extract<keyof T, string>>( | ||
add<K extends { [K in keyof T]: T[K] extends any[] ? K : never }[keyof T]>( | ||
attr: K, | ||
item: ((x: any[]) => void) extends ((x: T[K]) => void) ? T[K][number] : never | ||
item: T[K][number] | ||
): this | false; | ||
addAll<K extends Extract<keyof T, string>>( | ||
addAll<K extends { [K in keyof T]: T[K] extends any[] ? K : never }[keyof T]>( | ||
attr: K, | ||
items: ((x: any[]) => void) extends ((x: T[K]) => void) ? T[K] : never | ||
items: T[K] | ||
): this | false; | ||
@@ -433,3 +439,3 @@ addAllUnique: this['addAll']; | ||
setACL(acl: ACL, options?: SuccessFailureOptions): this | false; | ||
toJSON(): any; | ||
toJSON(): Object.ToJSON<T> & JSONBaseAttributes; | ||
toPointer(): Pointer; | ||
@@ -461,3 +467,3 @@ unPin(): 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[]>; | ||
saveAll<T extends readonly Object[]>(list: T, options?: Object.SaveAllOptions): Promise<T>; | ||
unPinAll(objects: Object[]): Promise<void>; | ||
@@ -495,2 +501,23 @@ unPinAllObjects(): Promise<void>; | ||
} | ||
// From https://github.com/parse-community/Parse-SDK-JS/blob/master/src/encode.js | ||
type Encode<T> = ( | ||
T extends Object | ||
? ReturnType<T['toJSON']> | Pointer | ||
: T extends (ACL | GeoPoint | Polygon | Relation | File) | ||
? ReturnType<T['toJSON']> | ||
: T extends Date | ||
? { __type: 'Date'; iso: string; } | ||
: T extends RegExp | ||
? string | ||
: T extends Array<infer R> | ||
? Array<Encode<R>> | ||
: T extends object | ||
? ToJSON<T> | ||
: T | ||
); | ||
type ToJSON<T> = { | ||
[K in keyof T]: Encode<T[K]> | ||
}; | ||
} | ||
@@ -775,3 +802,3 @@ | ||
getRoles(): Relation<Role, Role>; | ||
getUsers(): Relation<Role, User>; | ||
getUsers<U extends User>(): Relation<Role, U>; | ||
getName(): string; | ||
@@ -838,11 +865,11 @@ setName(name: string, options?: SuccessFailureOptions): any; | ||
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>; | ||
become<T extends User>(sessionToken: string, options?: UseMasterKeyOption): Promise<T>; | ||
current<T extends User>(): T | undefined; | ||
currentAsync<T extends User>(): Promise<T | null>; | ||
signUp<T extends User>(username: string, password: string, attrs: any, options?: SignUpOptions): Promise<T>; | ||
logIn<T extends User>(username: string, password: string, options?: FullOptions): Promise<T>; | ||
logOut<T extends User>(): Promise<T>; | ||
requestPasswordReset<T extends User>(email: string, options?: SuccessFailureOptions): Promise<T>; | ||
extend(protoProps?: any, classProps?: any): any; | ||
hydrate(userJSON: any): Promise<User>; | ||
hydrate<T extends User>(userJSON: any): Promise<T>; | ||
enableUnsafeCurrentUser(): void; | ||
@@ -849,0 +876,0 @@ } |
{ | ||
"name": "@types/parse", | ||
"version": "2.10.10", | ||
"version": "2.10.11", | ||
"description": "TypeScript definitions for parse", | ||
@@ -119,4 +119,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "cd2475d66d092a2ac880d1c20955094d9c89baba3ba861ee5c4cddcfc8c2cea6", | ||
"typeScriptVersion": "3.5" | ||
"typesPublisherContentHash": "736ba151cbf0ee83b0fbab849118bc670e3a6a418941b8febc0727a2b09f4592", | ||
"typeScriptVersion": "3.7" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 10 Jan 2020 23:24:35 GMT | ||
* Last updated: Wed, 15 Jan 2020 07:41:36 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
@@ -14,0 +14,0 @@ * Global values: none |
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
61004
1247