8000 fix: Updated typings for ServiceMethods (#1409) · feathersjs/feathers@b5ee7e2 · GitHub
[go: up one dir, main page]

Skip to content

Commit b5ee7e2

Browse files
deskohdaffl
authored andcommitted
fix: Updated typings for ServiceMethods (#1409)
1 parent 44542e9 commit b5ee7e2

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

packages/authentication/src/service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Params, ServiceMethods } from '@feathersjs/feathers';
77

88
const debug = Debug('@feathersjs/authentication/service');
99

10-
export class AuthenticationService extends AuthenticationBase implements ServiceMethods<AuthenticationResult> {
10+
export class AuthenticationService extends AuthenticationBase implements Partial<ServiceMethods<AuthenticationResult>> {
1111
/**
1212
* Return the payload for a JWT based on the authentication result.
1313
* Called internally by the `create` method.

packages/feathers/index.d.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -137,23 +137,20 @@ declare namespace createApplication {
137137
finally?: Partial<HookMap> | Hook | Hook[];
138138
}
139139

140-
// todo: figure out what to do: These methods don't actually need to be
141-
// implemented, so they can be undefined at runtime. Yet making them
142-
// optional gets cumbersome in strict mode.
143140
interface ServiceMethods<T> {
144141
[key: string]: any;
145142

146-
find? (params?: Params): Promise<T | T[] | Paginated<T>>;
143+
find (params?: Params): Promise<T | T[] | Paginated<T< 8000 span class="pl-c1">>>;
147144

148-
get? (id: Id, params?: Params): Promise<T>;
145+
get (id: Id, params?: Params): Promise<T>;
149146

150-
create? (data: Partial<T> | Array<Partial<T>>, params?: Params): Promise<T | T[]>;
147+
create (data: Partial<T> | Array<Partial<T>>, params?: Params): Promise<T | T[]>;
151148

152-
update? (id: NullableId, data: T, params?: Params): Promise<T>;
149+
update (id: NullableId, data: T, params?: Params): Promise<T>;
153150

154-
patch? (id: NullableId, data: Partial<T>, params?: Params): Promise<T>;
151+
patch (id: NullableId, data: Partial<T>, params?: Params): Promise<T>;
155152

156-
remove? (id: NullableId, params?: Params): Promise<T>;
153+
remove (id: NullableId, params?: Params): Promise<T>;
157154
}
158155

159156
interface SetupMethod {

0 commit comments

Comments
 (0)
0