@vercel/og 0.0.4 → 0.0.5

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.
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Modified version of https://unpkg.com/twemoji@13.1.0/dist/twemoji.esm.js.
3
+ */
4
+ export declare function getIconCode(char: string): string;
5
+ declare const api: {
6
+ openmoji: string;
7
+ twemoji: string;
8
+ blobmoji: string;
9
+ noto: string;
10
+ };
11
+ export declare type EmojiType = keyof typeof api;
12
+ export declare function loadEmoji(code: string, type?: EmojiType): Promise<Response>;
13
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,14 +1 @@
1
- import * as satori from 'satori';
2
- import * as react from 'react';
3
-
4
- declare module 'satori/wasm' {
5
- export function init(yoga: any): Promise<any>
6
- export default function satori_(
7
- element: react.ReactElement,
8
- options: satori.SatoriOptions
9
- ): Promise<string>
10
- }
11
-
12
- declare module 'yoga-wasm-web' {
13
- export default function initYoga(wasm: any): Promise<any>
14
- }
1
+ export * from './og';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- // src/index.ts
2
- import satori, { init as initSatori } from "satori/wasm";
1
+ // src/og.ts
2
+ import satori, { init as initSatori } from "satori/dist/esm/index.wasm";
3
3
  import initYoga from "yoga-wasm-web";
4
4
  import * as resvg from "@resvg/resvg-wasm";
5
5
  import resvg_wasm from "../vendor/resvg.simd.wasm?module";
@@ -43,7 +43,7 @@ function loadEmoji(code, type) {
43
43
  return fetch(`${api[type]}${upperCase ? code.toUpperCase() : code}.svg`);
44
44
  }
45
45
 
46
- // src/index.ts
46
+ // src/og.ts
47
47
  var initializedResvg = resvg.initWasm(resvg_wasm);
48
48
  var initializedYoga = initYoga(yoga_wasm).then((yoga) => initSatori(yoga));
49
49
  var interData = Uint8Array.from(atob(inter_latin_700_default), (c) => c.charCodeAt(0));
package/dist/og.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { SatoriOptions } from 'satori';
3
+ import { EmojiType } from './emoji';
4
+ declare type ImageResponseOptions = ConstructorParameters<typeof Response>[1] & Partial<Pick<SatoriOptions, 'width' | 'height' | 'debug' | 'loadAdditionalAsset' | 'graphemeImages' | 'fonts'>> & {
5
+ emoji?: EmojiType;
6
+ };
7
+ export declare class ImageResponse {
8
+ constructor(element: ReactElement, options?: ImageResponseOptions);
9
+ }
10
+ export {};
package/package.json CHANGED
@@ -1,15 +1,17 @@
1
1
  {
2
2
  "name": "@vercel/og",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
7
8
  "files": [
8
9
  "dist/**/*",
9
10
  "vendor/**/*"
10
11
  ],
11
12
  "scripts": {
12
- "build": "tsup src/index.ts --format esm --dts"
13
+ "build": "tsup src/index.ts --format esm && pnpm types",
14
+ "types": "tsc --project tsconfig.json"
13
15
  },
14
16
  "keywords": [],
15
17
  "author": "",
@@ -20,7 +22,9 @@
20
22
  "yoga-wasm-web": "^0.1.0"
21
23
  },
22
24
  "devDependencies": {
25
+ "@types/node": "^18.0.5",
23
26
  "@types/react": "^18.0.15",
24
- "tsup": "^6.1.3"
27
+ "tsup": "^6.1.3",
28
+ "typescript": "^4.7.4"
25
29
  }
26
30
  }