/**
 * Type-level tests for Static and Prerender DSL constraints
 *
 * Verifies that static/prerender handlers can only be used in supported DSL positions.
 * Uses compile-time type assertions (AssertTrue/AssertEqual) and expectTypeOf.
 */
import { describe, it, expect, expectTypeOf } from "vitest";
// ============================================================================
// Runtime tests using expectTypeOf
// ============================================================================
describe("Static type constraints", () => {
    it("is assignable to layout() handler", () => {
        expectTypeOf().toMatchTypeOf();
    });
    it("is not assignable to loading() component", () => {
        expectTypeOf().not.toMatchTypeOf();
    });
    it("is not assignable to intercept() handler", () => {
        expectTypeOf().not.toMatchTypeOf();
    });
    it("is not assignable to errorBoundary() fallback", () => {
        expectTypeOf().not.toMatchTypeOf();
    });
    it("is not assignable to notFoundBoundary() fallback", () => {
        expectTypeOf().not.toMatchTypeOf();
    });
});
describe("Prerender type constraints", () => {
    it("is not assignable to layout() handler", () => {
        expectTypeOf().not.toMatchTypeOf();
    });
    it("is not assignable to loading() component", () => {
        expectTypeOf().not.toMatchTypeOf();
    });
    it("is not assignable to intercept() handler", () => {
        expectTypeOf().not.toMatchTypeOf();
    });
    it("is not assignable to errorBoundary() fallback", () => {
        expectTypeOf().not.toMatchTypeOf();
    });
    it("is not assignable to notFoundBoundary() fallback", () => {
        expectTypeOf().not.toMatchTypeOf();
    });
});
// ============================================================================
// Runtime: inline usage allowed (Vite plugin handles ID injection)
// ============================================================================
describe("Static runtime constraints", () => {
    it("does not throw in dev when $$id is missing (inline usage supported)", async () => {
        const originalEnv = process.env.NODE_ENV;
        process.env.NODE_ENV = "development";
        try {
            const { Static } = await import("../static-handler.js");
            const result = Static(() => null);
            expect(result.__brand).toBe("staticHandler");
            expect(result.$$id).toBe("");
        }
        finally {
            process.env.NODE_ENV = originalEnv;
        }
    });
});
//# sourceMappingURL=static-handler-types.test.js.map