Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Asset type #373

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
13 changes: 12 additions & 1 deletion docs/api/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ The manifest API is also the same between the server and client, development and
You can access the manifest for any router by using calling `getManifest(routerName)` (exported by `vinxi/manifest`). This will give you a manifest object that looks like this:

```ts
export type Asset = string;
export type Asset = LinkAsset | ScriptOrStyleAsset;

type LinkAsset = {
tag: 'link';
attrs: Record<string, string>
}

type ScriptOrStyleAsset = {
tag: 'script' | 'style';
attrs: Record<string, string>;
children?: string;
}

export type Manifest = {
/** Name of the router */
Expand Down
13 changes: 12 additions & 1 deletion packages/vinxi/types/manifest.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
export type Asset = string;
export type Asset = LinkAsset | ScriptOrStyleAsset;

type LinkAsset = {
tag: 'link';
attrs: Record<string, string>
}

type ScriptOrStyleAsset = {
tag: 'script' | 'style';
attrs: Record<string, string>;
children?: string;
}

export type Manifest = {
/** Name of the router */
Expand Down