@hy-bricks/core 0.1.1 → 0.3.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/index.d.ts CHANGED
@@ -7,6 +7,10 @@ import { Plugin as Plugin_2 } from 'vue';
7
7
  import { PublicProps } from 'vue';
8
8
  import { Ref } from 'vue';
9
9
 
10
+ export declare function __resetLifecycleEmitter(): void;
11
+
12
+ export declare function __resetRegistry(): void;
13
+
10
14
  declare const __VLS_component: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
11
15
 
12
16
  declare type __VLS_Props = {
@@ -98,6 +102,8 @@ export declare interface ComponentInstanceHandle {
98
102
  __dispose(): void;
99
103
  }
100
104
 
105
+ export declare type ComponentKindRaw = 'visual' | 'layout' | 'data';
106
+
101
107
  export declare interface ComponentMeta {
102
108
  name?: {
103
109
  value?: string;
@@ -107,6 +113,7 @@ export declare interface ComponentMeta {
107
113
  style: Record<string, string>;
108
114
  customDecl: Record<string, CustomDecl>;
109
115
  methodNames: string[];
116
+ slotsDecl: SlotDeclMeta[];
110
117
  }
111
118
 
112
119
  export declare interface ComponentSource {
@@ -126,6 +133,12 @@ export declare interface CustomDecl {
126
133
  description?: string;
127
134
  }
128
135
 
136
+ export declare interface DataDirectionDecl {
137
+ key: string;
138
+ type?: string;
139
+ label?: string;
140
+ }
141
+
129
142
  export declare function debugScopedCssRefs(): Array<{
130
143
  scopeId: string;
131
144
  componentId: string;
@@ -171,6 +184,16 @@ export declare interface HyperCardInstance {
171
184
 
172
185
  export declare function injectScopedCss(scopeId: string, rawCss: string | undefined | null): void;
173
186
 
187
+ declare type InstanceLifecycleEventMap = {
188
+ 'instance:ready': InstanceLifecyclePayload;
189
+ 'instance:unmounted': InstanceLifecyclePayload;
190
+ };
191
+
192
+ export declare interface InstanceLifecyclePayload {
193
+ canvasId: string;
194
+ instanceId: string;
195
+ }
196
+
174
197
  export declare function isVuePlugin(v: unknown): boolean;
175
198
 
176
199
  declare type LibConfigValue<T> = T | readonly [T, ...unknown[]];
@@ -194,12 +217,29 @@ export declare interface MethodDecl {
194
217
  params: string[];
195
218
  }
196
219
 
197
- export declare function parseComponentSource(jsSource: unknown): ParsedSource;
220
+ export declare interface ModelDecl {
221
+ key: string;
222
+ prop?: string;
223
+ event?: string;
224
+ type?: string;
225
+ defaultValue?: unknown;
226
+ }
227
+
228
+ export declare function onInstanceLifecycle<E extends keyof InstanceLifecycleEventMap>(event: E, cb: (payload: InstanceLifecycleEventMap[E]) => void): () => void;
229
+
230
+ export declare function parseComponentSource(jsSource: unknown, htmlSource?: unknown): ParsedSource;
198
231
 
199
232
  export declare interface ParsedSource {
233
+ ok: boolean;
234
+ parseError?: string;
200
235
  methodsDecl: MethodDecl[];
201
236
  emitsDecl: EmitDecl[];
202
237
  propsDecl: PropDecl[];
238
+ slotsDecl: SlotDeclRaw[];
239
+ modelDecl: ModelDecl[];
240
+ dataInputsDecl: DataDirectionDecl[];
241
+ dataOutputsDecl: DataDirectionDecl[];
242
+ kind: ComponentKindRaw;
203
243
  }
204
244
 
205
245
  export declare interface PropDecl {
@@ -237,6 +277,22 @@ customValues: Record<string, unknown>;
237
277
 
238
278
  export declare function scopeCss(rawCss: string, scopeId: string): string;
239
279
 
280
+ export declare interface SlotDeclMeta {
281
+ name: string;
282
+ multiple?: boolean;
283
+ accepts?: string[];
284
+ maxChildren?: number;
285
+ label?: string;
286
+ }
287
+
288
+ export declare interface SlotDeclRaw {
289
+ name: string;
290
+ multiple?: boolean;
291
+ accepts?: string[];
292
+ maxChildren?: number;
293
+ label?: string;
294
+ }
295
+
240
296
  export declare function unregister(instanceId: string, canvasId?: string): void;
241
297
 
242
298
  export declare const VERSION = "0.0.0-stage2b";