@viewfly/core 0.0.26 → 0.0.27

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.
@@ -1,4 +1,3 @@
1
- import 'reflect-metadata';
2
1
  export * from './di/_api';
3
2
  export * from './_utils/make-error';
4
3
  export * from './foundation/_api';
@@ -1,36 +1,22 @@
1
- import { Injector, Provider, ReflectiveInjector } from './di/_api';
2
- import { JSXInternal, NativeNode } from './foundation/_api';
1
+ import type { Injector, Provider } from './di/_api';
2
+ import { JSXInternal, NativeNode, NativeRenderer } from './foundation/_api';
3
3
  /**
4
4
  * Viewfly 配置项
5
5
  */
6
6
  export interface Config {
7
- /** 是否自动更新视图 */
8
- autoUpdate?: boolean;
9
7
  /** 根节点 */
10
8
  root: JSXInternal.JSXNode;
9
+ /** 平台渲染器 */
10
+ nativeRenderer: NativeRenderer;
11
11
  /** 应用的上下文 */
12
12
  context?: Injector;
13
+ /** 是否自动更新视图 */
14
+ autoUpdate?: boolean;
13
15
  }
14
- /**
15
- * Viewfly 核心类,用于启动一个 Viewfly 应用
16
- */
17
- export declare class Viewfly<T extends NativeNode = NativeNode> extends ReflectiveInjector {
18
- private config;
19
- private destroyed;
20
- private rootComponent;
21
- private task;
22
- constructor(config: Config);
23
- provide(providers: Provider | Provider[]): this;
24
- /**
25
- * 启动 Viewfly
26
- * @param host 应用根节点
27
- */
28
- mount(host: T): this;
29
- render(): void;
30
- /**
31
- * 销毁 Viewfly 实例
32
- */
16
+ export interface Application<T extends NativeNode = NativeNode> {
17
+ provide(providers: Provider | Provider[]): Application<T>;
18
+ mount(host: T, autoUpdate?: boolean): Application<T>;
19
+ render(): Application<T>;
33
20
  destroy(): void;
34
- private createRootComponent;
35
- private microTask;
36
21
  }
22
+ export declare function viewfly<T extends NativeNode>({ context, nativeRenderer, autoUpdate, root }: Config): Application<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/core",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
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",
@@ -28,9 +28,6 @@
28
28
  },
29
29
  "license": "MIT",
30
30
  "keywords": [],
31
- "dependencies": {
32
- "reflect-metadata": "^0.1.13"
33
- },
34
31
  "devDependencies": {
35
32
  "@rollup/plugin-commonjs": "^25.0.3",
36
33
  "@rollup/plugin-typescript": "^11.1.2",
@@ -49,5 +46,5 @@
49
46
  "bugs": {
50
47
  "url": "https://github.com/viewfly/viewfly.git/issues"
51
48
  },
52
- "gitHead": "2c80fa3f23c647a918d542c0b626384d22766cb8"
49
+ "gitHead": "b66ca589f7662cd518fc2e5955b3e3ff9de83f94"
53
50
  }