elegance-js 1.17.1 → 1.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/global.d.ts +11 -0
- package/package.json +1 -1
package/dist/global.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { ObjectAttributeType } from "./helpers/ObjectAttributeType";
|
|
2
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
3
|
declare global {
|
|
3
4
|
type NonVoid<T> = T extends void ? never : T;
|
|
5
|
+
/** Deprecated. */
|
|
4
6
|
var __ELEGANCE_SERVER_DATA__: any;
|
|
7
|
+
/** Increment this by 1 to get a per-build unique ID. */
|
|
5
8
|
var __SERVER_CURRENT_STATE_ID__: number;
|
|
9
|
+
/** Deprecated. */
|
|
6
10
|
var __SERVER_CURRENT_REF_ID__: number;
|
|
11
|
+
/** The global server current state for this build. */
|
|
7
12
|
var __SERVER_CURRENT_STATE__: Array<{
|
|
8
13
|
value: unknown;
|
|
9
14
|
type: ObjectAttributeType;
|
|
@@ -27,7 +32,13 @@ declare global {
|
|
|
27
32
|
children: null;
|
|
28
33
|
options: Record<string, any> | Child;
|
|
29
34
|
};
|
|
35
|
+
/** The type for API Endpoints in route.ts files. */
|
|
36
|
+
type Endpoint = (req: IncomingMessage, res: ServerResponse) => Promise<void>;
|
|
37
|
+
/** The type for middleware functions in middleware.ts files. */
|
|
38
|
+
type Middleware = (req: IncomingMessage, res: ServerResponse, next: () => void) => Promise<void>;
|
|
39
|
+
/** The type for const layout in layout.ts files. */
|
|
30
40
|
type Layout = ((child: Child) => (AnyBuiltElement | Promise<AnyBuiltElement>));
|
|
41
|
+
/** The type for const metadata in layout.ts files. */
|
|
31
42
|
type LayoutMetadata = ((child: Child) => (AnyBuiltElement | Promise<AnyBuiltElement>));
|
|
32
43
|
type Page = (AnyBuiltElement) | (() => AnyBuiltElement) | (() => Promise<AnyBuiltElement>);
|
|
33
44
|
type Metadata = (() => (AnyBuiltElement)) | (() => Promise<AnyBuiltElement>);
|