@thisisagile/easy
Version:
Straightforward library for building domain-driven microservice architectures
29 lines (28 loc) • 917 B
TypeScript
import { PageOptions } from '../types/PageList';
import { Optional } from '../types/Types';
import { Json, JsonValue } from '../types/Json';
import { OneOrMore } from '../types/Array';
import { Id } from '../types/Id';
import type { Text } from '../types/Text';
export declare class Req<T = unknown> implements Omit<PageOptions, 'sort'> {
readonly path: Json;
readonly query: Json;
readonly body: T;
readonly headers: Record<string, OneOrMore<string>>;
readonly skip: Optional<number>;
readonly take: Optional<number>;
constructor(path: Json | undefined, query: Json | undefined, body: T, headers: Record<string, OneOrMore<string>>);
get id(): Id;
get q(): JsonValue;
get: (key: Text) => any;
}
export declare function toReq<T = unknown>(req: {
params?: {
id?: unknown;
};
query?: {
q?: unknown;
};
body?: T;
headers?: unknown;
}): Req;