@moku-labs/web 1.12.3 → 1.13.0
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/browser.d.mts +13 -351
- package/dist/browser.mjs +9 -838
- package/dist/index.cjs +73 -1338
- package/dist/index.d.cts +12 -391
- package/dist/index.d.mts +12 -393
- package/dist/index.mjs +17 -1300
- package/package.json +2 -1
package/dist/browser.d.mts
CHANGED
|
@@ -1,343 +1,15 @@
|
|
|
1
|
+
import { Log as Log$1 } from "@moku-labs/common";
|
|
1
2
|
import { EmitFn } from "@moku-labs/core";
|
|
3
|
+
import { Env, Log, browserEnv, envPlugin, logPlugin } from "@moku-labs/common/browser";
|
|
2
4
|
import { ComponentChildren, FunctionComponent, VNode } from "preact";
|
|
3
5
|
import { BundledTheme, ThemeRegistrationAny } from "shiki";
|
|
4
6
|
import { Pluggable, Processor } from "unified";
|
|
5
7
|
|
|
6
|
-
//#region src/
|
|
7
|
-
declare namespace types_d_exports$4 {
|
|
8
|
-
export { ExpectChain, LogApi, LogConfig, LogEntry, LogLevel, LogSink, LogState };
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @file log plugin — type definitions skeleton.
|
|
12
|
-
*
|
|
13
|
-
* Core-plugin type surface: config, state, public API, and the supporting
|
|
14
|
-
* value/sink/assertion-chain types. These types are inferred onto the plugin
|
|
15
|
-
* via state.ts / api.ts; index.ts passes NO explicit generics.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Runtime mode for the log plugin. Selects which default sinks are installed at
|
|
19
|
-
* onInit. The in-memory trace sink is ALWAYS installed regardless of mode.
|
|
20
|
-
*
|
|
21
|
-
* - "test" — no console sink (keeps test output clean); trace only.
|
|
22
|
-
* - "silent" — no console sink (explicit quiet); trace only.
|
|
23
|
-
* - "dev" — console sink + trace.
|
|
24
|
-
* - "production" — console sink + trace.
|
|
25
|
-
*/
|
|
26
|
-
type LogConfig = {
|
|
27
|
-
/** Sink-selection mode. Defaults to `production`. */mode: "test" | "dev" | "production" | "silent";
|
|
28
|
-
};
|
|
29
|
-
/** Severity level for a log entry. */
|
|
30
|
-
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
31
|
-
/**
|
|
32
|
-
* A single recorded log entry.
|
|
33
|
-
*/
|
|
34
|
-
type LogEntry = {
|
|
35
|
-
/** Severity level. */level: LogLevel; /** Event identifier (free-form string; convention: `domain:action`). */
|
|
36
|
-
event: string; /** Optional structured payload associated with the event. */
|
|
37
|
-
data?: unknown; /** Capture timestamp in epoch milliseconds (`Date.now()` at append time). */
|
|
38
|
-
ts: number; /** Optional originating plugin name. Reserved for future enrichment. */
|
|
39
|
-
plugin?: string;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Pluggable output target. Implement this to add console/file/JSON/etc. sinks
|
|
43
|
-
* WITHOUT changing the log API. Each logged entry is passed to `write` once,
|
|
44
|
-
* in registration order.
|
|
45
|
-
*/
|
|
46
|
-
type LogSink = {
|
|
47
|
-
/**
|
|
48
|
-
* Write a single entry to this sink.
|
|
49
|
-
*
|
|
50
|
-
* @param entry - The entry to emit.
|
|
51
|
-
*/
|
|
52
|
-
write(entry: LogEntry): void;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Fluent event-trace assertion chain. Reads the live entries array on each call,
|
|
56
|
-
* so assertions reflect the trace state at call time (not chain-creation time).
|
|
57
|
-
* Every method returns the same chain for fluent chaining; assertion failures throw.
|
|
58
|
-
*/
|
|
59
|
-
type ExpectChain = {
|
|
60
|
-
/**
|
|
61
|
-
* Assert at least one entry has `event`, optionally matching `partial` (subset match).
|
|
62
|
-
*
|
|
63
|
-
* @param event - Event name to find.
|
|
64
|
-
* @param partial - Optional partial data shape (subset-matched against `entry.data`).
|
|
65
|
-
* @returns The same chain for chaining.
|
|
66
|
-
* @throws {Error} `LogExpectAssertionError` when no matching entry exists.
|
|
67
|
-
*/
|
|
68
|
-
toHaveEvent(event: string, partial?: Record<string, unknown>): ExpectChain;
|
|
69
|
-
/**
|
|
70
|
-
* Assert all of `events` appear in the trace in the given relative order
|
|
71
|
-
* (gaps allowed; later events must occur after earlier ones).
|
|
72
|
-
*
|
|
73
|
-
* @param events - Ordered list of event names.
|
|
74
|
-
* @returns The same chain for chaining.
|
|
75
|
-
* @throws {Error} `LogExpectAssertionError` when the ordering cannot be satisfied.
|
|
76
|
-
*/
|
|
77
|
-
toHaveEventInOrder(events: string[]): ExpectChain;
|
|
78
|
-
/**
|
|
79
|
-
* Assert NO entry has `event` (optionally narrowed by `partial`).
|
|
80
|
-
*
|
|
81
|
-
* @param event - Event name that must be absent.
|
|
82
|
-
* @param partial - Optional partial data shape; only matching entries violate the assertion.
|
|
83
|
-
* @returns The same chain for chaining.
|
|
84
|
-
* @throws {Error} `LogExpectAssertionError` when a matching entry exists.
|
|
85
|
-
*/
|
|
86
|
-
toNotHaveEvent(event: string, partial?: Record<string, unknown>): ExpectChain;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Internal mutable state for the log plugin. Created fresh per createApp construction.
|
|
90
|
-
*/
|
|
91
|
-
type LogState = {
|
|
92
|
-
/** Append-only ordered trace of every logged entry (the in-memory trace sink's backing store). */entries: LogEntry[]; /** Registered output sinks. Each entry is written to every sink in order. */
|
|
93
|
-
sinks: LogSink[];
|
|
94
|
-
};
|
|
95
|
-
/** Public log API injected as `ctx.log` on every regular plugin and exposed as `app.log`. */
|
|
96
|
-
type LogApi = {
|
|
97
|
-
/**
|
|
98
|
-
* Append an `info` entry and fan it out to every sink.
|
|
99
|
-
*
|
|
100
|
-
* @param event - Event identifier (convention: `domain:action`).
|
|
101
|
-
* @param data - Optional structured payload.
|
|
102
|
-
*/
|
|
103
|
-
info(event: string, data?: unknown): void;
|
|
104
|
-
/**
|
|
105
|
-
* Append a `debug` entry and fan it out to every sink.
|
|
106
|
-
*
|
|
107
|
-
* @param event - Event identifier (convention: `domain:action`).
|
|
108
|
-
* @param data - Optional structured payload.
|
|
109
|
-
*/
|
|
110
|
-
debug(event: string, data?: unknown): void;
|
|
111
|
-
/**
|
|
112
|
-
* Append a `warn` entry and fan it out to every sink.
|
|
113
|
-
*
|
|
114
|
-
* @param event - Event identifier (convention: `domain:action`).
|
|
115
|
-
* @param data - Optional structured payload.
|
|
116
|
-
*/
|
|
117
|
-
warn(event: string, data?: unknown): void;
|
|
118
|
-
/**
|
|
119
|
-
* Append an `error` entry. When `error` is provided, its `message`/`stack` are
|
|
120
|
-
* merged into `data` under an `error` key; otherwise `data` is recorded as-is.
|
|
121
|
-
*
|
|
122
|
-
* @param event - Event identifier (convention: `domain:action`).
|
|
123
|
-
* @param data - Optional structured payload.
|
|
124
|
-
* @param error - Optional originating Error to merge into `data`.
|
|
125
|
-
*/
|
|
126
|
-
error(event: string, data?: unknown, error?: Error): void;
|
|
127
|
-
/**
|
|
128
|
-
* Return a frozen snapshot of the entries recorded so far (a fresh copy).
|
|
129
|
-
*
|
|
130
|
-
* @returns A readonly, frozen copy of the recorded entries.
|
|
131
|
-
*/
|
|
132
|
-
trace(): readonly LogEntry[];
|
|
133
|
-
/**
|
|
134
|
-
* Return a fluent assertion chain bound to the live entries array.
|
|
135
|
-
*
|
|
136
|
-
* @returns A fresh {@link ExpectChain}.
|
|
137
|
-
*/
|
|
138
|
-
expect(): ExpectChain;
|
|
139
|
-
/**
|
|
140
|
-
* Register an additional output sink at runtime.
|
|
141
|
-
*
|
|
142
|
-
* @param sink - The sink to add to the fan-out list.
|
|
143
|
-
*/
|
|
144
|
-
addSink(sink: LogSink): void; /** Clear all recorded entries while keeping registered sinks. */
|
|
145
|
-
reset(): void;
|
|
146
|
-
};
|
|
147
|
-
declare namespace types_d_exports$2 {
|
|
148
|
-
export { EnvApi, EnvConfig, EnvProvider, EnvState, EnvVarSpec };
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* @file env plugin — public + boundary type definitions.
|
|
152
|
-
*/
|
|
153
|
-
/**
|
|
154
|
-
* A source of raw environment values.
|
|
155
|
-
*
|
|
156
|
-
* Providers are walked in array order during resolution; the first provider to
|
|
157
|
-
* return a non-`undefined` (and non-empty-string) value for a key wins. `load()`
|
|
158
|
-
* is called exactly once per resolution at `onInit` time, after which both env
|
|
159
|
-
* maps are frozen. A provider like {@link cloudflareBindings} reads `globalThis`
|
|
160
|
-
* at that single `onInit` call (not per request).
|
|
161
|
-
*
|
|
162
|
-
* @example
|
|
163
|
-
* ```ts
|
|
164
|
-
* const custom: EnvProvider = {
|
|
165
|
-
* name: "vault",
|
|
166
|
-
* load: () => ({ DB_URL: readVaultSecret("db") })
|
|
167
|
-
* };
|
|
168
|
-
* ```
|
|
169
|
-
*/
|
|
170
|
-
interface EnvProvider {
|
|
171
|
-
/** Human-readable provider name, used in diagnostics and error messages. */
|
|
172
|
-
name: string;
|
|
173
|
-
/**
|
|
174
|
-
* Reads this provider's current view of the environment.
|
|
175
|
-
*
|
|
176
|
-
* @returns A flat record of variable names to string values. Keys the
|
|
177
|
-
* provider cannot supply must be omitted or set to `undefined`.
|
|
178
|
-
*/
|
|
179
|
-
load(): Record<string, string | undefined>;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Declares how a single environment variable is validated and exposed.
|
|
183
|
-
*
|
|
184
|
-
* @example
|
|
185
|
-
* ```ts
|
|
186
|
-
* const port: EnvVarSpec = { public: false, required: false, default: "3000" };
|
|
187
|
-
* const apiBase: EnvVarSpec = { public: true }; // key must start with PUBLIC_
|
|
188
|
-
* const token: EnvVarSpec = { public: false, required: true, secret: true };
|
|
189
|
-
* ```
|
|
190
|
-
*/
|
|
191
|
-
interface EnvVarSpec {
|
|
192
|
-
/**
|
|
193
|
-
* Whether the variable is safe to ship to the browser. When `true`, the key
|
|
194
|
-
* **must** start with {@link EnvConfig.publicPrefix} (cross-checked at
|
|
195
|
-
* `onInit`), and the variable is included in {@link EnvApi.getPublicMap}.
|
|
196
|
-
*/
|
|
197
|
-
public: boolean;
|
|
198
|
-
/** Whether resolution fails if the variable is still undefined after defaults. */
|
|
199
|
-
required?: boolean;
|
|
200
|
-
/** Value applied when no provider supplies the variable. */
|
|
201
|
-
default?: string;
|
|
202
|
-
/**
|
|
203
|
-
* Marks the variable as a secret for documentation / tooling. Has no runtime
|
|
204
|
-
* effect on resolution, but secrets are never permitted to be `public`.
|
|
205
|
-
*/
|
|
206
|
-
secret?: boolean;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Configuration for the {@link envPlugin} core plugin.
|
|
210
|
-
*
|
|
211
|
-
* @example
|
|
212
|
-
* ```ts
|
|
213
|
-
* createCoreConfig("web", {
|
|
214
|
-
* plugins: [envPlugin],
|
|
215
|
-
* pluginConfigs: {
|
|
216
|
-
* env: {
|
|
217
|
-
* schema: {
|
|
218
|
-
* PUBLIC_API_URL: { public: true, default: "/api" },
|
|
219
|
-
* SESSION_SECRET: { public: false, required: true, secret: true }
|
|
220
|
-
* }
|
|
221
|
-
* }
|
|
222
|
-
* }
|
|
223
|
-
* });
|
|
224
|
-
* ```
|
|
225
|
-
*/
|
|
226
|
-
type EnvConfig = {
|
|
227
|
-
/** Per-variable validation + exposure rules, keyed by variable name. */schema: Record<string, EnvVarSpec>;
|
|
228
|
-
/**
|
|
229
|
-
* Ordered list of value sources. The first provider yielding a non-`undefined`
|
|
230
|
-
* (and non-empty-string) value for a key wins. The plugin's own spec default is
|
|
231
|
-
* `[]`; the consumer supplies the providers per target (`[dotenv(), processEnv()]`
|
|
232
|
-
* on Node) — only the `/browser` entry pre-wires `browserEnv()` out of the box.
|
|
233
|
-
*/
|
|
234
|
-
providers: EnvProvider[];
|
|
235
|
-
/**
|
|
236
|
-
* Prefix that public variable names must carry. Bidirectionally enforced at
|
|
237
|
-
* `onInit`. Framework default is `"PUBLIC_"`.
|
|
238
|
-
*/
|
|
239
|
-
publicPrefix: string;
|
|
240
|
-
};
|
|
241
|
-
/**
|
|
242
|
-
* Internal env plugin state: the resolved variable table and its public subset.
|
|
243
|
-
* Both maps are populated and frozen (via `freezeMap`) during `onInit`.
|
|
244
|
-
*
|
|
245
|
-
* Exported only to type the `createState` / `api` / `validate` boundary —
|
|
246
|
-
* consumers use {@link EnvApi}, never `EnvState`.
|
|
247
|
-
*/
|
|
248
|
-
interface EnvState {
|
|
249
|
-
/** All validated variables that resolved to a defined value (incl. defaults). */
|
|
250
|
-
resolved: Map<string, string>;
|
|
251
|
-
/** Subset of `resolved` where `schema[key].public === true`. */
|
|
252
|
-
publicMap: Map<string, string>;
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* The resolved-environment accessor mounted at `ctx.env`. Built by the plugin's
|
|
256
|
-
* `api` factory over `ctx.state` ({@link EnvState}).
|
|
257
|
-
*
|
|
258
|
-
* Available after `onInit` (i.e. inside any plugin's lifecycle and in consumer
|
|
259
|
-
* code). All accessors read from the frozen `resolved` / `publicMap` maps;
|
|
260
|
-
* mutation is impossible.
|
|
261
|
-
*
|
|
262
|
-
* @example
|
|
263
|
-
* ```ts
|
|
264
|
-
* const url = ctx.env.get("PUBLIC_API_URL"); // string | undefined
|
|
265
|
-
* const token = ctx.env.require("DEPLOY_TOKEN"); // string, or throws
|
|
266
|
-
* ```
|
|
267
|
-
*/
|
|
268
|
-
type EnvApi = {
|
|
269
|
-
/**
|
|
270
|
-
* Reads a resolved variable.
|
|
271
|
-
*
|
|
272
|
-
* @param key - Variable name.
|
|
273
|
-
* @returns The value, or `undefined` if not present / not in schema.
|
|
274
|
-
*/
|
|
275
|
-
get(key: string): string | undefined;
|
|
276
|
-
/**
|
|
277
|
-
* Reads a variable that must exist.
|
|
278
|
-
*
|
|
279
|
-
* @param key - Variable name.
|
|
280
|
-
* @returns The value.
|
|
281
|
-
* @throws {Error} If the variable is undefined.
|
|
282
|
-
*/
|
|
283
|
-
require(key: string): string;
|
|
284
|
-
/**
|
|
285
|
-
* Tests presence of a resolved variable.
|
|
286
|
-
*
|
|
287
|
-
* @param key - Variable name.
|
|
288
|
-
* @returns `true` if a value is present.
|
|
289
|
-
*/
|
|
290
|
-
has(key: string): boolean;
|
|
291
|
-
/**
|
|
292
|
-
* Returns all public variables as a frozen plain object — convenient for
|
|
293
|
-
* spreading into a serializable payload.
|
|
294
|
-
*
|
|
295
|
-
* @returns A frozen `Record` of public variable names to values.
|
|
296
|
-
*/
|
|
297
|
-
getPublic(): Readonly<Record<string, string>>;
|
|
298
|
-
/**
|
|
299
|
-
* Returns the frozen map of public variables. This is the **sole** intended
|
|
300
|
-
* input to a build-time `define` injection: every entry is safe to inline
|
|
301
|
-
* into the browser bundle.
|
|
302
|
-
*
|
|
303
|
-
* @returns The frozen public map.
|
|
304
|
-
*/
|
|
305
|
-
getPublicMap(): ReadonlyMap<string, string>;
|
|
306
|
-
};
|
|
307
|
-
//#endregion
|
|
308
|
-
//#region src/plugins/env/providers.browser.d.ts
|
|
309
|
-
/**
|
|
310
|
-
* A browser-safe {@link EnvProvider} that reads `import.meta.env` and an optional
|
|
311
|
-
* `globalThis[globalKey]` snapshot, merging them with the runtime global winning.
|
|
312
|
-
* Contains zero `node:*` imports, so it is safe to include in the client bundle.
|
|
313
|
-
* Never throws on missing sources — each absent source resolves to `{}`.
|
|
314
|
-
*
|
|
315
|
-
* @param options - Optional settings.
|
|
316
|
-
* @param options.globalKey - `globalThis` key to read a public-env snapshot from. Defaults to `"__ENV__"`.
|
|
317
|
-
* @returns An {@link EnvProvider} named `browser-env`.
|
|
318
|
-
* @example
|
|
319
|
-
* ```ts
|
|
320
|
-
* const provider = browserEnv();
|
|
321
|
-
* provider.load(); // { PUBLIC_API_URL: "/api", ... }
|
|
322
|
-
* ```
|
|
323
|
-
*/
|
|
324
|
-
declare function browserEnv(options?: {
|
|
325
|
-
globalKey?: string;
|
|
326
|
-
}): EnvProvider;
|
|
327
|
-
//#endregion
|
|
328
|
-
//#region src/plugins/env/index.d.ts
|
|
8
|
+
//#region src/config.d.ts
|
|
329
9
|
/**
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
* @example
|
|
334
|
-
* ```ts
|
|
335
|
-
* createApp({ pluginConfigs: { env: { schema: { PUBLIC_API_URL: { public: true } } } } });
|
|
336
|
-
* ```
|
|
10
|
+
* @file Framework configuration — Config + Events types, core plugin registration.
|
|
11
|
+
* @see README.md
|
|
337
12
|
*/
|
|
338
|
-
declare const envPlugin: import("@moku-labs/core").CorePluginInstance<"env", EnvConfig, EnvState, EnvApi>;
|
|
339
|
-
//#endregion
|
|
340
|
-
//#region src/config.d.ts
|
|
341
13
|
/**
|
|
342
14
|
* Deployment stage. Drives content draft visibility — drafts are suppressed
|
|
343
15
|
* only in `"production"`; `"development"` and `"test"` both surface them.
|
|
@@ -583,7 +255,7 @@ interface PathMatcher {
|
|
|
583
255
|
};
|
|
584
256
|
} | null;
|
|
585
257
|
}
|
|
586
|
-
declare namespace types_d_exports$
|
|
258
|
+
declare namespace types_d_exports$3 {
|
|
587
259
|
export { Api$2 as Api, ClientRoute, CompileInput, CompiledRoute, Config$2 as Config, ExtractApi$1 as ExtractApi, ExtractRouteParams, ExtractSegmentParameter, GenerateContext, HeadConfig$1 as HeadConfig, LayoutContext, LoadContext, MatcherTable, Prettify, RouteBuilder, RouteContext, RouteDefinition, RouteHandlers, RouteMap, RouteRequire, RouteState, RouterApi, RouterConfig, RouterState, State$2 as State, TypedRoute, Urls };
|
|
588
260
|
}
|
|
589
261
|
/**
|
|
@@ -996,7 +668,7 @@ type Config$2 = RouterConfig;
|
|
|
996
668
|
type State$2 = RouterState;
|
|
997
669
|
/** Re-export under the canonical `Api` name for the plugin-types barrel. */
|
|
998
670
|
type Api$2 = RouterApi;
|
|
999
|
-
declare namespace types_d_exports$
|
|
671
|
+
declare namespace types_d_exports$2 {
|
|
1000
672
|
export { Api$1 as Api, ArticleMeta, Config$1 as Config, HeadConfig, HeadDefaults, HeadElement, ResolvedRoute, State$1 as State };
|
|
1001
673
|
}
|
|
1002
674
|
/**
|
|
@@ -1171,7 +843,7 @@ type Api$1 = {
|
|
|
1171
843
|
*/
|
|
1172
844
|
composeTitle(head: HeadConfig | undefined): string;
|
|
1173
845
|
};
|
|
1174
|
-
declare namespace types_d_exports$
|
|
846
|
+
declare namespace types_d_exports$4 {
|
|
1175
847
|
export { COMPONENT_HOOK_NAMES, ComponentContext, ComponentDef, ComponentHooks, ComponentInstance, ExtractApi, PageData, ResolvedSpaConfig, SpaApi, SpaConfig, SpaContext, SpaDataReader, SpaEmitFunction, SpaEvents, SpaKernel, SpaKernelDeps, SpaRequire, SpaState };
|
|
1176
848
|
}
|
|
1177
849
|
/** Payload map for the events `spa` emits, used to type the kernel's `emit` closure. */
|
|
@@ -1237,7 +909,7 @@ interface SpaContext {
|
|
|
1237
909
|
/** Emit a spa lifecycle event (notification-only). */
|
|
1238
910
|
emit: SpaEmitFunction;
|
|
1239
911
|
/** Structured logger (core `log` API). */
|
|
1240
|
-
readonly log: LogApi;
|
|
912
|
+
readonly log: Log$1.LogApi;
|
|
1241
913
|
}
|
|
1242
914
|
/** Configuration for the SPA runtime plugin. All fields optional; defaults applied in onInit. */
|
|
1243
915
|
type SpaConfig = {
|
|
@@ -2425,16 +2097,6 @@ declare const contentPlugin: import("@moku-labs/core").PluginInstance<"content",
|
|
|
2425
2097
|
};
|
|
2426
2098
|
}> & Record<never, never>;
|
|
2427
2099
|
//#endregion
|
|
2428
|
-
//#region src/plugins/log/index.d.ts
|
|
2429
|
-
/**
|
|
2430
|
-
* Core logging plugin — always-on in-memory trace + `expect()` event-trace DSL.
|
|
2431
|
-
* API injected as `ctx.log` on every regular plugin and surfaced as `app.log`.
|
|
2432
|
-
* No depends / events / hooks (core plugin per spec/03 §5).
|
|
2433
|
-
*
|
|
2434
|
-
* @see README.md
|
|
2435
|
-
*/
|
|
2436
|
-
declare const logPlugin: import("@moku-labs/core").CorePluginInstance<"log", LogConfig, LogState, LogApi>;
|
|
2437
|
-
//#endregion
|
|
2438
2100
|
//#region src/browser.d.ts
|
|
2439
2101
|
/**
|
|
2440
2102
|
* Create and initialize a browser-safe `@moku-labs/web` application — the Layer-3
|
|
@@ -2490,7 +2152,7 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
2490
2152
|
name: string;
|
|
2491
2153
|
el: Element;
|
|
2492
2154
|
};
|
|
2493
|
-
}> & Record<never, never>) | ExtraPlugins[number], [...ExtraPlugins], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", LogConfig, LogState, LogApi>, import("@moku-labs/core").CorePluginInstance<"env", EnvConfig, EnvState, EnvApi>]>> | undefined) => import("@moku-labs/core").App<Config$5, Events, (import("@moku-labs/core").PluginInstance<"site", Config$4, Record<string, never>, Api$4, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"i18n", Config$3, Record<string, never>, Api$3, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"router", RouterConfig, RouterState, RouterApi, {}> & {
|
|
2155
|
+
}> & Record<never, never>) | ExtraPlugins[number], [...ExtraPlugins], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common").LogConfig, import("@moku-labs/common").LogState, import("@moku-labs/common").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common").EnvConfig, import("@moku-labs/common").EnvState, import("@moku-labs/common").EnvApi>]>> | undefined) => import("@moku-labs/core").App<Config$5, Events, (import("@moku-labs/core").PluginInstance<"site", Config$4, Record<string, never>, Api$4, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"i18n", Config$3, Record<string, never>, Api$3, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"router", RouterConfig, RouterState, RouterApi, {}> & {
|
|
2494
2156
|
route: typeof route;
|
|
2495
2157
|
defineRoutes: typeof defineRoutes;
|
|
2496
2158
|
createUrls: typeof createUrls;
|
|
@@ -2519,7 +2181,7 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
2519
2181
|
name: string;
|
|
2520
2182
|
el: Element;
|
|
2521
2183
|
};
|
|
2522
|
-
}> & Record<never, never>) | ExtraPlugins[number], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", LogConfig, LogState, LogApi>, import("@moku-labs/core").CorePluginInstance<"env", EnvConfig, EnvState, EnvApi>]>>;
|
|
2184
|
+
}> & Record<never, never>) | ExtraPlugins[number], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common").LogConfig, import("@moku-labs/common").LogState, import("@moku-labs/common").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common").EnvConfig, import("@moku-labs/common").EnvState, import("@moku-labs/common").EnvApi>]>>;
|
|
2523
2185
|
/**
|
|
2524
2186
|
* Create a custom plugin bound to this framework's `Config`/`Events` and core
|
|
2525
2187
|
* APIs. Plugin types are inferred from the spec object — never written explicitly.
|
|
@@ -2535,6 +2197,6 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
2535
2197
|
* const app = createApp({ plugins: [analytics] });
|
|
2536
2198
|
* ```
|
|
2537
2199
|
*/
|
|
2538
|
-
declare const createPlugin: import("@moku-labs/core").BoundCreatePluginFunction<Config$5, Events, import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", LogConfig, LogState, LogApi>, import("@moku-labs/core").CorePluginInstance<"env", EnvConfig, EnvState, EnvApi>]>>;
|
|
2200
|
+
declare const createPlugin: import("@moku-labs/core").BoundCreatePluginFunction<Config$5, Events, import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common").LogConfig, import("@moku-labs/common").LogState, import("@moku-labs/common").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common").EnvConfig, import("@moku-labs/common").EnvState, import("@moku-labs/common").EnvApi>]>>;
|
|
2539
2201
|
//#endregion
|
|
2540
|
-
export { types_d_exports as Content, types_d_exports$1 as Data,
|
|
2202
|
+
export { types_d_exports as Content, types_d_exports$1 as Data, type Env, types_d_exports$2 as Head, type Log, types_d_exports$3 as Router, types_d_exports$4 as Spa, browserEnv, buildArticleHead, canonical, contentPlugin, createApp, createComponent, createPlugin, createUrls, dataPlugin, defineRoutes, envPlugin, feedLink, headPlugin, hreflang, i18nPlugin, jsonLd, lazyEmbed, logPlugin, meta, og, route, routerPlugin, sitePlugin, spaPlugin, twitter };
|