From f4e4378056b4a2428399335e6bdb155b6a278265 Mon Sep 17 00:00:00 2001 From: Girish21 Date: Sat, 10 Dec 2022 15:37:58 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=20type=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/remix-app/types/remix-env.d.ts | 13 +++---------- packages/worker/src/index.ts | 3 ++- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/remix-app/types/remix-env.d.ts b/packages/remix-app/types/remix-env.d.ts index 777322b..8e1c5e9 100644 --- a/packages/remix-app/types/remix-env.d.ts +++ b/packages/remix-app/types/remix-env.d.ts @@ -11,17 +11,10 @@ declare var process: { declare module '@remix-run/cloudflare' { import type { DataFunctionArgs as RemixDataFunctionArgs } from '@remix-run/cloudflare' - export * from '@remix-run/cloudflare/index' + export * from '@remix-run/cloudflare/dist/index' - interface DataFunctionArgs extends Omit { + export interface DataFunctionArgs + extends Omit { context: LoadContext } - - export interface ActionFunction { - (args: DataFunctionArgs): null | Response | Promise - } - - export interface LoaderFunction { - (args: DataFunctionArgs): null | Response | Promise - } } diff --git a/packages/worker/src/index.ts b/packages/worker/src/index.ts index d41a242..886444f 100644 --- a/packages/worker/src/index.ts +++ b/packages/worker/src/index.ts @@ -1,4 +1,5 @@ import { getAssetFromKV } from '@cloudflare/kv-asset-handler' +import type { AppLoadContext } from '@remix-run/cloudflare' import { createRequestHandler } from '@remix-run/cloudflare' import * as build from 'remix-app' import manifestJSON from '__STATIC_CONTENT_MANIFEST' @@ -38,7 +39,7 @@ export default { } catch (error) {} try { - let loadContext: LoadContext = { env } + let loadContext: AppLoadContext = { env } return await handleRemixRequest(request, loadContext) } catch (error) { console.log(error)