-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentry.ts
More file actions
49 lines (44 loc) · 1.36 KB
/
Copy pathentry.ts
File metadata and controls
49 lines (44 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import type { RouteDefinition } from "./index.ts"
export type {
FetchMiddleware,
FetchServerAssets,
FetchServerEntryOptions,
FlamefrontFetchServerEntry,
ResponseHeaders,
ResponseHeadersContext,
ResponseHeadersHook,
ServerDocuments,
ServerEntryLifecycle,
StaticFragmentContext,
StaticFragmentLoader,
TemplateContext,
TemplateLoader,
} from "./fetch.ts"
export type {
FlamefrontServerEntry,
ServerAssets,
SrvxMiddleware,
SrvxServerEntryOptions,
} from "./srvx.ts"
import type {
FetchServerEntryOptions,
FlamefrontFetchServerEntry,
} from "./fetch.ts"
import type { FlamefrontServerEntry, SrvxServerEntryOptions } from "./srvx.ts"
export type ServerEntryOptions<
Route extends RouteDefinition = RouteDefinition,
> = FetchServerEntryOptions<Route> | SrvxServerEntryOptions<Route>
export type ServerEntry = FlamefrontFetchServerEntry | FlamefrontServerEntry
/**
* Create the server entry selected by the `flamefront` Vite plugin options.
* Vite replaces this placeholder with the generated adapter module at build
* time; the direct-import error prevents an accidental unconfigured entry.
*/
export function createServerEntry<
Route extends RouteDefinition = RouteDefinition,
>(options: ServerEntryOptions<Route>): ServerEntry {
void options
throw new Error(
"flamefront/entry must be loaded through the flamefront Vite plugin.",
)
}