generated from meshery/meshery
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from codeSafari10/master
Add Readme for ts-library
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
**Overview** | ||
|
||
This library provides TypeScript interfaces corresponding to OpenAPI/JSON schemas. These interfaces are auto-generated, offering type safety and improved developer experience when working with API data. | ||
|
||
**Key Features** | ||
|
||
* **Type Safety:** TypeScript interfaces enforce type checks, preventing errors during development and improving code reliability. | ||
* **Enhanced Developer Experience:** Auto-completion and code validation provided by TypeScript make working with API data more efficient. | ||
* **Organized Namespace Structure:** Clear separation of types by schema version using namespaces avoids naming conflicts and promotes maintainability. | ||
|
||
**Namespace Structure** | ||
|
||
The library organizes types by schema version within the `index.js` file. This approach ensures clarity and prevents name conflicts when using multiple schema versions simultaneously. | ||
|
||
**Example:** | ||
|
||
|
||
```typescript | ||
export namespace v1alpha1 { | ||
export type CatalogData = CatalogDataT; | ||
export type CatalogCaveatsAndConsiderations = CaveatsAndConsiderations; | ||
} | ||
|
||
export namespace v1alpha2 { | ||
export type Design = DesignSchema; | ||
export type Relationship = HttpsSchemasMesheryIoRelationshipJson; | ||
} | ||
|
||
export namespace v1beta1 { | ||
export type Component = HttpsSchemasMesheryIoComponentJson; | ||
export type Model = HttpsSchemasMesheryIoModelJson; | ||
} | ||
``` | ||
|
||
|
||
|
||
|