refactor(core): minor fresh/compat cleanups (#2880)
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
import type { VNode } from "preact";
|
||||
import type { FreshContext } from "../context.ts";
|
||||
import type { HandlerFn, RouteHandler } from "../handlers.ts";
|
||||
import type { FreshContext } from "./context.ts";
|
||||
import type { HandlerFn, RouteHandler } from "./handlers.ts";
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link PageProps} instead.
|
||||
* @deprecated Use {@linkcode PageProps} instead.
|
||||
*/
|
||||
export type AppProps<_Data = unknown, T = unknown> = FreshContext<T>;
|
||||
/**
|
||||
* @deprecated Use {@link PageProps} instead.
|
||||
* @deprecated Use {@linkcode PageProps} instead.
|
||||
*/
|
||||
export type LayoutProps<_Data = unknown, T = unknown> = FreshContext<T>;
|
||||
/**
|
||||
* @deprecated Use {@link PageProps} instead.
|
||||
* @deprecated Use {@linkcode PageProps} instead.
|
||||
*/
|
||||
export type UnknownPageProps<_Data = unknown, T = unknown> = FreshContext<T>;
|
||||
/**
|
||||
* @deprecated Use {@link PageProps} instead.
|
||||
* @deprecated Use {@linkcode PageProps} instead.
|
||||
*/
|
||||
export type ErrorPageProps<_Data = unknown, T = unknown> = FreshContext<T>;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link FreshContext} instead.
|
||||
* @deprecated Use {@linkcode FreshContext} instead.
|
||||
*/
|
||||
export type RouteContext<_T = never, S = Record<string, unknown>> =
|
||||
FreshContext<S>;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RouteHandler} instead.
|
||||
* @deprecated Use {@linkcode RouteHandler} instead.
|
||||
*/
|
||||
// deno-lint-ignore no-explicit-any
|
||||
export type Handlers<T = any, State = Record<string, unknown>> = RouteHandler<
|
||||
@@ -35,7 +35,7 @@ export type Handlers<T = any, State = Record<string, unknown>> = RouteHandler<
|
||||
>;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link HandlerFn} instead.
|
||||
* @deprecated Use {@linkcode HandlerFn} instead.
|
||||
*/
|
||||
// deno-lint-ignore no-explicit-any
|
||||
export type Handler<T = any, State = Record<string, unknown>> = HandlerFn<
|
||||
@@ -54,14 +54,14 @@ function defineFn<State>(
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link [../mod.ts].Define.page|define.page} instead.
|
||||
* @deprecated Use {@linkcode [./mod.ts].Define.page|define.page} instead.
|
||||
*/
|
||||
export const defineApp = defineFn;
|
||||
/**
|
||||
* @deprecated Use {@link [../mod.ts].Define.page|define.page} instead.
|
||||
* @deprecated Use {@linkcode [./mod.ts].Define.page|define.page} instead.
|
||||
*/
|
||||
export const defineRoute = defineFn;
|
||||
/**
|
||||
* @deprecated Use {@link [../mod.ts].Define.page|define.page} instead.
|
||||
* @deprecated Use {@linkcode [./mod.ts].Define.page|define.page} instead.
|
||||
*/
|
||||
export const defineLayout = defineFn;
|
||||
@@ -1,13 +0,0 @@
|
||||
// Compat with older Fresh versions
|
||||
export {
|
||||
type AppProps,
|
||||
defineApp,
|
||||
defineLayout,
|
||||
defineRoute,
|
||||
type ErrorPageProps,
|
||||
type Handler,
|
||||
type Handlers,
|
||||
type LayoutProps,
|
||||
type RouteContext,
|
||||
type UnknownPageProps,
|
||||
} from "./server.ts";
|
||||
Reference in New Issue
Block a user