Skip to content

Commit

Permalink
fix(core): sets info parameter as required ElementInfo for intercept …
Browse files Browse the repository at this point in the history
…and service resolve functions
  • Loading branch information
rafamel committed Nov 23, 2019
1 parent e6385d2 commit 490f7d7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/classes/Application/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function createDefaults(): Required<ApplicationCreateOptions> {

export function defaultMap(
service: ServiceImplementation,
info: ElementInfo
info: Required<ElementInfo>
): ApplicationResolve {
return (data: any, context: any): Promise<any> | Observable<any> => {
return service.resolve(data, context, info);
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/classes/Intercept/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type InterceptInputFactory<I = any, O = any, C = any> = (
export type InterceptInputResolve<I = any, O = any, C = any> = (
data: I,
context: C,
info: ServiceInfo,
info: Required<ServiceInfo>,
next: (data?: I) => Observable<O>
) => Observable<O> | Promise<Observable<O>>;

Expand All @@ -36,5 +36,5 @@ export type InterceptHookInputFactory<T, C> = (
export type InterceptHookInputResolve<T, C> = (
data: T,
context: C,
info: ServiceInfo
info: Required<ServiceInfo>
) => T | void | Promise<T | void>;
4 changes: 2 additions & 2 deletions packages/core/src/classes/Service/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ export type ServiceSubscriptionInput<T, I, O, C> = Input & {
export type ServiceUnaryResolveInput<I = any, O = any, C = any> = (
data: I,
context: C,
info: ElementInfo
info: Required<ElementInfo>
) => Promise<O> | O;

export type ServiceStreamResolveInput<I = any, O = any, C = any> = (
data: I,
context: C,
info: ElementInfo
info: Required<ElementInfo>
) => Observable<O> | Promise<Observable<O>>;

/* Options */
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/types/collection/implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,13 @@ export type ServiceResolveImplementation<I = any, O = any, C = any> =
export type UnaryServiceResolveImplementation<I = any, O = any, C = any> = (
data: I,
context: C,
info: ElementInfo
info: Required<ElementInfo>
) => Promise<O>;

export type StreamServiceResolveImplementation<I = any, O = any, C = any> = (
data: I,
context: C,
info: ElementInfo
info: Required<ElementInfo>
) => Observable<O>;

/* Intercept */
Expand All @@ -152,7 +152,7 @@ export type InterceptFactoryImplementation<I = any, O = any, C = any> = (
export type InterceptResolveImplementation<I = any, O = any, C = any> = (
data: I,
context: C,
info: ServiceInfo,
info: Required<ServiceInfo>,
next: (data: I) => Observable<O>
) => Observable<O>;

Expand Down

0 comments on commit 490f7d7

Please sign in to comment.