UNPKG

@praecise/tere

Version:

Trusted Execution Runtime Environment SDK

47 lines (46 loc) 1.57 kB
import { PackageOptions, ScriptMetadata } from './types'; /** * Utilities for packaging TERE scripts */ export declare class TerePackager { /** * Magic header for TERE scripts */ private static readonly MAGIC_HEADER; /** * Create a TERE script from code and metadata * @param options Packaging options * @returns The compiled TERE binary as a Buffer */ static createScript(options: PackageOptions): Buffer; /** * Validate a TERE script * @param script The TERE script to validate * @returns True if the script is valid, false otherwise */ static validateScript(script: Buffer): boolean; /** * Extract metadata from a TERE script * @param script The TERE script to extract metadata from * @returns The metadata as a ScriptMetadata object */ static extractMetadata(script: Buffer): ScriptMetadata; /** * Get the script ID from a TERE script * @param script The TERE script to get the ID from * @returns The script ID, or null if not found */ static getScriptId(script: Buffer): string | null; /** * Generate a UUID (fallback for older Node.js versions) * @returns A UUID string */ private static generateUUID; /** * Update the functions list in a TERE script * @param script The TERE script to update * @param functions The updated list of exported functions * @returns The updated TERE binary as a Buffer */ static updateFunctions(script: Buffer, functions: string[]): Buffer; }