<commit_before>import { Express, Request, Response } from "express";

interface RenderVueParams {
  req: Request;
  res: Response;
}

interface RenderError extends Error {
  code: Response["statusCode"];
  url: Request["url"];
}

interface RenderErrorParams extends RenderVueParams {
  err: RenderError;
}

interface SsrMiddlewareFolders {
  root: string;
  public: string;
}

interface SsrMiddlewareRender {
  vue: (params: RenderVueParams) => Promise<string>;
  error: (params: RenderErrorParams) => void;
}

interface SsrMiddlewareParams {
  app: Express;
  resolveUrlPath: (url: string) => string;
  folders: SsrMiddlewareFolders;
  publicPath: string;
  render: SsrMiddlewareRender;
}

export type SsrMiddlewareCallback = (
  params: SsrMiddlewareParams
) => void | Promise<void>;<commit_msg>ts defs - ssr middleware - ssr context and folders (#8757)<commit_after>import { Express, Request, Response } from "express";

interface RenderParams {
  req: Request;
  res: Response;
}

interface RenderVueParams extends RenderParams, Record<string, any> {}

interface RenderError extends Error {
  code: Response["statusCode"];
  url: Request["url"];
}

interface RenderErrorParams extends RenderParams {
  err: RenderError;
}

interface SsrMiddlewareRender {
  vue: (ssrContext: RenderVueParams) => Promise<string>;
  error: (ssrContext: RenderErrorParams) => void;
}

interface SsrMiddlewareFolders {
  root: string;
  public: string;
}

interface SsrMiddlewareParams {
  app: Express;
  resolveUrlPath: (url: string) => string;
  publicPath: string;
  folders: SsrMiddlewareFolders;
  render: SsrMiddlewareRender;
}

export type SsrMiddlewareCallback = (
  params: SsrMiddlewareParams
) => void | Promise<void>;
{'fraction_non_alphanumeric': 0.10566258026853473, 'fraction_numerical': 0.002335084646818447, 'mean_word_length': 5.517110266159696, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1525973', 'n_tokens_mistral': 522, 'n_tokens_neox': 544, 'n_words': 139}