@viewfly/core 0.0.27 → 0.0.28

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.
@@ -12,10 +12,10 @@ export declare class JSXComponent {
12
12
  * Viewfly 组件管理类,用于管理组件的生命周期,上下文等
13
13
  */
14
14
  export declare class Component extends ReflectiveInjector implements JSXTypeof {
15
- type: JSXInternal.ComponentConstructor;
15
+ type: JSXInternal.ComponentSetup;
16
16
  props: Props;
17
17
  key?: Key | undefined;
18
- $$typeOf: JSXInternal.ComponentConstructor<any>;
18
+ $$typeOf: JSXInternal.ComponentSetup<any>;
19
19
  $$view: ComponentView;
20
20
  destroyCallbacks: LifeCycleCallback[];
21
21
  mountCallbacks: LifeCycleCallback[];
@@ -31,7 +31,7 @@ export declare class Component extends ReflectiveInjector implements JSXTypeof {
31
31
  private propsChangedDestroyCallbacks;
32
32
  private unWatch?;
33
33
  private isFirstRending;
34
- constructor(context: Injector, type: JSXInternal.ComponentConstructor, props: Props, key?: Key | undefined);
34
+ constructor(context: Injector, type: JSXInternal.ComponentSetup, props: Props, key?: Key | undefined);
35
35
  is(target: JSXTypeof): boolean;
36
36
  provide<T>(providers: Provider<T> | Provider<T>[]): void;
37
37
  setup(): {
@@ -9,10 +9,10 @@ export interface Props {
9
9
  export declare function Fragment(props: Props): () => any;
10
10
  export type Key = number | string;
11
11
  export declare function jsx(name: string, props: Props, key?: Key): JSXElement;
12
- export declare function jsx(setup: JSXInternal.ComponentConstructor, props: Props, key?: Key): JSXComponent;
12
+ export declare function jsx(setup: JSXInternal.ComponentSetup, props: Props, key?: Key): JSXComponent;
13
13
  export declare const jsxs: typeof jsx;
14
14
  export interface JSXTypeof {
15
- $$typeOf: string | JSXInternal.ComponentConstructor;
15
+ $$typeOf: string | JSXInternal.ComponentSetup;
16
16
  is(target: JSXTypeof): boolean;
17
17
  }
18
18
  export declare class JSXText implements JSXTypeof {
@@ -6,6 +6,6 @@ import { Injector } from '../di/_api';
6
6
  */
7
7
  export declare class RootComponent extends Component {
8
8
  onChange: (() => void) | null;
9
- constructor(parentInjector: Injector, factory: JSXInternal.ComponentConstructor);
9
+ constructor(parentInjector: Injector, factory: JSXInternal.ComponentSetup);
10
10
  markAsChanged(changedComponent?: Component): void;
11
11
  }
@@ -2,14 +2,14 @@ import { Key } from './jsx-element';
2
2
  import { ExtractInstanceType, Ref } from './component';
3
3
  export type JSXNode = JSXInternal.JSXNode;
4
4
  export declare namespace JSXInternal {
5
- type ClassNames = string | Record<string, unknown> | ClassNames[];
5
+ type ClassNames = string | Record<string, unknown> | false | null | undefined | ClassNames[];
6
6
  interface ComponentInstance<P> {
7
7
  $render(): JSXNode;
8
8
  $shouldUpdate?(currentProps: P, prevProps: P): boolean;
9
9
  }
10
10
  type JSXNode = Element | JSXInternal.ElementClass | string | number | boolean | null | undefined | JSXNode[];
11
- type ComponentConstructor<P = any> = (props: P) => (() => Element) | ComponentInstance<P>;
12
- type Element<P = any, C extends string | ComponentConstructor<P> = string | ComponentConstructor<P>> = C extends string ? IntrinsicElements[C] : (() => Element) | ComponentInstance<P>;
11
+ type ComponentSetup<P = any> = (props: P) => (() => Element) | ComponentInstance<P>;
12
+ type Element<P = any, C extends string | ComponentSetup<P> = string | ComponentSetup<P>> = C extends string ? IntrinsicElements[C] : (() => Element) | ComponentInstance<P>;
13
13
  interface IntrinsicAttributes {
14
14
  key?: Key;
15
15
  ref?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/core",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "Viewfly is a simple and easy-to-use JavaScript framework with an intuitive development experience.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -46,5 +46,5 @@
46
46
  "bugs": {
47
47
  "url": "https://github.com/viewfly/viewfly.git/issues"
48
48
  },
49
- "gitHead": "b66ca589f7662cd518fc2e5955b3e3ff9de83f94"
49
+ "gitHead": "fab3872455d5c34634ef007b4e154025ced3b833"
50
50
  }