SDK Reference
Welcome to the comprehensive reference documentation for the Microsoft Software Development Kit (SDK). This guide provides detailed information on classes, functions, interfaces, and structures available within the SDK, enabling you to build powerful and innovative applications.
Core API
The Core API provides fundamental building blocks for your applications, including essential data structures, object management, and fundamental system interactions.
Class: SystemManager
Manages system-level operations such as process management, configuration loading, and global event handling.
Methods:
Initialize(configPath: string): boolean: Initializes the SDK with a given configuration file. Returns true on success.Shutdown(): void: Shuts down the SDK gracefully.GetVersion(): string: Returns the current SDK version.
Function: Utils.ValidateInput(input: any): boolean
Performs basic validation on input parameters. Returns true if the input is considered valid.
Example: Initializing the SDK
import { SystemManager } from 'msdn-sdk/core';
const configPath = './config/settings.json';
if (SystemManager.Initialize(configPath)) {
console.log('SDK initialized successfully.');
console.log('SDK Version:', SystemManager.GetVersion());
} else {
console.error('Failed to initialize SDK.');
}
Networking
This module facilitates network communication, including HTTP requests, WebSocket connections, and data serialization.
Class: HttpClient
A robust client for making HTTP requests.
Methods:
Get(url: string, options?: object): Promise<Response>: Performs a GET request.Post(url: string, data: any, options?: object): Promise<Response>: Performs a POST request.Put(url: string, data: any, options?: object): Promise<Response>: Performs a PUT request.Delete(url: string, options?: object): Promise<Response>: Performs a DELETE request.
Interface: Response
Represents a network response.
status: number: The HTTP status code.data: any: The response body data.headers: Headers: The response headers.
Graphics
Provides tools for rendering graphics, handling image manipulation, and managing visual effects.
Class: CanvasRenderer
Renders graphics onto an HTML canvas element.
Methods:
DrawLine(x1: number, y1: number, x2: number, y2: number, color: string, lineWidth: number): voidDrawRectangle(x: number, y: number, width: number, height: number, color: string, lineWidth?: number): voidFillCircle(x: number, y: number, radius: number, color: string): void
Storage
Offers persistent and temporary data storage solutions.
Class: LocalStorage
Provides access to the browser's local storage.
Methods:
SetItem(key: string, value: string): voidGetItem(key: string): string | nullRemoveItem(key: string): voidClear(): void
Security
Includes utilities for encryption, decryption, and secure data handling.
Class: CryptoHelper
Provides cryptographic functions.
Methods:
Encrypt(data: string, key: string): Promise<string>Decrypt(encryptedData: string, key: string): Promise<string>
UI Elements
Reusable UI components and styling utilities.
Component: Button
A customizable button component.
Properties: label: string, onClick: function, type: 'primary' | 'secondary' | 'danger', disabled: boolean
Utilities
General-purpose helper functions.
Function: DateTime.Format(date: Date, formatString: string): string
Formats a Date object into a string according to the specified format.
Example format strings: 'YYYY-MM-DD HH:mm:ss', 'MM/DD/YYYY'