nuxt-og-image 5.1.13 → 6.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/cli.mjs +2 -0
- package/dist/chunks/tw4-classes.cjs +116 -0
- package/dist/chunks/tw4-classes.mjs +113 -0
- package/dist/chunks/tw4-generator.cjs +118 -0
- package/dist/chunks/tw4-generator.mjs +110 -0
- package/dist/cli.cjs +433 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.mjs +416 -0
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_fonts/0xp3SbCWC1OhX7q1-uF6kilMZFm-alJNkUtkLTPCy_A-tN9KwPUWhhXvtqh74sU9FIkI4W6hsbm85r0X24hjOfM.woff2 +0 -0
- package/dist/client/_fonts/1ZTlEDqU4DtwDJiND8f6qaugUpa0RIDvQl-v7iM6l54-D6hedAgqRfOCLZzaShnyeAvlEnMzk4Wm7g9WDKWFHIc.woff +0 -0
- package/dist/client/_fonts/4HA9tc4y8BVQeLXvLn3JgQqilAj1xrAnUSprQGHIPSw-ZPswEL_UDOYaxTLQDUySPjoOHDxhD83pD19HMfKfK9s.woff2 +0 -0
- package/dist/client/_fonts/Bmul3LaKlc7BUKqJHE_UmEoF40Sg_2ga52yJjwyDcKs-TnYmYl1DNYkiWMu0Vx49DakCPBuiCCj9zoLIuQjUdKY.woff2 +0 -0
- package/dist/client/_fonts/DfgmjWGpWte3Q3a54Nevr_BYmMM5YEJXRI1CdI2VwO0-ox5RadQfCyVTmKl_hubTaIJjtRw9oaQz2GDBeZR6l1M.woff2 +0 -0
- package/dist/client/_fonts/Lc_5lWuBuZcZ166p1-s-mnGkMJwIYJE_QDCkws8iCkI-r45Qbm2hCykrfOZ0kowz__uTTTUOPDN9hz34QcRNTY4.woff2 +0 -0
- package/dist/client/_fonts/iEvApgDRmzKzNqOYocBTrmcHZmuGAJloawKDP1S0nyE-T3oc_9We24QGwfw5naik4cM0g7VxylWVaQwKm4dy3cw.woff2 +0 -0
- package/dist/client/_nuxt/0kYTU2a7.js +2 -0
- package/dist/client/_nuxt/B0QDx5EE.js +2 -0
- package/dist/client/_nuxt/BKqzYw6x.js +3 -0
- package/dist/client/_nuxt/C-Ivr2Rl.js +1 -0
- package/dist/client/_nuxt/CLgn8DCr.js +1 -0
- package/dist/client/_nuxt/CwWm-XE3.js +1 -0
- package/dist/client/_nuxt/D9eL2h5z.js +1 -0
- package/dist/client/_nuxt/DJXHIJSq.js +1 -0
- package/dist/client/_nuxt/DVnX3Z-O.js +1 -0
- package/dist/client/_nuxt/DXObZt09.js +184 -0
- package/dist/client/_nuxt/Dxi6QG7I.js +1 -0
- package/dist/client/_nuxt/E8AZ6HoH.js +1 -0
- package/dist/client/_nuxt/IFrameLoader.CGrV1TpP.css +1 -0
- package/dist/client/_nuxt/JAMwWy1K.js +3864 -0
- package/dist/client/_nuxt/OSectionBlock.BVHnMsIr.css +1 -0
- package/dist/client/_nuxt/PONEy9N-.js +1 -0
- package/dist/client/_nuxt/UdkqSAsD.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/8e2df3bd-1df7-4172-a3c9-b46cdb9070e5.json +1 -0
- package/dist/client/_nuxt/entry.BEExJd9R.css +2 -0
- package/dist/client/_nuxt/error-404.B79WD2X-.css +1 -0
- package/dist/client/_nuxt/error-500.DT3Sd0Wu.css +1 -0
- package/dist/client/_nuxt/pages.eW3hi7XF.css +1 -0
- package/dist/client/_nuxt/templates.dUiUBaip.css +1 -0
- package/dist/client/_payload.json +1 -0
- package/dist/client/debug/_payload.json +1 -0
- package/dist/client/debug/index.html +1 -0
- package/dist/client/docs/_payload.json +1 -0
- package/dist/client/docs/index.html +1 -0
- package/dist/client/fonts/HubotSans-Regular.woff2 +0 -0
- package/dist/client/index.html +1 -1
- package/dist/client/templates/_payload.json +1 -0
- package/dist/client/templates/index.html +1 -0
- package/dist/module.cjs +36 -1027
- package/dist/module.d.cts +63 -25
- package/dist/module.d.mts +63 -25
- package/dist/module.d.ts +63 -25
- package/dist/module.json +1 -1
- package/dist/module.mjs +32 -1009
- package/dist/runtime/app/components/Templates/Community/Brutalist.satori.d.vue.ts +14 -0
- package/dist/runtime/app/components/Templates/Community/Brutalist.satori.vue +51 -0
- package/dist/runtime/app/components/Templates/Community/Brutalist.satori.vue.d.ts +14 -0
- package/dist/runtime/app/components/Templates/Community/{Frame.vue.d.ts → Frame.satori.d.vue.ts} +2 -2
- package/dist/runtime/app/components/Templates/Community/Frame.satori.vue +71 -0
- package/dist/runtime/app/components/Templates/Community/{Frame.d.vue.ts → Frame.satori.vue.d.ts} +2 -2
- package/dist/runtime/app/components/Templates/Community/Newspaper.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/Newspaper.satori.vue +70 -0
- package/dist/runtime/app/components/Templates/Community/Newspaper.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/Nuxt.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/{Nuxt.vue → Nuxt.satori.vue} +3 -3
- package/dist/runtime/app/components/Templates/Community/Nuxt.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.satori.vue +69 -0
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/Pergel.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/{Pergel.vue → Pergel.satori.vue} +14 -11
- package/dist/runtime/app/components/Templates/Community/Pergel.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/Retro.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/Retro.satori.vue +64 -0
- package/dist/runtime/app/components/Templates/Community/Retro.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/SaaS.satori.d.vue.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/SaaS.satori.vue +60 -0
- package/dist/runtime/app/components/Templates/Community/SaaS.satori.vue.d.ts +12 -0
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.satori.d.vue.ts +9 -0
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.satori.vue +38 -0
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.satori.vue.d.ts +9 -0
- package/dist/runtime/app/components/Templates/Community/{UnJs.d.vue.ts → UnJs.satori.d.vue.ts} +2 -2
- package/dist/runtime/app/components/Templates/Community/{UnJs.vue → UnJs.satori.vue} +41 -33
- package/dist/runtime/app/components/Templates/Community/{UnJs.vue.d.ts → UnJs.satori.vue.d.ts} +2 -2
- package/dist/runtime/app/components/Templates/Community/WithEmoji.satori.d.vue.ts +13 -0
- package/dist/runtime/app/components/Templates/Community/WithEmoji.satori.vue +27 -0
- package/dist/runtime/app/components/Templates/Community/WithEmoji.satori.vue.d.ts +13 -0
- package/dist/runtime/app/composables/_defineOgImageRaw.d.ts +6 -0
- package/dist/runtime/app/composables/_defineOgImageRaw.js +70 -0
- package/dist/runtime/app/composables/defineOgImage.d.ts +14 -2
- package/dist/runtime/app/composables/defineOgImage.js +13 -42
- package/dist/runtime/app/composables/defineOgImageComponent.d.ts +5 -1
- package/dist/runtime/app/composables/defineOgImageComponent.js +4 -5
- package/dist/runtime/app/composables/defineOgImageScreenshot.d.ts +1 -1
- package/dist/runtime/app/composables/defineOgImageScreenshot.js +2 -2
- package/dist/runtime/app/composables/mock.d.ts +7 -4
- package/dist/runtime/app/composables/mock.js +4 -4
- package/dist/runtime/app/utils/plugins.js +22 -28
- package/dist/runtime/app/utils.d.ts +15 -1
- package/dist/runtime/app/utils.js +74 -46
- package/dist/runtime/pure.d.ts +7 -0
- package/dist/runtime/pure.js +105 -0
- package/dist/runtime/server/og-image/bindings/css-inline/wasm-fs.d.ts +3 -2
- package/dist/runtime/server/og-image/bindings/css-inline/wasm.d.ts +3 -2
- package/dist/runtime/server/og-image/bindings/font-assets/cloudflare.d.ts +3 -0
- package/dist/runtime/server/og-image/bindings/font-assets/cloudflare.js +22 -0
- package/dist/runtime/server/og-image/bindings/font-assets/dev-prerender.d.ts +3 -0
- package/dist/runtime/server/og-image/bindings/font-assets/dev-prerender.js +49 -0
- package/dist/runtime/server/og-image/bindings/font-assets/node.d.ts +3 -0
- package/dist/runtime/server/og-image/bindings/font-assets/node.js +14 -0
- package/dist/runtime/server/og-image/bindings/resvg/node-dev.d.ts +5 -0
- package/dist/runtime/server/og-image/bindings/resvg/node-dev.js +70 -0
- package/dist/runtime/server/og-image/bindings/takumi/node.d.ts +6 -0
- package/dist/runtime/server/og-image/bindings/takumi/node.js +5 -0
- package/dist/runtime/server/og-image/bindings/takumi/wasm.d.ts +6 -0
- package/dist/runtime/server/og-image/bindings/takumi/wasm.js +6 -0
- package/dist/runtime/server/og-image/cache/buildCache.d.ts +16 -0
- package/dist/runtime/server/og-image/cache/buildCache.js +48 -0
- package/dist/runtime/server/og-image/cache/lru.d.ts +2 -2
- package/dist/runtime/server/og-image/cache/lru.js +3 -3
- package/dist/runtime/server/og-image/cache/mock.d.ts +1 -2
- package/dist/runtime/server/og-image/cache/mock.js +0 -1
- package/dist/runtime/server/og-image/chromium/screenshot.js +4 -3
- package/dist/runtime/server/og-image/context.d.ts +2 -3
- package/dist/runtime/server/og-image/context.js +55 -193
- package/dist/runtime/server/og-image/devtools.d.ts +10 -0
- package/dist/runtime/server/og-image/devtools.js +74 -0
- package/dist/runtime/server/og-image/fonts.d.ts +6 -0
- package/dist/runtime/server/og-image/fonts.js +41 -0
- package/dist/runtime/server/og-image/instances.d.ts +1 -0
- package/dist/runtime/server/og-image/instances.js +5 -0
- package/dist/runtime/server/og-image/satori/instances.d.ts +1 -36
- package/dist/runtime/server/og-image/satori/plugins/emojis.js +83 -4
- package/dist/runtime/server/og-image/satori/plugins/encoding.js +11 -1
- package/dist/runtime/server/og-image/satori/plugins/imageSrc.js +5 -1
- package/dist/runtime/server/og-image/satori/plugins/twClasses.js +35 -0
- package/dist/runtime/server/og-image/satori/renderer.js +16 -53
- package/dist/runtime/server/og-image/satori/transforms/emojis/emoji-names-minimal.d.ts +1 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/emoji-names-minimal.js +223 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/emoji-utils.d.ts +45 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/emoji-utils.js +13 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/fetch.d.ts +6 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/fetch.js +38 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/index.d.ts +7 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/index.js +64 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/local.d.ts +7 -0
- package/dist/runtime/server/og-image/satori/transforms/emojis/local.js +32 -0
- package/dist/runtime/server/og-image/satori/utils.js +5 -4
- package/dist/runtime/server/og-image/satori/vnodes.js +7 -6
- package/dist/runtime/server/og-image/takumi/instances.d.ts +1 -0
- package/dist/runtime/server/og-image/takumi/instances.js +6 -0
- package/dist/runtime/server/og-image/takumi/nodes.d.ts +12 -0
- package/dist/runtime/server/og-image/takumi/nodes.js +86 -0
- package/dist/runtime/server/og-image/takumi/renderer.d.ts +3 -0
- package/dist/runtime/server/og-image/takumi/renderer.js +45 -0
- package/dist/runtime/server/og-image/templates/html.js +32 -23
- package/dist/runtime/server/plugins/prerender.d.ts +1 -1
- package/dist/runtime/server/plugins/prerender.js +17 -7
- package/dist/runtime/server/util/auto-eject.d.ts +2 -0
- package/dist/runtime/server/util/auto-eject.js +30 -0
- package/dist/runtime/server/util/eventHandlers.d.ts +0 -1
- package/dist/runtime/server/util/eventHandlers.js +15 -85
- package/dist/runtime/server/util/options.d.ts +7 -2
- package/dist/runtime/server/util/options.js +40 -6
- package/dist/runtime/server/utils.d.ts +6 -2
- package/dist/runtime/server/utils.js +12 -8
- package/dist/runtime/shared/urlEncoding.d.ts +64 -0
- package/dist/runtime/shared/urlEncoding.js +194 -0
- package/dist/runtime/shared.d.ts +4 -9
- package/dist/runtime/shared.js +31 -50
- package/dist/runtime/types.d.ts +71 -25
- package/dist/shared/nuxt-og-image.D-QhzI76.mjs +2831 -0
- package/dist/shared/nuxt-og-image.iluFGbPR.cjs +2858 -0
- package/dist/types.d.mts +2 -0
- package/package.json +108 -44
- package/types/virtual.d.ts +7 -1
- package/dist/client/_nuxt/B3LgXoKV.js +0 -2
- package/dist/client/_nuxt/B8PEiB0p.js +0 -1
- package/dist/client/_nuxt/CPsbVDfV.js +0 -1
- package/dist/client/_nuxt/CVO1_9PV.js +0 -1
- package/dist/client/_nuxt/CjQm5wk3.js +0 -4029
- package/dist/client/_nuxt/Cp-IABpG.js +0 -1
- package/dist/client/_nuxt/D0TMZt8T.js +0 -1
- package/dist/client/_nuxt/D0r3Knsf.js +0 -1
- package/dist/client/_nuxt/builds/meta/eb2c0390-3125-4af7-b189-e76a7dfe3017.json +0 -1
- package/dist/client/_nuxt/entry.cdy4VsCK.css +0 -1
- package/dist/client/_nuxt/error-404.Cu4JbXd7.css +0 -1
- package/dist/client/_nuxt/error-500.B79uceR7.css +0 -1
- package/dist/runtime/app/components/OgImage/OgImage.d.ts +0 -3
- package/dist/runtime/app/components/OgImage/OgImage.js +0 -10
- package/dist/runtime/app/components/Templates/Community/BrandedLogo.d.vue.ts +0 -13
- package/dist/runtime/app/components/Templates/Community/BrandedLogo.vue +0 -22
- package/dist/runtime/app/components/Templates/Community/BrandedLogo.vue.d.ts +0 -13
- package/dist/runtime/app/components/Templates/Community/Frame.vue +0 -58
- package/dist/runtime/app/components/Templates/Community/Nuxt.d.vue.ts +0 -12
- package/dist/runtime/app/components/Templates/Community/Nuxt.vue.d.ts +0 -12
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.d.vue.ts +0 -15
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.vue +0 -103
- package/dist/runtime/app/components/Templates/Community/NuxtSeo.vue.d.ts +0 -15
- package/dist/runtime/app/components/Templates/Community/Pergel.d.vue.ts +0 -12
- package/dist/runtime/app/components/Templates/Community/Pergel.vue.d.ts +0 -12
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.d.vue.ts +0 -9
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.vue +0 -27
- package/dist/runtime/app/components/Templates/Community/SimpleBlog.vue.d.ts +0 -9
- package/dist/runtime/app/components/Templates/Community/Wave.d.vue.ts +0 -11
- package/dist/runtime/app/components/Templates/Community/Wave.vue +0 -28
- package/dist/runtime/app/components/Templates/Community/Wave.vue.d.ts +0 -11
- package/dist/runtime/app/components/Templates/Community/WithEmoji.d.vue.ts +0 -13
- package/dist/runtime/app/components/Templates/Community/WithEmoji.vue +0 -21
- package/dist/runtime/app/components/Templates/Community/WithEmoji.vue.d.ts +0 -13
- package/dist/runtime/assets/Inter-normal-400.ttf.base64 +0 -1
- package/dist/runtime/assets/Inter-normal-700.ttf.base64 +0 -1
- package/dist/runtime/server/og-image/satori/font.d.ts +0 -3
- package/dist/runtime/server/og-image/satori/font.js +0 -40
- package/dist/runtime/server/og-image/satori/plugins/unocss.js +0 -55
- package/dist/runtime/server/og-image/satori/transforms/emojis.d.ts +0 -3
- package/dist/runtime/server/og-image/satori/transforms/emojis.js +0 -3595
- package/dist/runtime/server/plugins/__zero-runtime/nuxt-content-v2.d.ts +0 -2
- package/dist/runtime/server/plugins/__zero-runtime/nuxt-content-v2.js +0 -9
- package/dist/runtime/server/plugins/nuxt-content-v2.d.ts +0 -2
- package/dist/runtime/server/plugins/nuxt-content-v2.js +0 -5
- package/dist/runtime/server/routes/__zero-runtime/font.d.ts +0 -2
- package/dist/runtime/server/routes/__zero-runtime/font.js +0 -8
- package/dist/runtime/server/routes/font.d.ts +0 -2
- package/dist/runtime/server/routes/font.js +0 -3
- package/dist/runtime/server/util/plugins.d.ts +0 -2
- package/dist/runtime/server/util/plugins.js +0 -56
- /package/dist/runtime/server/og-image/satori/plugins/{unocss.d.ts → twClasses.d.ts} +0 -0
package/dist/runtime/types.d.ts
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
import type { OgImageComponents } from '#og-image/components';
|
|
2
2
|
import type { ResvgRenderOptions } from '@resvg/resvg-js';
|
|
3
|
-
import type { UnoGenerator } from '@unocss/core';
|
|
4
3
|
import type { AllowedComponentProps, Component, ComponentCustomProps, VNodeProps } from '@vue/runtime-core';
|
|
5
4
|
import type { H3Error, H3Event } from 'h3';
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
5
|
+
import type { Hookable } from 'hookable';
|
|
6
|
+
import type { NitroRuntimeHooks } from 'nitropack/types';
|
|
8
7
|
import type { SatoriOptions } from 'satori';
|
|
9
8
|
import type { html } from 'satori-html';
|
|
10
9
|
import type { JpegOptions, SharpOptions } from 'sharp';
|
|
11
10
|
import type { Ref } from 'vue';
|
|
11
|
+
interface NitroApp {
|
|
12
|
+
hooks: Hookable<NitroRuntimeHooks>;
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
12
15
|
export interface OgImageRenderEventContext {
|
|
13
|
-
unocss: UnoGenerator;
|
|
14
16
|
e: H3Event;
|
|
15
17
|
extension: 'png' | 'jpeg' | 'jpg' | 'svg' | 'html' | 'json';
|
|
16
18
|
key: string;
|
|
17
19
|
basePath: string;
|
|
18
20
|
renderer: Renderer;
|
|
19
21
|
options: OgImageOptions;
|
|
20
|
-
|
|
22
|
+
isDevToolsContextRequest: boolean;
|
|
21
23
|
publicStoragePath: string;
|
|
22
24
|
runtimeConfig: OgImageRuntimeConfig;
|
|
23
25
|
_nitro: NitroApp;
|
|
24
26
|
}
|
|
25
27
|
export type IconifyEmojiIconSets = 'twemoji' | 'noto' | 'fluent-emoji' | 'fluent-emoji-flat' | 'fluent-emoji-high-contrast' | 'noto-v1' | 'emojione' | 'emojione-monotone' | 'emojione-v1' | 'streamline-emojis' | 'openmoji';
|
|
28
|
+
export type EmojiStrategy = 'auto' | 'local' | 'fetch';
|
|
26
29
|
export interface OgImageRuntimeConfig {
|
|
27
30
|
version: string;
|
|
28
31
|
satoriOptions: SatoriOptions;
|
|
@@ -32,17 +35,24 @@ export interface OgImageRuntimeConfig {
|
|
|
32
35
|
defaults: OgImageOptions;
|
|
33
36
|
debug: boolean;
|
|
34
37
|
baseCacheKey: string;
|
|
35
|
-
fonts: FontConfig[];
|
|
36
38
|
hasNuxtIcon: boolean;
|
|
39
|
+
hasNuxtContent?: boolean;
|
|
37
40
|
colorPreference: 'light' | 'dark';
|
|
38
41
|
isNuxtContentDocumentDriven: boolean;
|
|
39
|
-
strictNuxtContentPaths: boolean;
|
|
40
42
|
zeroRuntime: boolean;
|
|
43
|
+
cacheQueryParams: boolean;
|
|
41
44
|
componentDirs?: string[];
|
|
45
|
+
/** Directory for persistent build cache (CI caching) */
|
|
46
|
+
buildCacheDir?: string;
|
|
47
|
+
/** Source directory for auto-eject (dev only) */
|
|
48
|
+
srcDir?: string;
|
|
49
|
+
/** Path to community templates (dev only) */
|
|
50
|
+
communityTemplatesDir?: string;
|
|
42
51
|
app: {
|
|
43
52
|
baseURL: string;
|
|
44
53
|
};
|
|
45
54
|
}
|
|
55
|
+
export type RendererType = 'satori' | 'chromium' | 'takumi';
|
|
46
56
|
export interface OgImageComponent {
|
|
47
57
|
path?: string;
|
|
48
58
|
pascalName: string;
|
|
@@ -50,6 +60,7 @@ export interface OgImageComponent {
|
|
|
50
60
|
hash: string;
|
|
51
61
|
category: 'app' | 'community' | 'pro';
|
|
52
62
|
credits?: string;
|
|
63
|
+
renderer: RendererType;
|
|
53
64
|
}
|
|
54
65
|
export interface ScreenshotOptions {
|
|
55
66
|
colorScheme?: 'dark' | 'light';
|
|
@@ -75,7 +86,7 @@ export interface ScreenshotOptions {
|
|
|
75
86
|
export interface OgImagePrebuilt extends OgImageOptions {
|
|
76
87
|
}
|
|
77
88
|
export type DefineOgImageInput = OgImageOptions | OgImagePrebuilt | false;
|
|
78
|
-
export interface OgImageOptions<T extends keyof OgImageComponents =
|
|
89
|
+
export interface OgImageOptions<T extends keyof OgImageComponents = keyof OgImageComponents> {
|
|
79
90
|
/**
|
|
80
91
|
* The width of the screenshot.
|
|
81
92
|
*
|
|
@@ -106,8 +117,13 @@ export interface OgImageOptions<T extends keyof OgImageComponents = 'NuxtSeo'> {
|
|
|
106
117
|
* Props to pass to the component.
|
|
107
118
|
*/
|
|
108
119
|
props?: OgImageComponents[T] | Record<string, any>;
|
|
109
|
-
|
|
110
|
-
|
|
120
|
+
/**
|
|
121
|
+
* Override renderer. Only used internally for screenshots.
|
|
122
|
+
* For normal usage, renderer is determined by component filename suffix.
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
renderer?: RendererType;
|
|
126
|
+
extension?: 'png' | 'jpeg' | 'jpg' | 'svg' | 'html';
|
|
111
127
|
emojis?: IconifyEmojiIconSets;
|
|
112
128
|
/**
|
|
113
129
|
* Provide a static HTML template to render the OG Image instead of a component.
|
|
@@ -117,7 +133,13 @@ export interface OgImageOptions<T extends keyof OgImageComponents = 'NuxtSeo'> {
|
|
|
117
133
|
satori?: SatoriOptions;
|
|
118
134
|
screenshot?: Partial<ScreenshotOptions>;
|
|
119
135
|
sharp?: SharpOptions & JpegOptions;
|
|
120
|
-
|
|
136
|
+
takumi?: {
|
|
137
|
+
format?: 'png' | 'jpeg' | 'webp';
|
|
138
|
+
persistentImages?: Array<{
|
|
139
|
+
src: string;
|
|
140
|
+
data: ArrayBuffer;
|
|
141
|
+
}>;
|
|
142
|
+
};
|
|
121
143
|
cacheMaxAgeSeconds?: number;
|
|
122
144
|
/**
|
|
123
145
|
* Social preview metadata
|
|
@@ -128,27 +150,43 @@ export interface OgImageOptions<T extends keyof OgImageComponents = 'NuxtSeo'> {
|
|
|
128
150
|
* @internal
|
|
129
151
|
*/
|
|
130
152
|
_query?: Record<string, any>;
|
|
153
|
+
/**
|
|
154
|
+
* Hash for cache lookup when URL is too long for filesystem
|
|
155
|
+
* @internal
|
|
156
|
+
*/
|
|
157
|
+
_hash?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Allow multiple og images to be generated for the same route by setting a unique key.
|
|
160
|
+
*/
|
|
161
|
+
key?: string;
|
|
162
|
+
/**
|
|
163
|
+
* Custom cache key for this OG image.
|
|
164
|
+
*
|
|
165
|
+
* When set, this key is used directly for caching instead of the auto-generated key.
|
|
166
|
+
*/
|
|
167
|
+
cacheKey?: string;
|
|
131
168
|
}
|
|
132
169
|
export interface FontConfig {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
absolutePath?: boolean;
|
|
170
|
+
family: string;
|
|
171
|
+
weight: number;
|
|
172
|
+
style: 'normal' | 'italic';
|
|
173
|
+
src: string;
|
|
174
|
+
localPath: string;
|
|
139
175
|
}
|
|
140
|
-
export interface
|
|
176
|
+
export interface SatoriFontConfig extends FontConfig {
|
|
141
177
|
cacheKey: string;
|
|
142
|
-
|
|
178
|
+
name: string;
|
|
179
|
+
data: BufferSource;
|
|
143
180
|
}
|
|
144
|
-
export type InputFontConfig = (`${string}:${number}` | `${string}:${'normal' | 'ital'}:${number}` | string | FontConfig);
|
|
145
181
|
export interface RuntimeCompatibilitySchema {
|
|
146
182
|
chromium: 'chrome-launcher' | 'on-demand' | 'playwright' | false;
|
|
147
183
|
['css-inline']: 'node' | 'wasm' | 'wasm-fs' | false;
|
|
148
|
-
resvg: 'node' | 'wasm' | 'wasm-fs' | false;
|
|
184
|
+
resvg: 'node' | 'node-dev' | 'wasm' | 'wasm-fs' | false;
|
|
149
185
|
satori: 'node' | 'wasm' | 'wasm-fs' | false;
|
|
186
|
+
takumi: 'node' | 'wasm' | false;
|
|
150
187
|
sharp: 'node' | false;
|
|
151
|
-
|
|
188
|
+
emoji?: 'local' | 'fetch';
|
|
189
|
+
wasm?: any;
|
|
152
190
|
}
|
|
153
191
|
export type CompatibilityFlags = Partial<Omit<RuntimeCompatibilitySchema, 'wasm'>>;
|
|
154
192
|
export interface CompatibilityFlagEnvOverrides {
|
|
@@ -160,18 +198,25 @@ export type RendererOptions = Omit<OgImageOptions, 'extension'> & {
|
|
|
160
198
|
extension: Omit<OgImageOptions['extension'], 'html'>;
|
|
161
199
|
};
|
|
162
200
|
export interface Renderer {
|
|
163
|
-
name: 'chromium' | 'satori';
|
|
201
|
+
name: 'chromium' | 'satori' | 'takumi';
|
|
164
202
|
supportedFormats: Partial<RendererOptions['extension']>[];
|
|
165
203
|
createImage: (e: OgImageRenderEventContext) => Promise<H3Error | BufferSource | Buffer | Uint8Array | void | undefined>;
|
|
166
204
|
debug: (e: OgImageRenderEventContext) => Promise<Record<string, any>>;
|
|
167
205
|
}
|
|
168
206
|
export type ExtractComponentProps<T extends Component> = T extends new (...args: any) => any ? Omit<InstanceType<T>['$props'], keyof ComponentCustomProps | keyof VNodeProps | keyof AllowedComponentProps> : never;
|
|
169
|
-
export type OgImagePageScreenshotOptions = Omit<OgImageOptions, 'html' | '
|
|
170
|
-
export type VNode = ReturnType<typeof html
|
|
207
|
+
export type OgImagePageScreenshotOptions = Omit<OgImageOptions, 'html' | 'component' | 'satori' | 'resvg' | 'sharp'>;
|
|
208
|
+
export type VNode = ReturnType<typeof html> & {
|
|
209
|
+
_emojiMatches?: RegExpMatchArray | null;
|
|
210
|
+
};
|
|
171
211
|
export interface SatoriTransformer {
|
|
172
212
|
filter: (node: VNode) => boolean;
|
|
173
213
|
transform: (node: VNode, e: OgImageRenderEventContext) => Promise<void> | void;
|
|
174
214
|
}
|
|
215
|
+
export interface DevToolsMetaDataExtraction {
|
|
216
|
+
key: string;
|
|
217
|
+
twitter?: Record<string, string>;
|
|
218
|
+
og?: Record<string, string>;
|
|
219
|
+
}
|
|
175
220
|
export interface SocialPreviewMetaData {
|
|
176
221
|
twitter?: Record<string, string>;
|
|
177
222
|
og?: Record<string, string> & {
|
|
@@ -185,3 +230,4 @@ export interface SocialPreviewMetaData {
|
|
|
185
230
|
export interface RouteRulesOgImage extends Partial<OgImageOptions> {
|
|
186
231
|
[key: string]: any;
|
|
187
232
|
}
|
|
233
|
+
export {};
|