likec4 1.59.2 → 1.59.4
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/__app__/src/chunks/AIChat.mjs +118 -123
- package/__app__/src/chunks/LikeC4Styles.mjs +828 -686
- package/__app__/src/chunks/ProjectsOverview.mjs +82 -82
- package/__app__/src/chunks/es.mjs +1 -1
- package/__app__/src/chunks/hooks.mjs +164 -135
- package/__app__/src/chunks/libs/@floating-ui.mjs +649 -335
- package/__app__/src/chunks/libs/@mantine.mjs +2934 -2040
- package/__app__/src/chunks/libs/@tanstack-ai.mjs +28 -28
- package/__app__/src/chunks/libs/@tanstack.mjs +46 -51
- package/__app__/src/chunks/libs/@xstate/react.mjs +59 -40
- package/__app__/src/chunks/libs/@xyflow/react.mjs +535 -448
- package/__app__/src/chunks/libs/bezier-js.mjs +10 -9
- package/__app__/src/chunks/libs/d3.mjs +20 -45
- package/__app__/src/chunks/libs/fast-equals.mjs +62 -50
- package/__app__/src/chunks/libs/framer.mjs +300 -279
- package/__app__/src/chunks/libs/zod.mjs +17 -14
- package/__app__/src/chunks/rolldown-runtime.mjs +2 -2
- package/__app__/src/chunks/styled-system.mjs +2580 -132
- package/__app__/src/main.mjs +24925 -23485
- package/__app__/src/style.css +1 -1
- package/config/schema.json +49 -0
- package/dist/app/render-view-client.css +1 -0
- package/dist/app/render-view-client.js +739 -0
- package/dist/chunks/enableServer.mjs +1 -1
- package/dist/chunks/filenames.mjs +7 -6
- package/dist/chunks/index.d.mts +18 -1
- package/dist/chunks/index2.d.mts +79 -26
- package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
- package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +5 -5
- package/dist/chunks/libs/@chevrotain/types.d.mts +108 -0
- package/dist/chunks/libs/@logtape/logtape.mjs +4 -4
- package/dist/chunks/libs/@lume/kiwi.mjs +1 -1
- package/dist/chunks/libs/birpc.mjs +1 -1
- package/dist/chunks/libs/chevrotain-allstar.mjs +1 -1
- package/dist/chunks/libs/chevrotain.mjs +16 -16
- package/dist/chunks/libs/json5.mjs +3 -3
- package/dist/chunks/libs/langium.d.mts +1777 -16
- package/dist/chunks/libs/langium.mjs +11 -11
- package/dist/chunks/libs/merge-error-cause.mjs +2 -2
- package/dist/chunks/libs/p-queue.mjs +1 -1
- package/dist/chunks/libs/package-manager-detector.mjs +1 -1
- package/dist/chunks/libs/pako.mjs +2 -2
- package/dist/chunks/libs/picomatch.mjs +1 -1
- package/dist/chunks/libs/pretty-ms.mjs +1 -1
- package/dist/chunks/libs/remeda.mjs +1 -1
- package/dist/chunks/libs/ufo.mjs +1 -1
- package/dist/chunks/libs/unstorage.mjs +1 -1
- package/dist/chunks/libs/zod.d.mts +1717 -17
- package/dist/chunks/libs/zod.mjs +4 -4
- package/dist/chunks/node.mjs +68 -57
- package/dist/chunks/rolldown-runtime.mjs +1 -1
- package/dist/chunks/sequence-view.mjs +1 -1
- package/dist/chunks/vite-plugin.mjs +168 -54
- package/dist/cli/index.d.mts +1 -1
- package/dist/cli/index.mjs +291 -165
- package/dist/config/index.d.mts +7 -1
- package/dist/config/index.mjs +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -1
- package/dist/model/index.d.mts +4 -4
- package/dist/vite-plugin/index.d.mts +2 -2
- package/dist/vite-plugin/internal/index.d.mts +72 -35
- package/dist/vite-plugin/internal/index.mjs +125 -44
- package/package.json +47 -47
- package/react/index.d.mts +22767 -1432
- package/react/index.mjs +38152 -32309
- package/vite-plugin-modules.d.ts +21 -1
- package/dist/chunks/dist.mjs +0 -10
- package/dist/chunks/logger.mjs +0 -1
package/dist/config/index.d.mts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
import { i as __name } from "../chunks/rolldown-runtime.mjs";
|
|
1
2
|
import { _ as isLikeC4JsonConfig, a as LikeC4ProjectConfig, c as LikeC4ProjectJsonConfig, d as defineConfig, f as defineGenerators, g as isLikeC4Config, h as defineThemeColor, l as LikeC4StylesConfig, m as defineTheme, n as GeneratorFnContext, o as LikeC4ProjectConfigInput, p as defineStyle, r as GeneratorFnParams, s as LikeC4ProjectConfigOps, t as GeneratorFn, u as LikeC4StylesConfigInput, v as isLikeC4NonJsonConfig } from "../chunks/index.mjs";
|
|
2
|
-
export
|
|
3
|
+
//#region ../config/dist/chunks/webapp-export-formats.d.mts
|
|
4
|
+
//#region src/webapp-export-formats.d.ts
|
|
5
|
+
declare const WebappExportFormats: readonly ["png", "jpg", "dot", "d2", "mmd", "puml", "drawio"];
|
|
6
|
+
type WebappExportFormat = typeof WebappExportFormats[number];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { type GeneratorFn, type GeneratorFnContext, type GeneratorFnParams, type LikeC4ProjectConfig, type LikeC4ProjectConfigInput, LikeC4ProjectConfigOps, type LikeC4ProjectJsonConfig, type LikeC4StylesConfig, type LikeC4StylesConfigInput, type WebappExportFormat, defineConfig, defineGenerators, defineStyle, defineTheme, defineThemeColor, isLikeC4Config, isLikeC4JsonConfig, isLikeC4NonJsonConfig };
|
package/dist/config/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/rolldown-runtime.mjs";import{a as e,d as t,
|
|
1
|
+
import"../chunks/rolldown-runtime.mjs";import{a as e,d as t,f as n,i as r,n as i,o as a,r as o,t as s,u as c}from"../chunks/filenames.mjs";function defineConfig(e){return a.parse(e)}function defineGenerators(e){return r.parse(e)}function defineThemeColor(e){return n.parse(e)}function defineTheme(e){return c.parse(e)}function defineStyle(e){return t.parse(e)}export{e as LikeC4ProjectConfigOps,defineConfig,defineGenerators,defineStyle,defineTheme,defineThemeColor,s as isLikeC4Config,i as isLikeC4JsonConfig,o as isLikeC4NonJsonConfig};
|
package/dist/index.d.mts
CHANGED
|
@@ -38,8 +38,8 @@ type LikeC4Options = {
|
|
|
38
38
|
*/
|
|
39
39
|
logLevel?: 'trace' | 'debug' | 'info' | 'warning' | 'error' | undefined;
|
|
40
40
|
};
|
|
41
|
-
interface LikeC4 extends LikeC4$1 {}
|
|
42
|
-
declare namespace LikeC4 {
|
|
41
|
+
export interface LikeC4 extends LikeC4$1 {}
|
|
42
|
+
export declare namespace LikeC4 {
|
|
43
43
|
function fromSource(likec4SourceCode: string, _opts?: LikeC4Options): Promise<LikeC4>;
|
|
44
44
|
/**
|
|
45
45
|
* Initializes a LikeC4 instance from the specified workspace path.
|
|
@@ -48,4 +48,4 @@ declare namespace LikeC4 {
|
|
|
48
48
|
function fromWorkspace(path?: string, _opts?: LikeC4Options): Promise<LikeC4>;
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
|
-
export {
|
|
51
|
+
export { type LikeC4Options, type WriteDSLOptions, writeDSL };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./chunks/rolldown-runtime.mjs";import{n as
|
|
1
|
+
import{i as e}from"./chunks/rolldown-runtime.mjs";import{i as t,r as n,t as r}from"./chunks/node.mjs";import{n as i}from"./chunks/sequence-view.mjs";import{exact as a}from"@likec4/core";let o;(function(t){async function fromSource$1(e,t){let{logger:n,watch:o,...s}=t??{};return r(e,i(a({...s,configureLogger:n}),{configureLogger:`console`}))}e(fromSource$1,`fromSource`),t.fromSource=fromSource$1;async function fromWorkspace$1(e=``,t){let{logger:r,watch:o,...s}=t??{};return n(e,i(a({...s,configureLogger:r}),{configureLogger:`console`}))}e(fromWorkspace$1,`fromWorkspace`),t.fromWorkspace=fromWorkspace$1})(o||={});export{o as LikeC4,t as writeDSL};
|
package/dist/model/index.d.mts
CHANGED
|
@@ -48,13 +48,13 @@ interface SequenceViewLayout {
|
|
|
48
48
|
}
|
|
49
49
|
//#endregion
|
|
50
50
|
//#region src/sequence/sequence-view.d.ts
|
|
51
|
-
declare function calcSequenceLayout(view: LayoutedDynamicView): LayoutedDynamicView.Sequence.Layout;
|
|
51
|
+
export declare function calcSequenceLayout(view: LayoutedDynamicView): LayoutedDynamicView.Sequence.Layout;
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/model/index.d.ts
|
|
54
|
-
type UnknownLayouted = types.UnknownLayouted;
|
|
54
|
+
export type UnknownLayouted = types.UnknownLayouted;
|
|
55
55
|
/**
|
|
56
56
|
* Used by vite plugin to generate `virtual:likec4/model`
|
|
57
57
|
*/
|
|
58
|
-
declare function createLikeC4Model(model: any): LikeC4Model$1<UnknownLayouted>;
|
|
58
|
+
export declare function createLikeC4Model(model: any): LikeC4Model$1<UnknownLayouted>;
|
|
59
59
|
//#endregion
|
|
60
|
-
export { type ComputedProjectEdge, type ComputedProjectNode, type ComputedProjectsView, Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, type DeploymentElementModel, DeploymentNodeModel, type DeploymentRelationEndpoint, DeploymentRelationModel, EdgeModel, ElementModel, type LayoutedProjectEdge, type LayoutedProjectNode, type LayoutedProjectsView, LikeC4DeploymentModel, LikeC4Model, LikeC4ViewModel, NodeModel, RelationshipModel, type SequenceViewLayout,
|
|
60
|
+
export { type ComputedProjectEdge, type ComputedProjectNode, type ComputedProjectsView, Connection, ConnectionModel, DeployedInstanceModel, DeploymentConnectionModel, type DeploymentElementModel, DeploymentNodeModel, type DeploymentRelationEndpoint, DeploymentRelationModel, EdgeModel, ElementModel, type LayoutedProjectEdge, type LayoutedProjectNode, type LayoutedProjectsView, LikeC4DeploymentModel, LikeC4Model, LikeC4ViewModel, NodeModel, RelationshipModel, type SequenceViewLayout, deploymentConnection, differenceConnections, findAscendingConnections, findDeepestNestedConnection, findDescendantConnections, hasSameSource, hasSameSourceTarget, hasSameTarget, isAnyInOut, isDeployedInstanceModel, isDeploymentElementModel, isDeploymentNodeModel, isDeploymentRelationModel, isEdgeModel, isElementModel, isIncoming, isLikeC4ViewModel, isNestedConnection, isNestedElementOfDeployedInstanceModel, isNodeModel, isOutgoing, isRelationModel, mergeConnections, modelConnection, sortConnectionsByBoundaryHierarchy, sortDeepestFirst, type types };
|
|
@@ -138,6 +138,6 @@ type LikeC4VitePluginOptions = SharedOptions & ({
|
|
|
138
138
|
watch?: never;
|
|
139
139
|
logLevel?: never;
|
|
140
140
|
});
|
|
141
|
-
declare function LikeC4VitePlugin({ environments, appConfig, ai: _ai, ...pluginOpts }: LikeC4VitePluginOptions): PluginOption;
|
|
141
|
+
export declare function LikeC4VitePlugin({ environments, appConfig, ai: _ai, ...pluginOpts }: LikeC4VitePluginOptions): PluginOption;
|
|
142
142
|
//#endregion
|
|
143
|
-
export {
|
|
143
|
+
export type { LikeC4VitePluginOptions };
|
|
@@ -3,7 +3,7 @@ import { DependencyList } from "react";
|
|
|
3
3
|
import { LayoutedElementView, LayoutedLikeC4ModelData, LayoutedView, ProjectId, ViewChange, ViewId } from "@likec4/core/types";
|
|
4
4
|
import { AdhocViewPredicate } from "@likec4/core/compute-view";
|
|
5
5
|
//#region ../vite-plugin/dist/internal/index.d.mts
|
|
6
|
-
//#region ../../node_modules/.pnpm/nanostores@1.3
|
|
6
|
+
//#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/atom/index.d.ts
|
|
7
7
|
type AllKeys<T> = T extends any ? keyof T : never;
|
|
8
8
|
type Primitive = boolean | number | string;
|
|
9
9
|
type ReadonlyIfObject<Value> = Value extends undefined ? Value : Value extends ((...args: any) => any) ? Value : Value extends Primitive ? Value : Value extends object ? Readonly<Value> : Value;
|
|
@@ -11,6 +11,23 @@ type ReadonlyIfObject<Value> = Value extends undefined ? Value : Value extends (
|
|
|
11
11
|
* Store object.
|
|
12
12
|
*/
|
|
13
13
|
interface ReadableAtom<Value = any> {
|
|
14
|
+
/**
|
|
15
|
+
* Compares the previous and next values on every `set`.
|
|
16
|
+
*
|
|
17
|
+
* Returning `true` means the values are the same, so the store keeps the old
|
|
18
|
+
* value and no listener is called.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Called only by the store's own writes, so a store that never writes never
|
|
22
|
+
* calls it. `Map#setKey` uses {@link MapStore#eqKey} instead.
|
|
23
|
+
*
|
|
24
|
+
* Before the first write, `oldValue` can be `undefined`, for instance on the
|
|
25
|
+
* first run of a computed store.
|
|
26
|
+
*
|
|
27
|
+
* @default Object.is
|
|
28
|
+
* @returns `true` if the values are equal, `false` otherwise.
|
|
29
|
+
*/
|
|
30
|
+
eq(oldValue: ReadonlyIfObject<Value> | undefined, newValue: ReadonlyIfObject<Value>): boolean;
|
|
14
31
|
/**
|
|
15
32
|
* Get store value.
|
|
16
33
|
*
|
|
@@ -41,7 +58,7 @@ interface ReadableAtom<Value = any> {
|
|
|
41
58
|
* @param listener Callback with store value and old value.
|
|
42
59
|
* @returns Function to remove listener.
|
|
43
60
|
*/
|
|
44
|
-
listen(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value>) => void): () => void;
|
|
61
|
+
listen(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value> | undefined) => void): () => void;
|
|
45
62
|
/**
|
|
46
63
|
* Low-level method to notify listeners about changes in the store.
|
|
47
64
|
*
|
|
@@ -124,23 +141,38 @@ type Atom<Value = any> = ReadableAtom<Value> | WritableAtom<Value>;
|
|
|
124
141
|
* @param initialValue Initial value of the store.
|
|
125
142
|
* @returns The store object with methods to subscribe.
|
|
126
143
|
*/
|
|
127
|
-
declare function atom<Value, StoreExt = object>(...args: undefined extends Value ? [] | [Value] : [Value]): PreinitializedWritableAtom<Value> & StoreExt;
|
|
144
|
+
export declare function atom<Value, StoreExt = object>(...args: undefined extends Value ? [] | [Value] : [Value]): PreinitializedWritableAtom<Value> & StoreExt;
|
|
128
145
|
//#endregion
|
|
129
|
-
//#region ../../node_modules/.pnpm/nanostores@1.3
|
|
146
|
+
//#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/map/index.d.ts
|
|
130
147
|
type KeyofBase = keyof any;
|
|
131
|
-
type Get<T, K extends KeyofBase> =
|
|
148
|
+
type Get<T, K extends KeyofBase> = T extends any ? K extends keyof T ? T[K] : never : never;
|
|
132
149
|
type HasIndexSignature<T> = string extends keyof T ? true : false;
|
|
133
|
-
type ValueWithUndefinedForIndexSignatures<Value, Key extends
|
|
150
|
+
type ValueWithUndefinedForIndexSignatures<Value, Key extends KeyofBase> = Value extends any ? HasIndexSignature<Value> extends true ? undefined | Get<Value, Key> : Get<Value, Key> : never;
|
|
134
151
|
type WritableStore<Value = any> = (Value extends object ? MapStore<Value> : never) | WritableAtom<Value>;
|
|
135
152
|
type Store<Value = any> = ReadableAtom<Value> | WritableStore<Value>;
|
|
136
|
-
type
|
|
153
|
+
type Gettable<Value = any> = {
|
|
137
154
|
get(): Value;
|
|
138
|
-
readonly value: undefined | Value;
|
|
139
155
|
};
|
|
140
|
-
type StoreValue<SomeStore> = SomeStore extends
|
|
141
|
-
get(): infer Value;
|
|
142
|
-
} ? Value : any;
|
|
156
|
+
type StoreValue<SomeStore> = SomeStore extends Gettable<infer Value> ? Value : any;
|
|
143
157
|
interface MapStore<Value extends object = any> extends WritableAtom<Value> {
|
|
158
|
+
/**
|
|
159
|
+
* Compares the previous and next values for a key on `setKey`.
|
|
160
|
+
*
|
|
161
|
+
* Returning `true` means the values are the same, so the store keeps the old
|
|
162
|
+
* value and no listener is called.
|
|
163
|
+
*
|
|
164
|
+
* One function serves every key of the map, so the key name comes as the
|
|
165
|
+
* third argument. The old value is `undefined` when the key is not in the map
|
|
166
|
+
* yet.
|
|
167
|
+
*
|
|
168
|
+
* @remarks
|
|
169
|
+
* Deleting an existing key skips the comparison and notifies either way.
|
|
170
|
+
* Whole-value writes use {@link ReadableAtom#eq} instead.
|
|
171
|
+
*
|
|
172
|
+
* @default Object.is
|
|
173
|
+
* @returns `true` if the values are equal, `false` otherwise.
|
|
174
|
+
*/
|
|
175
|
+
eqKey<Key extends AllKeys<Value>>(oldValue: Get<Value, Key> | undefined, newValue: Get<Value, Key> | undefined, key: Key): boolean;
|
|
144
176
|
/**
|
|
145
177
|
* Subscribe to store changes.
|
|
146
178
|
*
|
|
@@ -148,11 +180,10 @@ interface MapStore<Value extends object = any> extends WritableAtom<Value> {
|
|
|
148
180
|
* immediately.
|
|
149
181
|
*
|
|
150
182
|
* @param listener Callback with store value and old value.
|
|
151
|
-
* @param changedKey Key that
|
|
152
|
-
* has been used to change a store.
|
|
183
|
+
* @param changedKey Key that changed, when the notification carries one.
|
|
153
184
|
* @returns Function to remove listener.
|
|
154
185
|
*/
|
|
155
|
-
listen(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value
|
|
186
|
+
listen(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value> | undefined, changedKey: AllKeys<Value> | undefined) => void): () => void;
|
|
156
187
|
/**
|
|
157
188
|
* Low-level method to notify listeners about changes in the store.
|
|
158
189
|
*
|
|
@@ -189,7 +220,7 @@ interface MapStore<Value extends object = any> extends WritableAtom<Value> {
|
|
|
189
220
|
* @param key The key name.
|
|
190
221
|
* @param value New value.
|
|
191
222
|
*/
|
|
192
|
-
setKey<Key extends AllKeys<Value>>(key: Key, value:
|
|
223
|
+
setKey<Key extends AllKeys<Value>>(key: Key, value: ValueWithUndefinedForIndexSignatures<Value, Key>): void;
|
|
193
224
|
/**
|
|
194
225
|
* Subscribe to store changes and call listener immediately.
|
|
195
226
|
*
|
|
@@ -202,8 +233,7 @@ interface MapStore<Value extends object = any> extends WritableAtom<Value> {
|
|
|
202
233
|
* ```
|
|
203
234
|
*
|
|
204
235
|
* @param listener Callback with store value and old value.
|
|
205
|
-
* @param changedKey Key that
|
|
206
|
-
* if `setKey` has been used to change a store.
|
|
236
|
+
* @param changedKey Key that changed, when the notification carries one.
|
|
207
237
|
* @returns Function to remove listener.
|
|
208
238
|
*/
|
|
209
239
|
subscribe(listener: (value: ReadonlyIfObject<Value>, oldValue: ReadonlyIfObject<Value> | undefined, changedKey: AllKeys<Value> | undefined) => void): () => void;
|
|
@@ -212,21 +242,28 @@ interface PreinitializedMapStore<Value extends object = any> extends MapStore<Va
|
|
|
212
242
|
readonly value: Value;
|
|
213
243
|
}
|
|
214
244
|
/**
|
|
215
|
-
* Create map store. Map store is a store with
|
|
216
|
-
* as a store value.
|
|
245
|
+
* Create map store with an initial value. Map store is a store with
|
|
246
|
+
* key-value object as a store value.
|
|
247
|
+
*
|
|
248
|
+
* @param value Initial store value.
|
|
249
|
+
* @returns The store object with methods to subscribe.
|
|
250
|
+
*/
|
|
251
|
+
export declare function map<Value extends object, StoreExt extends object = object>(value: Value): PreinitializedMapStore<Value> & StoreExt;
|
|
252
|
+
/**
|
|
253
|
+
* Create map store with no initial value, or one that may be missing.
|
|
217
254
|
*
|
|
218
|
-
* @param
|
|
255
|
+
* @param value Initial store value, if there is one.
|
|
219
256
|
* @returns The store object with methods to subscribe.
|
|
220
257
|
*/
|
|
221
|
-
declare function map<Value extends object, StoreExt extends object = object>(value?: Value): PreinitializedMapStore<Value
|
|
258
|
+
export declare function map<Value extends object, StoreExt extends object = object>(value?: Value): PreinitializedMapStore<Partial<Value>> & StoreExt;
|
|
222
259
|
//#endregion
|
|
223
|
-
//#region ../../node_modules/.pnpm/nanostores@1.3
|
|
260
|
+
//#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/task/index.d.ts
|
|
224
261
|
interface Task<Value> extends Promise<Value> {
|
|
225
262
|
t: true;
|
|
226
263
|
}
|
|
227
264
|
//#endregion
|
|
228
|
-
//#region ../../node_modules/.pnpm/nanostores@1.3
|
|
229
|
-
type StoreValues<Stores extends
|
|
265
|
+
//#region ../../node_modules/.pnpm/nanostores@1.5.3/node_modules/nanostores/computed/index.d.ts
|
|
266
|
+
type StoreValues<Stores extends readonly Gettable[]> = { -readonly [Index in keyof Stores]: StoreValue<Stores[Index]>; };
|
|
230
267
|
interface Computed {
|
|
231
268
|
/**
|
|
232
269
|
* @deprecated Use `@nanostores/async`.
|
|
@@ -235,7 +272,7 @@ interface Computed {
|
|
|
235
272
|
/**
|
|
236
273
|
* @deprecated Use `@nanostores/async`.
|
|
237
274
|
*/
|
|
238
|
-
<Value, OriginStores extends
|
|
275
|
+
<Value, OriginStores extends readonly Store[]>(stores: readonly [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value>): ReadableAtom<undefined | Value>;
|
|
239
276
|
<Value, OriginStore extends Store>(stores: OriginStore, cb: (value: StoreValue<OriginStore>) => Value): ReadableAtom<Value>;
|
|
240
277
|
/**
|
|
241
278
|
* Create derived store, which use generates value from another stores.
|
|
@@ -252,9 +289,9 @@ interface Computed {
|
|
|
252
289
|
*
|
|
253
290
|
* Use `@nanostores/async` for async function.
|
|
254
291
|
*/
|
|
255
|
-
<Value, OriginStores extends
|
|
292
|
+
<Value, OriginStores extends readonly Store[]>(stores: readonly [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
|
|
256
293
|
}
|
|
257
|
-
declare const computed: Computed;
|
|
294
|
+
export declare const computed: Computed;
|
|
258
295
|
interface Batched {
|
|
259
296
|
<Value, OriginStore extends Store>(stores: OriginStore, cb: (value: StoreValue<OriginStore>) => Task<Value> | Value): ReadableAtom<Value>;
|
|
260
297
|
/**
|
|
@@ -271,9 +308,9 @@ interface Batched {
|
|
|
271
308
|
* })
|
|
272
309
|
* ```
|
|
273
310
|
*/
|
|
274
|
-
<Value, OriginStores extends
|
|
311
|
+
<Value, OriginStores extends readonly Store[]>(stores: readonly [...OriginStores], cb: (...values: StoreValues<OriginStores>) => Task<Value> | Value): ReadableAtom<Value>;
|
|
275
312
|
}
|
|
276
|
-
declare const batched: Batched;
|
|
313
|
+
export declare const batched: Batched;
|
|
277
314
|
//#endregion
|
|
278
315
|
//#region src/rpc/protocol.d.ts
|
|
279
316
|
interface LikeC4VitePluginRpc {
|
|
@@ -306,7 +343,7 @@ interface LikeC4VitePluginRpc {
|
|
|
306
343
|
}): Promise<LayoutedElementView>;
|
|
307
344
|
}
|
|
308
345
|
//#endregion
|
|
309
|
-
//#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.
|
|
346
|
+
//#region ../../node_modules/.pnpm/@nanostores+react@1.1.0_nanostores@1.5.3_react@19.2.8/node_modules/@nanostores/react/index.d.ts
|
|
310
347
|
type StoreKeys<T> = T extends {
|
|
311
348
|
setKey: (k: infer K, v: any) => unknown;
|
|
312
349
|
} ? K : never;
|
|
@@ -352,10 +389,10 @@ interface UseStoreOptions<SomeStore> {
|
|
|
352
389
|
* @param store Store instance.
|
|
353
390
|
* @returns Store value.
|
|
354
391
|
*/
|
|
355
|
-
declare function useStore<SomeStore extends Store>(store: SomeStore, options?: UseStoreOptions<SomeStore>): StoreValue<SomeStore>;
|
|
392
|
+
export declare function useStore<SomeStore extends Store>(store: SomeStore, options?: UseStoreOptions<SomeStore>): StoreValue<SomeStore>;
|
|
356
393
|
//#endregion
|
|
357
394
|
//#region src/internal.d.ts
|
|
358
|
-
interface LikeC4VitePluginRpcOptions {
|
|
395
|
+
export interface LikeC4VitePluginRpcOptions {
|
|
359
396
|
/**
|
|
360
397
|
* Function to post raw message
|
|
361
398
|
*/
|
|
@@ -369,8 +406,8 @@ interface LikeC4VitePluginRpcOptions {
|
|
|
369
406
|
* Create a PluginRPC instance for the LikeC4 Vite plugin
|
|
370
407
|
* used by the Vite plugin in virtual modules
|
|
371
408
|
*/
|
|
372
|
-
declare function createRpc(options: LikeC4VitePluginRpcOptions): LikeC4VitePluginRpc;
|
|
373
|
-
declare function createHooksForModel($atom: WritableAtom<LayoutedLikeC4ModelData>): {
|
|
409
|
+
export declare function createRpc(options: LikeC4VitePluginRpcOptions): LikeC4VitePluginRpc;
|
|
410
|
+
export declare function createHooksForModel($atom: WritableAtom<LayoutedLikeC4ModelData>): {
|
|
374
411
|
updateModel: (data: LayoutedLikeC4ModelData) => void;
|
|
375
412
|
$likec4model: Atom<LikeC4Model.Layouted>;
|
|
376
413
|
useLikeC4Model: () => LikeC4Model.Layouted;
|
|
@@ -378,4 +415,4 @@ declare function createHooksForModel($atom: WritableAtom<LayoutedLikeC4ModelData
|
|
|
378
415
|
useLikeC4View: (viewId: string) => LayoutedView | null;
|
|
379
416
|
};
|
|
380
417
|
//#endregion
|
|
381
|
-
export {
|
|
418
|
+
export type { Atom, LikeC4VitePluginRpc, ReadableAtom, WritableAtom };
|