From 5fd88f93f51f9c778c718dc883d776cae9ab6f35 Mon Sep 17 00:00:00 2001 From: Samuel Stroschein <35429197+samuelstroschein@users.noreply.github.com> Date: Fri, 22 Nov 2024 19:51:21 -0500 Subject: [PATCH] rename types --- .../src/server-protocol-handler/create-lsp-handler.ts | 8 ++++---- packages/lix-sdk/src/server-protocol-handler/index.ts | 5 +---- .../lix-sdk/src/server-protocol-handler/routes/new.ts | 4 ++-- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/packages/lix-sdk/src/server-protocol-handler/create-lsp-handler.ts b/packages/lix-sdk/src/server-protocol-handler/create-lsp-handler.ts index beda5bc200..9103221f28 100644 --- a/packages/lix-sdk/src/server-protocol-handler/create-lsp-handler.ts +++ b/packages/lix-sdk/src/server-protocol-handler/create-lsp-handler.ts @@ -1,14 +1,14 @@ import type { Storage } from "./storage/storage.js"; import { route } from "./routes/new.js"; -export type LixServerProtocolHandler = (request: Request) => Promise; +export type LspHandler = (request: Request) => Promise; -export type LixiumContext = { +export type LspHandlerContext = { request: Request; storage: Storage; }; -export type RouteHandler = (context: LixiumContext) => Promise; +export type LspRouteHandler = (context: LspHandlerContext) => Promise; /** * The handler for the lix server protocol. @@ -48,7 +48,7 @@ export type RouteHandler = (context: LixiumContext) => Promise; */ export async function createLspHandler(args: { storage: Storage; -}): Promise { +}): Promise { const context = { storage: args.storage }; return async (request) => { diff --git a/packages/lix-sdk/src/server-protocol-handler/index.ts b/packages/lix-sdk/src/server-protocol-handler/index.ts index cc448ab993..6a65ce80de 100644 --- a/packages/lix-sdk/src/server-protocol-handler/index.ts +++ b/packages/lix-sdk/src/server-protocol-handler/index.ts @@ -1,5 +1,2 @@ -export { - createLspHandler, - type LixServerProtocolHandler, -} from "./create-lsp-handler.js"; +export { createLspHandler, type LspHandler } from "./create-lsp-handler.js"; export { createInMemoryLspHandlerStorage } from "./storage/create-in-memory-storage.js"; diff --git a/packages/lix-sdk/src/server-protocol-handler/routes/new.ts b/packages/lix-sdk/src/server-protocol-handler/routes/new.ts index faaa8bc734..dce8812c83 100644 --- a/packages/lix-sdk/src/server-protocol-handler/routes/new.ts +++ b/packages/lix-sdk/src/server-protocol-handler/routes/new.ts @@ -1,6 +1,6 @@ -import type { RouteHandler } from "../create-lsp-handler.js"; +import type { LspRouteHandler } from "../create-lsp-handler.js"; -export const route: RouteHandler = async () => { +export const route: LspRouteHandler = async () => { // const body = await context.request.blob(); return new Response("hello world", {