/** * Detect a top-of-file `"use client"` directive in RAW source text (including * untranspiled TSX, which the acorn-based detectors can't parse). * * Used during build-time auto-discovery, where we must scan first-party * `.tsx/.ts/.jsx/.js` files on disk to decide which directive-only client * modules to emit to `dist/client`. We can't run the JSX/TS-aware Rollup * parser there (no plugin context), so we apply React's own structural * contract directly: a file-level `"use client"` must be a string-literal * statement at the very top of the module, before any real code. * * This is deliberately stricter than the naive `code.match(/client/)` * substring check (which flags any module mentioning the word "client"): * - leading whitespace, line (`//`) and block (`/* *\/`) comments are * skipped (they're allowed above a directive), * - a leading `"use strict"` prologue is tolerated (real libraries ship * `"use strict"; "use client";`), * - the directive must then be the first actual statement. * Anything else (an import, a variable, the word "client" in a comment or * identifier) yields false. */ export declare function sourceHasTopLevelClientDirective(source: string): boolean; //# sourceMappingURL=sourceHasTopLevelClientDirective.d.ts.map