Getting Started
The Common Types Library provides a set of general types and interfaces for the Softkit ecosystem, frequently used in auto-generated code to ensure consistency and reduce redundancy.
Installation
To include the Common Types Library in your project, install it via yarn:
yarn add @softkit/common-types
Basic Usage
The library includes a variety of types for general use across your applications. Below is a list of some key types and where to find more information on them:
Standard Types
SimpleResponseForCreatedEntityWithMessage
: A response structure for newly created entities.IdParamUUID
: For validating UUID parameters in requests.VersionNumberParam
: Validates version numbers as non-negative integers.
Utility Types
ExcludeKeys
: Excludes specified keys from a type.ExtractArrayMembers
: Extracts member types from array types.Maybe
: Represents a type that can beundefined
.
These types are integral to DTOs, entity definitions, and other complex types, providing a consistent structure across your services.