@mpkit/types
Advanced tools
+11
| export interface MkEventTargetEvent { | ||
| readonly isTrusted: boolean; | ||
| readonly type: string; | ||
| readonly target: any; | ||
| } | ||
| export interface MkEventTargetEventHandler { | ||
| (event: MkEventTargetEvent); | ||
| } | ||
| export interface MkEventTargetEventListener { | ||
| handleEvent: MkEventTargetEventHandler; | ||
| } |
| export interface MkEventTargetEvent { | ||
| readonly isTrusted: boolean; | ||
| readonly type: string; | ||
| readonly target: any; | ||
| } | ||
| export interface MkEventTargetEventHandler { | ||
| (event: MkEventTargetEvent): any; | ||
| } | ||
| export interface MkEventTargetEventListener { | ||
| handleEvent: MkEventTargetEventHandler; | ||
| } |
| /*! | ||
| * MpKit v1.0.3 | ||
| * MpKit v1.0.5 | ||
| * (c) 2020-2020 imingyu<mingyuhisoft@163.com> | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.cjs.js","sources":["../api.ts","../platform.ts","../ebus.ts","../view.ts","../view-parser.ts"],"sourcesContent":["export interface MpApiCallback {\n (res?: any);\n}\nexport interface MpApiMethodArg {\n success: MpApiCallback;\n fail: MpApiCallback;\n complete: MpApiCallback;\n [prop: string]: any;\n}\nexport interface MpApiMethod {\n (options?: MpApiMethodArg | any): any;\n}\n\nexport interface MpApiVar {\n [prop: string]: MpApiMethod;\n}\nexport enum MpRequestOptionsMethod {\n OPTIONS = \"OPTIONS\",\n GET = \"GET\",\n POST = \"POST\",\n HEAD = \"HEAD\",\n PUT = \"PUT\",\n DELETE = \"DELETE\",\n TRACE = \"TRACE\",\n CONNECT = \"CONNECT\",\n}\nexport interface MpRequestOptions extends MpApiMethodArg {\n url: string;\n method: MpRequestOptionsMethod;\n headers?: {\n [prop: string]: string | number;\n };\n}\nexport interface MpRequestTask {\n abort: Function;\n}\nexport interface MpApiRequestMethod {\n (options: MpRequestOptions): MpRequestTask;\n}\n","export enum MpPlatform {\n wechat = \"wechat\",\n alipay = \"alipay\",\n smart = \"smart\",\n tiktok = \"tiktok\",\n unknown = \"unknown\",\n}\n","export interface EventData {\n type: string;\n ts: number;\n data?: any;\n}\nexport interface EventHandler {\n (eventData: EventData, ...args: any[]);\n}\nexport interface EBus {\n on(type: string, handler: EventHandler);\n off(type: string, handler?: EventHandler);\n emit(type: string, data: any);\n}\nexport enum EventType {\n All = \"All\",\n Error = \"Error\",\n ViewInitLife = \"ViewInitLife\",\n ViewInitMount = \"ViewInitMount\",\n ViewMethodStart = \"ViewMethodStart\",\n ViewMethodEnd = \"ViewMethodEnd\",\n UIEvent = \"UIEvent\",\n ApiMethodStart = \"ApiMethodStart\",\n ApiMethodEnd = \"ApiMethodEnd\",\n ApiMethodComplete = \"ApiMethodComplete\",\n RequestStart = \"RequestStart\",\n RequestEnd = \"RequestEnd\",\n}\n","import { MkEnumMap } from \"./util\";\nimport { MkSetData } from \"./set-data\";\nexport interface MpAppLaunchOptions {}\nexport interface MpViewInitLife<V, T> {\n (this: V, options: T): void;\n}\nexport interface MpViewLife<V> {\n (this: V): void;\n}\nexport type MpViewInitLifes = \"onLaunch\" | \"onLoad\" | \"created\" | \"onInit\";\nexport type MpViewMountLifes = \"onShow\" | \"attached\" | \"didMount\";\n// 小程序App实例\nexport interface MpViewApp extends MpViewAppSpec, MpView {}\n// 小程序App函数接收的配置对象\nexport interface MpViewAppSpec {\n onLaunch: MpViewInitLife<MpViewApp, MpAppLaunchOptions>;\n onShow: MpViewInitLife<MpViewApp, MpAppLaunchOptions>;\n onHide: MpViewLife<MpViewApp>;\n onError: MpViewLife<MpViewApp>;\n [prop: string]: any;\n}\nexport interface MpAlipayViewApp extends MpViewApp, MpAlipayViewAppSpec {}\nexport interface MpAlipayViewAppSpec extends MpViewAppSpec {\n onShareAppMessage: MpViewLife<MpAlipayViewApp>;\n}\n\nexport interface MpViewFactory {\n (spec: MpViewAppSpec | MpViewPageSpec | MpViewComponentSpec): void;\n}\nexport enum MpViewType {\n App = \"App\",\n Page = \"Page\",\n Component = \"Component\",\n}\nexport interface MpViewSpec {\n data: any;\n}\nexport interface MpViewComponetPropSpec {\n type: Function;\n default?: any;\n observer?: Function;\n}\nexport interface MpViewPageSpec extends MpViewSpec {\n [prop: string]: any;\n}\nexport type MpViewComponentLifes =\n | \"created\"\n | \"attached\"\n | \"ready\"\n | \"moved\"\n | \"detached\"\n | \"error\";\nexport type MpViewComponentPageLifes = \"show\" | \"hide\" | \"resize\";\nexport interface MpViewComponentSpec extends MpViewSpec {\n properties?: {\n [prop: string]: Function | MpViewComponetPropSpec;\n };\n lifetimes?: MkEnumMap<MpViewComponentLifes, Function | string>;\n pageLifetimes?: MkEnumMap<MpViewComponentPageLifes, Function | string>;\n methods: {\n [prop: string]: Function;\n };\n [prop: string]: any;\n}\nexport interface MpView {\n $mkSpec: MpViewSpec;\n $mkType: MpViewType;\n $mkKey: string;\n $mkKeyIsDefine?: boolean | string;\n $mkNativeSetData: MpSetDataHandler;\n $mkSetData: MkSetData;\n $mkSetDataIsBind?: boolean;\n $mkReadyData: any;\n data: any;\n setData: MpSetDataHandler;\n}\nexport interface MpWechatSelectOwnerComponent {\n (): void | MpView;\n}\nexport interface MpWechatView extends MpView {\n __wxExparserNodeId__: string;\n __wxWebviewId__: number;\n is: string;\n selectOwnerComponent: MpWechatSelectOwnerComponent;\n}\nexport interface MpWechatPageView extends MpWechatView {\n route: string;\n}\nexport interface MpTiktokView extends MpView {\n __webviewId__: number;\n __nodeId__: number;\n is: string;\n}\nexport interface MpComponentPropObserver {\n (this: MpView, oldValue: any, newVal: any): void;\n}\n\nexport interface MpComponentPropSpec {\n type: Function;\n default: any;\n observer: MpComponentPropObserver;\n}\n\nexport interface MpAlipayView extends MpView {\n $id: number;\n}\n\nexport interface MpAlipayViewPage extends MpAlipayView {\n $viewId: string;\n route: string;\n}\nexport interface MpAlipayViewComponent extends MpAlipayView {\n $page: MpAlipayViewPage;\n is: string;\n props: {\n [prop: string]: any;\n __tag: string;\n };\n}\nexport interface MpSmartViewPage extends MpView {\n route: string;\n}\nexport interface MpSmartViewComponent extends MpView {\n componentName: string;\n nodeId: string;\n pageinstance: MpSmartViewPage;\n is: string;\n}\nexport interface MpSetDataHandler {\n (data: any, callback?: Function): void;\n}\n","export interface MpViewParserOptions {}\nexport interface MpElement {\n tag?: string;\n type: MpElementType;\n attrs?: MpElementAttr[];\n children?: MpElementContent[] | MpElement[];\n selfCloseing?: boolean;\n}\nexport enum MpElementType {\n node = \"node\",\n text = \"text\",\n comment = \"comment\",\n}\nexport interface MpElementAttr {\n name: string;\n value?: MpElementContent;\n}\n\nexport enum MpElementContentType {\n number = \"number\",\n boolean = \"boolean\",\n string = \"string\",\n null = \"null\",\n dynamic = \"dynamic\",\n}\nexport interface MpElementContent {\n type: MpElementContentType;\n value: string | number | boolean | null | MpDynamicValue;\n}\nexport interface MpDynamicValue {\n source: string;\n ast: any;\n}\n"],"names":["MpRequestOptionsMethod","MpPlatform","EventType","MpViewType","MpElementType","MpElementContentType"],"mappings":";;;;;;;;;;AAgBA,WAAYA;AACRA,EAAAA,iCAAA,YAAA;AACAA,EAAAA,6BAAA,QAAA;AACAA,EAAAA,8BAAA,SAAA;AACAA,EAAAA,8BAAA,SAAA;AACAA,EAAAA,6BAAA,QAAA;AACAA,EAAAA,gCAAA,WAAA;AACAA,EAAAA,+BAAA,UAAA;AACAA,EAAAA,iCAAA,YAAA;AACH,CATD,EAAYA,8BAAsB,KAAtBA,8BAAsB,KAAA,CAAlC;;AChBA,WAAYC;AACRA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,mBAAA,UAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,qBAAA,YAAA;AACH,CAND,EAAYA,kBAAU,KAAVA,kBAAU,KAAA,CAAtB;;ACaA,WAAYC;AACRA,EAAAA,gBAAA,QAAA;AACAA,EAAAA,kBAAA,UAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,0BAAA,kBAAA;AACAA,EAAAA,4BAAA,oBAAA;AACAA,EAAAA,0BAAA,kBAAA;AACAA,EAAAA,oBAAA,YAAA;AACAA,EAAAA,2BAAA,mBAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,8BAAA,sBAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,uBAAA,eAAA;AACH,CAbD,EAAYA,iBAAS,KAATA,iBAAS,KAAA,CAArB;;ACgBA,WAAYC;AACRA,EAAAA,iBAAA,QAAA;AACAA,EAAAA,kBAAA,SAAA;AACAA,EAAAA,uBAAA,cAAA;AACH,CAJD,EAAYA,kBAAU,KAAVA,kBAAU,KAAA,CAAtB;;ACrBA,WAAYC;AACRA,EAAAA,qBAAA,SAAA;AACAA,EAAAA,qBAAA,SAAA;AACAA,EAAAA,wBAAA,YAAA;AACH,CAJD,EAAYA,qBAAa,KAAbA,qBAAa,KAAA,CAAzB;;AAUA,WAAYC;AACRA,EAAAA,8BAAA,WAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,8BAAA,WAAA;AACAA,EAAAA,4BAAA,SAAA;AACAA,EAAAA,+BAAA,YAAA;AACH,CAND,EAAYA,4BAAoB,KAApBA,4BAAoB,KAAA,CAAhC"} | ||
| {"version":3,"file":"index.cjs.js","sources":["../api.ts","../platform.ts","../ebus.ts","../view.ts","../view-parser.ts"],"sourcesContent":["export interface MpApiCallback {\n (res?: any);\n}\nexport interface MpApiMethodArg {\n success: MpApiCallback;\n fail: MpApiCallback;\n complete: MpApiCallback;\n [prop: string]: any;\n}\nexport interface MpApiMethod {\n (options?: MpApiMethodArg | any): any;\n}\n\nexport interface MpApiVar {\n [prop: string]: MpApiMethod;\n}\nexport enum MpRequestOptionsMethod {\n OPTIONS = \"OPTIONS\",\n GET = \"GET\",\n POST = \"POST\",\n HEAD = \"HEAD\",\n PUT = \"PUT\",\n DELETE = \"DELETE\",\n TRACE = \"TRACE\",\n CONNECT = \"CONNECT\",\n}\nexport interface MpRequestOptions extends MpApiMethodArg {\n url: string;\n method: MpRequestOptionsMethod;\n headers?: {\n [prop: string]: string | number;\n };\n}\nexport interface MpRequestTask {\n abort: Function;\n}\nexport interface MpApiRequestMethod {\n (options: MpRequestOptions): MpRequestTask;\n}\n","export enum MpPlatform {\n wechat = \"wechat\",\n alipay = \"alipay\",\n smart = \"smart\",\n tiktok = \"tiktok\",\n unknown = \"unknown\",\n}\n","export interface EventData {\n type: string;\n ts: number;\n data?: any;\n}\nexport interface EventHandler {\n (eventData: EventData, ...args: any[]);\n}\nexport interface EBus {\n on(type: string, handler: EventHandler);\n off(type: string, handler?: EventHandler);\n emit(type: string, data: any);\n}\nexport enum EventType {\n All = \"All\",\n Error = \"Error\",\n ViewInitLife = \"ViewInitLife\",\n ViewInitMount = \"ViewInitMount\",\n ViewMethodStart = \"ViewMethodStart\",\n ViewMethodEnd = \"ViewMethodEnd\",\n UIEvent = \"UIEvent\",\n ApiMethodStart = \"ApiMethodStart\",\n ApiMethodEnd = \"ApiMethodEnd\",\n ApiMethodComplete = \"ApiMethodComplete\",\n RequestStart = \"RequestStart\",\n RequestEnd = \"RequestEnd\",\n}\n","import { MkEnumMap } from \"./util\";\nimport { MkSetData } from \"./set-data\";\nexport interface MpAppLaunchOptions {}\nexport interface MpViewInitLife<V, T> {\n (this: V, options: T): void;\n}\nexport interface MpViewLife<V> {\n (this: V): void;\n}\nexport type MpViewInitLifes = \"onLaunch\" | \"onLoad\" | \"created\" | \"onInit\";\nexport type MpViewMountLifes = \"onShow\" | \"attached\" | \"didMount\";\n// 小程序App实例\nexport interface MpViewApp extends MpViewAppSpec, MpView {}\n// 小程序App函数接收的配置对象\nexport interface MpViewAppSpec {\n onLaunch: MpViewInitLife<MpViewApp, MpAppLaunchOptions>;\n onShow: MpViewInitLife<MpViewApp, MpAppLaunchOptions>;\n onHide: MpViewLife<MpViewApp>;\n onError: MpViewLife<MpViewApp>;\n [prop: string]: any;\n}\nexport interface MpAlipayViewApp extends MpViewApp, MpAlipayViewAppSpec {}\nexport interface MpAlipayViewAppSpec extends MpViewAppSpec {\n onShareAppMessage: MpViewLife<MpAlipayViewApp>;\n}\n\nexport interface MpViewFactory {\n (spec: MpViewAppSpec | MpViewPageSpec | MpViewComponentSpec | any): void;\n}\nexport enum MpViewType {\n App = \"App\",\n Page = \"Page\",\n Component = \"Component\",\n}\nexport interface MpViewSpec {\n data: any;\n}\nexport interface MpViewComponetPropSpec {\n type: Function;\n default?: any;\n observer?: Function;\n}\nexport interface MpViewPageSpec extends MpViewSpec {\n [prop: string]: any;\n}\nexport type MpViewComponentLifes =\n | \"created\"\n | \"attached\"\n | \"ready\"\n | \"moved\"\n | \"detached\"\n | \"error\";\nexport type MpViewComponentPageLifes = \"show\" | \"hide\" | \"resize\";\nexport interface MpViewComponentSpec extends MpViewSpec {\n properties?: {\n [prop: string]: Function | MpViewComponetPropSpec;\n };\n lifetimes?: MkEnumMap<MpViewComponentLifes, Function | string>;\n pageLifetimes?: MkEnumMap<MpViewComponentPageLifes, Function | string>;\n methods: {\n [prop: string]: Function;\n };\n [prop: string]: any;\n}\nexport interface MpView {\n $mkSpec: MpViewSpec;\n $mkType: MpViewType;\n $mkKey: string;\n $mkKeyIsDefine?: boolean | string;\n $mkNativeSetData: MpSetDataHandler;\n $mkSetData: MkSetData;\n $mkSetDataIsBind?: boolean;\n $mkReadyData: any;\n data: any;\n setData: MpSetDataHandler;\n}\nexport interface MpWechatSelectOwnerComponent {\n (): void | MpView;\n}\nexport interface MpWechatView extends MpView {\n __wxExparserNodeId__: string;\n __wxWebviewId__: number;\n is: string;\n selectOwnerComponent: MpWechatSelectOwnerComponent;\n}\nexport interface MpWechatPageView extends MpWechatView {\n route: string;\n}\nexport interface MpTiktokView extends MpView {\n __webviewId__: number;\n __nodeId__: number;\n is: string;\n}\nexport interface MpComponentPropObserver {\n (this: MpView, oldValue: any, newVal: any): void;\n}\n\nexport interface MpComponentPropSpec {\n type: Function;\n default: any;\n observer: MpComponentPropObserver;\n}\n\nexport interface MpAlipayView extends MpView {\n $id: number;\n}\n\nexport interface MpAlipayViewPage extends MpAlipayView {\n $viewId: string;\n route: string;\n}\nexport interface MpAlipayViewComponent extends MpAlipayView {\n $page: MpAlipayViewPage;\n is: string;\n props: {\n [prop: string]: any;\n __tag: string;\n };\n}\nexport interface MpSmartViewPage extends MpView {\n route: string;\n}\nexport interface MpSmartViewComponent extends MpView {\n componentName: string;\n nodeId: string;\n pageinstance: MpSmartViewPage;\n is: string;\n}\nexport interface MpSetDataHandler {\n (data: any, callback?: Function): void;\n}\n","export interface MpViewParserOptions {}\nexport interface MpElement {\n tag?: string;\n type: MpElementType;\n attrs?: MpElementAttr[];\n children?: MpElementContent[] | MpElement[];\n selfCloseing?: boolean;\n}\nexport enum MpElementType {\n node = \"node\",\n text = \"text\",\n comment = \"comment\",\n}\nexport interface MpElementAttr {\n name: string;\n value?: MpElementContent;\n}\n\nexport enum MpElementContentType {\n number = \"number\",\n boolean = \"boolean\",\n string = \"string\",\n null = \"null\",\n dynamic = \"dynamic\",\n}\nexport interface MpElementContent {\n type: MpElementContentType;\n value: string | number | boolean | null | MpDynamicValue;\n}\nexport interface MpDynamicValue {\n source: string;\n ast: any;\n}\n"],"names":["MpRequestOptionsMethod","MpPlatform","EventType","MpViewType","MpElementType","MpElementContentType"],"mappings":";;;;;;;;;;AAgBA,WAAYA;AACRA,EAAAA,iCAAA,YAAA;AACAA,EAAAA,6BAAA,QAAA;AACAA,EAAAA,8BAAA,SAAA;AACAA,EAAAA,8BAAA,SAAA;AACAA,EAAAA,6BAAA,QAAA;AACAA,EAAAA,gCAAA,WAAA;AACAA,EAAAA,+BAAA,UAAA;AACAA,EAAAA,iCAAA,YAAA;AACH,CATD,EAAYA,8BAAsB,KAAtBA,8BAAsB,KAAA,CAAlC;;AChBA,WAAYC;AACRA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,mBAAA,UAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,qBAAA,YAAA;AACH,CAND,EAAYA,kBAAU,KAAVA,kBAAU,KAAA,CAAtB;;ACaA,WAAYC;AACRA,EAAAA,gBAAA,QAAA;AACAA,EAAAA,kBAAA,UAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,0BAAA,kBAAA;AACAA,EAAAA,4BAAA,oBAAA;AACAA,EAAAA,0BAAA,kBAAA;AACAA,EAAAA,oBAAA,YAAA;AACAA,EAAAA,2BAAA,mBAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,8BAAA,sBAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,uBAAA,eAAA;AACH,CAbD,EAAYA,iBAAS,KAATA,iBAAS,KAAA,CAArB;;ACgBA,WAAYC;AACRA,EAAAA,iBAAA,QAAA;AACAA,EAAAA,kBAAA,SAAA;AACAA,EAAAA,uBAAA,cAAA;AACH,CAJD,EAAYA,kBAAU,KAAVA,kBAAU,KAAA,CAAtB;;ACrBA,WAAYC;AACRA,EAAAA,qBAAA,SAAA;AACAA,EAAAA,qBAAA,SAAA;AACAA,EAAAA,wBAAA,YAAA;AACH,CAJD,EAAYA,qBAAa,KAAbA,qBAAa,KAAA,CAAzB;;AAUA,WAAYC;AACRA,EAAAA,8BAAA,WAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,8BAAA,WAAA;AACAA,EAAAA,4BAAA,SAAA;AACAA,EAAAA,+BAAA,YAAA;AACH,CAND,EAAYA,4BAAoB,KAApBA,4BAAoB,KAAA,CAAhC"} |
| /*! | ||
| * MpKit v1.0.3 | ||
| * MpKit v1.0.5 | ||
| * (c) 2020-2020 imingyu<mingyuhisoft@163.com> | ||
@@ -4,0 +4,0 @@ * Released under the MIT License. |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.esm.js","sources":["../api.ts","../platform.ts","../ebus.ts","../view.ts","../view-parser.ts"],"sourcesContent":["export interface MpApiCallback {\n (res?: any);\n}\nexport interface MpApiMethodArg {\n success: MpApiCallback;\n fail: MpApiCallback;\n complete: MpApiCallback;\n [prop: string]: any;\n}\nexport interface MpApiMethod {\n (options?: MpApiMethodArg | any): any;\n}\n\nexport interface MpApiVar {\n [prop: string]: MpApiMethod;\n}\nexport enum MpRequestOptionsMethod {\n OPTIONS = \"OPTIONS\",\n GET = \"GET\",\n POST = \"POST\",\n HEAD = \"HEAD\",\n PUT = \"PUT\",\n DELETE = \"DELETE\",\n TRACE = \"TRACE\",\n CONNECT = \"CONNECT\",\n}\nexport interface MpRequestOptions extends MpApiMethodArg {\n url: string;\n method: MpRequestOptionsMethod;\n headers?: {\n [prop: string]: string | number;\n };\n}\nexport interface MpRequestTask {\n abort: Function;\n}\nexport interface MpApiRequestMethod {\n (options: MpRequestOptions): MpRequestTask;\n}\n","export enum MpPlatform {\n wechat = \"wechat\",\n alipay = \"alipay\",\n smart = \"smart\",\n tiktok = \"tiktok\",\n unknown = \"unknown\",\n}\n","export interface EventData {\n type: string;\n ts: number;\n data?: any;\n}\nexport interface EventHandler {\n (eventData: EventData, ...args: any[]);\n}\nexport interface EBus {\n on(type: string, handler: EventHandler);\n off(type: string, handler?: EventHandler);\n emit(type: string, data: any);\n}\nexport enum EventType {\n All = \"All\",\n Error = \"Error\",\n ViewInitLife = \"ViewInitLife\",\n ViewInitMount = \"ViewInitMount\",\n ViewMethodStart = \"ViewMethodStart\",\n ViewMethodEnd = \"ViewMethodEnd\",\n UIEvent = \"UIEvent\",\n ApiMethodStart = \"ApiMethodStart\",\n ApiMethodEnd = \"ApiMethodEnd\",\n ApiMethodComplete = \"ApiMethodComplete\",\n RequestStart = \"RequestStart\",\n RequestEnd = \"RequestEnd\",\n}\n","import { MkEnumMap } from \"./util\";\nimport { MkSetData } from \"./set-data\";\nexport interface MpAppLaunchOptions {}\nexport interface MpViewInitLife<V, T> {\n (this: V, options: T): void;\n}\nexport interface MpViewLife<V> {\n (this: V): void;\n}\nexport type MpViewInitLifes = \"onLaunch\" | \"onLoad\" | \"created\" | \"onInit\";\nexport type MpViewMountLifes = \"onShow\" | \"attached\" | \"didMount\";\n// 小程序App实例\nexport interface MpViewApp extends MpViewAppSpec, MpView {}\n// 小程序App函数接收的配置对象\nexport interface MpViewAppSpec {\n onLaunch: MpViewInitLife<MpViewApp, MpAppLaunchOptions>;\n onShow: MpViewInitLife<MpViewApp, MpAppLaunchOptions>;\n onHide: MpViewLife<MpViewApp>;\n onError: MpViewLife<MpViewApp>;\n [prop: string]: any;\n}\nexport interface MpAlipayViewApp extends MpViewApp, MpAlipayViewAppSpec {}\nexport interface MpAlipayViewAppSpec extends MpViewAppSpec {\n onShareAppMessage: MpViewLife<MpAlipayViewApp>;\n}\n\nexport interface MpViewFactory {\n (spec: MpViewAppSpec | MpViewPageSpec | MpViewComponentSpec): void;\n}\nexport enum MpViewType {\n App = \"App\",\n Page = \"Page\",\n Component = \"Component\",\n}\nexport interface MpViewSpec {\n data: any;\n}\nexport interface MpViewComponetPropSpec {\n type: Function;\n default?: any;\n observer?: Function;\n}\nexport interface MpViewPageSpec extends MpViewSpec {\n [prop: string]: any;\n}\nexport type MpViewComponentLifes =\n | \"created\"\n | \"attached\"\n | \"ready\"\n | \"moved\"\n | \"detached\"\n | \"error\";\nexport type MpViewComponentPageLifes = \"show\" | \"hide\" | \"resize\";\nexport interface MpViewComponentSpec extends MpViewSpec {\n properties?: {\n [prop: string]: Function | MpViewComponetPropSpec;\n };\n lifetimes?: MkEnumMap<MpViewComponentLifes, Function | string>;\n pageLifetimes?: MkEnumMap<MpViewComponentPageLifes, Function | string>;\n methods: {\n [prop: string]: Function;\n };\n [prop: string]: any;\n}\nexport interface MpView {\n $mkSpec: MpViewSpec;\n $mkType: MpViewType;\n $mkKey: string;\n $mkKeyIsDefine?: boolean | string;\n $mkNativeSetData: MpSetDataHandler;\n $mkSetData: MkSetData;\n $mkSetDataIsBind?: boolean;\n $mkReadyData: any;\n data: any;\n setData: MpSetDataHandler;\n}\nexport interface MpWechatSelectOwnerComponent {\n (): void | MpView;\n}\nexport interface MpWechatView extends MpView {\n __wxExparserNodeId__: string;\n __wxWebviewId__: number;\n is: string;\n selectOwnerComponent: MpWechatSelectOwnerComponent;\n}\nexport interface MpWechatPageView extends MpWechatView {\n route: string;\n}\nexport interface MpTiktokView extends MpView {\n __webviewId__: number;\n __nodeId__: number;\n is: string;\n}\nexport interface MpComponentPropObserver {\n (this: MpView, oldValue: any, newVal: any): void;\n}\n\nexport interface MpComponentPropSpec {\n type: Function;\n default: any;\n observer: MpComponentPropObserver;\n}\n\nexport interface MpAlipayView extends MpView {\n $id: number;\n}\n\nexport interface MpAlipayViewPage extends MpAlipayView {\n $viewId: string;\n route: string;\n}\nexport interface MpAlipayViewComponent extends MpAlipayView {\n $page: MpAlipayViewPage;\n is: string;\n props: {\n [prop: string]: any;\n __tag: string;\n };\n}\nexport interface MpSmartViewPage extends MpView {\n route: string;\n}\nexport interface MpSmartViewComponent extends MpView {\n componentName: string;\n nodeId: string;\n pageinstance: MpSmartViewPage;\n is: string;\n}\nexport interface MpSetDataHandler {\n (data: any, callback?: Function): void;\n}\n","export interface MpViewParserOptions {}\nexport interface MpElement {\n tag?: string;\n type: MpElementType;\n attrs?: MpElementAttr[];\n children?: MpElementContent[] | MpElement[];\n selfCloseing?: boolean;\n}\nexport enum MpElementType {\n node = \"node\",\n text = \"text\",\n comment = \"comment\",\n}\nexport interface MpElementAttr {\n name: string;\n value?: MpElementContent;\n}\n\nexport enum MpElementContentType {\n number = \"number\",\n boolean = \"boolean\",\n string = \"string\",\n null = \"null\",\n dynamic = \"dynamic\",\n}\nexport interface MpElementContent {\n type: MpElementContentType;\n value: string | number | boolean | null | MpDynamicValue;\n}\nexport interface MpDynamicValue {\n source: string;\n ast: any;\n}\n"],"names":["MpRequestOptionsMethod","MpPlatform","EventType","MpViewType","MpElementType","MpElementContentType"],"mappings":";;;;;;IAgBYA;;AAAZ,WAAYA;AACRA,EAAAA,iCAAA,YAAA;AACAA,EAAAA,6BAAA,QAAA;AACAA,EAAAA,8BAAA,SAAA;AACAA,EAAAA,8BAAA,SAAA;AACAA,EAAAA,6BAAA,QAAA;AACAA,EAAAA,gCAAA,WAAA;AACAA,EAAAA,+BAAA,UAAA;AACAA,EAAAA,iCAAA,YAAA;AACH,CATD,EAAYA,sBAAsB,KAAtBA,sBAAsB,KAAA,CAAlC;;IChBYC;;AAAZ,WAAYA;AACRA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,mBAAA,UAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,qBAAA,YAAA;AACH,CAND,EAAYA,UAAU,KAAVA,UAAU,KAAA,CAAtB;;ICaYC;;AAAZ,WAAYA;AACRA,EAAAA,gBAAA,QAAA;AACAA,EAAAA,kBAAA,UAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,0BAAA,kBAAA;AACAA,EAAAA,4BAAA,oBAAA;AACAA,EAAAA,0BAAA,kBAAA;AACAA,EAAAA,oBAAA,YAAA;AACAA,EAAAA,2BAAA,mBAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,8BAAA,sBAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,uBAAA,eAAA;AACH,CAbD,EAAYA,SAAS,KAATA,SAAS,KAAA,CAArB;;ICgBYC;;AAAZ,WAAYA;AACRA,EAAAA,iBAAA,QAAA;AACAA,EAAAA,kBAAA,SAAA;AACAA,EAAAA,uBAAA,cAAA;AACH,CAJD,EAAYA,UAAU,KAAVA,UAAU,KAAA,CAAtB;;ICrBYC;;AAAZ,WAAYA;AACRA,EAAAA,qBAAA,SAAA;AACAA,EAAAA,qBAAA,SAAA;AACAA,EAAAA,wBAAA,YAAA;AACH,CAJD,EAAYA,aAAa,KAAbA,aAAa,KAAA,CAAzB;;IAUYC;;AAAZ,WAAYA;AACRA,EAAAA,8BAAA,WAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,8BAAA,WAAA;AACAA,EAAAA,4BAAA,SAAA;AACAA,EAAAA,+BAAA,YAAA;AACH,CAND,EAAYA,oBAAoB,KAApBA,oBAAoB,KAAA,CAAhC;;;;"} | ||
| {"version":3,"file":"index.esm.js","sources":["../api.ts","../platform.ts","../ebus.ts","../view.ts","../view-parser.ts"],"sourcesContent":["export interface MpApiCallback {\n (res?: any);\n}\nexport interface MpApiMethodArg {\n success: MpApiCallback;\n fail: MpApiCallback;\n complete: MpApiCallback;\n [prop: string]: any;\n}\nexport interface MpApiMethod {\n (options?: MpApiMethodArg | any): any;\n}\n\nexport interface MpApiVar {\n [prop: string]: MpApiMethod;\n}\nexport enum MpRequestOptionsMethod {\n OPTIONS = \"OPTIONS\",\n GET = \"GET\",\n POST = \"POST\",\n HEAD = \"HEAD\",\n PUT = \"PUT\",\n DELETE = \"DELETE\",\n TRACE = \"TRACE\",\n CONNECT = \"CONNECT\",\n}\nexport interface MpRequestOptions extends MpApiMethodArg {\n url: string;\n method: MpRequestOptionsMethod;\n headers?: {\n [prop: string]: string | number;\n };\n}\nexport interface MpRequestTask {\n abort: Function;\n}\nexport interface MpApiRequestMethod {\n (options: MpRequestOptions): MpRequestTask;\n}\n","export enum MpPlatform {\n wechat = \"wechat\",\n alipay = \"alipay\",\n smart = \"smart\",\n tiktok = \"tiktok\",\n unknown = \"unknown\",\n}\n","export interface EventData {\n type: string;\n ts: number;\n data?: any;\n}\nexport interface EventHandler {\n (eventData: EventData, ...args: any[]);\n}\nexport interface EBus {\n on(type: string, handler: EventHandler);\n off(type: string, handler?: EventHandler);\n emit(type: string, data: any);\n}\nexport enum EventType {\n All = \"All\",\n Error = \"Error\",\n ViewInitLife = \"ViewInitLife\",\n ViewInitMount = \"ViewInitMount\",\n ViewMethodStart = \"ViewMethodStart\",\n ViewMethodEnd = \"ViewMethodEnd\",\n UIEvent = \"UIEvent\",\n ApiMethodStart = \"ApiMethodStart\",\n ApiMethodEnd = \"ApiMethodEnd\",\n ApiMethodComplete = \"ApiMethodComplete\",\n RequestStart = \"RequestStart\",\n RequestEnd = \"RequestEnd\",\n}\n","import { MkEnumMap } from \"./util\";\nimport { MkSetData } from \"./set-data\";\nexport interface MpAppLaunchOptions {}\nexport interface MpViewInitLife<V, T> {\n (this: V, options: T): void;\n}\nexport interface MpViewLife<V> {\n (this: V): void;\n}\nexport type MpViewInitLifes = \"onLaunch\" | \"onLoad\" | \"created\" | \"onInit\";\nexport type MpViewMountLifes = \"onShow\" | \"attached\" | \"didMount\";\n// 小程序App实例\nexport interface MpViewApp extends MpViewAppSpec, MpView {}\n// 小程序App函数接收的配置对象\nexport interface MpViewAppSpec {\n onLaunch: MpViewInitLife<MpViewApp, MpAppLaunchOptions>;\n onShow: MpViewInitLife<MpViewApp, MpAppLaunchOptions>;\n onHide: MpViewLife<MpViewApp>;\n onError: MpViewLife<MpViewApp>;\n [prop: string]: any;\n}\nexport interface MpAlipayViewApp extends MpViewApp, MpAlipayViewAppSpec {}\nexport interface MpAlipayViewAppSpec extends MpViewAppSpec {\n onShareAppMessage: MpViewLife<MpAlipayViewApp>;\n}\n\nexport interface MpViewFactory {\n (spec: MpViewAppSpec | MpViewPageSpec | MpViewComponentSpec | any): void;\n}\nexport enum MpViewType {\n App = \"App\",\n Page = \"Page\",\n Component = \"Component\",\n}\nexport interface MpViewSpec {\n data: any;\n}\nexport interface MpViewComponetPropSpec {\n type: Function;\n default?: any;\n observer?: Function;\n}\nexport interface MpViewPageSpec extends MpViewSpec {\n [prop: string]: any;\n}\nexport type MpViewComponentLifes =\n | \"created\"\n | \"attached\"\n | \"ready\"\n | \"moved\"\n | \"detached\"\n | \"error\";\nexport type MpViewComponentPageLifes = \"show\" | \"hide\" | \"resize\";\nexport interface MpViewComponentSpec extends MpViewSpec {\n properties?: {\n [prop: string]: Function | MpViewComponetPropSpec;\n };\n lifetimes?: MkEnumMap<MpViewComponentLifes, Function | string>;\n pageLifetimes?: MkEnumMap<MpViewComponentPageLifes, Function | string>;\n methods: {\n [prop: string]: Function;\n };\n [prop: string]: any;\n}\nexport interface MpView {\n $mkSpec: MpViewSpec;\n $mkType: MpViewType;\n $mkKey: string;\n $mkKeyIsDefine?: boolean | string;\n $mkNativeSetData: MpSetDataHandler;\n $mkSetData: MkSetData;\n $mkSetDataIsBind?: boolean;\n $mkReadyData: any;\n data: any;\n setData: MpSetDataHandler;\n}\nexport interface MpWechatSelectOwnerComponent {\n (): void | MpView;\n}\nexport interface MpWechatView extends MpView {\n __wxExparserNodeId__: string;\n __wxWebviewId__: number;\n is: string;\n selectOwnerComponent: MpWechatSelectOwnerComponent;\n}\nexport interface MpWechatPageView extends MpWechatView {\n route: string;\n}\nexport interface MpTiktokView extends MpView {\n __webviewId__: number;\n __nodeId__: number;\n is: string;\n}\nexport interface MpComponentPropObserver {\n (this: MpView, oldValue: any, newVal: any): void;\n}\n\nexport interface MpComponentPropSpec {\n type: Function;\n default: any;\n observer: MpComponentPropObserver;\n}\n\nexport interface MpAlipayView extends MpView {\n $id: number;\n}\n\nexport interface MpAlipayViewPage extends MpAlipayView {\n $viewId: string;\n route: string;\n}\nexport interface MpAlipayViewComponent extends MpAlipayView {\n $page: MpAlipayViewPage;\n is: string;\n props: {\n [prop: string]: any;\n __tag: string;\n };\n}\nexport interface MpSmartViewPage extends MpView {\n route: string;\n}\nexport interface MpSmartViewComponent extends MpView {\n componentName: string;\n nodeId: string;\n pageinstance: MpSmartViewPage;\n is: string;\n}\nexport interface MpSetDataHandler {\n (data: any, callback?: Function): void;\n}\n","export interface MpViewParserOptions {}\nexport interface MpElement {\n tag?: string;\n type: MpElementType;\n attrs?: MpElementAttr[];\n children?: MpElementContent[] | MpElement[];\n selfCloseing?: boolean;\n}\nexport enum MpElementType {\n node = \"node\",\n text = \"text\",\n comment = \"comment\",\n}\nexport interface MpElementAttr {\n name: string;\n value?: MpElementContent;\n}\n\nexport enum MpElementContentType {\n number = \"number\",\n boolean = \"boolean\",\n string = \"string\",\n null = \"null\",\n dynamic = \"dynamic\",\n}\nexport interface MpElementContent {\n type: MpElementContentType;\n value: string | number | boolean | null | MpDynamicValue;\n}\nexport interface MpDynamicValue {\n source: string;\n ast: any;\n}\n"],"names":["MpRequestOptionsMethod","MpPlatform","EventType","MpViewType","MpElementType","MpElementContentType"],"mappings":";;;;;;IAgBYA;;AAAZ,WAAYA;AACRA,EAAAA,iCAAA,YAAA;AACAA,EAAAA,6BAAA,QAAA;AACAA,EAAAA,8BAAA,SAAA;AACAA,EAAAA,8BAAA,SAAA;AACAA,EAAAA,6BAAA,QAAA;AACAA,EAAAA,gCAAA,WAAA;AACAA,EAAAA,+BAAA,UAAA;AACAA,EAAAA,iCAAA,YAAA;AACH,CATD,EAAYA,sBAAsB,KAAtBA,sBAAsB,KAAA,CAAlC;;IChBYC;;AAAZ,WAAYA;AACRA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,mBAAA,UAAA;AACAA,EAAAA,oBAAA,WAAA;AACAA,EAAAA,qBAAA,YAAA;AACH,CAND,EAAYA,UAAU,KAAVA,UAAU,KAAA,CAAtB;;ICaYC;;AAAZ,WAAYA;AACRA,EAAAA,gBAAA,QAAA;AACAA,EAAAA,kBAAA,UAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,0BAAA,kBAAA;AACAA,EAAAA,4BAAA,oBAAA;AACAA,EAAAA,0BAAA,kBAAA;AACAA,EAAAA,oBAAA,YAAA;AACAA,EAAAA,2BAAA,mBAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,8BAAA,sBAAA;AACAA,EAAAA,yBAAA,iBAAA;AACAA,EAAAA,uBAAA,eAAA;AACH,CAbD,EAAYA,SAAS,KAATA,SAAS,KAAA,CAArB;;ICgBYC;;AAAZ,WAAYA;AACRA,EAAAA,iBAAA,QAAA;AACAA,EAAAA,kBAAA,SAAA;AACAA,EAAAA,uBAAA,cAAA;AACH,CAJD,EAAYA,UAAU,KAAVA,UAAU,KAAA,CAAtB;;ICrBYC;;AAAZ,WAAYA;AACRA,EAAAA,qBAAA,SAAA;AACAA,EAAAA,qBAAA,SAAA;AACAA,EAAAA,wBAAA,YAAA;AACH,CAJD,EAAYA,aAAa,KAAbA,aAAa,KAAA,CAAzB;;IAUYC;;AAAZ,WAAYA;AACRA,EAAAA,8BAAA,WAAA;AACAA,EAAAA,+BAAA,YAAA;AACAA,EAAAA,8BAAA,WAAA;AACAA,EAAAA,4BAAA,SAAA;AACAA,EAAAA,+BAAA,YAAA;AACH,CAND,EAAYA,oBAAoB,KAApBA,oBAAoB,KAAA,CAAhC;;;;"} |
+2
-2
| { | ||
| "name": "@mpkit/types", | ||
| "version": "1.0.3", | ||
| "version": "1.0.5", | ||
| "description": "mpkit包相关typescript类型", | ||
@@ -31,3 +31,3 @@ "author": "imingyu <mingyuhisoft@163.com>", | ||
| }, | ||
| "gitHead": "af684d56b7756879259bef05ff3cefa5b6e65bfd" | ||
| "gitHead": "c680ee7e9b339f8dd4696f82f41ff31f7cc09172" | ||
| } |
+1
-1
@@ -28,3 +28,3 @@ import { MkEnumMap } from "./util"; | ||
| export interface MpViewFactory { | ||
| (spec: MpViewAppSpec | MpViewPageSpec | MpViewComponentSpec): void; | ||
| (spec: MpViewAppSpec | MpViewPageSpec | MpViewComponentSpec | any): void; | ||
| } | ||
@@ -31,0 +31,0 @@ export declare enum MpViewType { |
+1
-1
@@ -28,3 +28,3 @@ import { MkEnumMap } from "./util"; | ||
| export interface MpViewFactory { | ||
| (spec: MpViewAppSpec | MpViewPageSpec | MpViewComponentSpec): void; | ||
| (spec: MpViewAppSpec | MpViewPageSpec | MpViewComponentSpec | any): void; | ||
| } | ||
@@ -31,0 +31,0 @@ export enum MpViewType { |
42355
1.5%30
7.14%816
2.77%