Skip to content

Commit f33be73

Browse files
authored
fix(typescript): Improve TypeScript backwards compatibility (#2310)
1 parent dece8fb commit f33be73

File tree

26 files changed

+3583
-25978
lines changed

26 files changed

+3583
-25978
lines changed

.github/workflows/deno.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
uses: actions/checkout@v2
1111

1212
- name: Setup Deno
13-
uses: denolib/setup-deno@v2
13+
uses: denoland/setup-deno@main
1414
with:
1515
deno-version: v1.x
1616

deno/_feathers/declarations.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export type Service<T, D = Partial<T>> =
5454
export type ServiceInterface<T, D = Partial<T>> =
5555
Partial<ServiceMethods<T, D>>;
5656

57-
export interface ServiceAddons<A, S> extends EventEmitter {
57+
export interface ServiceAddons<A = Application, S = Service<any, any>> extends EventEmitter {
5858
id?: string;
5959
hooks (options: HookOptions<A, S>): this;
6060
}
@@ -316,6 +316,8 @@ export interface HookContext<A = Application, S = any> extends BaseHookContext<S
316316
export type LegacyHookFunction<A = Application, S = Service<any, any>> =
317317
(this: S, context: HookContext<A, S>) => (Promise<HookContext<Application, S> | void> | HookContext<Application, S> | void);
318318

319+
export type Hook<A = Application, S = Service<any, any>> = LegacyHookFunction<A, S>;
320+
319321
type LegacyHookMethodMap<A, S> =
320322
{ [L in keyof S]?: SelfOrArray<LegacyHookFunction<A, S>>; } &
321323
{ all?: SelfOrArray<LegacyHookFunction<A, S>> };

0 commit comments

Comments
 (0)