@podium/podlet 5.0.0 → 5.0.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/index.d.ts DELETED
@@ -1,114 +0,0 @@
1
- import { HttpIncoming, AssetJs, AssetCss } from '@podium/utils';
2
- import PodiumProxy from '@podium/proxy';
3
- import MetricsClient from '@metrics/client';
4
-
5
- // Use declaration merging to extend Express.
6
- declare global {
7
- namespace Express {
8
- interface Response {
9
- podiumSend(fragment: string, ...args: unknown[]): Response;
10
- }
11
- }
12
- }
13
-
14
- declare class Podlet {
15
- constructor(options: Podlet.PodletOptions);
16
-
17
- name: string;
18
-
19
- version: string;
20
-
21
- manifestRoute: string;
22
-
23
- contentRoute: string;
24
-
25
- fallbackRoute: string;
26
-
27
- cssRoute: AssetCss[];
28
-
29
- jsRoute: AssetJs[];
30
-
31
- proxyRoutes: Record<string, string>;
32
-
33
- log: Podlet.AbsLogger;
34
-
35
- development: boolean;
36
-
37
- httpProxy: PodiumProxy;
38
-
39
- baseContext: Podlet.PodletContext;
40
-
41
- defaultContext: Podlet.PodletContext;
42
-
43
- metrics: MetricsClient;
44
-
45
- pathname(): string;
46
-
47
- middleware(): (req: any, res: any, next: any) => Promise<void>;
48
-
49
- manifest(options?: { prefix?: boolean }): string;
50
-
51
- content(options?: { prefix?: boolean }): string;
52
-
53
- fallback(options?: { prefix?: boolean }): string;
54
-
55
- js(options: AssetJs | Array<AssetJs>): void;
56
-
57
- css(options: AssetCss | Array<AssetCss>): void;
58
-
59
- proxy(options: { target: string; name: string }): string;
60
-
61
- defaults(context: any): any;
62
-
63
- view<T = { [key: string]: unknown }>(
64
- template: (
65
- incoming: HttpIncoming<T>,
66
- fragment: string,
67
- ...args: unknown[]
68
- ) => string,
69
- ): void;
70
-
71
- render<T = { [key: string]: unknown }>(
72
- incoming: HttpIncoming<T>,
73
- fragment: string,
74
- ...args: unknown[]
75
- ): string;
76
-
77
- process(incoming: HttpIncoming): Promise<HttpIncoming>;
78
- }
79
-
80
- declare namespace Podlet {
81
- export type AbsLogger = {
82
- trace: LogFunction;
83
- debug: LogFunction;
84
- info: LogFunction;
85
- warn: LogFunction;
86
- error: LogFunction;
87
- fatal: LogFunction;
88
- };
89
-
90
- type LogFunction = (...args: any) => void;
91
-
92
- export type PodletContext = {
93
- debug: 'true' | 'false';
94
- locale: string;
95
- deviceType: string;
96
- requestedBy: string;
97
- mountOrigin: string;
98
- mountPathname: string;
99
- publicPathname: string;
100
- };
101
-
102
- export interface PodletOptions {
103
- name: string;
104
- pathname: string;
105
- version: string;
106
- manifest?: string;
107
- content?: string;
108
- fallback?: string;
109
- logger?: Console | AbsLogger;
110
- development?: boolean;
111
- }
112
- }
113
-
114
- export = Podlet;