Skip to content

Commit

Permalink
🛠 type cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Girish21 committed Dec 10, 2022
1 parent 1a5dd91 commit f4e4378
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
13 changes: 3 additions & 10 deletions packages/remix-app/types/remix-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<RemixDataFunctionArgs, 'context'> {
export interface DataFunctionArgs
extends Omit<RemixDataFunctionArgs, 'context'> {
context: LoadContext
}

export interface ActionFunction {
(args: DataFunctionArgs): null | Response | Promise<Response>
}

export interface LoaderFunction {
(args: DataFunctionArgs): null | Response | Promise<Response>
}
}
3 changes: 2 additions & 1 deletion packages/worker/src/index.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f4e4378

Please sign in to comment.