eduone-types
v1.0.13
Published
Type declarations for module federation shared APIs
Downloads
46
Maintainers
Readme
eduone-types
Type declarations for module federation shared APIs
Mô tả
Thư viện này cung cấp các type definitions cho các remote apps được share qua Module Federation trong hệ sinh thái EduOne.
Cài đặt
npm install eduone-typesUsage
Import types cho remoteApp
import type { ButtonProps, CardProps } from "remoteApp/components";
import type { CountingStoreAPI, ProfileStoreAPI } from "remoteApp/api";
import type { AppProps } from "remoteApp/App";Import types cho userRemoteApp
import type { sum, minus } from "userRemoteApp/utils";Import types cho hostApp
import type { CommonAPIStore } from "hostApp/stores";Import MUI extensions
// Import để extend MUI Typography variants và Palette
import "eduone-types/mui";Import types cho trainingService
import type { IAcademicYear, IAcademicCohort } from "trainingService/types";
import type {
ACADEMIC_YEAR_STATUS_ENUM,
ACADEMIC_COHORT_STATUS_ENUM,
} from "trainingService/enums";Cấu trúc
eduone-types/
├── remoteTypes/
│ ├── remoteApp/
│ │ └── index.d.ts # Types cho remoteApp
│ ├── userRemoteApp/
│ │ └── index.d.ts # Types cho userRemoteApp
│ ├── hostApp/
│ │ └── index.d.ts # Types cho hostApp
│ ├── mui/
│ │ └── index.d.ts # MUI extensions
│ └── trainingService/
│ └── index.d.ts # Types cho trainingService
├── package.json
└── tsconfig.jsonPhát triển
Thêm types mới
- Mở file tương ứng trong
remoteTypes/ - Thêm module declaration mới
- Cập nhật version trong
package.json - Publish:
npm publish
Cấu hình TypeScript
File tsconfig.json đã được cấu hình sẵn để:
- Compile to ES2020
- Generate declaration files
- Support ESNext modules
- Enable strict mode
Peer Dependencies
- react >= 19.0.0
- react-dom >= 19.0.0
- @emotion/react >= 11.14.0
- @emotion/styled >= 11.14.0
- @mui/material >= 7.0.2
License
MIT
Author
Vu Nam
