Skip to content

Commit

Permalink
Merge 3a43b94 into b87ae85
Browse files Browse the repository at this point in the history
  • Loading branch information
Ana Margarida Silva committed Jan 6, 2021
2 parents b87ae85 + 3a43b94 commit f9b9035
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
15 changes: 15 additions & 0 deletions types/base/error.d.ts
@@ -0,0 +1,15 @@
export declare class YoniusError {
constructor(message: string, code?: number)
isClient(): boolean
isServer(): boolean
}

export declare class OperationalError extends YoniusError {
constructor(message?: string, code?: number)
}

export declare class NotFoundError extends OperationalError {}

export declare class NotImplementedError extends OperationalError {}

export declare class ValidationError extends OperationalError {}
1 change: 1 addition & 0 deletions types/base/index.d.ts
@@ -1 +1,2 @@
export * from "./error";
export * from "./main";
1 change: 1 addition & 0 deletions types/util/index.d.ts
Expand Up @@ -2,3 +2,4 @@ export * from "./assert";
export * from "./config";
export * from "./data";
export * from "./mongo";
export * from "./validation";
35 changes: 35 additions & 0 deletions types/util/validation.d.ts
@@ -0,0 +1,35 @@
export declare function eq<T>(
valueC: T,
message?: string
): (value?: T, ctx?: any) => boolean;

export declare function gt<T>(
valueC: T,
message?: string
): (value?: T, ctx?: any) => boolean;

export declare function notEmpty(
message?: string
): (value?: string | unknown[], ctx?: any) => boolean;

export declare function isIn<T>(
valueC: T[],
message?: string
): (value?: T, ctx?: any) => boolean;

export declare function isSimple(
message?: string
): (value?: string, ctx?: any) => boolean;

export declare function isEmail(
message?: string
): (value?: string, ctx?: any) => boolean;

export declare function isUrl(
message?: string
): (value?: string, ctx?: any) => boolean;

export declare function isRegex(
regex: string,
message?: string
): (value?: string, ctx?: any) => boolean;

0 comments on commit f9b9035

Please sign in to comment.