Skip to content

Commit

Permalink
rename types
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelstroschein committed Nov 23, 2024
1 parent 9790573 commit 5fd88f9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { Storage } from "./storage/storage.js";
import { route } from "./routes/new.js";

export type LixServerProtocolHandler = (request: Request) => Promise<Response>;
export type LspHandler = (request: Request) => Promise<Response>;

export type LixiumContext = {
export type LspHandlerContext = {
request: Request;
storage: Storage;
};

export type RouteHandler = (context: LixiumContext) => Promise<Response>;
export type LspRouteHandler = (context: LspHandlerContext) => Promise<Response>;

/**
* The handler for the lix server protocol.
Expand Down Expand Up @@ -48,7 +48,7 @@ export type RouteHandler = (context: LixiumContext) => Promise<Response>;
*/
export async function createLspHandler(args: {
storage: Storage;
}): Promise<LixServerProtocolHandler> {
}): Promise<LspHandler> {
const context = { storage: args.storage };

return async (request) => {
Expand Down
5 changes: 1 addition & 4 deletions packages/lix-sdk/src/server-protocol-handler/index.ts
Original file line number Diff line number Diff line change
@@ -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";
4 changes: 2 additions & 2 deletions packages/lix-sdk/src/server-protocol-handler/routes/new.ts
Original file line number Diff line number Diff line change
@@ -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", {
Expand Down

0 comments on commit 5fd88f9

Please sign in to comment.