Skip to content

Commit 3233cf2

Browse files
committed
we love periods
1 parent f250c2c commit 3233cf2

File tree

2 files changed

+36
-34
lines changed

2 files changed

+36
-34
lines changed

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

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,24 @@ export interface BuildData {
6868
out_dir: string;
6969
service_worker: string | null;
7070
client: {
71-
/** Path to the client entry point */
71+
/** Path to the client entry point. */
7272
start: string;
73-
/** Path to the generated `app.js` file that contains the client manifest. Only set in case of `bundleStrategy === 'split'` */
73+
/** Path to the generated `app.js` file that contains the client manifest. Only set in case of `bundleStrategy === 'split'`. */
7474
app?: string;
75-
/** JS files that the client entry point relies on */
75+
/** JS files that the client entry point relies on. */
7676
imports: string[];
7777
/**
7878
* JS files that represent the entry points of the layouts/pages.
7979
* An entry is undefined if the layout/page has no component or universal file (i.e. only has a `.server.js` file).
8080
* Only set in case of `router.resolution === 'server'`.
8181
*/
82-
nodes?: (string | undefined)[];
82+
nodes?: Array<string | undefined>;
8383
/**
8484
* CSS files referenced in the entry points of the layouts/pages.
8585
* An entry is undefined if the layout/page has no component or universal file (i.e. only has a `.server.js` file) or if has no CSS.
8686
* Only set in case of `router.resolution === 'server'`.
8787
*/
88-
css?: (string[] | undefined)[];
88+
css?: Array<string[] | undefined>;
8989
/**
9090
* Contains the client route manifest in a form suitable for the server which is used for server side route resolution.
9191
* Notably, it contains all routes, regardless of whether they are prerendered or not (those are missing in the optimized server route manifest).
@@ -95,7 +95,7 @@ export interface BuildData {
9595
stylesheets: string[];
9696
fonts: string[];
9797
uses_env_dynamic_public: boolean;
98-
/** Only set in case of `bundleStrategy === 'inline'` */
98+
/** Only set in case of `bundleStrategy === 'inline'`. */
9999
inline?: {
100100
script: string;
101101
style: string | undefined;
@@ -172,15 +172,15 @@ export class InternalServer extends Server {
172172
options: RequestOptions & {
173173
prerendering?: PrerenderOptions;
174174
read: (file: string) => Buffer;
175-
/** A hook called before `handle` during dev, so that `AsyncLocalStorage` can be populated */
175+
/** A hook called before `handle` during dev, so that `AsyncLocalStorage` can be populated. */
176176
before_handle?: (event: RequestEvent, config: any, prerender: PrerenderOption) => void;
177177
emulator?: Emulator;
178178
}
179179
): Promise<Response>;
180180
}
181181

182182
export interface ManifestData {
183-
/** Static files from `kit.config.files.assets` */
183+
/** Static files from `kit.config.files.assets`. */
184184
assets: Asset[];
185185
hooks: {
186186
client: string | null;
@@ -194,15 +194,15 @@ export interface ManifestData {
194194

195195
export interface PageNode {
196196
depth: number;
197-
/** The +page/layout.svelte */
197+
/** The `+page/layout.svelte`. */
198198
component?: string; // TODO supply default component if it's missing (bit of an edge case)
199-
/** The +page/layout.js/.ts */
199+
/** The `+page/layout.js/.ts`. */
200200
universal?: string;
201-
/** The +page/layout.server.js/ts */
201+
/** The `+page/layout.server.js/ts`. */
202202
server?: string;
203203
parent_id?: string;
204204
parent?: PageNode;
205-
/** Filled with the pages that reference this layout (if this is a layout) */
205+
/** Filled with the pages that reference this layout (if this is a layout). */
206206
child_pages?: PageNode[];
207207
}
208208

@@ -220,6 +220,7 @@ export interface PrerenderOptions {
220220
export type RecursiveRequired<T> = {
221221
// Recursive implementation of TypeScript's Required utility type.
222222
// Will recursively continue until it reaches a primitive or Function
223+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
223224
[K in keyof T]-?: Extract<T[K], Function> extends never // If it does not have a Function type
224225
? RecursiveRequired<T[K]> // recursively continue through.
225226
: T[K]; // Use the exact type for everything else
@@ -306,20 +307,20 @@ export interface ServerDataChunkNode {
306307

307308
/**
308309
* Signals that the server `load` function was not run, and the
309-
* client should use what it has in memory
310+
* client should use what it has in memory.
310311
*/
311312
export interface ServerDataSkippedNode {
312313
type: 'skip';
313314
}
314315

315316
/**
316-
* Signals that the server `load` function failed
317+
* Signals that the server `load` function failed.
317318
*/
318319
export interface ServerErrorNode {
319320
type: 'error';
320321
error: App.Error;
321322
/**
322-
* Only set for HttpErrors
323+
* Only set for HttpErrors.
323324
*/
324325
status?: number;
325326
}
@@ -339,7 +340,7 @@ export interface ServerMetadataRoute {
339340

340341
export interface ServerMetadata {
341342
nodes: Array<{
342-
/** Also `true` when using `trailingSlash`, because we need to do a server request in that case to get its value */
343+
/** Also `true` when using `trailingSlash`, because we need to do a server request in that case to get its value. */
343344
has_server_load: boolean;
344345
}>;
345346
routes: Map<string, ServerMetadataRoute>;
@@ -365,15 +366,15 @@ export type SSRComponentLoader = () => Promise<SSRComponent>;
365366

366367
export interface SSRNode {
367368
component: SSRComponentLoader;
368-
/** index into the `nodes` array in the generated `client/app.js` */
369+
/** index into the `nodes` array in the generated `client/app.js`. */
369370
index: number;
370371
/** external JS files that are loaded on the client. `imports[0]` is the entry point (e.g. `client/nodes/0.js`) */
371372
imports: string[];
372373
/** external CSS files that are loaded on the client */
373374
stylesheets: string[];
374375
/** external font files that are loaded on the client */
375376
fonts: string[];
376-
/** inlined styles */
377+
/** inlined styles. */
377378
inline_styles?(): MaybePromise<Record<string, string>>;
378379

379380
universal: {
@@ -466,18 +467,18 @@ export interface SSRState {
466467
fallback?: string;
467468
getClientAddress(): string;
468469
/**
469-
* True if we're currently attempting to render an error page
470+
* True if we're currently attempting to render an error page.
470471
*/
471472
error: boolean;
472473
/**
473-
* Allows us to prevent `event.fetch` from making infinitely looping internal requests
474+
* Allows us to prevent `event.fetch` from making infinitely looping internal requests.
474475
*/
475476
depth: number;
476477
platform?: any;
477478
prerendering?: PrerenderOptions;
478479
/**
479480
* When fetching data from a +server.js endpoint in `load`, the page's
480-
* prerender option is inherited by the endpoint, unless overridden
481+
* prerender option is inherited by the endpoint, unless overridden.
481482
*/
482483
prerender_default?: PrerenderOption;
483484
read?: (file: string) => Buffer;

packages/kit/types/index.d.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,24 +1716,24 @@ declare module '@sveltejs/kit' {
17161716
out_dir: string;
17171717
service_worker: string | null;
17181718
client: {
1719-
/** Path to the client entry point */
1719+
/** Path to the client entry point. */
17201720
start: string;
1721-
/** Path to the generated `app.js` file that contains the client manifest. Only set in case of `bundleStrategy === 'split'` */
1721+
/** Path to the generated `app.js` file that contains the client manifest. Only set in case of `bundleStrategy === 'split'`. */
17221722
app?: string;
1723-
/** JS files that the client entry point relies on */
1723+
/** JS files that the client entry point relies on. */
17241724
imports: string[];
17251725
/**
17261726
* JS files that represent the entry points of the layouts/pages.
17271727
* An entry is undefined if the layout/page has no component or universal file (i.e. only has a `.server.js` file).
17281728
* Only set in case of `router.resolution === 'server'`.
17291729
*/
1730-
nodes?: (string | undefined)[];
1730+
nodes?: Array<string | undefined>;
17311731
/**
17321732
* CSS files referenced in the entry points of the layouts/pages.
17331733
* An entry is undefined if the layout/page has no component or universal file (i.e. only has a `.server.js` file) or if has no CSS.
17341734
* Only set in case of `router.resolution === 'server'`.
17351735
*/
1736-
css?: (string[] | undefined)[];
1736+
css?: Array<string[] | undefined>;
17371737
/**
17381738
* Contains the client route manifest in a form suitable for the server which is used for server side route resolution.
17391739
* Notably, it contains all routes, regardless of whether they are prerendered or not (those are missing in the optimized server route manifest).
@@ -1743,7 +1743,7 @@ declare module '@sveltejs/kit' {
17431743
stylesheets: string[];
17441744
fonts: string[];
17451745
uses_env_dynamic_public: boolean;
1746-
/** Only set in case of `bundleStrategy === 'inline'` */
1746+
/** Only set in case of `bundleStrategy === 'inline'`. */
17471747
inline?: {
17481748
script: string;
17491749
style: string | undefined;
@@ -1753,7 +1753,7 @@ declare module '@sveltejs/kit' {
17531753
}
17541754

17551755
interface ManifestData {
1756-
/** Static files from `kit.config.files.assets` */
1756+
/** Static files from `kit.config.files.assets`. */
17571757
assets: Asset[];
17581758
hooks: {
17591759
client: string | null;
@@ -1767,21 +1767,22 @@ declare module '@sveltejs/kit' {
17671767

17681768
interface PageNode {
17691769
depth: number;
1770-
/** The +page/layout.svelte */
1770+
/** The `+page/layout.svelte`. */
17711771
component?: string; // TODO supply default component if it's missing (bit of an edge case)
1772-
/** The +page/layout.js/.ts */
1772+
/** The `+page/layout.js/.ts`. */
17731773
universal?: string;
1774-
/** The +page/layout.server.js/ts */
1774+
/** The `+page/layout.server.js/ts`. */
17751775
server?: string;
17761776
parent_id?: string;
17771777
parent?: PageNode;
1778-
/** Filled with the pages that reference this layout (if this is a layout) */
1778+
/** Filled with the pages that reference this layout (if this is a layout). */
17791779
child_pages?: PageNode[];
17801780
}
17811781

17821782
type RecursiveRequired<T> = {
17831783
// Recursive implementation of TypeScript's Required utility type.
17841784
// Will recursively continue until it reaches a primitive or Function
1785+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
17851786
[K in keyof T]-?: Extract<T[K], Function> extends never // If it does not have a Function type
17861787
? RecursiveRequired<T[K]> // recursively continue through.
17871788
: T[K]; // Use the exact type for everything else
@@ -1843,15 +1844,15 @@ declare module '@sveltejs/kit' {
18431844

18441845
interface SSRNode {
18451846
component: SSRComponentLoader;
1846-
/** index into the `nodes` array in the generated `client/app.js` */
1847+
/** index into the `nodes` array in the generated `client/app.js`. */
18471848
index: number;
18481849
/** external JS files that are loaded on the client. `imports[0]` is the entry point (e.g. `client/nodes/0.js`) */
18491850
imports: string[];
18501851
/** external CSS files that are loaded on the client */
18511852
stylesheets: string[];
18521853
/** external font files that are loaded on the client */
18531854
fonts: string[];
1854-
/** inlined styles */
1855+
/** inlined styles. */
18551856
inline_styles?(): MaybePromise<Record<string, string>>;
18561857

18571858
universal: {

0 commit comments

Comments
 (0)