Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit a15304c

Browse files
Folks reported issues with TS, so rolled this change back
1 parent df8a79d commit a15304c

File tree

2 files changed

+104
-84
lines changed

2 files changed

+104
-84
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
<img src="docs/images/firebase-logo.png" width="116px" height="32px" alt="Firebase"/>
22

3+
## 3.7.0 (2016, October 10)
4+
5+
[Full changelog](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/compare/3.6.4...3.7.0)
6+
7+
### SDK versions
8+
9+
TODO!!!
10+
If version numbers __changed__, clean your platform folders to avoid build errors.
11+
12+
- iOS: 3.5.x
13+
- Android: 9.4.0
14+
15+
### New
16+
- [#153](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/153) / [#157](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/157) Get Auth Token
17+
18+
### Fixes
19+
- [#154](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/154) Compatibility with Fresco
20+
- `createUser` now returns the same value on iOS and Android
21+
- TypeScript changes in 3.6.4 rolled back because of a few bugreports.
22+
23+
24+
25+
326
## 3.6.4 (2016, October 9)
427

528
[Full changelog](https://github.com/EddyVerbruggen/nativescript-plugin-firebase/compare/3.6.3...3.6.4)

firebase.d.ts

Lines changed: 81 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
declare namespace firebase {
1+
declare module "nativescript-firebase" {
22

33
/**
44
* The allowed values for LoginOptions.type.
55
*/
66
export enum LoginType {
7-
/**
8-
* No further data is required.
9-
*/
10-
ANONYMOUS,
11-
/**
12-
* This requires you to pass in email and password properties as well.
13-
*/
14-
PASSWORD,
15-
/**
16-
* This requires you to pass either an authentication token generated by your backend server
17-
* or the tokenProviderFn function that returns a promise to provide the token.
18-
* See: https://firebase.google.com/docs/auth/server
19-
*/
20-
CUSTOM,
21-
/**
22-
* This requires you to setup Facebook Auth in the Firebase console,
23-
* as well as uncommenting the SDK includes in include.gradle (Android) and Podfile (iOS).
24-
*/
25-
FACEBOOK,
26-
/**
27-
* This requires you to setup Google Sign In in the Firebase console,
28-
* as well as uncommenting the SDK includes in include.gradle (Android) and Podfile (iOS).
29-
*/
30-
GOOGLE
7+
/**
8+
* No further data is required.
9+
*/
10+
ANONYMOUS,
11+
/**
12+
* This requires you to pass in email and password properties as well.
13+
*/
14+
PASSWORD,
15+
/**
16+
* This requires you to pass either an authentication token generated by your backend server
17+
* or the tokenProviderFn function that returns a promise to provide the token.
18+
* See: https://firebase.google.com/docs/auth/server
19+
*/
20+
CUSTOM,
21+
/**
22+
* This requires you to setup Facebook Auth in the Firebase console,
23+
* as well as uncommenting the SDK includes in include.gradle (Android) and Podfile (iOS).
24+
*/
25+
FACEBOOK,
26+
/**
27+
* This requires you to setup Google Sign In in the Firebase console,
28+
* as well as uncommenting the SDK includes in include.gradle (Android) and Podfile (iOS).
29+
*/
30+
GOOGLE
3131
}
3232

3333
/**
3434
* The allowed values for QueryOptions.orderBy.type.
3535
*/
3636
export enum QueryOrderByType {
37-
KEY,
38-
VALUE,
39-
CHILD,
40-
PRIORITY
37+
KEY,
38+
VALUE,
39+
CHILD,
40+
PRIORITY
4141
}
4242

4343
/**
4444
* The allowed values for QueryOptions.range.type.
4545
*/
4646
export enum QueryRangeType {
47-
START_AT,
48-
END_AT,
49-
EQUAL_TO
47+
START_AT,
48+
END_AT,
49+
EQUAL_TO
5050
}
5151

5252
/**
5353
* The allowed values for QueryOptions.limit.type.
5454
*/
5555
export enum QueryLimitType {
56-
FIRST,
57-
LAST
56+
FIRST,
57+
LAST
5858
}
5959

6060
export interface ServerValue {
@@ -370,6 +370,7 @@ declare namespace firebase {
370370
}
371371

372372
export interface UploadFileResult {
373+
373374
}
374375

375376
export interface DownloadFileOptions {
@@ -429,8 +430,24 @@ declare namespace firebase {
429430
log: string;
430431
}
431432

433+
export function init(options: InitOptions): Promise<any>;
434+
435+
// Database
436+
export function push(path: string, value: any): Promise<PushResult>;
437+
export function setValue(path: string, value: any): Promise<any>;
438+
export function update(path: string, value: any): Promise<any>;
439+
export function remove(path: string): Promise<any>;
440+
export function query(onValueEvent: (data: FBData) => void, path: string, options: QueryOptions): Promise<any>;
441+
export function addChildEventListener(onChildEvent: (data: FBData) => void, path: string): Promise<AddEventListenerResult>;
442+
export function addValueEventListener(onValueEvent: (data: FBData) => void, path: string): Promise<AddEventListenerResult>;
443+
export function removeEventListeners(listeners: Array<any>, path: string): Promise<any>;
444+
/**
445+
* Tells the client to keep its local cache in sync with the server automatically.
446+
*/
447+
export function keepInSync(path: string, switchOn: boolean): Promise<any>;
448+
432449
// Analytics, nicely grouped in its own module
433-
namespace analytics {
450+
export module analytics {
434451
export interface LogEventParameter {
435452
key: string;
436453
value: string;
@@ -464,52 +481,32 @@ declare namespace firebase {
464481
function setUserProperty(options: SetUserPropertyOptions): Promise<any>;
465482
}
466483

467-
interface Firebase {
468-
init(options: InitOptions): Promise<any>;
469-
470-
// Database
471-
push(path: string, value: any): Promise<PushResult>;
472-
setValue(path: string, value: any): Promise<any>;
473-
update(path: string, value: any): Promise<any>;
474-
remove(path: string): Promise<any>;
475-
query(onValueEvent: (data: FBData) => void, path: string, options: QueryOptions): Promise<any>;
476-
addChildEventListener(onChildEvent: (data: FBData) => void, path: string): Promise<AddEventListenerResult>;
477-
addValueEventListener(onValueEvent: (data: FBData) => void, path: string): Promise<AddEventListenerResult>;
478-
removeEventListeners(listeners: Array<any>, path: string): Promise<any>;
479-
/**
480-
* Tells the client to keep its local cache in sync with the server automatically.
481-
*/
482-
keepInSync(path: string, switchOn: boolean): Promise<any>;
483-
484-
// Auth
485-
login(options: LoginOptions): Promise<User>;
486-
getAuthToken(option: GetAuthTokenOptions): Promise<string>;
487-
logout(): Promise<any>;
488-
createUser(options: CreateUserOptions): Promise<CreateUserResult>;
489-
deleteUser(): Promise<any>;
490-
resetPassword(options: ResetPasswordOptions): Promise<any>;
491-
changePassword(options: ChangePasswordOptions): Promise<any>;
492-
addAuthStateListener(listener: AuthStateChangeListener): boolean;
493-
removeAuthStateListener(listener: AuthStateChangeListener): boolean;
494-
hasAuthStateListener(listener: AuthStateChangeListener): boolean;
495-
getCurrentUser(): Promise<User>;
496-
497-
// FCM
498-
addOnMessageReceivedCallback(onMessageReceived: (data: Message) => void): Promise<any>;
499-
addOnPushTokenReceivedCallback(onPushTokenReceived: (data: string) => void): Promise<any>;
500-
501-
// remote config
502-
getRemoteConfig(options: GetRemoteConfigOptions): Promise<GetRemoteConfigResult>;
503-
504-
// storage
505-
uploadFile(options: UploadFileOptions): Promise<UploadFileResult>;
506-
downloadFile(options: DownloadFileOptions): Promise<any>;
507-
getDownloadUrl(options: GetDownloadUrlOptions): Promise<string>;
508-
deleteFile(options: DeleteFileOptions): Promise<any>;
509-
510-
// crash logging
511-
// sendCrashLog(options: SendCrashLogOptions): Promise<any>;
512-
}
513-
}
514-
515-
export = firebase;
484+
// Auth
485+
export function login(options: LoginOptions): Promise<User>;
486+
export function getAuthToken(option: GetAuthTokenOptions): Promise<string>;
487+
export function logout(): Promise<any>;
488+
export function createUser(options: CreateUserOptions): Promise<CreateUserResult>;
489+
export function deleteUser(): Promise<any>;
490+
export function resetPassword(options: ResetPasswordOptions): Promise<any>;
491+
export function changePassword(options: ChangePasswordOptions): Promise<any>;
492+
export function addAuthStateListener(listener: AuthStateChangeListener): boolean;
493+
export function removeAuthStateListener(listener: AuthStateChangeListener): boolean;
494+
export function hasAuthStateListener(listener: AuthStateChangeListener): boolean;
495+
export function getCurrentUser(): Promise<User>;
496+
497+
// FCM
498+
export function addOnMessageReceivedCallback(onMessageReceived: (data: Message) => void): Promise<any>;
499+
export function addOnPushTokenReceivedCallback(onPushTokenReceived: (data: string) => void): Promise<any>;
500+
501+
// remote config
502+
export function getRemoteConfig(options: GetRemoteConfigOptions): Promise<GetRemoteConfigResult>;
503+
504+
// storage
505+
export function uploadFile(options: UploadFileOptions): Promise<UploadFileResult>;
506+
export function downloadFile(options: DownloadFileOptions): Promise<any>;
507+
export function getDownloadUrl(options: GetDownloadUrlOptions): Promise<string>;
508+
export function deleteFile(options: DeleteFileOptions): Promise<any>;
509+
510+
// crash logging
511+
// export function sendCrashLog(options: SendCrashLogOptions): Promise<any>;
512+
}

0 commit comments

Comments
 (0)