[types] Add missing typescript statics for messaging, notifications and links

This commit is contained in:
Chris Bianca 2018-04-12 08:50:13 +01:00
parent 1838089684
commit 590d69ce89
1 changed files with 36 additions and 10 deletions

46
lib/index.d.ts vendored
View File

@ -30,9 +30,9 @@ declare module "react-native-firebase" {
firestore: FirebaseModuleAndStatics<RNFirebase.firestore.Firestore, RNFirebase.firestore.FirestoreStatics>; firestore: FirebaseModuleAndStatics<RNFirebase.firestore.Firestore, RNFirebase.firestore.FirestoreStatics>;
iid: FirebaseModuleAndStatics<RNFirebase.iid.InstanceId> iid: FirebaseModuleAndStatics<RNFirebase.iid.InstanceId>
// invites: FirebaseModuleAndStatics<RNFirebase.invites.Invites> // invites: FirebaseModuleAndStatics<RNFirebase.invites.Invites>
links: FirebaseModuleAndStatics<RNFirebase.links.Links>; links: FirebaseModuleAndStatics<RNFirebase.links.Links, RNFirebase.links.LinksStatics>;
messaging: FirebaseModuleAndStatics<RNFirebase.messaging.Messaging>; messaging: FirebaseModuleAndStatics<RNFirebase.messaging.Messaging, RNFirebase.messaging.MessagingStatics>;
notifications: FirebaseModuleAndStatics<RNFirebase.notifications.Notifications>; notifications: FirebaseModuleAndStatics<RNFirebase.notifications.Notifications, RNFirebase.notifications.NotificationsStatics>;
// perf: FirebaseModuleAndStatics<RNFirebase.perf.Perf>; // perf: FirebaseModuleAndStatics<RNFirebase.perf.Perf>;
storage: FirebaseModuleAndStatics<RNFirebase.storage.Storage>; storage: FirebaseModuleAndStatics<RNFirebase.storage.Storage>;
// utils: FirebaseModuleAndStatics<RNFirebase.utils.Utils>; // utils: FirebaseModuleAndStatics<RNFirebase.utils.Utils>;
@ -940,6 +940,10 @@ declare module "react-native-firebase" {
setTo(to: string): RemoteMessage setTo(to: string): RemoteMessage
setTtl(ttl: number): RemoteMessage setTtl(ttl: number): RemoteMessage
} }
interface MessagingStatics {
RemoteMessage: RemoteMessage;
}
} }
namespace iid { namespace iid {
@ -1087,7 +1091,7 @@ declare module "react-native-firebase" {
setOnlyAlertOnce(onlyAlertOnce: boolean): Notification setOnlyAlertOnce(onlyAlertOnce: boolean): Notification
setPriority(priority: Android.Priority): Notification setPriority(priority: Android.Priority): Notification
setProgress(max: number, progress: number, indeterminate: boolean): Notification setProgress(max: number, progress: number, indeterminate: boolean): Notification
//setPublicVersion(publicVersion: Notification): Notification //setPublicVersion(publicVersion: Notification): Notification
setRemoteInputHistory(remoteInputHistory: string[]): Notification setRemoteInputHistory(remoteInputHistory: string[]): Notification
setShortcutId(shortcutId: string): Notification setShortcutId(shortcutId: string): Notification
setShowWhen(showWhen: boolean): Notification setShowWhen(showWhen: boolean): Notification
@ -1170,7 +1174,7 @@ declare module "react-native-firebase" {
constructor(groupId: string, name: string) constructor(groupId: string, name: string)
} }
export enum BadgeIconType { export enum BadgeIconType {
Large = 2, Large = 2,
None = 0, None = 0,
@ -1199,13 +1203,13 @@ declare module "react-native-firebase" {
Sound = 1, Sound = 1,
Vibrate = 2 Vibrate = 2
} }
export enum GroupAlert { export enum GroupAlert {
All = 0, All = 0,
Children = 2, Children = 2,
Summary = 1 Summary = 1
} }
export enum Importance { export enum Importance {
Default = 3, Default = 3,
High = 4, High = 4,
@ -1223,7 +1227,7 @@ declare module "react-native-firebase" {
Max = 2, Max = 2,
Min = -2 Min = -2
} }
export enum SemanticAction { export enum SemanticAction {
Archive = 5, Archive = 5,
Call = 10, Call = 10,
@ -1237,7 +1241,7 @@ declare module "react-native-firebase" {
ThumbsUp = 8, ThumbsUp = 8,
Unmute = 7 Unmute = 7
} }
export enum Visibility { export enum Visibility {
Private = 0, Private = 0,
Public = 1, Public = 1,
@ -1256,7 +1260,7 @@ declare module "react-native-firebase" {
progress: number; progress: number;
} }
} }
class IOSNotification { class IOSNotification {
alertAction?: string alertAction?: string
attachments: IOSAttachment[] attachments: IOSAttachment[]
@ -1287,6 +1291,24 @@ declare module "react-native-firebase" {
thumbnailClippingRect: any thumbnailClippingRect: any
thumbnailTime: string thumbnailTime: string
} }
interface NotificationsStatics {
Android: {
Action: Android.Action,
BadgeIconType: Android.BadgeIconType,
Category: Android.Category,
Channel: Android.Channel,
ChannelGroup: Android.ChannelGroup,
Defaults: Android.Defaults,
GroupAlert: Android.GroupAlert,
Importance: Android.Importance,
Priority: Android.Priority,
RemoteInput: Android.RemoteInput,
SemanticAction: Android.SemanticAction,
Visibility: Android.Visibility,
};
Notification: Notification;
}
} }
namespace crash { namespace crash {
@ -1426,6 +1448,10 @@ declare module "react-native-firebase" {
setImageUrl(imageUrl: string): DynamicLink setImageUrl(imageUrl: string): DynamicLink
setTitle(title: string): DynamicLink setTitle(title: string): DynamicLink
} }
interface LinksStatics {
DynamicLink: DynamicLink;
}
} }
namespace firestore { namespace firestore {