mathix420/vuito

View on GitHub
packages/vuito/src/types.ts

Summary

Maintainability
A
0 mins
Test Coverage
export type VRow = {
  test(value: unknown): boolean;
  onlyIf?(parent: Record<string, unknown>): boolean;
  message: string;
};

export type VTemplateRow = Array<VRow> & {
  check(value: unknown, parent?: Record<string, unknown>): Promise<void>;
};

export type VInputTemplate = {
  [key: string]: Array<VRow>;
};

export type VKeys = {
  readonly [key: string]: VTemplateRow;
};

export type VTemplate = VKeys & {
  check(object: Record<string, unknown>): Promise<void>;
};

export type VLengthy = unknown & {
  length: number;
};