@webjsdev/core 0.7.12 → 0.7.14
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 +19 -2
- package/package.json +1 -1
- package/src/component.d.ts +7 -3
- package/src/csp-nonce.d.ts +3 -0
- package/src/serialize.d.ts +8 -0
- package/src/webjs-frame.d.ts +2 -0
- package/src/webjs-stream.d.ts +8 -0
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
|
-
|
|
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
package/src/component.d.ts
CHANGED
|
@@ -114,7 +114,11 @@ export abstract class WebComponent extends HTMLElement {
|
|
|
114
114
|
/** Optional render-error boundary inside the component. */
|
|
115
115
|
renderError?(error: Error): TemplateResult | void;
|
|
116
116
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
// Concrete on the base (component.js implements all three), so a subclass
|
|
118
|
+
// override can call `super.connectedCallback()` etc. without a
|
|
119
|
+
// possibly-undefined error (#433). NOT optional, unlike the subclass-only
|
|
120
|
+
// hooks above (firstUpdated / renderError).
|
|
121
|
+
connectedCallback(): void;
|
|
122
|
+
disconnectedCallback(): void;
|
|
123
|
+
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
120
124
|
}
|
|
@@ -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,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;
|