This namespace serves as the main container for the ts-workspace module's core components.
Namespaces
- ChildNamespace
Child namespace containing additional components that extend the functionality of the parent namespace.
The namespace includes:
- Child class definitions (from "./ChildClass")
- Child interface declarations (from "./ChildInterface")
- Enum declarations (from "./Enum")
- Utility functions (from "./function")
This namespace provides additional tools and structures that complement the core components of the ts-workspace module, allowing for more specialized and extended use cases.
Type Definitions
string
|
T
# Type
A union type of string and a generic type T that allows for flexible typing. It allows for flexible typing where a value can be either a string or of any other specified type.
This type represents either a string or a value of the generic type T.
Examples
// Using Type with a specific type
type StringOrNumber = Type<number>;
const value1: StringOrNumber = "Hello"; // valid
const value2: StringOrNumber = 42; // valid
const value3: StringOrNumber = true; // invalid
// Using Type in a function
function processValue<T>(value: Type<T>): void {
if (typeof value === 'string') {
console.log('String value:', value);
} else {
console.log('Non-string value:', value);
}
}