Skip to content

Commit

Permalink
Merge branch 'refs/heads/next' into Add-ff-check
Browse files Browse the repository at this point in the history
  • Loading branch information
Cliftonz committed May 28, 2024
2 parents a798599 + 1a0f971 commit 7c147f9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/echo/src/express.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { type VercelRequest, type VercelResponse } from '@vercel/node';
import { type Request, type Response } from 'express';

import { EchoRequestHandler, IServeHandlerOptions } from './handler';
import { EchoRequestHandler, ServeHandlerOptions } from './handler';
import { Either } from './types';
import { type SupportedFrameworkName } from './types';

export const frameworkName: SupportedFrameworkName = 'express';

export const serve = (options: IServeHandlerOptions): any => {
export const serve = (options: ServeHandlerOptions): any => {
const echoHandler = new EchoRequestHandler({
frameworkName,
...options,
Expand Down
4 changes: 2 additions & 2 deletions packages/echo/src/h3.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { getHeader, getQuery, type H3Event, readBody, send, setHeaders } from 'h3';

import { EchoRequestHandler, IServeHandlerOptions } from './handler';
import { EchoRequestHandler, ServeHandlerOptions } from './handler';
import { type SupportedFrameworkName } from './types';

export const frameworkName: SupportedFrameworkName = 'h3';

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export const serve = (options: IServeHandlerOptions) => {
export const serve = (options: ServeHandlerOptions) => {
const handler = new EchoRequestHandler({
frameworkName,
...options,
Expand Down
5 changes: 3 additions & 2 deletions packages/echo/src/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ import {
} from './errors';
import { MaybePromise } from './types';

export interface IServeHandlerOptions {
// eslint-disable-next-line @typescript-eslint/naming-convention
export interface ServeHandlerOptions {
client: Echo;
}

interface IEchoRequestHandlerOptions<Input extends any[] = any[], Output = any> extends IServeHandlerOptions {
interface IEchoRequestHandlerOptions<Input extends any[] = any[], Output = any> extends ServeHandlerOptions {
frameworkName: string;
client: Echo;
handler: Handler<Input, Output>;
Expand Down
1 change: 1 addition & 0 deletions packages/echo/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { Echo } from './client';
export * from './types';
export { EchoRequestHandler, ServeHandlerOptions } from './handler';
4 changes: 2 additions & 2 deletions packages/echo/src/next.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type NextApiRequest, type NextApiResponse } from 'next';
import { type NextRequest } from 'next/server';

import { EchoRequestHandler, IServeHandlerOptions } from './handler';
import { EchoRequestHandler, ServeHandlerOptions } from './handler';
import { Either } from './types';
import { type SupportedFrameworkName } from './types';
import { getResponse } from './utils';
Expand All @@ -24,7 +24,7 @@ export const frameworkName: SupportedFrameworkName = 'nextjs';
* export const { GET, POST, PUT } = serve({ client: echo });
* ```
*/
export const serve = (options: IServeHandlerOptions): any => {
export const serve = (options: ServeHandlerOptions): any => {
const echoHandler = new EchoRequestHandler({
frameworkName,
...options,
Expand Down
4 changes: 2 additions & 2 deletions packages/echo/src/nuxt.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { getHeader, getQuery, H3Event, readBody, send, setHeaders } from 'h3';

import { EchoRequestHandler, IServeHandlerOptions } from './handler';
import { EchoRequestHandler, ServeHandlerOptions } from './handler';
import { type SupportedFrameworkName } from './types';

export const frameworkName: SupportedFrameworkName = 'nuxt';

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
export const serve = (options: IServeHandlerOptions) => {
export const serve = (options: ServeHandlerOptions) => {
const handler = new EchoRequestHandler({
frameworkName,
...options,
Expand Down

0 comments on commit 7c147f9

Please sign in to comment.