/** * Main entry point for AIT (Apps-in-Toss) bundle operations. */ import { AITReader, AITReaderOptions } from "./reader"; import { AITWriter, AITWriterOptions } from "./writer"; import { Format } from "./format"; /** * Main entry point for AIT bundle operations. * * @example * ```typescript * // Writing (auto-generated UUIDv7 for deploymentId) * const writer = AppsInTossBundle.writer({ appName: "app-name" }); * writer.setMetadata({ platform: PlatformType.REACT_NATIVE }); * writer.addFile("index.html", new TextEncoder().encode("...")); * const buffer = await writer.toBuffer(); * * // Writing with explicit deploymentId * const writer = AppsInTossBundle.writer({ * deploymentId: "019bfa90-ad4c-799f-b227-b4159e6867f7", * appName: "app-name", * }); * * // Reading * const reader = AppsInTossBundle.reader(buffer); * console.log(reader.deploymentId); * console.log(reader.appName); * const content = await reader.readEntry("index.html"); * ``` */ export declare class AppsInTossBundle { private constructor(); /** * Create a new writer. * * @param options Writer options including deploymentId and appName * @returns AITWriter instance */ static writer(options: AITWriterOptions): AITWriter; /** * Create a reader from a Uint8Array buffer. * * @param buffer AIT file contents * @param options Reader options * @returns AITReader instance */ static reader(buffer: Uint8Array, options?: AITReaderOptions): AITReader; /** * Create a reader from an ArrayBuffer. * * @param buffer AIT file contents as ArrayBuffer * @param options Reader options * @returns AITReader instance */ static readerFromArrayBuffer(buffer: ArrayBuffer, options?: AITReaderOptions): AITReader; /** * Get the current format version. * * @returns Current format version */ static getFormatVersion(): number; /** * Get the magic bytes identifying AIT files. * * @returns Magic bytes */ static getMagic(): Uint8Array; /** * Bundle format types. */ static readonly Format: typeof Format; /** * Detect the bundle format from a buffer. * * @param buffer - The buffer to detect format from (only first 8 bytes are needed) * @returns The detected format * * @example * ```typescript * const buffer = await fs.readFile("bundle.ait"); * const format = AppsInTossBundle.detect(buffer); * * if (format === AppsInTossBundle.Format.AIT) { * const reader = AppsInTossBundle.reader(buffer); * // Process AIT bundle * } else if (format === AppsInTossBundle.Format.ZIP) { * // Process legacy ZIP bundle * } * ``` */ static detect(buffer: Uint8Array): Format; /** * Check if the buffer represents an AIT format. * * @param buffer - The buffer to check (only first 8 bytes are needed) * @returns true if AIT format */ static isAIT(buffer: Uint8Array): boolean; /** * Check if the buffer represents a ZIP format. * * @param buffer - The buffer to check (only first 4 bytes are needed) * @returns true if ZIP format */ static isZIP(buffer: Uint8Array): boolean; /** * Generate a new UUIDv7 string. * * @returns A UUIDv7 string in standard format (8-4-4-4-12) */ static generateUUID7(): string; } //# sourceMappingURL=bundle.d.ts.map