glass-easel-miniprogram-adapter 0.15.0 → 0.15.2

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/src/behavior.ts CHANGED
@@ -1,6 +1,11 @@
1
1
  import type * as glassEasel from 'glass-easel'
2
2
  import { type GeneralComponentDefinition, type utils as typeUtils } from './types'
3
- import { determineComponentExports, type GeneralComponent } from './component'
3
+ import {
4
+ type AllData,
5
+ determineComponentExports,
6
+ type GeneralComponent,
7
+ type PropertyValues,
8
+ } from './component'
4
9
 
5
10
  type DataList = typeUtils.DataList
6
11
  type PropertyList = typeUtils.PropertyList
@@ -60,6 +65,16 @@ export class Behavior<
60
65
  }
61
66
  }
62
67
 
68
+ export type ComponentFieldTypes<
69
+ TData extends DataList,
70
+ TProperty extends PropertyList,
71
+ TMethod extends MethodList,
72
+ > = {
73
+ propertyValues: PropertyValues<TProperty>
74
+ dataWithProperties: AllData<TData, TProperty>
75
+ methods: TMethod
76
+ }
77
+
63
78
  export class ComponentType<
64
79
  TData extends DataList,
65
80
  TProperty extends PropertyList,
@@ -72,6 +87,10 @@ export class ComponentType<
72
87
  /** @internal */
73
88
  _$: glassEasel.ComponentDefinition<TData, TProperty, TMethod>
74
89
 
90
+ // this field is designed for type identification in some external modules, such as glass-easel-analyzer
91
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
92
+ protected readonly _$fieldTypes: ComponentFieldTypes<TData, TProperty, TMethod> = undefined as any
93
+
75
94
  /** @internal */
76
95
  constructor(inner: glassEasel.ComponentDefinition<TData, TProperty, TMethod>) {
77
96
  this._$ = inner