|
1 | | -/// <reference types="wechat-miniprogram" /> |
2 | | -/// <reference types="wechat-miniprogram" /> |
3 | | -/// <reference types="wechat-miniprogram" /> |
4 | | -export { behavior } from './behavior' |
5 | | -type ComputedInstance< |
6 | | - D extends WechatMiniprogram.Component.DataOption, |
7 | | - P extends WechatMiniprogram.Component.PropertyOption, |
8 | | - M extends WechatMiniprogram.Component.MethodOption, |
9 | | - C extends Record< |
10 | | - string, |
11 | | - ( |
12 | | - data: D & { |
13 | | - [K in keyof P]: any |
14 | | - }, |
15 | | - ) => any |
16 | | - >, |
17 | | - TCustomProperty extends WechatMiniprogram.IAnyObject = Record<string, never>, |
18 | | -> = WechatMiniprogram.Component.Instance<D, P, M, TCustomProperty> & { |
19 | | - data: { |
20 | | - [K in keyof C]: ReturnType<C[K]> |
21 | | - } & { |
22 | | - [K in keyof P]: any |
23 | | - } |
24 | | -} |
25 | | -type ComputedOptions< |
26 | | - TData extends WechatMiniprogram.Component.DataOption, |
27 | | - TProperty extends WechatMiniprogram.Component.PropertyOption, |
28 | | - TMethod extends WechatMiniprogram.Component.MethodOption, |
29 | | - TWatch extends Record<string, (...args: any[]) => void>, |
30 | | - TComputed extends Record< |
31 | | - string, |
32 | | - (data: TData & WechatMiniprogram.Component.PropertyOptionToData<TProperty>) => any |
33 | | - >, |
34 | | - TCustomInstanceProperty extends WechatMiniprogram.IAnyObject = {}, |
35 | | -> = (Partial<WechatMiniprogram.Component.Data<TData>> & |
36 | | - Partial<WechatMiniprogram.Component.Property<TProperty>> & |
37 | | - Partial<WechatMiniprogram.Component.Method<TMethod>> & |
38 | | - Partial<WechatMiniprogram.Component.OtherOption> & |
39 | | - Partial<WechatMiniprogram.Component.Lifetimes> & { |
40 | | - watch?: TWatch |
41 | | - computed?: TComputed |
42 | | - template?: string |
43 | | - }) & |
44 | | - ThisType<ComputedInstance<TData, TProperty, TMethod, TComputed, TCustomInstanceProperty>> |
45 | | -export declare function ComponentWithComputed< |
46 | | - TData extends WechatMiniprogram.Component.DataOption, |
47 | | - TProperty extends WechatMiniprogram.Component.PropertyOption, |
48 | | - TMethod extends WechatMiniprogram.Component.MethodOption, |
49 | | - TWatch extends Record<string, (...args: any[]) => void>, |
50 | | - TComputed extends Record< |
51 | | - string, |
52 | | - (data: TData & WechatMiniprogram.Component.PropertyOptionToData<TProperty>) => any |
53 | | - >, |
54 | | - TCustomInstanceProperty extends WechatMiniprogram.IAnyObject = {}, |
55 | | ->( |
56 | | - options: ComputedOptions<TData, TProperty, TMethod, TWatch, TComputed, TCustomInstanceProperty>, |
57 | | -): string |
58 | | -export declare function BehaviorWithComputed< |
59 | | - TData extends WechatMiniprogram.Behavior.DataOption, |
60 | | - TProperty extends WechatMiniprogram.Behavior.PropertyOption, |
61 | | - TMethod extends WechatMiniprogram.Behavior.MethodOption, |
62 | | - TWatch extends Record<string, (...args: any[]) => void>, |
63 | | - TComputed extends Record< |
64 | | - string, |
65 | | - (data: TData & WechatMiniprogram.Component.PropertyOptionToData<TProperty>) => any |
66 | | - >, |
67 | | - TCustomInstanceProperty extends WechatMiniprogram.IAnyObject = {}, |
68 | | ->( |
69 | | - options: ComputedOptions<TData, TProperty, TMethod, TWatch, TComputed, TCustomInstanceProperty>, |
70 | | -): string |
| 1 | +export { behavior, computed, watch } from './behavior'; |
| 2 | +type ComputedInstance<D extends WechatMiniprogram.Component.DataOption, P extends WechatMiniprogram.Component.PropertyOption, M extends WechatMiniprogram.Component.MethodOption, C extends Record<string, (data: D & { |
| 3 | + [K in keyof P]: any; |
| 4 | +}) => any>, TCustomProperty extends WechatMiniprogram.IAnyObject = Record<string, never>> = WechatMiniprogram.Component.Instance<D, P, M, TCustomProperty> & { |
| 5 | + data: { |
| 6 | + [K in keyof C]: ReturnType<C[K]>; |
| 7 | + } & { |
| 8 | + [K in keyof P]: any; |
| 9 | + }; |
| 10 | +}; |
| 11 | +type ComputedOptions<TData extends WechatMiniprogram.Component.DataOption, TProperty extends WechatMiniprogram.Component.PropertyOption, TMethod extends WechatMiniprogram.Component.MethodOption, TWatch extends Record<string, (...args: any[]) => void>, TComputed extends Record<string, (data: TData & WechatMiniprogram.Component.PropertyOptionToData<TProperty>) => any>, TCustomInstanceProperty extends WechatMiniprogram.IAnyObject = {}> = (Partial<WechatMiniprogram.Component.Data<TData>> & Partial<WechatMiniprogram.Component.Property<TProperty>> & Partial<WechatMiniprogram.Component.Method<TMethod>> & Partial<WechatMiniprogram.Component.OtherOption> & Partial<WechatMiniprogram.Component.Lifetimes> & { |
| 12 | + watch?: TWatch; |
| 13 | + computed?: TComputed; |
| 14 | + template?: string; |
| 15 | +}) & ThisType<ComputedInstance<TData, TProperty, TMethod, TComputed, TCustomInstanceProperty>>; |
| 16 | +export declare function ComponentWithComputed<TData extends WechatMiniprogram.Component.DataOption, TProperty extends WechatMiniprogram.Component.PropertyOption, TMethod extends WechatMiniprogram.Component.MethodOption, TWatch extends Record<string, (...args: any[]) => void>, TComputed extends Record<string, (data: TData & WechatMiniprogram.Component.PropertyOptionToData<TProperty>) => any>, TCustomInstanceProperty extends WechatMiniprogram.IAnyObject = {}>(options: ComputedOptions<TData, TProperty, TMethod, TWatch, TComputed, TCustomInstanceProperty>): string; |
| 17 | +export declare function BehaviorWithComputed<TData extends WechatMiniprogram.Behavior.DataOption, TProperty extends WechatMiniprogram.Behavior.PropertyOption, TMethod extends WechatMiniprogram.Behavior.MethodOption, TWatch extends Record<string, (...args: any[]) => void>, TComputed extends Record<string, (data: TData & WechatMiniprogram.Component.PropertyOptionToData<TProperty>) => any>, TCustomInstanceProperty extends WechatMiniprogram.IAnyObject = {}>(options: ComputedOptions<TData, TProperty, TMethod, TWatch, TComputed, TCustomInstanceProperty>): string; |
71 | 18 | export declare enum DataTracerMode { |
72 | | - Auto = 0, |
73 | | - Proxy = 1, |
74 | | - DefineProperty = 2, |
| 19 | + Auto = 0, |
| 20 | + Proxy = 1, |
| 21 | + DefineProperty = 2 |
75 | 22 | } |
76 | | -export declare const getCurrentDataTracerMode: () => DataTracerMode |
77 | | -export declare const setCurrentDataTracerMode: (mode: DataTracerMode) => void |
| 23 | +export declare const getCurrentDataTracerMode: () => DataTracerMode; |
| 24 | +export declare const setCurrentDataTracerMode: (mode: DataTracerMode) => void; |
0 commit comments