Skip to content

Commit

Permalink
remove type EndpointOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
vasfvitor authored and alexanderniebuhr committed Dec 5, 2023
1 parent 32a64dd commit 631d28f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type APIContext, type EndpointOutput } from 'astro';
import { type APIContext } from 'astro';
// @ts-ignore
import mod from '../util/add.wasm?module';

Expand All @@ -7,7 +7,7 @@ const addModule: any = new WebAssembly.Instance(mod);

export async function GET(
context: APIContext
): Promise<EndpointOutput | Response> {
): Promise<Response> {

return new Response(JSON.stringify({ answer: addModule.exports.add(40, 2) }), {
status: 200,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type APIContext, type EndpointOutput } from 'astro';
import { type APIContext } from 'astro';
import { add } from '../../../util/add';

export async function GET(
context: APIContext
): Promise<EndpointOutput | Response> {
): Promise<Response> {

return new Response(JSON.stringify({ answer: add(80, 4) }), {
status: 200,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type APIContext, type EndpointOutput } from 'astro';
import { type APIContext } from 'astro';
import { add } from '../util/add';

export async function GET(
context: APIContext
): Promise<EndpointOutput | Response> {
): Promise<Response> {

return new Response(JSON.stringify({ answer: add(40, 2) }), {
status: 200,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type APIContext, type EndpointOutput } from 'astro';
import { type APIContext } from 'astro';
// @ts-ignore
import mod from '../../../util/add.wasm?module';

Expand All @@ -8,7 +8,7 @@ export const prerender = false;

export async function GET(
context: APIContext
): Promise<EndpointOutput | Response> {
): Promise<Response> {
const a = Number.parseInt(context.params.a!);
const b = Number.parseInt(context.params.b!);
return new Response(JSON.stringify({ answer: addModule.exports.add(a, b) }), {
Expand Down
4 changes: 2 additions & 2 deletions packages/cloudflare/test/fixtures/wasm/src/pages/hybrid.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { type APIContext, type EndpointOutput } from 'astro';
import { type APIContext } from 'astro';
// @ts-ignore
import mod from '../util/add.wasm?module';

const addModule: any = new WebAssembly.Instance(mod);

export async function GET(
context: APIContext
): Promise<EndpointOutput | Response> {
): Promise<Response> {
return new Response(JSON.stringify({ answer: addModule.exports.add(20, 1) }), {
status: 200,
headers: {
Expand Down

0 comments on commit 631d28f

Please sign in to comment.