nestjs-express-cassandra
Version:
Express-cassandra module for Nest framework
52 lines (51 loc) • 1.57 kB
TypeScript
import { ColumnType } from './cassandra.interface';
import { CqlOperatorOptions } from './orm.interface';
export declare type ClusterOrder<Entity> = {
[KEY in keyof Entity]?: 'desc' | 'asc';
};
declare type FilterOptions<Entity> = Partial<{
[KEY in keyof Entity]: CqlOperatorOptions<Entity[KEY]>;
}>;
export interface EntityOptions<T = object> {
name?: string;
table_name?: string;
key: Array<keyof T | Array<keyof T>>;
indexes?: Array<keyof T> | string[];
clustering_order?: ClusterOrder<T>;
materialized_views?: Record<string, MaterializeViewOptions<T>>;
options?: {
timestamps?: {
createdAt?: string;
updatedAt?: string;
};
versions?: {
key: string;
};
};
}
export interface ExtendedEntityOptions<T = object> extends EntityOptions<T> {
instanceMethods: unknown;
classMethods: unknown;
}
export interface MaterializeViewOptions<T> {
key: Array<keyof T | Array<keyof T>>;
select: Array<keyof T | '*'>;
clustering_order?: ClusterOrder<T>;
filter?: FilterOptions<T>;
}
export interface ColumnOptions {
type?: ColumnType;
typeDef?: string;
default?: string | (() => string) | Function | {
$db_function: string;
};
rule?: ColumnRuleOptions;
}
export interface ColumnRuleOptions {
required?: boolean;
}
export declare type FunctionType = Function;
export declare type ObjectType = Object;
export declare type TargetType = Object;
export declare type ColumnsType = Record<string, ColumnOptions>;
export {};