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

[BUG] Missing types for notificationCenter.addNotificationListener #962

Open
1 task done
rupesh-checkatrade opened this issue Nov 18, 2024 · 1 comment
Open
1 task done

Comments

@rupesh-checkatrade
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

SDK Version

5.3.4

Current Behavior

There are no types exported for the 'decisionPayload' that comes back from an notificationCenter.addNotificationListener

Expected Behavior

Precise types should be exported for the object returned to the callback

Steps To Reproduce

  1. setup the SDK in an TypeScript project
  2. add a notificationCenter.addNotificationListener
  3. try to set/infer the type of the parameters in the callback

SDK Type

Browser

Node Version

No response

Browsers impacted

No response

Link

No response

Logs

No response

Severity

No response

Workaround/Solution

No response

Recent Change

No response

Conflicts

No response

@rupesh-checkatrade
Copy link
Author

I've had to construct my own using a selection of other exported types:

interface OptimizelyDecisionInfo
  extends Omit<OptimizelyDecision, 'userContext' | 'reasons'> {
  decisionEventDispatched: boolean;
}

interface OptimizelyDecisionCallbackPayload extends ListenerPayload {
  type: string; // declared enum in but not exposed from @optimizely/optimizely-sdk/dist/utils/enums/index.d.ts
  decisionInfo: OptimizelyDecisionInfo;
}

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

No branches or pull requests

1 participant