@stacksjs/stx
Version:
A performant UI Framework. Powered by Bun.
51 lines • 1.39 kB
TypeScript
import type { StxOptions } from './types';
/**
* Build all PWA assets
*
* Generates manifest.json, service worker, icons, and offline page.
*
* @param options - stx configuration options
* @param outputDir - Directory to write PWA assets
* @returns Build result with file paths and status
*/
export declare function buildPwaAssets(options: StxOptions, outputDir: string): Promise<PwaBuildResult>;
/**
* Process HTML to inject PWA tags
*
* Convenience function that wraps injectPwaTags.
*
* @param html - HTML content to process
* @param options - stx configuration options
* @returns HTML with PWA tags injected
*/
export declare function processPwaHtml(html: string, options: StxOptions): string;
/**
* Check if PWA is enabled in options
*/
export declare function isPwaEnabled(options: StxOptions): boolean;
/**
* PWA build result
*/
export declare interface PwaBuildResult {
success: boolean
files: {
manifest?: string
serviceWorker?: string
offlinePage?: string
icons: string[]
}
errors: string[]
warnings: string[]
precacheStats?: {
fileCount: number
totalSize: number
}
}
export * from './pwa/audit';
export * from './pwa/directives';
export * from './pwa/icons';
export * from './pwa/inject';
export * from './pwa/manifest';
export * from './pwa/offline';
export * from './pwa/precache';
export * from './pwa/service-worker';