8000 feat(transport-commons): Ability to register routes with custom params by vonagam · Pull Request #2482 · feathersjs/feathers · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/feathers/src/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface ServiceOptions {
events?: string[];
methods?: string[];
serviceEvents?: string[];
routeParams?: { [key: string]: any };
}

export interface ServiceMethods<T = any, D = Partial<T>> {
Expand Down Expand Up @@ -110,7 +111,7 @@ export type CustomMethods<T extends {[key: string]: [any, any]}> = {
[K in keyof T]: (data: T[K][0], params?: Params) => Promise<T[K][1]>;
}

export type ServiceMixin<A> = (service: FeathersService<A>, path: string, options?: ServiceOptions) => void;
export type ServiceMixin<A> = (service: FeathersService<A>, path: string, options: ServiceOptions) => void;

export type ServiceGenericType<S> = S extends ServiceInterface<infer T> ? T : any;
export type ServiceGenericData<S> = S extends ServiceInterface<infer _T, infer D> ? D : any;
Expand Down Expand Up @@ -234,7 +235,7 @@ export interface Query {
export interface Params {
query?: Query;
provider?: string;
route?: { [key: string]: string };
route?: { [key: string]: any };
headers?: { [key: string]: any };
[key: string]: any; // (JL) not sure if we want this
}
Expand Down
47 changes: 26 additions & 21 deletions packages/transport-commons/src/routing/index.ts