Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/kit/src/exports/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
RequestOptions,
RouteSegment
} from '../types/private.js';
import { SSRManifest, ValidatedConfig } from 'types';
import { ValidatedConfig } from 'types';
import { Plugin } from 'vite';
import { RouteId as AppRouteId, LayoutParams as AppLayoutParams } from '$app/types';
import { StandardSchemaV1 } from '@standard-schema/spec';
Expand Down Expand Up @@ -681,8 +681,7 @@ export interface RouteDefinition<Config = any> {
config: Config;
}

export class Server {
constructor(manifest: SSRManifest);
export interface Server {
init(options: ServerInitOptions): Promise<void>;
respond(request: Request, options: RequestOptions): Promise<Response>;
}
Expand Down
19 changes: 4 additions & 15 deletions packages/kit/src/types/internal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ export interface InternalRequestOptions extends RequestOptions {
emulator?: Emulator;
}

export class InternalServer extends Server {
export class InternalServer implements Server {
constructor(manifest: SSRManifest);
init(options: ServerInitOptions): Promise<void>;
respond(request: Request, options: InternalRequestOptions): Promise<Response>;
}
Expand Down Expand Up @@ -461,48 +462,36 @@ export interface ServerNode {

/**
* Information required to instantiate a new `Server` instance.
* This interface's fields are internal implementation details, and
* changes may be made at any time without being considered breaking.
*/
export interface SSRManifest {
/**
* The directory where SvelteKit keeps its stuff, including static assets (such as JS and CSS) and internally-used routes.
* @internal
* The directory where SvelteKit keeps its stuff, including static assets
* (such as JS and CSS) and internally-used routes.
*/
app_dir: string;
/**
* The `base` and `appDir` settings combined without a leading slash.
* @internal
*/
app_path: string;
/**
* Static files from `config.files.assets` and the service worker (if any).
* @internal
*/
assets: Set<string>;
/**
* Map of file extensions to MIME types
* @internal
*/
mime_types: Record<string, string>;
/** @internal */
client: BuildData['client'];
/** @internal */
nodes: SSRNodeLoader[];
/**
* hashed filename -> import to that file
* @internal
*/
remotes: Record<string, () => Promise<{ default: Record<string, any> }>>;
/** @internal */
routes: SSRRoute[];
/** @internal */
prerendered_routes: Set<string>;
/** @internal */
matchers: () => Promise<Record<string, ParamMatcher>>;
/**
* A `[file]: size` map of all assets imported by server code.
* @internal
*/
server_assets: Record<string, number>;
}
Expand Down
11 changes: 1 addition & 10 deletions packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,7 @@ declare module '@sveltejs/kit' {
config: Config;
}

export class Server {
constructor(manifest: SSRManifest);
export interface Server {
init(options: ServerInitOptions): Promise<void>;
respond(request: Request, options: RequestOptions): Promise<Response>;
}
Expand Down Expand Up @@ -917,14 +916,6 @@ declare module '@sveltejs/kit' {
: T[K]; // Use the exact type for everything else
};

/**
* Information required to instantiate a new `Server` instance.
* This interface's fields are internal implementation details, and
* changes may be made at any time without being considered breaking.
*/
interface SSRManifest {
}

type ValidatedConfig = RecursiveRequired<Omit<Config, 'preprocess'>> & {
preprocess: Config['preprocess'];
};
Expand Down
Loading