Skip to content

Commit

Permalink
Merge pull request #20 from OneSignal/cd_update
Browse files Browse the repository at this point in the history
Generator Update
  • Loading branch information
rgomezp authored Mar 23, 2023
2 parents 9cfefe0 + 12af4ca commit fb4c1f0
Showing 1 changed file with 34 additions and 41 deletions.
75 changes: 34 additions & 41 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,65 +153,58 @@ interface IInitObject {
}

interface IOneSignalOneSignal {
login(externalId: string, jwtToken?: string): Promise<void>
logout(): Promise<void>
init(options: IInitObject): Promise<void>
setConsentGiven(consent: boolean): Promise<void>
setConsentRequired(requiresConsent: boolean): Promise<void>
Slidedown: IOneSignalSlidedown;
Notifications: IOneSignalNotifications;
Session: IOneSignalSession;
User: IOneSignalUser;
Debug: IOneSignalDebug;
[index: string]: any;
login(externalId: string, jwtToken?: string): Promise<void>;
logout(): Promise<void>;
init(options: IInitObject): Promise<void>;
setConsentGiven(consent: boolean): Promise<void>;
setConsentRequired(requiresConsent: boolean): Promise<void>;
}
interface IOneSignalNotifications {
setDefaultUrl(url: string): Promise<void>
setDefaultTitle(title: string): Promise<void>
isPushSupported(): boolean
getPermissionStatus(onComplete: Action<NotificationPermission>): Promise<NotificationPermission>
requestPermission(): Promise<void>
addEventListener(event: NotificationEventName, listener: (obj: any) => void): void
removeEventListener(event: NotificationEventName, listener: (obj: any) => void): void
[index: string]: any;
setDefaultUrl(url: string): Promise<void>;
setDefaultTitle(title: string): Promise<void>;
isPushSupported(): boolean;
getPermissionStatus(onComplete: Action<NotificationPermission>): Promise<NotificationPermission>;
requestPermission(): Promise<void>;
addEventListener(event: NotificationEventName, listener: (obj: any) => void): void;
removeEventListener(event: NotificationEventName, listener: (obj: any) => void): void;
}
interface IOneSignalSlidedown {
promptPush(options?: AutoPromptOptions): Promise<void>
promptPushCategories(options?: AutoPromptOptions): Promise<void>
promptSms(options?: AutoPromptOptions): Promise<void>
promptEmail(options?: AutoPromptOptions): Promise<void>
promptSmsAndEmail(options?: AutoPromptOptions): Promise<void>
addEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void
removeEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void
[index: string]: any;
promptPush(options?: AutoPromptOptions): Promise<void>;
promptPushCategories(options?: AutoPromptOptions): Promise<void>;
promptSms(options?: AutoPromptOptions): Promise<void>;
promptEmail(options?: AutoPromptOptions): Promise<void>;
promptSmsAndEmail(options?: AutoPromptOptions): Promise<void>;
addEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;
removeEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void;
}
interface IOneSignalDebug {
setLogLevel(logLevel: string): void
[index: string]: any;
setLogLevel(logLevel: string): void;
}
interface IOneSignalSession {
sendOutcome(outcomeName: string, outcomeWeight?: number): Promise<void>
sendUniqueOutcome(outcomeName: string): Promise<void>
[index: string]: any;
sendOutcome(outcomeName: string, outcomeWeight?: number): Promise<void>;
sendUniqueOutcome(outcomeName: string): Promise<void>;
}
interface IOneSignalUser {
addAlias(label: string, id: string): void
addAliases(aliases: { [key: string]: string }): void
removeAlias(label: string): void
removeAliases(labels: string[]): void
addEmail(email: string): void
removeEmail(email: string): void
addSms(smsNumber: string): void
removeSms(smsNumber: string): void
PushSubscription: IOneSignalPushSubscription;
[index: string]: any;
addAlias(label: string, id: string): void;
addAliases(aliases: { [key: string]: string }): void;
removeAlias(label: string): void;
removeAliases(labels: string[]): void;
addEmail(email: string): void;
removeEmail(email: string): void;
addSms(smsNumber: string): void;
removeSms(smsNumber: string): void;
}
interface IOneSignalPushSubscription {
optIn(): Promise<void>
optOut(): Promise<void>
addEventListener(event: 'subscriptionChange', listener: (change: SubscriptionChangeEvent) => void): void
removeEventListener(event: 'subscriptionChange', listener: (change: SubscriptionChangeEvent) => void): void
[index: string]: any;
optIn(): Promise<void>;
optOut(): Promise<void>;
addEventListener(event: 'subscriptionChange', listener: (change: SubscriptionChangeEvent) => void): void;
removeEventListener(event: 'subscriptionChange', listener: (change: SubscriptionChangeEvent) => void): void;
}

function oneSignalLogin(externalId: string, jwtToken?: string): Promise<void> {
Expand Down

0 comments on commit fb4c1f0

Please sign in to comment.