Skip to content

Commit

Permalink
fix(typescript): Move Paginated type back for better compatibility (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl authored May 13, 2021
1 parent b8bc362 commit 2917d05
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/adapter-commons/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { _ } from '@feathersjs/commons';

export { AdapterService, InternalServiceMethods, ServiceOptions, Paginated } from './service';
export { AdapterService, InternalServiceMethods, ServiceOptions } from './service';
export { filterQuery, FILTERS, OPERATORS } from './filter-query';
export * from './sort';

Expand Down
9 changes: 1 addition & 8 deletions packages/adapter-commons/src/service.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import { NotImplemented, BadRequest, MethodNotAllowed } from '@feathersjs/errors';
import { ServiceMethods, Params, Id, NullableId } from '@feathersjs/feathers';
import { ServiceMethods, Params, Id, NullableId, Paginated } from '@feathersjs/feathers';
import { filterQuery } from './filter-query';

export interface Paginated<T> {
total: number;
limit: number;
skip: number;
data: T[];
}

const callMethod = (self: any, name: any, ...args: any[]) => {
if (typeof self[name] !== 'function') {
return Promise.reject(new NotImplemented(`Method ${name} not available`));
Expand Down
7 changes: 7 additions & 0 deletions packages/feathers/src/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ type OptionalPick<T, K extends PropertyKey> = Pick<T, Extract<keyof T, K>>

export type { NextFunction };

export interface Paginated<T> {
total: number;
limit: number;
skip: number;
data: T[];
}

export interface ServiceOptions {
events?: string[];
methods?: string[];
Expand Down

0 comments on commit 2917d05

Please # to comment.