Skip to content

Commit 915bfd2

Browse files
committed
fix: Add types to a few more methods
1 parent fd4ce27 commit 915bfd2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

resources/Resource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@ export class Resource<Record extends object = any> implements ResourceInterface<
314314
static coerceId(id: string): number | string {
315315
return id;
316316
}
317-
static parseQuery(search, query) {
317+
static parseQuery(search: string, query: RequestTarget): RequestTarget | Query | URLSearchParams | undefined {
318318
return parseQuery(search, query);
319319
}
320-
static parsePath(path, context, query) {
320+
static parsePath(path: string, context: Context, query: URLSearchParams) {
321321
const dotIndex = path.indexOf('.');
322322
if (dotIndex > -1) {
323323
// handle paths of the form /path/id.property

resources/ResourceInterface.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ export interface ResourceStaticInterface<Record extends object = any> {
9090
context?: Context
9191
): Promise<Record> | Record | void | Promise<void>;
9292

93-
parseQuery(search: any, query: any): any;
94-
parsePath(path: any, context: Context, query: any): any;
93+
parseQuery(search: string, query: RequestTarget): RequestTarget | Query | URLSearchParams | undefined;
94+
parsePath(path: string, context: Context, query: URLSearchParams): string | { property: string; id: string };
9595
isCollection: boolean;
9696

9797
getResource(

0 commit comments

Comments
 (0)