likec4 1.31.0 → 1.32.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.
@@ -19,31 +19,32 @@ declare module 'likec4:icons' {
19
19
  }
20
20
 
21
21
  declare module 'likec4:model' {
22
- import type { DiagramView, LayoutedLikeC4ModelData, LikeC4Model } from 'likec4/model'
22
+ import type { DiagramView, LayoutedLikeC4ModelData, LikeC4Model, UnknownLayouted } from 'likec4/model'
23
23
  import type { nano } from 'likec4/react'
24
24
 
25
- export type Atom<T> = nano.Atom<T>
25
+ export type Atom<T> = nano.ReadableAtom<T>
26
26
 
27
- export type { DiagramView, LayoutedLikeC4ModelData, LikeC4Model }
27
+ export type { DiagramView, LayoutedLikeC4ModelData, LikeC4Model, UnknownLayouted }
28
28
 
29
29
  export function loadModel(projectId: string): Promise<{
30
- $likec4data: Atom<LayoutedLikeC4ModelData>
31
- $likec4model: Atom<LikeC4Model.Layouted>
32
- useLikeC4Model: () => LikeC4Model.Layouted
33
- useLikeC4Views: () => ReadonlyArray<DiagramView>
34
- useLikeC4View: (viewId: string) => DiagramView | null
30
+ $likec4data: Atom<LayoutedLikeC4ModelData<UnknownLayouted>>
31
+ $likec4model: Atom<LikeC4Model<UnknownLayouted>>
32
+ useLikeC4Model: () => LikeC4Model<UnknownLayouted>
33
+ useLikeC4Views: () => ReadonlyArray<DiagramView<UnknownLayouted>>
34
+ useLikeC4View: (viewId: string) => DiagramView<UnknownLayouted> | null
35
35
  }>
36
36
  }
37
37
 
38
38
  declare module 'likec4:single-project' {
39
+ import type { DiagramView, LayoutedLikeC4ModelData, LikeC4Model, UnknownLayouted } from 'likec4/model'
39
40
  import type { ElementIconRenderer } from 'likec4:icons'
40
- import type { Atom, DiagramView, LayoutedLikeC4ModelData, LikeC4Model } from 'likec4:model'
41
+ import type { Atom } from 'likec4:model'
41
42
 
42
- export const $likec4data: Atom<LayoutedLikeC4ModelData>
43
- export const $likec4model: Atom<LikeC4Model.Layouted>
44
- export function useLikeC4Model(): LikeC4Model.Layouted
45
- export function useLikeC4Views(): ReadonlyArray<DiagramView>
46
- export function useLikeC4View(viewId: string): DiagramView | null
43
+ export const $likec4data: Atom<LayoutedLikeC4ModelData<UnknownLayouted>>
44
+ export const $likec4model: Atom<LikeC4Model<UnknownLayouted>>
45
+ export function useLikeC4Model(): LikeC4Model<UnknownLayouted>
46
+ export function useLikeC4Views(): ReadonlyArray<DiagramView<UnknownLayouted>>
47
+ export function useLikeC4View(viewId: string): DiagramView<UnknownLayouted> | null
47
48
 
48
49
  export const IconRenderer: ElementIconRenderer
49
50
 
@@ -51,23 +52,23 @@ declare module 'likec4:single-project' {
51
52
  }
52
53
 
53
54
  declare module 'likec4:react' {
54
- import type { Aux, DiagramView, LikeC4Model } from 'likec4/model'
55
+ import type { aux, DiagramView, LikeC4Model, UnknownLayouted } from 'likec4/model'
55
56
  import type { LikeC4ViewProps, ReactLikeC4Props } from 'likec4/react'
56
57
  import type { JSX, PropsWithChildren } from 'react'
57
58
 
58
59
  // This will be used later for augmenting the types
59
- interface Types extends Aux<string, string, string, DiagramView> {
60
+ interface Types extends UnknownLayouted {
60
61
  }
61
62
 
62
- export type LikeC4ViewId = Types['View']
63
+ export type LikeC4ViewId = aux.ViewId<Types>
63
64
 
64
65
  export function useLikeC4Model(): LikeC4Model<Types>
65
- export function useLikeC4Views(): ReadonlyArray<DiagramView<LikeC4ViewId>>
66
- export function useLikeC4View(viewId: LikeC4ViewId): DiagramView | null
66
+ export function useLikeC4Views(): ReadonlyArray<DiagramView<Types>>
67
+ export function useLikeC4View(viewId: LikeC4ViewId): DiagramView<Types> | null
67
68
 
68
69
  export function LikeC4ModelProvider(props: PropsWithChildren): JSX.Element
69
- export function LikeC4View({ viewId, ...props }: LikeC4ViewProps<LikeC4ViewId>): JSX.Element
70
- export function ReactLikeC4({ viewId, ...props }: ReactLikeC4Props<LikeC4ViewId>): JSX.Element
70
+ export function LikeC4View({ viewId, ...props }: LikeC4ViewProps<Types>): JSX.Element
71
+ export function ReactLikeC4({ viewId, ...props }: ReactLikeC4Props<Types>): JSX.Element
71
72
  }
72
73
 
73
74
  declare module 'likec4:dot' {
@@ -86,17 +87,29 @@ declare module 'likec4:mmd' {
86
87
  mmdSource(viewId: string): string
87
88
  }>
88
89
  }
90
+ declare module 'likec4:puml' {
91
+ export function loadPumlSources(projectId: string): Promise<{
92
+ pumlSource(viewId: string): string
93
+ }>
94
+ }
89
95
 
90
96
  // Per project
91
97
 
92
98
  declare module 'likec4:model/*' {
93
- import type { Atom, DiagramView, LayoutedLikeC4ModelData, LikeC4Model } from 'likec4:model'
99
+ import type { aux, DiagramView, LayoutedLikeC4ModelData, LikeC4Model, UnknownLayouted } from 'likec4/model'
100
+ import type { Atom } from 'likec4:model'
94
101
 
95
- export const $likec4data: Atom<LayoutedLikeC4ModelData>
96
- export const $likec4model: Atom<LikeC4Model.Layouted>
97
- export function useLikeC4Model(): LikeC4Model.Layouted
98
- export function useLikeC4Views(): ReadonlyArray<DiagramView>
99
- export function useLikeC4View(viewId: string): DiagramView | null
102
+ // This will be used later for augmenting the types
103
+ interface Types extends UnknownLayouted {
104
+ }
105
+
106
+ export type LikeC4ViewId = aux.ViewId<Types>
107
+
108
+ export const $likec4data: Atom<LayoutedLikeC4ModelData<Types>>
109
+ export const $likec4model: Atom<LikeC4Model<Types>>
110
+ export function useLikeC4Model(): LikeC4Model<Types>
111
+ export function useLikeC4Views(): ReadonlyArray<DiagramView<Types>>
112
+ export function useLikeC4View(viewId: LikeC4ViewId): DiagramView<Types> | null
100
113
  }
101
114
 
102
115
  declare module 'likec4:icons/*' {
@@ -112,21 +125,21 @@ declare module 'likec4:icons/*' {
112
125
  }
113
126
 
114
127
  declare module 'likec4:react/*' {
115
- import type { Aux, DiagramView, LikeC4Model } from 'likec4/model'
128
+ import type { aux, DiagramView, LikeC4Model, UnknownLayouted } from 'likec4/model'
116
129
  import type { LikeC4ViewProps, ReactLikeC4Props } from 'likec4/react'
117
130
  import type { JSX, PropsWithChildren } from 'react'
118
131
 
119
132
  // This will be used later for augmenting the types
120
- interface Types extends Aux<string, string, string, DiagramView> {
133
+ interface Types extends UnknownLayouted {
121
134
  }
122
135
 
123
- export type LikeC4ViewId = Types['View']
136
+ export type LikeC4ViewId = aux.ViewId<Types>
124
137
 
125
138
  export function useLikeC4Model(): LikeC4Model<Types>
126
- export function useLikeC4Views(): ReadonlyArray<DiagramView<LikeC4ViewId>>
127
- export function useLikeC4View(viewId: LikeC4ViewId): DiagramView | null
139
+ export function useLikeC4Views(): ReadonlyArray<DiagramView<Types>>
140
+ export function useLikeC4View(viewId: LikeC4ViewId): DiagramView<Types> | null
128
141
 
129
142
  export function LikeC4ModelProvider(props: PropsWithChildren): JSX.Element
130
- export function LikeC4View({ viewId, ...props }: LikeC4ViewProps<LikeC4ViewId>): JSX.Element
131
- export function ReactLikeC4({ viewId, ...props }: ReactLikeC4Props<LikeC4ViewId>): JSX.Element
143
+ export function LikeC4View({ viewId, ...props }: LikeC4ViewProps<Types>): JSX.Element
144
+ export function ReactLikeC4({ viewId, ...props }: ReactLikeC4Props<Types>): JSX.Element
132
145
  }