@viewfly/core 3.0.0-alpha.2 → 3.0.0-alpha.4

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,3 +1,4 @@
1
+ export declare function triggerArrayByRange(target: unknown[], startIndex: number, endIndex: number): void;
1
2
  export declare function createArrayHandlers(wrapper: (v: unknown) => unknown): {
2
3
  entries(): Generator<unknown[], void, unknown>;
3
4
  keys(): Generator<unknown, void, unknown>;
@@ -16,12 +17,12 @@ export declare function createArrayHandlers(wrapper: (v: unknown) => unknown): {
16
17
  lastIndexOf(...args: unknown[]): number;
17
18
  map<U>(callbackFn: (value: unknown, index: number, array: unknown[]) => U, thisArg?: any): U[];
18
19
  pop(): any;
19
- push(this: any, ...items: any[]): any;
20
+ push(this: any, ...items: any[]): number;
20
21
  reduce(callbackFn: (previousValue: unknown, currentValue: unknown, currentIndex: number, array: unknown[]) => unknown, ...args: any[]): any;
21
22
  reduceRight(callbackFn: (previousValue: unknown, currentValue: unknown, currentIndex: number, array: unknown[]) => unknown, ...args: any[]): any;
22
23
  shift(): any;
23
24
  some(predicate: (value: unknown, index: number, array: unknown[]) => unknown, thisArg?: any): boolean;
24
- splice(start: number, deleteCount?: number): unknown[];
25
+ splice(start: number, ...items: any[]): unknown[];
25
26
  toReversed(): any;
26
27
  toSorted(compareFn?: (a: unknown, b: unknown) => number): any;
27
28
  toSpliced(start: number, deleteCount: number, ...items: any[]): any;
@@ -1,3 +1,9 @@
1
+ export declare function nextTick(): Promise<void>;
2
+ /**
3
+ * 同步清空响应式调度队列。
4
+ * @internal 仅用于框架内部桥接与测试控制,不建议业务代码使用。
5
+ */
6
+ export declare function flushReactiveEffectsSync(): void;
1
7
  export declare enum TrackOpTypes {
2
8
  Get = "Get",
3
9
  Has = "Has",
@@ -7,7 +13,8 @@ export declare enum TriggerOpTypes {
7
13
  Set = "Set",
8
14
  Add = "Add",
9
15
  Delete = "Delete",
10
- Clear = "Clear"
16
+ Clear = "Clear",
17
+ Iterate = "Iterate"
11
18
  }
12
19
  export declare function track(target: object, type: TrackOpTypes, key?: unknown): void;
13
20
  export declare function trigger(target: object, type: TriggerOpTypes, key?: unknown): void;
@@ -3,7 +3,7 @@ export declare function createMapHandlers(wrapper: (v: unknown) => unknown): {
3
3
  keys(): Generator<unknown, void, unknown>;
4
4
  values(): Generator<unknown, void, unknown>;
5
5
  get(this: any, key: any): unknown;
6
- set(this: any, key: any, value: any): Map<any, any>;
6
+ set(this: any, key: any, value: any): any;
7
7
  has(this: any, key: any): any;
8
8
  delete(this: any, key: any): any;
9
9
  forEach(this: any, callbackFn: (value: any, key: any, map: Map<any, any>) => void, thisArg?: any): void;
@@ -1,5 +1,7 @@
1
1
  export declare const rawToProxyCache: WeakMap<object, any>;
2
2
  export declare const proxyToRawCache: WeakMap<object, any>;
3
+ export declare const shallowRawToProxyCache: WeakMap<object, any>;
4
+ export declare const shallowProxyToRawCache: WeakMap<object, any>;
3
5
  /**
4
6
  * 将响应式对象转换为原始对象
5
7
  * @param value 响应式对象
@@ -46,6 +48,7 @@ export declare class ObjectReactiveHandler<T extends object> implements ProxyHan
46
48
  get(target: T, p: string | symbol, receiver: any): any;
47
49
  deleteProperty(target: T, p: string | symbol): boolean;
48
50
  ownKeys(target: T): ArrayLike<string | symbol>;
51
+ has(target: T, p: string | symbol): boolean;
49
52
  }
50
53
  export declare class ArrayReactiveHandler extends ObjectReactiveHandler<any[]> {
51
54
  interceptors: {
@@ -66,12 +69,12 @@ export declare class ArrayReactiveHandler extends ObjectReactiveHandler<any[]> {
66
69
  lastIndexOf(...args: unknown[]): number;
67
70
  map<U>(callbackFn: (value: unknown, index: number, array: unknown[]) => U, thisArg?: any): U[];
68
71
  pop(): any;
69
- push(this: any, ...items: any[]): any;
72
+ push(this: any, ...items: any[]): number;
70
73
  reduce(callbackFn: (previousValue: unknown, currentValue: unknown, currentIndex: number, array: unknown[]) => unknown, ...args: any[]): any;
71
74
  reduceRight(callbackFn: (previousValue: unknown, currentValue: unknown, currentIndex: number, array: unknown[]) => unknown, ...args: any[]): any;
72
75
  shift(): any;
73
76
  some(predicate: (value: unknown, index: number, array: unknown[]) => unknown, thisArg?: any): boolean;
74
- splice(start: number, deleteCount?: number): unknown[];
77
+ splice(start: number, ...items: any[]): unknown[];
75
78
  toReversed(): any;
76
79
  toSorted(compareFn?: (a: unknown, b: unknown) => number): any;
77
80
  toSpliced(start: number, deleteCount: number, ...items: any[]): any;
@@ -80,6 +83,8 @@ export declare class ArrayReactiveHandler extends ObjectReactiveHandler<any[]> {
80
83
  };
81
84
  constructor(config: ReactiveConfig);
82
85
  get(target: any[], p: string | symbol, receiver: any): any;
86
+ set(target: any[], p: string | symbol, newValue: any, receiver: any): boolean;
87
+ deleteProperty(target: any[], p: string | symbol): boolean;
83
88
  }
84
89
  export declare class MapReactiveHandler extends ObjectReactiveHandler<Map<any, any> | WeakMap<object, any>> {
85
90
  interceptors: {
@@ -87,7 +92,7 @@ export declare class MapReactiveHandler extends ObjectReactiveHandler<Map<any, a
87
92
  keys(): Generator<unknown, void, unknown>;
88
93
  values(): Generator<unknown, void, unknown>;
89
94
  get(this: any, key: any): unknown;
90
- set(this: any, key: any, value: any): Map<any, any>;
95
+ set(this: any, key: any, value: any): any;
91
96
  has(this: any, key: any): any;
92
97
  delete(this: any, key: any): any;
93
98
  forEach(this: any, callbackFn: (value: any, key: any, map: Map<any, any>) => void, thisArg?: any): void;
package/dist/viewfly.d.ts CHANGED
@@ -17,7 +17,7 @@ export interface Config {
17
17
  }
18
18
  export interface Application<T extends NativeNode = NativeNode> {
19
19
  provide(providers: Provider | Provider[]): Application<T>;
20
- mount(host: T): Application<T>;
20
+ mount(container: T): Application<T>;
21
21
  use(module: Module | Module[]): Application<T>;
22
22
  render(): Application<T>;
23
23
  destroy(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viewfly/core",
3
- "version": "3.0.0-alpha.2",
3
+ "version": "3.0.0-alpha.4",
4
4
  "description": "Viewfly is a simple and easy-to-use JavaScript framework with an intuitive development experience.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",