Skip to content

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

Merged
merged 9 commits into from
Sep 28, 2020

Conversation

ozayr-zaviar
Copy link
Contributor

Summary

  • Added declaration file in notification center index.d.ts

Test plan

  • All test cases must work fine. No unit test to test declaration file for now.

@ozayr-zaviar
Copy link
Contributor Author

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.

@ozayr-zaviar ozayr-zaviar removed their assignment Sep 22, 2020
@coveralls
Copy link

coveralls commented Sep 22, 2020

Coverage Status

Coverage remained the same at 96.638% when pulling 85ef8c4 on uzair/nc_declaration into 530223e on master.

* limitations under the License.
*/

import { UserAttributes, Experiment, Variation } from '@optimizely/optimizely-sdk';
Copy link
Contributor

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;
Copy link
Contributor

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

@msohailhussain msohailhussain requested review from mjc1283 and a team September 23, 2020 20:29
@msohailhussain msohailhussain marked this pull request as ready for review September 23, 2020 20:30
*/

declare module '@optimizely/optimizely-sdk/lib/core/notification_center' {
import { UserAttributes, Experiment, Variation } from '@optimizely/optimizely-sdk';
Copy link
Contributor

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

Copy link
Contributor

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.

@yavorona yavorona self-requested a review September 24, 2020 16:38
*/

declare module '@optimizely/optimizely-sdk/lib/core/notification_center' {
import { UserAttributes, Experiment, Variation } from '@optimizely/optimizely-sdk';
Copy link
Contributor

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 {
Copy link
Contributor

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't export this

@msohailhussain msohailhussain changed the base branch from master to convert_semver_to_ts September 25, 2020 17:05
@msohailhussain msohailhussain changed the base branch from convert_semver_to_ts to master September 25, 2020 17:05
decisionInfo?: DecisionInfo;
experiment?: import('../../shared_types').Experiment;
variation?: import('../../shared_types').Variation;
logEvent?: string;
Copy link
Contributor

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;
Copy link
Contributor

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.

Copy link
Contributor

@yavorona yavorona left a 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;
Copy link
Contributor

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

@mjc1283 mjc1283 merged commit ff62ee4 into master Sep 28, 2020
@mjc1283 mjc1283 deleted the uzair/nc_declaration branch September 28, 2020 19:25
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.

6 participants