mirror of https://github.com/sveltejs/svelte
feat: export RenderOutput, SyncRenderOutput, Csp and Sha256Source from svelte/server (#18648)
`render` returns `RenderOutput` and takes `csp: Csp`, but both are declared in `src/internal/server/types.d.ts` and never exported. The generated `svelte/server` block has them without `export`, so nothing outside the repo can import them and the docs page names `RenderOutput` as the return type with nothing on the page defining it. Moves them into `src/server/public.d.ts` the way `svelte/motion` went in #17967, rather than re-exporting internals.pull/18680/merge
parent
faf1e103c5
commit
cac27c783e
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': minor
|
||||||
|
---
|
||||||
|
|
||||||
|
feat: export `RenderOutput`, `SyncRenderOutput`, `Csp` and `Sha256Source` from `svelte/server`
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
export type Csp = { nonce?: string; hash?: boolean };
|
||||||
|
|
||||||
|
export type Sha256Source = `sha256-${string}`;
|
||||||
|
|
||||||
|
export interface SyncRenderOutput {
|
||||||
|
/** HTML that goes into the `<head>` */
|
||||||
|
head: string;
|
||||||
|
/** @deprecated use `body` instead */
|
||||||
|
html: string;
|
||||||
|
/** HTML that goes somewhere into the `<body>` */
|
||||||
|
body: string;
|
||||||
|
hashes: {
|
||||||
|
script: Sha256Source[];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export type RenderOutput = SyncRenderOutput & PromiseLike<SyncRenderOutput>;
|
||||||
Loading…
Reference in new issue