@webjsdev/core 0.7.12 → 0.7.13

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 CHANGED
@@ -66,7 +66,7 @@ export { repeat, isRepeat } from './src/repeat.js';
66
66
  export { Suspense, isSuspense } from './src/suspense.js';
67
67
  export { connectWS } from './src/websocket-client.js';
68
68
  export { richFetch } from './src/rich-fetch.js';
69
- export { enableClientRouter, disableClientRouter } from './src/router-client.js';
69
+ export { enableClientRouter, disableClientRouter, revalidate } from './src/router-client.js';
70
70
 
71
71
  // `navigate` is typed against the generated `Route` union (#258) rather than
72
72
  // the JSDoc `string`. Until an app runs `webjs types`, `Route` resolves to
@@ -74,10 +74,27 @@ export { enableClientRouter, disableClientRouter } from './src/router-client.js'
74
74
  // tsserver error. The runtime is the same async function in router-client.js.
75
75
  import type { Route } from './src/routes.d.ts';
76
76
  export function navigate(url: Route, opts?: { replace?: boolean }): Promise<void>;
77
- export { unsafeHTML, isUnsafeHTML, live, isLive } from './src/directives.js';
77
+ // The full lit-html-parity directive set (mirrors index.js); the per-directive
78
+ // declarations live in src/directives.d.ts. `repeat` is re-exported above.
79
+ export {
80
+ unsafeHTML, isUnsafeHTML, live, isLive, keyed, isKeyed, guard, isGuard,
81
+ templateContent, isTemplateContent, ref, isRef, createRef, cache, isCache,
82
+ until, isUntil, asyncAppend, isAsyncAppend, asyncReplace, isAsyncReplace,
83
+ watch, isWatch,
84
+ } from './src/directives.js';
78
85
  export { createContext, ContextProvider, ContextConsumer, ContextRequestEvent } from './src/context.js';
79
86
  export { Task, TaskStatus } from './src/task.js';
80
87
 
88
+ // Signals (the default state primitive, invariant 5), the CSP nonce reader,
89
+ // the wire serializer, and the streaming/frame custom elements. These mirror
90
+ // the index.js runtime re-exports; their declarations live in the matching
91
+ // src/*.d.ts (#388 fixed the index.d.ts drift from index.js).
92
+ export { signal, computed, effect, batch, isSignal, Signal } from './src/signal.js';
93
+ export { cspNonce, setCspNonceProvider } from './src/csp-nonce.js';
94
+ export { stringify, parse, serialize, deserialize } from './src/serialize.js';
95
+ export { WebjsFrame } from './src/webjs-frame.js';
96
+ export { WebjsStream, renderStream } from './src/webjs-stream.js';
97
+
81
98
  // Optimistic-mutation helper: set a signal to an expected value immediately,
82
99
  // run the action, roll back on a thrown error or a `{ success: false }`
83
100
  // ActionResult, keep the value on success. Returns the action's result.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webjsdev/core",
3
- "version": "0.7.12",
3
+ "version": "0.7.13",
4
4
  "type": "module",
5
5
  "description": "webjs core runtime - html/css tags, WebComponent base, isomorphic renderers",
6
6
  "types": "./index.d.ts",
@@ -0,0 +1,3 @@
1
+ /** Per-request CSP nonce provider (#259). Server-side; the browser bundle drops setCspNonceProvider. */
2
+ export function setCspNonceProvider(fn: () => string): void;
3
+ export function cspNonce(): string;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The webjs wire serializer (rich-type round-trip: Date / Map / Set / BigInt /
3
+ * Error / typed arrays / Blob / File / FormData / Symbols / cycles).
4
+ */
5
+ export function stringify(value: unknown): Promise<string>;
6
+ export function parse(text: string): unknown;
7
+ export function serialize(value: unknown): Promise<unknown>;
8
+ export function deserialize(value: unknown): unknown;
@@ -0,0 +1,2 @@
1
+ /** The `<webjs-frame>` partial-swap region custom element (#253). */
2
+ export class WebjsFrame extends HTMLElement {}
@@ -0,0 +1,8 @@
1
+ /** The `<webjs-stream>` element-level update custom element (#248). */
2
+ export class WebjsStream extends HTMLElement {}
3
+
4
+ /** Apply a `<webjs-stream>` payload (string / nodes) into a document. */
5
+ export function renderStream(
6
+ input: string | DocumentFragment | Node,
7
+ doc?: Document,
8
+ ): void;