mini-types
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "mini-types", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "TypeScript declarations for Alipay's mini program.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -14,2 +14,4 @@ /** | ||
* | ||
* - 1:{error: 1, message: "not implemented!"} 请求没有结束,就跳转到了另一个页面。 | ||
* - 2:参数错误。 | ||
* - 11:无权跨域 | ||
@@ -19,6 +21,8 @@ * - 12:网络出错 | ||
* - 14:解码失败 | ||
* - 15:HTTP错误 | ||
* - 16:请求已被停止/服务端限流 | ||
* - 15:小程序页面传参如果做urlencode需要把整体参数进行编码。 | ||
* - 19:HTTP错误。 | ||
* - 20:请求已被停止/服务端限流 | ||
* - 23:代理请求失败。 | ||
*/ | ||
readonly status?: 11 | 12 | 13 | 14 | 19; | ||
readonly status?: 1 | 2 | 11 | 12 | 13 | 14 | 15 | 19 | 20 | 23; | ||
@@ -25,0 +29,0 @@ /** |
@@ -99,13 +99,1 @@ declare namespace tinyapp { | ||
} | ||
/** | ||
* `App()` 接受一个 object 作为参数,用来配置小程序的生命周期等。 | ||
*/ | ||
/* tslint:disable:no-unnecessary-generics */ | ||
declare function App<G>(options: tinyapp.AppOptions<G>): void; | ||
/* tslint:enable:no-unnecessary-generics */ | ||
/** | ||
* 获取小程序实例,一般用在各个子页面之中获取顶层应用。 | ||
*/ | ||
declare function getApp(): { globalData: any }; |
@@ -100,11 +100,1 @@ declare namespace tinyapp { | ||
} | ||
/* tslint:disable:no-unnecessary-generics */ | ||
declare function Component<P, D, M extends tinyapp.IComponentMethods>( | ||
options: tinyapp.ComponentOptions< | ||
P, | ||
D, | ||
M | ||
> | ||
): void; | ||
/* tslint:enable:no-unnecessary-generics */ |
@@ -7,51 +7,3 @@ // TypeScript Version: 3.3 | ||
/// <reference path="./api/index.d.ts" /> | ||
declare namespace tinyapp { | ||
/** | ||
* 事件对象 https://docs.alipay.com/mini/framework/events#a-namefc3wdba%E4%BA%8B%E4%BB%B6%E5%AF%B9%E8%B1%A1 | ||
*/ | ||
interface IBaseEvent { | ||
readonly type: string; | ||
readonly timeStamp: number; | ||
readonly target: { | ||
readonly tagName: string; | ||
readonly dataset: Readonly<Record<string, any>>; | ||
readonly targetDataset: Readonly<Record<string, any>>; | ||
readonly offsetLeft: number; | ||
readonly offsetTop: number; | ||
}; | ||
readonly currentTarget: { | ||
readonly tagName: string; | ||
readonly dataset: Readonly<Record<string, any>>; | ||
readonly offsetLeft: number; | ||
readonly offsetTop: number; | ||
}; | ||
} | ||
interface ICustomEvent extends IBaseEvent { | ||
/** | ||
* 自定义事件所携带的数据,如表单组件的提交事件会携带用户的输入信息, | ||
* 媒体的错误事件会携带错误信息,详细的描述请参考组件定义中各个事件的定义。 | ||
*/ | ||
readonly detail: Readonly<Record<string, any>>; | ||
} | ||
interface ITouch { | ||
readonly identifier: number; | ||
readonly pageX: number; | ||
readonly pageY: number; | ||
readonly clientX: number; | ||
readonly clientY: number; | ||
} | ||
interface ICanvasTouch { | ||
readonly identifier: number; | ||
readonly x: number; | ||
readonly y: number; | ||
} | ||
interface ITouchEvent extends IBaseEvent { | ||
readonly touches: ReadonlyArray<ITouch | ICanvasTouch>; | ||
readonly changedTouches: ReadonlyArray<ITouch | ICanvasTouch>; | ||
} | ||
} | ||
/// <reference path="./global.d.ts" /> | ||
/// <reference path="./event.d.ts" /> |
@@ -158,15 +158,1 @@ declare namespace tinyapp { | ||
} | ||
/** | ||
* Page() 函数用来注册一个页面。 | ||
* 接受一个 object 参数,其指定页面的初始数据、生命周期函数、事件处理函数等。 | ||
*/ | ||
/* tslint:disable:no-unnecessary-generics */ | ||
declare function Page<D>(options: tinyapp.PageOptions<D>): void; | ||
/* tslint:enable:no-unnecessary-generics */ | ||
/** | ||
* getCurrentPages() 函数用于获取当前页面栈的实例, | ||
* 以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。 | ||
*/ | ||
declare function getCurrentPages(): Array<tinyapp.IPageInstance<any>>; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
173998
82
5971