-
Notifications
You must be signed in to change notification settings - Fork 83
feat: Added declaration file for notification center index.d.ts #574
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
Conversation
This PR is based on project config declaration branch, before merging into master, we'll have to rebase once project config declaration file PR is merged. |
* limitations under the License. | ||
*/ | ||
|
||
import { UserAttributes, Experiment, Variation } from '@optimizely/optimizely-sdk'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move imports inside the module
|
||
export type Options = { | ||
logger: LogHandler; | ||
errorHandle: ErrorHandler; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be errorHandler
instead of errorHandle
*/ | ||
|
||
declare module '@optimizely/optimizely-sdk/lib/core/notification_center' { | ||
import { UserAttributes, Experiment, Variation } from '@optimizely/optimizely-sdk'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase and update these imports, which are now live in shared_types.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, please make this change.
*/ | ||
|
||
declare module '@optimizely/optimizely-sdk/lib/core/notification_center' { | ||
import { UserAttributes, Experiment, Variation } from '@optimizely/optimizely-sdk'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, please make this change.
@@ -180,7 +180,7 @@ declare module '@optimizely/optimizely-sdk' { | |||
logEvent: Event; | |||
} | |||
|
|||
interface Experiment { | |||
export interface Experiment { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't export this
@@ -196,7 +196,7 @@ declare module '@optimizely/optimizely-sdk' { | |||
forcedVariations: object; | |||
} | |||
|
|||
interface Variation { | |||
export interface Variation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't export this
e9ce6f8
to
fcc31fd
Compare
…ected and linting fixed
…pt-sdk into uzair/nc_declaration
decisionInfo?: DecisionInfo; | ||
experiment?: import('../../shared_types').Experiment; | ||
variation?: import('../../shared_types').Variation; | ||
logEvent?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be logEvent?: Event;
, which lives in @optimizely/optimizely-sdk
. I think it would make sense if we move it to share_types.ts
and import it here, as well as into@optimizely/optimizely-sdk
module.
}; | ||
|
||
export interface NotificationData { | ||
type?: DECISION_NOTIFICATION_TYPES; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
type?: DECISION_NOTIFICATION_TYPES
is causing a compiler error. Please change it to string
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look good except for a couple of comments!
variation?: import('../../shared_types').Variation; | ||
logEvent?: string; | ||
eventKey?: string; | ||
eventTags?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change to eventTags?: import('../../shared_types').EventTags
Summary
Test plan