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

Likhith/75850/configure account package for ts migration #15

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"]
}