Skip to content

Commit

Permalink
Merge pull request #373 from langovoi/fix-asset-types
Browse files Browse the repository at this point in the history
fix Asset type
  • Loading branch information
nksaraf authored Oct 22, 2024
2 parents 71ba1f3 + c261150 commit 2dbda1d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/grumpy-masks-accept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vinxi": patch
---

fix Asset type
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

0 comments on commit 2dbda1d

Please sign in to comment.