mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-15 06:48:25 +08:00
fix weixin-app, add this type to intersection observer (#28754)
This commit is contained in:
committed by
Ryan Cavanaugh
parent
c86f6b0ccf
commit
0a583cbe13
8181
types/weixin-app/index.d.ts
vendored
8181
types/weixin-app/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,25 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"weixin-app-tests.ts"
|
||||
]
|
||||
}
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6", "dom"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": ["../"],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": ["index.d.ts", "weixin-app-tests.ts"],
|
||||
"exclude": [".prettierrc"]
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-any-union": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"no-any-union": false,
|
||||
"no-unnecessary-generics": false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ getCurrentPages();
|
||||
|
||||
interface MyOwnEvent
|
||||
extends wx.CustomEvent<
|
||||
"my-own",
|
||||
{
|
||||
hello: string;
|
||||
}
|
||||
> { }
|
||||
"my-own",
|
||||
{
|
||||
hello: string;
|
||||
}
|
||||
> {}
|
||||
|
||||
let behavior = Behavior({
|
||||
behaviors: [],
|
||||
@@ -18,7 +18,7 @@ let behavior = Behavior({
|
||||
data: {
|
||||
myBehaviorData: ""
|
||||
},
|
||||
attached() { },
|
||||
attached() {},
|
||||
methods: {
|
||||
myBehaviorMethod() {
|
||||
const s: string = this.data.myBehaviorData;
|
||||
@@ -57,7 +57,7 @@ Component({
|
||||
attached() {
|
||||
wx.setEnableDebug({
|
||||
enableDebug: true,
|
||||
success(res) { }
|
||||
success(res) {}
|
||||
});
|
||||
|
||||
wx.reportMonitor("123", 123);
|
||||
@@ -66,6 +66,10 @@ Component({
|
||||
wx.getLogManager().log("123");
|
||||
wx.getLogManager().warn("123");
|
||||
wx.getLogManager().debug("123");
|
||||
|
||||
this.createIntersectionObserver({}).observe("123", res => {
|
||||
res.id;
|
||||
});
|
||||
},
|
||||
|
||||
detached() {
|
||||
@@ -73,14 +77,14 @@ Component({
|
||||
{
|
||||
key: null
|
||||
},
|
||||
() => { }
|
||||
() => {}
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
pageLifetimes: {
|
||||
show() { },
|
||||
hide() { }
|
||||
show() {},
|
||||
hide() {}
|
||||
},
|
||||
|
||||
// 生命周期函数,可以为函数,或一个在methods段中定义的方法名
|
||||
@@ -89,13 +93,13 @@ Component({
|
||||
{
|
||||
key: "123"
|
||||
},
|
||||
() => { }
|
||||
() => {}
|
||||
);
|
||||
},
|
||||
|
||||
moved() { },
|
||||
moved() {},
|
||||
|
||||
detached() { },
|
||||
detached() {},
|
||||
|
||||
methods: {
|
||||
readMyDataAndMyProps() {
|
||||
@@ -188,21 +192,19 @@ Page({
|
||||
}
|
||||
};
|
||||
},
|
||||
onPageScroll: () => {
|
||||
// this.
|
||||
// Do something when page scroll
|
||||
wx.createIntersectionObserver()
|
||||
.relativeToViewport()
|
||||
.observe("div", res => {
|
||||
console.log(res.id);
|
||||
console.log(res.dataset);
|
||||
console.log(res.intersectionRatio);
|
||||
console.log(res.intersectionRect.left);
|
||||
console.log(res.intersectionRect.top);
|
||||
console.log(res.intersectionRect.width);
|
||||
console.log(res.intersectionRect.height);
|
||||
})
|
||||
.disconnect();
|
||||
onPageScroll() {
|
||||
wx.createIntersectionObserver(this, {})
|
||||
.relativeToViewport()
|
||||
.observe("div", res => {
|
||||
console.log(res.id);
|
||||
console.log(res.dataset);
|
||||
console.log(res.intersectionRatio);
|
||||
console.log(res.intersectionRect.left);
|
||||
console.log(res.intersectionRect.top);
|
||||
console.log(res.intersectionRect.width);
|
||||
console.log(res.intersectionRect.height);
|
||||
})
|
||||
.disconnect();
|
||||
},
|
||||
onTabItemTap(item: any) {
|
||||
this.setData({
|
||||
|
||||
Reference in New Issue
Block a user