diff --git a/.changeset/sweet-rivers-join.md b/.changeset/sweet-rivers-join.md new file mode 100644 index 000000000..e2e5b11db --- /dev/null +++ b/.changeset/sweet-rivers-join.md @@ -0,0 +1,5 @@ +--- +"frames.js": patch +--- + +fix: expose core types and utils via frames.js/types and frames.js/utils diff --git a/examples/framesjs-starter/app/examples/new-api-custom-middleware/frames/frames.ts b/examples/framesjs-starter/app/examples/new-api-custom-middleware/frames/frames.ts index eee185c92..b37090590 100644 --- a/examples/framesjs-starter/app/examples/new-api-custom-middleware/frames/frames.ts +++ b/examples/framesjs-starter/app/examples/new-api-custom-middleware/frames/frames.ts @@ -1,9 +1,12 @@ -import { createFrames, types } from "frames.js/next"; +import { createFrames } from "frames.js/next"; +import { FramesMiddleware } from "frames.js/types"; -const priceMiddleware: types.FramesMiddleware< - any, - { ethPrice?: number } -> = async (ctx, next) => { +type PriceContext = { ethPrice?: number }; + +const priceMiddleware: FramesMiddleware = async ( + ctx, + next +) => { try { const res = await fetch( "https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd" diff --git a/packages/frames.js/package.json b/packages/frames.js/package.json index bff424d13..52e4ab9f7 100644 --- a/packages/frames.js/package.json +++ b/packages/frames.js/package.json @@ -144,6 +144,26 @@ "default": "./dist/core/index.cjs" } }, + "./types": { + "import": { + "types": "./dist/core/types.d.ts", + "default": "./dist/core/types.js" + }, + "require": { + "types": "./dist/core/types.d.cts", + "default": "./dist/core/types.cjs" + } + }, + "./utils": { + "import": { + "types": "./dist/core/utils.d.ts", + "default": "./dist/core/utils.js" + }, + "require": { + "types": "./dist/core/utils.d.cts", + "default": "./dist/core/utils.cjs" + } + }, "./middleware": { "import": { "types": "./dist/middleware/index.d.ts", @@ -246,4 +266,4 @@ "protobufjs": "^7.2.6", "viem": "^2.7.8" } -} +} \ No newline at end of file