Skip to content

Commit

Permalink
Merge pull request #15 from likhith-deriv/likhith/75850/configure-acc…
Browse files Browse the repository at this point in the history
…ount-package-for-ts-migration

Likhith/75850/configure account package for ts migration
  • Loading branch information
suisin-deriv committed Oct 28, 2022
2 parents 471f971 + 74d0210 commit ef40752
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 7 deletions.
5 changes: 4 additions & 1 deletion packages/account/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ module.exports = {
webpack: { config: webpackConfig({}) },
},
},
};
rules: {
'import/no-extraneous-dependencies': ['off', { devDependencies: ['**/*.spec.*'] }],
},
};
1 change: 1 addition & 0 deletions packages/account/build/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const ALIASES = {
Services: path.resolve(__dirname, '../src/Services'),
Stores: path.resolve(__dirname, '../src/Stores'),
Styles: path.resolve(__dirname, '../src/Styles'),
Types: path.resolve(__dirname, '../src/Types'),
};

const rules = (is_test_env = false, is_mocha_only = false) => [
Expand Down
1 change: 1 addition & 0 deletions packages/account/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '@binary-com/binary-document-uploader';
1 change: 1 addition & 0 deletions packages/account/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"dependencies": {
"@binary-com/binary-document-uploader": "^2.4.7",
"@deriv/api-types": "1.0.54",
"@deriv/components": "^1.0.0",
"@deriv/shared": "^1.0.0",
"@deriv/translations": "^1.0.0",
Expand Down
11 changes: 11 additions & 0 deletions packages/account/src/Types/common-prop.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export type TFormValidation = {
warnings: { [key: string]: string };
errors: { [key: string]: string };
};

export type TToken = {
display_name: string;
last_used: string;
scopes: string[];
token: string;
};
18 changes: 18 additions & 0 deletions packages/account/src/Types/context.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { TToken } from './common-prop.type';

export type TPlatformContext = {
is_appstore: boolean;
displayName: string;
};

export type TApiContext = {
api_tokens: NonNullable<TToken[]> | undefined;
deleteToken: (token: string) => Promise<void>;
footer_ref: Element | DocumentFragment | undefined;
overlay_ref:
| ((...args: unknown[]) => unknown)
| import('prop-types').InferProps<{
current: import('prop-types').Requireable<unknown>;
}>;
toggleOverlay: () => void;
};
2 changes: 2 additions & 0 deletions packages/account/src/Types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './common-prop.type';
export * from './context.type';
10 changes: 4 additions & 6 deletions packages/account/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,13 @@
"Containers/*": ["src/Containers/*"],
"Constants/*": ["src/Constants/*"],
"Configs/*": ["src/Configs/*"],
"Duplicated/*": ["src/Duplicated/*"],
"Helpers/*": ["src/Helpers/*"],
"Layout/*": ["src/Layout/*"],
"Modules/*": ["src/Modules/*"],
"Sections/*": ["src/Sections/*"],
"Stores/*": ["src/Stores/*"],
"Styles/*": ["src/Styles/*"],
"@deriv/*": ["../*/src"]
"Types": ["src/Types"],
"@deriv/*": ["../*/src"],
}
},
"include": ["src"]
}
"include": ["src","globals.d.ts"]
}

0 comments on commit ef40752

Please sign in to comment.