Skip to content

Commit

Permalink
Merge pull request #98 from codeSafari10/master
Browse files Browse the repository at this point in the history
Add Readme for ts-library
  • Loading branch information
MUzairS15 committed Jul 9, 2024
2 parents ee38e6e + 11ff972 commit 21a6fb2
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions typescript/README.md
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;
}
```




0 comments on commit 21a6fb2

Please sign in to comment.