From 9ab22101bc3d146626bd93af47a6d0a5c8adb39a Mon Sep 17 00:00:00 2001 From: Ukendio Date: Mon, 18 Sep 2023 19:35:53 +0200 Subject: [PATCH 1/6] Predicate should accept variadic args --- types/Promise.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/Promise.d.ts b/types/Promise.d.ts index 17c2dcb..74f224f 100644 --- a/types/Promise.d.ts +++ b/types/Promise.d.ts @@ -608,7 +608,7 @@ interface PromiseConstructor { * end) * ``` */ - fromEvent(this: void, event: RBXScriptSignal<(value: T) => void>, predicate?: (value: T) => boolean): Promise; + fromEvent>(this: void, event: RBXScriptSignal<(...args: T) => void>, predicate?: (...args: T) => boolean): Promise; fromEvent(this: void, event: RBXScriptSignal<() => void>, predicate?: () => boolean): Promise; fromEvent( this: void, From b32e156d3506f02f94965b4dd74802d6f744d99a Mon Sep 17 00:00:00 2001 From: Ukendio Date: Mon, 18 Sep 2023 19:39:52 +0200 Subject: [PATCH 2/6] line length --- types/Promise.d.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/types/Promise.d.ts b/types/Promise.d.ts index 74f224f..5abe869 100644 --- a/types/Promise.d.ts +++ b/types/Promise.d.ts @@ -608,7 +608,11 @@ interface PromiseConstructor { * end) * ``` */ - fromEvent>(this: void, event: RBXScriptSignal<(...args: T) => void>, predicate?: (...args: T) => boolean): Promise; + fromEvent>( + this: void, + event: RBXScriptSignal<(...args: T) => void>, + predicate?: (...args: T) => boolean + ): Promise; fromEvent(this: void, event: RBXScriptSignal<() => void>, predicate?: () => boolean): Promise; fromEvent( this: void, From ce8c3fa972d4275731e10896cdf72a8ae95c95fe Mon Sep 17 00:00:00 2001 From: Ukendio Date: Mon, 18 Sep 2023 19:41:01 +0200 Subject: [PATCH 3/6] Fix duck typed --- types/Promise.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/Promise.d.ts b/types/Promise.d.ts index 5abe869..7833e20 100644 --- a/types/Promise.d.ts +++ b/types/Promise.d.ts @@ -614,10 +614,10 @@ interface PromiseConstructor { predicate?: (...args: T) => boolean ): Promise; fromEvent(this: void, event: RBXScriptSignal<() => void>, predicate?: () => boolean): Promise; - fromEvent( + fromEvent>( this: void, - event: { Connect: (callback: (value: T) => void) => void }, - predicate?: (value: T) => boolean, + event: { Connect: (callback: (...args: T) => void) => void }, + predicate?: (...args: T) => boolean, ): Promise; /** Checks whether the given object is a Promise via duck typing. This only checks if the object is a table and has an `andThen` method. */ From cb2f22001fde03e62c660b6ee24385df50adbed6 Mon Sep 17 00:00:00 2001 From: Ukendio Date: Mon, 18 Sep 2023 20:11:16 +0200 Subject: [PATCH 4/6] Revert "Predicate should accept variadic args" This reverts commit 9ab22101bc3d146626bd93af47a6d0a5c8adb39a. --- types/Promise.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/Promise.d.ts b/types/Promise.d.ts index 7833e20..d1b8670 100644 --- a/types/Promise.d.ts +++ b/types/Promise.d.ts @@ -608,11 +608,15 @@ interface PromiseConstructor { * end) * ``` */ +<<<<<<< HEAD fromEvent>( this: void, event: RBXScriptSignal<(...args: T) => void>, predicate?: (...args: T) => boolean ): Promise; +======= + fromEvent(this: void, event: RBXScriptSignal<(value: T) => void>, predicate?: (value: T) => boolean): Promise; +>>>>>>> parent of 9ab2210 (Predicate should accept variadic args) fromEvent(this: void, event: RBXScriptSignal<() => void>, predicate?: () => boolean): Promise; fromEvent>( this: void, From 50404c9a37892d8dce22e2c2ebddffe97c5c635b Mon Sep 17 00:00:00 2001 From: Ukendio Date: Mon, 18 Sep 2023 20:32:36 +0200 Subject: [PATCH 5/6] Accepting defeat --- types/Promise.d.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/types/Promise.d.ts b/types/Promise.d.ts index d1b8670..e1152e6 100644 --- a/types/Promise.d.ts +++ b/types/Promise.d.ts @@ -608,20 +608,17 @@ interface PromiseConstructor { * end) * ``` */ -<<<<<<< HEAD fromEvent>( - this: void, - event: RBXScriptSignal<(...args: T) => void>, - predicate?: (...args: T) => boolean - ): Promise; -======= + this: void, + event: RBXScriptSignal<(...args: T) => void>, + predicate?: (...args: T) => boolean, + ): Promise fromEvent(this: void, event: RBXScriptSignal<(value: T) => void>, predicate?: (value: T) => boolean): Promise; ->>>>>>> parent of 9ab2210 (Predicate should accept variadic args) fromEvent(this: void, event: RBXScriptSignal<() => void>, predicate?: () => boolean): Promise; - fromEvent>( + fromEvent( this: void, - event: { Connect: (callback: (...args: T) => void) => void }, - predicate?: (...args: T) => boolean, + event: { Connect: (callback: (value: T) => void) => void }, + predicate?: (value: T) => boolean, ): Promise; /** Checks whether the given object is a Promise via duck typing. This only checks if the object is a table and has an `andThen` method. */ From 011996b27d42a0fbee341eaa929ed624d5ee8465 Mon Sep 17 00:00:00 2001 From: Ukendio Date: Mon, 18 Sep 2023 20:33:39 +0200 Subject: [PATCH 6/6] Add Semicolon --- types/Promise.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/Promise.d.ts b/types/Promise.d.ts index e1152e6..efe84a6 100644 --- a/types/Promise.d.ts +++ b/types/Promise.d.ts @@ -612,7 +612,7 @@ interface PromiseConstructor { this: void, event: RBXScriptSignal<(...args: T) => void>, predicate?: (...args: T) => boolean, - ): Promise + ): Promise; fromEvent(this: void, event: RBXScriptSignal<(value: T) => void>, predicate?: (value: T) => boolean): Promise; fromEvent(this: void, event: RBXScriptSignal<() => void>, predicate?: () => boolean): Promise; fromEvent(