Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ts): add ts declaration #166

Merged
merged 1 commit into from
Oct 21, 2019
Merged

feat(ts): add ts declaration #166

merged 1 commit into from
Oct 21, 2019

Conversation

Armanio
Copy link

@Armanio Armanio commented Oct 2, 2019

I tried to declare all methods, but I can wrong. Feel free to point out errors.
Thank you!

@dpa99c dpa99c merged commit 2928104 into dpa99c:master Oct 21, 2019
@Armanio Armanio deleted the feat/ts branch October 21, 2019 15:36
@Birowsky
Copy link
Sponsor

Birowsky commented Nov 3, 2019

Thanx for the effort, this is not published, right?

I took a look at the commit, however, the onMessageReceived payload is not typed.

Can you please let me know whether I inferred the correct type based on the docs?

type Notification //payload type
  = FirebaseNotifIos
  | FirebaseNotifAndroid

type FirebaseNotifIos = MessageType & {
  aps: { alert: { title: string, body: string } }
  payload: string
}

type FirebaseNotifAndroid = MessageType & {
  title?: string
  body?: string
  payload: string
}

type MessageType
  = { messageType: 'data' }
  | { messageType: 'notification', tap: 'background' | 'foreground' };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants