airx 0.3.0 → 0.4.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.
@@ -42,7 +42,7 @@ export interface Instance<E extends AbstractElement = AbstractElement> {
42
42
  element?: AirxElement;
43
43
  beforeElement?: AirxElement;
44
44
  signalWatcher?: signal.Watcher;
45
- childrenRender?: AirxComponentRender;
45
+ componentReturnValue?: AirxComponentRender | AirxElement;
46
46
  needReRender?: boolean;
47
47
  elementNamespace?: string;
48
48
  context: InnerAirxComponentContext<E>;
@@ -1,6 +1,6 @@
1
- import * as CSS from 'csstype';
2
- import { Signal } from 'signal-polyfill';
3
- import { AirxChildren } from './element';
1
+ import type * as CSS from 'csstype';
2
+ import type { Signal } from 'signal-polyfill';
3
+ import type { AirxComponentRender, AirxChildren } from './element';
4
4
  export interface Events {
5
5
  onCopy: ClipboardEvent;
6
6
  onCut: ClipboardEvent;
@@ -971,7 +971,7 @@ export interface SVGAttributes extends AriaAttributes, EventHandlers<Events> {
971
971
  z?: Numberish;
972
972
  zoomAndPan?: string;
973
973
  }
974
- interface IntrinsicElementAttributes {
974
+ interface IntrinsicElementAttributesMap {
975
975
  a: AnchorHTMLAttributes;
976
976
  abbr: HTMLAttributes;
977
977
  address: HTMLAttributes;
@@ -1145,27 +1145,29 @@ interface IntrinsicElementAttributes {
1145
1145
  use: SVGAttributes;
1146
1146
  view: SVGAttributes;
1147
1147
  }
1148
- export type HtmlRef<T extends HTMLElement = HTMLElement> = {
1149
- ref?: Signal.State<T | undefined>;
1150
- };
1151
- export type ReservedProps = {
1152
- children?: AirxChildren;
1148
+ export interface RefAttributes {
1149
+ ref?: Signal.State<any | undefined> | ((ele: any) => void);
1150
+ }
1151
+ export interface ReservedAttributes {
1153
1152
  key?: string | number | symbol;
1154
- };
1153
+ children?: AirxChildren;
1154
+ }
1155
1155
  export type NativeElements = {
1156
- [K in keyof IntrinsicElementAttributes]: IntrinsicElementAttributes[K] & ReservedProps & HtmlRef;
1156
+ [K in keyof IntrinsicElementAttributesMap]: IntrinsicElementAttributesMap[K] & ReservedAttributes & RefAttributes;
1157
1157
  };
1158
1158
  declare global {
1159
1159
  namespace JSX {
1160
- interface ElementAttributesProperty {
1160
+ type ElementClass = never;
1161
+ interface Element extends AirxComponentRender {
1161
1162
  }
1162
1163
  interface ElementChildrenAttribute {
1163
- children: AirxChildren;
1164
+ children: {};
1164
1165
  }
1165
1166
  interface IntrinsicElements extends NativeElements {
1166
- [name: string]: any;
1167
1167
  }
1168
- type IntrinsicAttributes = ReservedProps;
1168
+ interface IntrinsicAttributes {
1169
+ key?: string | number | symbol;
1170
+ }
1169
1171
  }
1170
1172
  }
1171
1173
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "airx",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "a front framework with jsx",
5
5
  "main": "./output/umd/index.js",
6
6
  "module": "./output/esm/index.js",