Skip to content

Commit 6548355

Browse files
committed
chore: fix types for universal and server fields
1 parent 0f82298 commit 6548355

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

packages/kit/src/types/internal.d.ts

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,27 @@ export interface SSRComponent {
364364

365365
export type SSRComponentLoader = () => Promise<SSRComponent>;
366366

367+
export interface UniversalNode {
368+
load?: Load;
369+
prerender?: PrerenderOption;
370+
ssr?: boolean;
371+
csr?: boolean;
372+
trailingSlash?: TrailingSlash;
373+
config?: any;
374+
entries?: PrerenderEntryGenerator;
375+
}
376+
377+
export interface ServerNode {
378+
load?: ServerLoad;
379+
prerender?: PrerenderOption;
380+
ssr?: boolean;
381+
csr?: boolean;
382+
trailingSlash?: TrailingSlash;
383+
actions?: Actions;
384+
config?: any;
385+
entries?: PrerenderEntryGenerator;
386+
}
387+
367388
export interface SSRNode {
368389
component: SSRComponentLoader;
369390
/** index into the `nodes` array in the generated `client/app.js`. */
@@ -377,29 +398,10 @@ export interface SSRNode {
377398
/** inlined styles. */
378399
inline_styles?(): MaybePromise<Record<string, string>>;
379400

380-
universal: {
381-
load?: Load;
382-
prerender?: PrerenderOption;
383-
ssr?: boolean;
384-
csr?: boolean;
385-
trailingSlash?: TrailingSlash;
386-
config?: any;
387-
entries?: PrerenderEntryGenerator;
388-
};
389-
390-
server: {
391-
load?: ServerLoad;
392-
prerender?: PrerenderOption;
393-
ssr?: boolean;
394-
csr?: boolean;
395-
trailingSlash?: TrailingSlash;
396-
actions?: Actions;
397-
config?: any;
398-
entries?: PrerenderEntryGenerator;
399-
};
400-
401401
universal_id?: string;
402402
server_id?: string;
403+
universal?: UniversalNode;
404+
server?: ServerNode;
403405
}
404406

405407
export type SSRNodeLoader = () => Promise<SSRNode>;

packages/kit/src/utils/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @template {'prerender' | 'ssr' | 'csr' | 'trailingSlash' | 'entries'} Option
3-
* @template {(import('types').SSRNode['universal'] | import('types').SSRNode['server'])[Option]} Value
3+
* @template {(import('types').UniversalNode | import('types').ServerNode)[Option]} Value
44
*
55
* @param {Array<import('types').SSRNode | undefined>} nodes
66
* @param {Option} option

0 commit comments

Comments
 (0)