import { UploadInfo, Subscription } from '@napplet/core'; import { UploadRequest, UploadResult, UploadStatus } from './types.js'; /** * Napplet NAP upload sdk entrypoint. * * @module */ /** * @napplet/nap/upload -- SDK helpers wrapping window.napplet.upload. * * These convenience functions delegate to `window.napplet.upload.*` at call time. * The shim must be imported somewhere to install the global. */ /** * Inspect upload rails and coarse runtime policy limits. * * @returns Promise resolving to advisory upload info. */ declare function uploadInfo(): Promise; /** Alias for {@link uploadInfo} on the SDK subpath. */ declare const info: typeof uploadInfo; /** * Upload bytes through the shell's storage pipeline. * * @param request The upload request (bytes + intent) * @returns Promise resolving to the initial upload result * * @example * ```ts * import { uploadFile } from '@napplet/nap/upload'; * * const result = await uploadFile({ data: blob, filename: 'pic.png' }); * ``` */ declare function uploadFile(request: UploadRequest): Promise; /** Alias for {@link uploadFile} on the SDK subpath. */ declare const upload: typeof uploadFile; /** * Get the latest known status for a prior upload. * * @param uploadId The shell-generated upload id * @returns Promise resolving to the latest status */ declare function uploadStatus(uploadId: string): Promise; /** Alias for {@link uploadStatus} on the SDK subpath. */ declare const status: typeof uploadStatus; /** * Register for shell-pushed upload status updates. * * @param handler Called with each new UploadStatus * @returns A Subscription with `close()` to stop listening */ declare function uploadOnStatus(handler: (status: UploadStatus) => void): Subscription; /** Alias for {@link uploadOnStatus} on the SDK subpath. */ declare const onStatus: typeof uploadOnStatus; export { info, onStatus, status, upload, uploadFile, uploadInfo, uploadOnStatus, uploadStatus };