import type { ParsedEvent } from './events';
/**
 * Strip side-effect `.css` imports from a `<script client>` body and read
 * their contents off disk.
 *
 * Bun.build doesn't know what to do with `import 'foo.css'` in a JS entry —
 * it either errors or returns the original code unchanged, which leaks the
 * unresolved import into the browser payload. So we intercept those imports
 * before bundling, resolve them ourselves (bare specifiers via Bun's resolver,
 * relative paths against the template's directory), and surface the file
 * contents to the caller so they can be emitted as `<style>` tags wrapped in
 * `@layer vendor { … }`.
 *
 * Missing or unresolvable files emit a single warn-level log and are left
 * out of the result; the original import is still stripped so the bundler
 * never sees it. The trade-off is a silent style miss vs. a broken JS bundle —
 * the former is recoverable, the latter takes the whole component down.
 *
 * Dedupe is by absolute resolved path, so two components importing the same
 * `medium-editor.css` only emit one `<style>` block per `processClientScript`
 * call. Cross-component dedupe still relies on the caller's HTML response
 * (CSS rules collapse harmlessly at the browser level either way).
 */
export declare function extractAndStripCssImports(code: string, options: { filePath?: string, projectRoot?: string }): { code: string, styles: VendorCssImport[] };
/**
 * Render collected vendor CSS as one `<style>` tag per resolved source,
 * each wrapped in `@layer vendor { … }` so the styles can never out-specificity
 * utility classes (assuming the consuming app declares the layer order in
 * its global stylesheet, e.g. `@layer vendor, components, utilities;`).
 *
 * Wrapping in a layer at emit time means consumers get correct ordering even
 * if they forget to declare the layer order — anonymous layers still rank
 * below un-layered rules, so vendor styles default to lowest precedence.
 */
export declare function renderVendorStyleTags(styles: VendorCssImport[]): string;
/**
 * Transform a <script client> block's content into a fully processed <script> tag.
 *
 * - Auto-imports from 'stx' and '@stacksjs/browser' (no explicit imports needed)
 * - Resolves `import { x } from '@stores'` to runtime store access
 * - Appends event binding code inside the script scope
 * - Wraps everything in a scoped IIFE
 *
 * @param scriptContent - The raw content inside <script client>...</script>
 * @param options - Event bindings and other processing options
 * @returns A complete `<script>...</script>` tag ready for browser injection
 */
export declare function processClientScript(scriptContent: string, options?: ClientScriptOptions): Promise<string>;
export declare interface VendorCssImport {
  source: string
  resolvedPath: string
  contents: string
}
// =============================================================================
// Types
// =============================================================================
export declare interface ClientScriptOptions {
  eventBindings?: ParsedEvent[]
  autoImports?: boolean
  attrs?: string
  hasColonDirectives?: boolean
  templateContent?: string
  filePath?: string
  projectRoot?: string
  production?: boolean
}
