Skip to content

Commit

Permalink
feat(ts): add ts declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Armanio committed Oct 2, 2019
1 parent 9f7af6d commit 2bc2d85
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "cordova-plugin-firebasex",
"version": "6.1.0",
"description": "Cordova plugin for Google Firebase",
"types": "./types/index.d.ts",
"author": {
"name": "Dave Alden"
},
Expand Down
59 changes: 59 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
interface IChannelOptions {
id: string
name?: string
sound?: string
vibration?: boolean | number[]
light?: boolean
lightColor?: string
importance?: 0 | 1 | 2 | 3 | 4
badge?: boolean
visibility?: -1 | 0 | 1
}

interface FirebasePlugin {
getToken(success: (value: string) => void, error: (err: string) => void): void
onTokenRefresh(success: (value: string) => void, error: (err: string) => void): void
getAPNSToken(success: (value: string) => void, error: (err: string) => void): void
onMessageReceived(success: (value: object) => void, error: (err: string) => void): void
grantPermission(success: (value: boolean) => void, error: (err: string) => void): void
hasPermission(success: (value: boolean) => void, error: (err: string) => void): void
unregister(): void
setBadgeNumber(badgeNumber: number): void
getBadgeNumber(success: (badgeNumber: number) => void, error: (err: string) => void): void
clearAllNotifications(): void
subscribe(topic: string): void
unsubscribe(topic: string): void
createChannel(channel: IChannelOptions, success: () => void, error: (err: string) => void): void
setDefaultChannel(channel: IChannelOptions, success: () => void, error: (err: string) => void): void
deleteChannel(channel: string, success: () => void, error: (err: string) => void): void
listChannels(success: (list: { id: string; name: string }[]) => void, error: (err: string) => void): void
setAnalyticsCollectionEnabled(setEnabled: boolean): void
logEvent(eventName: string, eventProperties: object): void
setScreenName(screenName: string): void
setUserId(userId: string): void
setUserProperty(userName: string, userValue: string): void
setCrashlyticsCollectionEnabled(): void
setCrashlyticsUserId(userId: string): void
sendCrash(): void
logMessage(message: string): void
logError(errorMessage: string): void
verifyPhoneNumber(
phoneNumber: string,
timeOutDuration: number,
success: (value: string | object) => void,
error: (err: string) => void
): void
fetch(cacheExpirationSeconds: number, success: () => void, error: (err: string) => void): void
fetch(success: () => void, error: (err: string) => void): void
activateFetched(success: (activated: boolean) => void, error: (err: string) => void): void
getValue(key: string, success: (value: string) => void, error: (err: string) => void): void
getByteArray(key: string, success: (value: object) => void, error: (err: string) => void): void
getInfo(success: (info: object) => void, error: (err: string) => void): void
setConfigSettings(configSettings: object, success: (info: object) => void, error: (err: string) => void): void
setDefaults(defaultSettings: object, success: (info: object) => void, error: (err: string) => void): void
setPerformanceCollectionEnabled(setEnabled: boolean): void
startTrace(name: string, success: () => void, error: (err: string) => void): void
incrementCounter(name: string, counterName: string, success: () => void, error: (err: string) => void): void
stopTrace(name: string): void
}
declare var FirebasePlugin: FirebasePlugin;

0 comments on commit 2bc2d85

Please sign in to comment.