Home / Class/ ComponentProps Class — svelte Architecture

ComponentProps Class — svelte Architecture

Architecture documentation for the ComponentProps class in index.d.ts from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  4719e8a3_cb20_f33b_93e5_2fedfa14447f["ComponentProps"]
  6bd9d090_a582_e05c_669e_d53d4e7245f2["index.d.ts"]
  4719e8a3_cb20_f33b_93e5_2fedfa14447f -->|defined in| 6bd9d090_a582_e05c_669e_d53d4e7245f2
  b16b17c8_a339_c4a4_5c84_8139f6409c64["render()"]
  4719e8a3_cb20_f33b_93e5_2fedfa14447f -->|method| b16b17c8_a339_c4a4_5c84_8139f6409c64

Relationship Graph

Source Code

packages/svelte/types/index.d.ts lines 2545–2594

declare module 'svelte/server' {
	import type { ComponentProps, Component, SvelteComponent, ComponentType } from 'svelte';
	/**
	 * Only available on the server and when compiling with the `server` option.
	 * Takes a component and returns an object with `body` and `head` properties on it, which you can use to populate the HTML when server-rendering your app.
	 */
	export function render<
		Comp extends SvelteComponent<any> | Component<any>,
		Props extends ComponentProps<Comp> = ComponentProps<Comp>
	>(
		...args: {} extends Props
			? [
					component: Comp extends SvelteComponent<any> ? ComponentType<Comp> : Comp,
					options?: {
						props?: Omit<Props, '$$slots' | '$$events'>;
						context?: Map<any, any>;
						idPrefix?: string;
						csp?: Csp;
					}
				]
			: [
					component: Comp extends SvelteComponent<any> ? ComponentType<Comp> : Comp,
					options: {
						props: Omit<Props, '$$slots' | '$$events'>;
						context?: Map<any, any>;
						idPrefix?: string;
						csp?: Csp;
					}
				]
	): RenderOutput;
	type Csp = { nonce?: string; hash?: boolean };

	type Sha256Source = `sha256-${string}`;

	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[];
		};
	}

	type RenderOutput = SyncRenderOutput & PromiseLike<SyncRenderOutput>;

	export {};
}

Frequently Asked Questions

What is the ComponentProps class?
ComponentProps is a class in the svelte codebase, defined in packages/svelte/types/index.d.ts.
Where is ComponentProps defined?
ComponentProps is defined in packages/svelte/types/index.d.ts at line 2545.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free