Core API Reference

This section provides a comprehensive overview of the core APIs available in the MSDN framework. These APIs form the foundation for building robust and scalable applications.

General Utilities

DateTime Class

Provides functionality for manipulating dates and times.


// Example Usage
let now = DateTime.Now();
console.log(now.ToString("yyyy-MM-dd HH:mm:ss"));
        

StringHelper Module

Offers various utility methods for string manipulation.


// Example Usage
if (!StringHelper.IsNullOrEmpty(userName)) {
    console.log("User name is valid.");
}
        

Console Object

Provides methods for interacting with the console output.


// Example Usage
Console.Log("Application started.");
Console.Error("Failed to load configuration.");
        

MathUtils Module

Contains mathematical functions and constants.

Method/Property Description Signature
MathUtils.PI The mathematical constant π. number
MathUtils.Sqrt(number) Returns the square root of a number. (number) => number
MathUtils.Abs(number) Returns the absolute value of a number. (number) => number
MathUtils.Max(a, b) Returns the larger of two numbers. (a: number, b: number) => number

ConfigurationManager

Manages application configuration settings.

This class allows you to access and manage configuration settings for your application, typically loaded from a configuration file.

// Example Usage
ConfigurationManager.Load("appsettings.json");
let apiEndpoint = ConfigurationManager.GetValue("api:endpoint");
console.log(`API Endpoint: ${apiEndpoint}`);
        

Error Handling

The core API includes robust error handling mechanisms. Exceptions are thrown for critical errors, and specific error codes may be returned for less severe issues.

Common Exception Types