Merge pull request #31575 from DefinitelyTyped/fix-post-3.3-errors

Fix post 3.3 errors
This commit is contained in:
Nathan Shively-Sanders
2018-12-21 14:08:22 -08:00
committed by GitHub
12 changed files with 78 additions and 16 deletions
-4
View File
@@ -285,7 +285,6 @@ declare namespace BlissNS {
addEventListener(type: "MSGotPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T;
addEventListener(type: "MSInertiaStart", listener: (ev: MSGestureEvent) => any, useCapture?: boolean): T;
addEventListener(type: "MSLostPointerCapture", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T;
addEventListener(type: "MSManipulationStateChanged", listener: (ev: MSManipulationEvent) => any, useCapture?: boolean): T;
addEventListener(type: "MSPointerCancel", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T;
addEventListener(type: "MSPointerDown", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T;
addEventListener(type: "MSPointerEnter", listener: (ev: MSPointerEvent) => any, useCapture?: boolean): T;
@@ -555,18 +554,15 @@ declare namespace BlissNS {
getElementsByTagName(name: "video"): NodeListOf<HTMLVideoElement>;
getElementsByTagName(name: "view"): NodeListOf<SVGViewElement>;
getElementsByTagName(name: "wbr"): NodeListOf<HTMLElement>;
getElementsByTagName(name: "x-ms-webview"): NodeListOf<MSHTMLWebViewElement>;
getElementsByTagName(name: "xmp"): NodeListOf<HTMLElement>;
getElementsByTagName(name: string): NodeListOf<Element>;
getElementsByTagNameNS(namespaceURI: string, localName: string): NodeListOf<Element>;
hasAttribute(name: string): boolean;
hasAttributeNS(namespaceURI: string, localName: string): boolean;
msGetRegionContent(): MSRangeCollection;
msGetUntransformedBounds(): ClientRect;
msMatchesSelector(selectors: string): boolean;
msReleasePointerCapture(pointerId: number): T;
msSetPointerCapture(pointerId: number): T;
msZoomTo(args: MsZoomToOptions): T;
releasePointerCapture(pointerId: number): T;
removeAttribute(name?: string): T;
removeAttributeNS(namespaceURI: string, localName: string): T;
+3 -1
View File
@@ -11,12 +11,14 @@ declare namespace debounce {
}
}
type ArgumentsType<T> = T extends (...args: infer A) => any ? A : never;
declare function debounce<T extends (...args: any[]) => any>(
func: T,
wait?: number,
options?: debounce.DebounceOptions
): (
...args: Parameters<T>
...args: ArgumentsType<T>
) => ReturnType<T> extends Promise<any>
? ReturnType<T>
: Promise<ReturnType<T>>;
+7
View File
@@ -0,0 +1,7 @@
{
"private": true,
"types": "index",
"typesVersions": {
">=3.1.0-0": { "*": ["ts3.1/*"] }
}
}
@@ -0,0 +1,25 @@
import debounce = require("debounce-promise");
import { DebounceOptions } from "debounce-promise";
const options: DebounceOptions = {};
const optionsA: DebounceOptions = { leading: true };
const f = async () => 2;
const f2 = (a: string) => 2;
debounce(f, 100);
debounce(f, 0, options);
debounce(f, 100, optionsA);
debounce(f, 10, { accumulate: true });
const foo = debounce(async () => f2, 10, {
leading: true,
accumulate: true
});
foo().then(f => f("2"));
const bar = debounce(async () => [1, 2, 3], 100);
bar().then(ar => ar.concat());
// Converts the return value from the producer function to a promise
const two = debounce((a: string, b: number, c: { d: boolean }) => [4], 10, {
leading: true,
accumulate: true
});
two("1", 2, { d: false }).then(ar => ar.pop(), () => 2);
+18
View File
@@ -0,0 +1,18 @@
declare namespace debounce {
interface DebounceOptions {
leading?: boolean;
accumulate?: boolean;
}
}
declare function debounce<T extends (...args: any[]) => any>(
func: T,
wait?: number,
options?: debounce.DebounceOptions
): (
...args: Parameters<T>
) => ReturnType<T> extends Promise<any>
? ReturnType<T>
: Promise<ReturnType<T>>;
export = debounce;
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../../",
"typeRoots": ["../../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "debounce-promise-tests.ts"]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/pixijs/pixi.js/tree/dev
// Definitions by: clark-stevenson <https://github.com/clark-stevenson>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
// TypeScript Version: 2.3
declare namespace PIXI {
// from CONST
+2 -1
View File
@@ -15,10 +15,11 @@
],
"types": [],
"noEmit": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"quill-tests.ts"
]
}
}
+4 -4
View File
@@ -655,8 +655,8 @@ async function typedThemes() {
createGlobalStyle,
ThemeProvider,
ThemeConsumer
} = (await import("styled-components")) as ThemedStyledComponentsModule<
typeof theme
} = (await import("styled-components")) as any as ThemedStyledComponentsModule<
typeof theme
>;
const ThemedDiv = styled.div`
@@ -753,10 +753,10 @@ async function themeAugmentation() {
accent: string;
}
const base = (await import("styled-components")) as ThemedStyledComponentsModule<
const base = (await import("styled-components")) as any as ThemedStyledComponentsModule<
BaseTheme
>;
const extra = (await import("styled-components")) as ThemedStyledComponentsModule<
const extra = (await import("styled-components")) as any as ThemedStyledComponentsModule<
ExtraTheme,
BaseTheme
>;
+1 -4
View File
@@ -15,9 +15,6 @@ instance = new modal({
},
});
instance.addFooterBtn('text', undefined, function(e) {
e.x;
this.innerText;
});
instance.addFooterBtn('text', undefined, e => e.x);
instance.setStickyFooter(false);
-1
View File
@@ -8,7 +8,6 @@
"target": "es2017",
"lib": [
"es2015",
"dom",
"webworker"
],
"noImplicitAny": true,