property-wize-types
v1.3.40
Published
Define data types for front end and backend
Downloads
1,404
Readme
Using property-wize-types Project's Type Definitions
The property-wize-types
project is a library for defining types for frontend and middleware projects. You can add new type files under the src/types
folder of the property-wize-types
project. After adding a new type file, run the npm run generate-index
command to generate the index.ts
file. Then, run npx tsc
command to compile the project.
In the other two projects, dependencies to the property-wize-types
project have been configured, and after compilation, you can use the newly added types in these two projects.
Steps
Add New Type Definitions: Add the new type file to the
src/types
folder of theproperty-wize-types
project.Generate
index.ts
File: Run the following command to generate theindex.ts
file:
npm run generate-index
- Compile the Project: Run the following command to compile the project:
npx tsc
- Use in Other Projects:
Dependencies to the
property-wize-types
project have already been configured in the other two projects. You can directly import and use the newly added types.
Example
Suppose you have added a new type file named NewType.ts
to the src/types
folder. Follow these steps:
- Define the new type in the
NewType.ts
file. - Run
npm run generate-index
to generate theindex.ts
file. - Run
npx tsc
to compile the project. - Import and use the
NewType
type in the other projects.
// Importing the newly added type in other projects
import { NewType } from 'property-wize-types';
You can save the above code as a Markdown file and adjust it as needed. Let me know if you need further assistance!