Skip to content

Commit

Permalink
feat(theme favicon): allow Buffer type for content (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoria12 authored Apr 4, 2023
1 parent 91b82d4 commit e66e9e0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ declare namespace fastifySwaggerUi {
type FastifySwaggerUiTheme = {
css?: { filename: string; content: string; }[];
js?: { filename: string; content: string; }[];
favicon: { filename: string; rel: string; type: string; sizes: string; content: string; }[];
favicon: { filename: string; rel: string; type: string; sizes: string; content: string | Buffer; }[];
}

type FastifySwaggerUILogo = {
Expand Down
14 changes: 14 additions & 0 deletions types/types.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,17 @@ app.register(fastifySwaggerUi, {
content: 'somethingsomething'
}
})

app.register(fastifySwaggerUi, {
theme: {
favicon: [
{
filename: 'favicon-16x16.png',
rel: 'icon',
sizes: '16x16',
type: 'image/png',
content: Buffer.from('somethingsomething')
}
],
},
})

0 comments on commit e66e9e0

Please sign in to comment.